diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-07-24 14:01:35 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-07-24 14:01:35 +0000 |
commit | 14ea312808599001674784a839bf7cf5a8eea872 (patch) | |
tree | 9875456d3eba2ceb2f86909ee280333e2dfefa94 /activerecord/test/fixtures | |
parent | 1ae0a53d861c43dff8883fc956a08404c23f180c (diff) | |
download | rails-14ea312808599001674784a839bf7cf5a8eea872.tar.gz rails-14ea312808599001674784a839bf7cf5a8eea872.tar.bz2 rails-14ea312808599001674784a839bf7cf5a8eea872.zip |
Made Oracle a first-class connection adapter by adhering closer to idiomatic Oracle style #1798 [The Gang of Oracles]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1912 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test/fixtures')
-rwxr-xr-x | activerecord/test/fixtures/company.rb | 1 | ||||
-rw-r--r-- | activerecord/test/fixtures/db_definitions/oci.drop.sql | 38 | ||||
-rw-r--r-- | activerecord/test/fixtures/db_definitions/oci.sql | 34 | ||||
-rw-r--r-- | activerecord/test/fixtures/db_definitions/oci2.drop.sql | 2 | ||||
-rw-r--r-- | activerecord/test/fixtures/db_definitions/oci2.sql | 4 | ||||
-rw-r--r-- | activerecord/test/fixtures/subject.rb | 4 |
6 files changed, 72 insertions, 11 deletions
diff --git a/activerecord/test/fixtures/company.rb b/activerecord/test/fixtures/company.rb index c7655fb1dd..5af39c1297 100755 --- a/activerecord/test/fixtures/company.rb +++ b/activerecord/test/fixtures/company.rb @@ -1,5 +1,6 @@ class Company < ActiveRecord::Base attr_protected :rating + set_sequence_name :companies_nonstd_seq validates_presence_of :name end diff --git a/activerecord/test/fixtures/db_definitions/oci.drop.sql b/activerecord/test/fixtures/db_definitions/oci.drop.sql index 532a2f4208..52b377398d 100644 --- a/activerecord/test/fixtures/db_definitions/oci.drop.sql +++ b/activerecord/test/fixtures/db_definitions/oci.drop.sql @@ -1,9 +1,11 @@ drop table accounts; drop table companies; drop table topics; +drop synonym subjects; +drop table developers_projects; +drop table computers; drop table developers; drop table projects; -drop table developers_projects; drop table customers; drop table movies; drop table subscribers; @@ -14,10 +16,36 @@ drop table colnametests; drop table mixins; drop table people; drop table binaries; -drop table posts; drop table comments; drop table authors; -drop table computers; -drop table categories; +drop table tasks; drop table categories_posts; -drop sequence rails_sequence; +drop table categories; +drop table posts; +drop table fk_test_has_pk; +drop table fk_test_has_fk; +drop sequence accounts_seq; +drop sequence companies_nonstd_seq; +drop sequence topics_seq; +drop sequence developers_seq; +drop sequence projects_seq; +drop sequence developers_projects_seq; +drop sequence customers_seq; +drop sequence movies_seq; +drop sequence subscribers_seq; +drop sequence booleantests_seq; +drop sequence auto_id_tests_seq; +drop sequence entrants_seq; +drop sequence colnametests_seq; +drop sequence mixins_seq; +drop sequence people_seq; +drop sequence binaries_seq; +drop sequence posts_seq; +drop sequence comments_seq; +drop sequence authors_seq; +drop sequence tasks_seq; +drop sequence computers_seq; +drop sequence categories_seq; +drop sequence categories_posts_seq; +drop sequence fk_test_has_pk_seq; +drop sequence fk_test_has_fk_seq; diff --git a/activerecord/test/fixtures/db_definitions/oci.sql b/activerecord/test/fixtures/db_definitions/oci.sql index 0923651dfc..8abdc0e6ae 100644 --- a/activerecord/test/fixtures/db_definitions/oci.sql +++ b/activerecord/test/fixtures/db_definitions/oci.sql @@ -1,5 +1,3 @@ -create sequence rails_sequence minvalue 10000; - create table companies ( id integer not null, type varchar(50) default null, @@ -12,12 +10,17 @@ create table companies ( primary key (id) ); +-- non-standard sequence name used to test set_sequence_name +-- +create sequence companies_nonstd_seq minvalue 10000; + create table accounts ( id integer not null, firm_id integer default null references companies initially deferred disable, credit_limit integer default null, primary key (id) ); +create sequence accounts_seq minvalue 10000; create table topics ( id integer not null, @@ -50,6 +53,9 @@ create table topics ( type varchar(50) default null, primary key (id) ); +create sequence topics_seq minvalue 10000; + +create synonym subjects for topics; create table developers ( id integer not null, @@ -59,6 +65,7 @@ create table developers ( updated_at timestamp default null, primary key (id) ); +create sequence developers_seq minvalue 10000; create table projects ( id integer not null, @@ -66,6 +73,7 @@ create table projects ( type varchar(255) default null, primary key (id) ); +create sequence projects_seq minvalue 10000; create table developers_projects ( developer_id integer not null references developers initially deferred disable, @@ -79,6 +87,7 @@ create table developers_projects ( project_id integer not null references projects initially deferred disable, joined_on date default null ); +create sequence developers_projects_seq minvalue 10000; create table customers ( id integer not null, @@ -90,42 +99,49 @@ create table customers ( gps_location varchar(100) default null, primary key (id) ); +create sequence customers_seq minvalue 10000; create table movies ( movieid integer not null, name varchar(100) default null, primary key (movieid) ); +create sequence movies_seq minvalue 10000; create table subscribers ( nick varchar(100) not null, name varchar(100) default null, primary key (nick) ); +create sequence subscribers_seq minvalue 10000; create table booleantests ( id integer not null, value integer default null, primary key (id) ); +create sequence booleantests_seq minvalue 10000; create table auto_id_tests ( auto_id integer not null, value integer default null, primary key (auto_id) ); +create sequence auto_id_tests_seq minvalue 10000; create table entrants ( id integer not null primary key, name varchar(255) not null, course_id integer not null ); +create sequence entrants_seq minvalue 10000; create table colnametests ( id integer not null, references integer not null, primary key (id) ); +create sequence colnametests_seq minvalue 10000; create table mixins ( id integer not null, @@ -152,6 +168,7 @@ create table mixins ( updated_at date default null, primary key (id) ); +create sequence mixins_seq minvalue 10000; create table people ( id integer not null, @@ -159,18 +176,21 @@ create table people ( lock_version integer default 0, primary key (id) ); +create sequence people_seq minvalue 10000; create table binaries ( id integer not null, data blob null, primary key (id) ); +create sequence binaries_seq minvalue 10000; create table computers ( id integer not null primary key, developer integer not null references developers initially deferred disable, - extendedWarranty integer not null + "extendedWarranty" integer not null ); +create sequence computers_seq minvalue 10000; create table posts ( id integer not null primary key, @@ -179,6 +199,7 @@ create table posts ( type varchar(255) default null, body varchar(3000) default null ); +create sequence posts_seq minvalue 10000; create table comments ( id integer not null primary key, @@ -186,34 +207,41 @@ create table comments ( type varchar(255) default null, body varchar(3000) default null ); +create sequence comments_seq minvalue 10000; create table authors ( id integer not null primary key, name varchar(255) default null ); +create sequence authors_seq minvalue 10000; create table tasks ( id integer not null primary key, starting date default null, ending date default null ); +create sequence tasks_seq minvalue 10000; create table categories ( id integer not null primary key, name varchar(255) default null, type varchar(255) default null ); +create sequence categories_seq minvalue 10000; create table categories_posts ( category_id integer not null references categories initially deferred disable, post_id integer not null references posts initially deferred disable ); +create sequence categories_posts_seq minvalue 10000; create table fk_test_has_pk ( id integer not null primary key ); +create sequence fk_test_has_pk_seq minvalue 10000; create table fk_test_has_fk ( id integer not null primary key, fk_id integer not null references fk_test_has_fk initially deferred disable ); +create sequence fk_test_has_fk_seq minvalue 10000; diff --git a/activerecord/test/fixtures/db_definitions/oci2.drop.sql b/activerecord/test/fixtures/db_definitions/oci2.drop.sql index 7277a52552..abe7e55c31 100644 --- a/activerecord/test/fixtures/db_definitions/oci2.drop.sql +++ b/activerecord/test/fixtures/db_definitions/oci2.drop.sql @@ -1,2 +1,2 @@ drop table courses; -drop sequence rails_sequence; +drop sequence courses_seq; diff --git a/activerecord/test/fixtures/db_definitions/oci2.sql b/activerecord/test/fixtures/db_definitions/oci2.sql index 5ac62b0062..3c171f4f14 100644 --- a/activerecord/test/fixtures/db_definitions/oci2.sql +++ b/activerecord/test/fixtures/db_definitions/oci2.sql @@ -1,6 +1,6 @@ -create sequence rails_sequence minvalue 10000; - create table courses ( id int not null primary key, name varchar(255) not null ); + +create sequence courses_seq minvalue 10000; diff --git a/activerecord/test/fixtures/subject.rb b/activerecord/test/fixtures/subject.rb new file mode 100644 index 0000000000..3502943f3a --- /dev/null +++ b/activerecord/test/fixtures/subject.rb @@ -0,0 +1,4 @@ +# used for OracleSynonymTest, see test/synonym_test_oci.rb +# +class Subject < ActiveRecord::Base +end |