Skip to content
This repository
Browse code

Use schema.rb for all databases

Move adapter specific schema into their own files

Signed-off-by: Michael Koziarski <michael@koziarski.com>
  • Loading branch information...
commit a4fc93c3a9f59dcd7cf56c6ae1cb1fb749f6678b 1 parent 0a94f16
Frederick Cheung authored NZKoz committed

Showing 43 changed files with 432 additions and 2,928 deletions. Show diff stats Hide diff stats

  1. 2  activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
  2. 58  activerecord/test/cases/aaa_create_tables_test.rb
  3. 2  activerecord/test/cases/associations/has_many_through_associations_test.rb
  4. 2  activerecord/test/cases/associations_test.rb
  5. 2  activerecord/test/cases/base_test.rb
  6. 33  activerecord/test/schema/db2.drop.sql
  7. 235  activerecord/test/schema/db2.sql
  8. 1  activerecord/test/schema/db22.drop.sql
  9. 4  activerecord/test/schema/db22.sql
  10. 65  activerecord/test/schema/firebird.drop.sql
  11. 310  activerecord/test/schema/firebird.sql
  12. 2  activerecord/test/schema/firebird2.drop.sql
  13. 6  activerecord/test/schema/firebird2.sql
  14. 33  activerecord/test/schema/frontbase.drop.sql
  15. 273  activerecord/test/schema/frontbase.sql
  16. 1  activerecord/test/schema/frontbase2.drop.sql
  17. 4  activerecord/test/schema/frontbase2.sql
  18. 12  activerecord/test/schema/mysql_specific_schema.rb
  19. 2  activerecord/test/schema/openbase.drop.sql
  20. 318  activerecord/test/schema/openbase.sql
  21. 2  activerecord/test/schema/openbase2.drop.sql
  22. 7  activerecord/test/schema/openbase2.sql
  23. 67  activerecord/test/schema/oracle.drop.sql
  24. 330  activerecord/test/schema/oracle.sql
  25. 2  activerecord/test/schema/oracle2.drop.sql
  26. 6  activerecord/test/schema/oracle2.sql
  27. 44  activerecord/test/schema/postgresql.drop.sql
  28. 294  activerecord/test/schema/postgresql.sql
  29. 1  activerecord/test/schema/postgresql2.drop.sql
  30. 4  activerecord/test/schema/postgresql2.sql
  31. 103  activerecord/test/schema/postgresql_specific_schema.rb
  32. 575  activerecord/test/schema/schema.rb
  33. 9  activerecord/test/schema/schema2.rb
  34. 33  activerecord/test/schema/sqlite.drop.sql
  35. 219  activerecord/test/schema/sqlite.sql
  36. 1  activerecord/test/schema/sqlite2.drop.sql
  37. 4  activerecord/test/schema/sqlite2.sql
  38. 25  activerecord/test/schema/sqlite_specific_schema.rb
  39. 5  activerecord/test/schema/sqlserver_specific_schema.rb
  40. 35  activerecord/test/schema/sybase.drop.sql
  41. 222  activerecord/test/schema/sybase.sql
  42. 2  activerecord/test/schema/sybase2.drop.sql
  43. 5  activerecord/test/schema/sybase2.sql
2  activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
@@ -617,7 +617,7 @@ def reset_pk_sequence!(table, pk = nil, sequence = nil) #:nodoc:
617 617
             quoted_sequence = quote_column_name(sequence)
618 618
 
619 619
             select_value <<-end_sql, 'Reset sequence'
620  
-              SELECT setval('#{sequence}', (SELECT COALESCE(MAX(#{pk})+(SELECT increment_by FROM #{quoted_sequence}), (SELECT min_value FROM #{quoted_sequence})) FROM #{quote_table_name(table)}), false)
  620
+              SELECT setval('#{quoted_sequence}', (SELECT COALESCE(MAX(#{quote_column_name pk})+(SELECT increment_by FROM #{quoted_sequence}), (SELECT min_value FROM #{quoted_sequence})) FROM #{quote_table_name(table)}), false)
621 621
             end_sql
622 622
           else
623 623
             @logger.warn "#{table} has primary key #{pk} with no default sequence" if @logger
58  activerecord/test/cases/aaa_create_tables_test.rb
@@ -4,65 +4,21 @@
4 4
 class AAACreateTablesTest < ActiveRecord::TestCase
5 5
   self.use_transactional_fixtures = false
6 6
 
7  
-  def test_drop_and_create_main_tables
8  
-    recreate ActiveRecord::Base unless use_migrations?
9  
-    assert true
10  
-  end
11  
-
12 7
   def test_load_schema
13  
-    if ActiveRecord::Base.connection.supports_migrations?
14  
-      eval(File.read(SCHEMA_ROOT + "/schema.rb"))
15  
-    else
16  
-      recreate ActiveRecord::Base, '3'
  8
+    eval(File.read(SCHEMA_ROOT + "/schema.rb"))
  9
+    if File.exists?(adapter_specific_schema_file)
  10
+      eval(File.read(adapter_specific_schema_file))
17 11
     end
18 12
     assert true
19 13
   end
20 14
 
21 15
   def test_drop_and_create_courses_table
22  
-    if Course.connection.supports_migrations?
23  
-      eval(File.read(SCHEMA_ROOT + "/schema2.rb"))
24  
-    end
25  
-    recreate Course, '2' unless use_migrations_for_courses?
  16
+    eval(File.read(SCHEMA_ROOT + "/schema2.rb"))
26 17
     assert true
27 18
   end
28 19
 
29 20
   private
30  
-    def use_migrations?
31  
-      unittest_sql_filename = ActiveRecord::Base.connection.adapter_name.downcase + ".sql"
32  
-      not File.exist? SCHEMA_ROOT + "/#{unittest_sql_filename}"
33  
-    end
34  
-
35  
-    def use_migrations_for_courses?
36  
-      unittest2_sql_filename = ActiveRecord::Base.connection.adapter_name.downcase + "2.sql"
37  
-      not File.exist? SCHEMA_ROOT + "/#{unittest2_sql_filename}"
38  
-    end
39  
-
40  
-    def recreate(base, suffix = nil)
41  
-      connection = base.connection
42  
-      adapter_name = connection.adapter_name.downcase + suffix.to_s
43  
-      execute_sql_file SCHEMA_ROOT + "/#{adapter_name}.drop.sql", connection
44  
-      execute_sql_file SCHEMA_ROOT + "/#{adapter_name}.sql", connection
45  
-    end
46  
-
47  
-    def execute_sql_file(path, connection)
48  
-      # OpenBase has a different format for sql files
49  
-      if current_adapter?(:OpenBaseAdapter) then
50  
-          File.read(path).split("go").each_with_index do |sql, i|
51  
-            begin
52  
-              # OpenBase does not support comments embedded in sql
53  
-              connection.execute(sql,"SQL statement ##{i}") unless sql.blank?
54  
-            rescue ActiveRecord::StatementInvalid
55  
-              #$stderr.puts "warning: #{$!}"
56  
-            end
57  
-          end
58  
-      else
59  
-        File.read(path).split(';').each_with_index do |sql, i|
60  
-          begin
61  
-            connection.execute("\n\n-- statement ##{i}\n#{sql}\n") unless sql.blank?
62  
-          rescue ActiveRecord::StatementInvalid
63  
-            #$stderr.puts "warning: #{$!}"
64  
-          end
65  
-        end
66  
-      end
67  
-    end
  21
+  def adapter_specific_schema_file
  22
+    SCHEMA_ROOT + '/' + ActiveRecord::Base.connection.adapter_name.downcase + '_specific_schema.rb'
  23
+  end
68 24
 end
2  activerecord/test/cases/associations/has_many_through_associations_test.rb
@@ -25,7 +25,7 @@ def test_associating_new
25 25
     new_person = nil # so block binding catches it
26 26
     
27 27
     assert_queries(0) do
28  
-      new_person = Person.new
  28
+      new_person = Person.new :first_name => 'bob'
29 29
     end
30 30
     
31 31
     # Associating new records always saves them
2  activerecord/test/cases/associations_test.rb
@@ -41,7 +41,7 @@ def test_bad_collection_keys
41 41
   end
42 42
 
43 43
   def test_should_construct_new_finder_sql_after_create
44  
-    person = Person.new
  44
+    person = Person.new :first_name => 'clark'
45 45
     assert_equal [], person.readers.find(:all)
46 46
     person.save!
47 47
     reader = Reader.create! :person => person, :post => Post.new(:title => "foo", :body => "bar")
2  activerecord/test/cases/base_test.rb
@@ -1704,7 +1704,7 @@ def test_find_on_abstract_base_class_doesnt_use_type_condition
1704 1704
     old_class = LooseDescendant
1705 1705
     Object.send :remove_const, :LooseDescendant
1706 1706
 
1707  
-    descendant = old_class.create!
  1707
+    descendant = old_class.create! :first_name => 'bob'
1708 1708
     assert_not_nil LoosePerson.find(descendant.id), "Should have found instance of LooseDescendant when finding abstract LoosePerson: #{descendant.inspect}"
1709 1709
   ensure
1710 1710
     unless Object.const_defined?(:LooseDescendant)
33  activerecord/test/schema/db2.drop.sql
... ...
@@ -1,33 +0,0 @@
1  
-DROP TABLE accounts;
2  
-DROP TABLE funny_jokes;
3  
-DROP TABLE companies;
4  
-DROP TABLE topics;
5  
-DROP TABLE developers;
6  
-DROP TABLE projects;
7  
-DROP TABLE developers_projects;
8  
-DROP TABLE orders;
9  
-DROP TABLE customers;
10  
-DROP TABLE movies;
11  
-DROP TABLE subscribers;
12  
-DROP TABLE booleantests;
13  
-DROP TABLE auto_id_tests;
14  
-DROP TABLE entrants;
15  
-DROP TABLE colnametests;
16  
-DROP TABLE mixins;
17  
-DROP TABLE people;
18  
-DROP TABLE readers;
19  
-DROP TABLE binaries;
20  
-DROP TABLE computers;
21  
-DROP TABLE posts;
22  
-DROP TABLE comments;
23  
-DROP TABLE authors;
24  
-DROP TABLE tasks;
25  
-DROP TABLE categories;
26  
-DROP TABLE categories_posts;
27  
-DROP TABLE fk_test_has_pk;
28  
-DROP TABLE fk_test_has_fk;
29  
-DROP TABLE keyboards;
30  
-DROP TABLE legacy_things;
31  
-DROP TABLE numeric_data;
32  
-DROP TABLE mixed_case_monkeys;
33  
-DROP TABLE minimalistics;
235  activerecord/test/schema/db2.sql
... ...
@@ -1,235 +0,0 @@
1  
-CREATE TABLE accounts (
2  
-  id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
3  
-  firm_id INT DEFAULT NULL,
4  
-  credit_limit INT DEFAULT NULL,
5  
-  PRIMARY KEY (id)
6  
-);
7  
-
8  
-CREATE TABLE funny_jokes (
9  
-  id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
10  
-  name VARCHAR(50) DEFAULT NULL,
11  
-  PRIMARY KEY (id)
12  
-);
13  
-
14  
-CREATE TABLE companies (
15  
-  id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
16  
-  type VARCHAR(50) DEFAULT NULL,
17  
-  ruby_type VARCHAR(50) DEFAULT NULL,
18  
-  firm_id INT DEFAULT NULL,
19  
-  name VARCHAR(50) DEFAULT NULL,
20  
-  client_of INT DEFAULT NULL,
21  
-  rating INT DEFAULT 1,
22  
-  PRIMARY KEY (id)
23  
-);
24  
-
25  
-CREATE TABLE topics (
26  
-  id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
27  
-  title VARCHAR(255) DEFAULT NULL,
28  
-  author_name VARCHAR(255) DEFAULT NULL,
29  
-  author_email_address VARCHAR(255) DEFAULT NULL,
30  
-  written_on TIMESTAMP DEFAULT NULL,
31  
-  bonus_time TIME DEFAULT NULL,
32  
-  last_read DATE DEFAULT NULL,
33  
-  content VARCHAR(3000),
34  
-  approved SMALLINT DEFAULT 1,
35  
-  replies_count INT DEFAULT 0,
36  
-  parent_id INT DEFAULT NULL,
37  
-  type VARCHAR(50) DEFAULT NULL,
38  
-  PRIMARY KEY (id)
39  
-);
40  
-
41  
-CREATE TABLE developers (
42  
-  id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
43  
-  name VARCHAR(100) DEFAULT NULL,
44  
-  salary INT DEFAULT 70000,
45  
-  created_at TIMESTAMP DEFAULT NULL,
46  
-  updated_at TIMESTAMP DEFAULT NULL,
47  
-  PRIMARY KEY (id)
48  
-);
49  
-
50  
-CREATE TABLE projects (
51  
-  id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
52  
-  name VARCHAR(100) DEFAULT NULL,
53  
-  type VARCHAR(255) DEFAULT NULL,
54  
-  PRIMARY KEY (id)
55  
-);
56  
-
57  
-CREATE TABLE developers_projects (
58  
-  developer_id INT NOT NULL,
59  
-  project_id INT NOT NULL,
60  
-  joined_on DATE DEFAULT NULL,
61  
-  access_level SMALLINT DEFAULT 1
62  
-);
63  
-
64  
-CREATE TABLE orders (
65  
-  id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
66  
-  name VARCHAR(100) DEFAULT NULL,
67  
-  billing_customer_id INT DEFAULT NULL,
68  
-  shipping_customer_id INT DEFAULT NULL,
69  
-  PRIMARY KEY (id)
70  
-);
71  
-
72  
-CREATE TABLE customers (
73  
-  id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
74  
-  name VARCHAR(100) DEFAULT NULL,
75  
-  balance INT DEFAULT 0,
76  
-  address_street VARCHAR(100) DEFAULT NULL,
77  
-  address_city VARCHAR(100) DEFAULT NULL,
78  
-  address_country VARCHAR(100) DEFAULT NULL,
79  
-  gps_location VARCHAR(100) DEFAULT NULL,
80  
-  PRIMARY KEY (id)
81  
-);
82  
-
83  
-CREATE TABLE movies (
84  
-  movieid INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
85  
-  name VARCHAR(100) DEFAULT NULL,
86  
-  PRIMARY KEY (movieid)
87  
-);
88  
-
89  
-CREATE TABLE subscribers (
90  
-  nick VARCHAR(100) NOT NULL,
91  
-  name VARCHAR(100) DEFAULT NULL,
92  
-  PRIMARY KEY (nick)
93  
-);
94  
-
95  
-CREATE TABLE booleantests (
96  
-  id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
97  
-  value INT DEFAULT NULL,
98  
-  PRIMARY KEY (id)
99  
-);
100  
-
101  
-CREATE TABLE auto_id_tests (
102  
-  auto_id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
103  
-  value INT DEFAULT NULL,
104  
-  PRIMARY KEY (auto_id)
105  
-);
106  
-
107  
-CREATE TABLE entrants (
108  
-  id INT NOT NULL PRIMARY KEY,
109  
-  name VARCHAR(255) NOT NULL,
110  
-  course_id INT NOT NULL
111  
-);
112  
-
113  
-CREATE TABLE colnametests (
114  
-  id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
115  
-  references INT NOT NULL,
116  
-  PRIMARY KEY (id)
117  
-);
118  
-
119  
-CREATE TABLE mixins (
120  
-  id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
121  
-  parent_id INT DEFAULT NULL,
122  
-  pos INT DEFAULT NULL,
123  
-  created_at TIMESTAMP DEFAULT NULL,
124  
-  updated_at TIMESTAMP DEFAULT NULL,
125  
-  lft INT DEFAULT NULL,
126  
-  rgt INT DEFAULT NULL,
127  
-  root_id INT DEFAULT NULL,
128  
-  type VARCHAR(40) DEFAULT NULL,
129  
-  PRIMARY KEY (id)
130  
-);
131  
-
132  
-CREATE TABLE people (
133  
-  id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
134  
-  first_name VARCHAR(40) NOT NULL,
135  
-  lock_version INT DEFAULT 0,
136  
-  PRIMARY KEY (id)
137  
-);
138  
-
139  
-CREATE TABLE readers (
140  
-  id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
141  
-  post_id INT NOT NULL,
142  
-  person_id INT NOT NULL,
143  
-  PRIMARY KEY (id)
144  
-);
145  
-
146  
-CREATE TABLE binaries (
147  
-  id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
148  
-  data BLOB(50000),
149  
-  PRIMARY KEY (id)
150  
-);
151  
-
152  
-CREATE TABLE computers (
153  
-  id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
154  
-  developer INT NOT NULL,
155  
-  extendedWarranty INT NOT NULL
156  
-);
157  
-
158  
-CREATE TABLE posts (
159  
-  id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
160  
-  author_id INT DEFAULT NULL,
161  
-  title VARCHAR(255) DEFAULT NULL,
162  
-  type VARCHAR(255) DEFAULT NULL,
163  
-  body VARCHAR(3000) DEFAULT NULL
164  
-);
165  
-
166  
-CREATE TABLE comments (
167  
-  id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
168  
-  post_id INT DEFAULT NULL,
169  
-  type VARCHAR(255) DEFAULT NULL,
170  
-  body VARCHAR(3000) DEFAULT NULL
171  
-);
172  
-
173  
-CREATE TABLE authors (
174  
-  id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
175  
-  name VARCHAR(255) DEFAULT NULL
176  
-);
177  
-
178  
-CREATE TABLE tasks (
179  
-  id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
180  
-  starting TIMESTAMP DEFAULT NULL,
181  
-  ending TIMESTAMP DEFAULT NULL
182  
-);
183  
-
184  
-CREATE TABLE categories (
185  
-  id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
186  
-  name VARCHAR(255) NOT NULL,
187  
-  type VARCHAR(40) DEFAULT NULL
188  
-);
189  
-
190  
-CREATE TABLE categories_posts (
191  
-  category_id INT NOT NULL,
192  
-  post_id INT NOT NULL
193  
-);
194  
-
195  
-CREATE TABLE keyboards (
196  
-  key_number INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
197  
-  name VARCHAR(255)
198  
-);
199  
-
200  
-CREATE TABLE fk_test_has_pk (
201  
-  id INT NOT NULL PRIMARY KEY
202  
-);
203  
-
204  
-CREATE TABLE fk_test_has_fk (
205  
-  id    INT NOT NULL PRIMARY KEY,
206  
-  fk_id INT NOT NULL,
207  
-
208  
-  FOREIGN KEY (fk_id) REFERENCES fk_test_has_pk(id)
209  
-);
210  
-
211  
---This table has an altered lock_version column name
212  
-CREATE TABLE legacy_things (
213  
-  id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
214  
-  tps_report_number INT DEFAULT NULL,
215  
-  version INT DEFAULT 0,
216  
-  PRIMARY KEY (id)
217  
-);
218  
-
219  
-CREATE TABLE numeric_data (
220  
-  id INT NOT NULL PRIMARY KEY,
221  
-  bank_balance DECIMAL(10,2),
222  
-  big_bank_balance DECIMAL(15,2),
223  
-  world_population DECIMAL(10),
224  
-  my_house_population DECIMAL(2),
225  
-  decimal_number_with_default DECIMAL(3,2) DEFAULT 2.78
226  
-);
227  
-
228  
-CREATE TABLE mixed_case_monkeys (
229  
- monkeyID INT NOT NULL PRIMARY KEY,
230  
- fleaCount INT
231  
-);
232  
-
233  
-CREATE TABLE minimalistics (
234  
-  id INT NOT NULL PRIMARY KEY
235  
-);
1  activerecord/test/schema/db22.drop.sql
... ...
@@ -1 +0,0 @@
1  
-DROP TABLE courses;
4  activerecord/test/schema/db22.sql
... ...
@@ -1,4 +0,0 @@
1  
-CREATE TABLE courses (
2  
- id INT NOT NULL PRIMARY KEY,
3  
- name VARCHAR(255) NOT NULL
4  
-);
65  activerecord/test/schema/firebird.drop.sql
... ...
@@ -1,65 +0,0 @@
1  
-DROP TABLE accounts;
2  
-DROP TABLE funny_jokes;
3  
-DROP TABLE companies;
4  
-DROP TABLE topics;
5  
-DROP TABLE developers;
6  
-DROP TABLE projects;
7  
-DROP TABLE developers_projects;
8  
-DROP TABLE orders;
9  
-DROP TABLE customers;
10  
-DROP TABLE movies;
11  
-DROP TABLE subscribers;
12  
-DROP TABLE booleantests;
13  
-DROP TABLE auto_id_tests;
14  
-DROP TABLE entrants;
15  
-DROP TABLE colnametests;
16  
-DROP TABLE mixins;
17  
-DROP TABLE people;
18  
-DROP TABLE readers;
19  
-DROP TABLE binaries;
20  
-DROP TABLE computers;
21  
-DROP TABLE posts;
22  
-DROP TABLE comments;
23  
-DROP TABLE authors;
24  
-DROP TABLE tasks;
25  
-DROP TABLE categories;
26  
-DROP TABLE categories_posts;
27  
-DROP TABLE fk_test_has_fk;
28  
-DROP TABLE fk_test_has_pk;
29  
-DROP TABLE keyboards;
30  
-DROP TABLE defaults;
31  
-DROP TABLE legacy_things;
32  
-DROP TABLE numeric_data;
33  
-DROP TABLE mixed_case_monkeys;
34  
-DROP TABLE minimalistics;
35  
-
36  
-DROP DOMAIN D_BOOLEAN;
37  
-
38  
-DROP GENERATOR accounts_seq;
39  
-DROP GENERATOR funny_jokes_seq;
40  
-DROP GENERATOR companies_nonstd_seq;
41  
-DROP GENERATOR topics_seq;
42  
-DROP GENERATOR developers_seq;
43  
-DROP GENERATOR projects_seq;
44  
-DROP GENERATOR orders_seq;
45  
-DROP GENERATOR customers_seq;
46  
-DROP GENERATOR movies_seq;
47  
-DROP GENERATOR booleantests_seq;
48  
-DROP GENERATOR auto_id_tests_seq;
49  
-DROP GENERATOR entrants_seq;
50  
-DROP GENERATOR colnametests_seq;
51  
-DROP GENERATOR mixins_seq;
52  
-DROP GENERATOR people_seq;
53  
-DROP GENERATOR binaries_seq;
54  
-DROP GENERATOR computers_seq;
55  
-DROP GENERATOR posts_seq;
56  
-DROP GENERATOR comments_seq;
57  
-DROP GENERATOR authors_seq;
58  
-DROP GENERATOR tasks_seq;
59  
-DROP GENERATOR categories_seq;
60  
-DROP GENERATOR keyboards_seq;
61  
-DROP GENERATOR defaults_seq;
62  
-DROP GENERATOR legacy_things_seq;
63  
-DROP GENERATOR numeric_data_seq;
64  
-DROP GENERATOR mixed_case_monkeys_seq;
65  
-DROP GENERATOR minimalistics_seq;
310  activerecord/test/schema/firebird.sql
... ...
@@ -1,310 +0,0 @@
1  
-CREATE DOMAIN D_BOOLEAN AS SMALLINT CHECK (VALUE IN (0, 1) OR VALUE IS NULL);
2  
-
3  
-CREATE TABLE accounts (
4  
-  id BIGINT NOT NULL,
5  
-  firm_id BIGINT,
6  
-  credit_limit INTEGER,
7  
-  PRIMARY KEY (id)
8  
-);
9  
-CREATE GENERATOR accounts_seq;
10  
-SET GENERATOR accounts_seq TO 10000;
11  
-
12  
-CREATE TABLE funny_jokes (
13  
-  id BIGINT NOT NULL,
14  
-  name VARCHAR(50),
15  
-  PRIMARY KEY (id)
16  
-);
17  
-CREATE GENERATOR funny_jokes_seq;
18  
-SET GENERATOR funny_jokes_seq TO 10000;
19  
-
20  
-CREATE TABLE companies (
21  
-  id BIGINT NOT NULL,
22  
-  "TYPE" VARCHAR(50),
23  
-  ruby_type VARCHAR(50),
24  
-  firm_id BIGINT,
25  
-  name VARCHAR(50),
26  
-  client_of INTEGER,
27  
-  rating INTEGER DEFAULT 1,
28  
-  PRIMARY KEY (id)
29  
-);
30  
-CREATE GENERATOR companies_nonstd_seq;
31  
-SET GENERATOR companies_nonstd_seq TO 10000;
32  
-
33  
-CREATE TABLE topics (
34  
-  id BIGINT NOT NULL,
35  
-  title VARCHAR(255),
36  
-  author_name VARCHAR(255),
37  
-  author_email_address VARCHAR(255),
38  
-  written_on TIMESTAMP,
39  
-  bonus_time TIME,
40  
-  last_read DATE,
41  
-  content VARCHAR(4000),
42  
-  approved D_BOOLEAN DEFAULT 1,
43  
-  replies_count INTEGER DEFAULT 0,
44  
-  parent_id BIGINT,
45  
-  "TYPE" VARCHAR(50),
46  
-  PRIMARY KEY (id)
47  
-);
48  
-CREATE GENERATOR topics_seq;
49  
-SET GENERATOR topics_seq TO 10000;
50  
-
51  
-CREATE TABLE developers (
52  
-  id BIGINT NOT NULL,
53  
-  name VARCHAR(100),
54  
-  salary INTEGER DEFAULT 70000,
55  
-  created_at TIMESTAMP,
56  
-  updated_at TIMESTAMP,
57  
-  PRIMARY KEY (id)
58  
-);
59  
-CREATE GENERATOR developers_seq;
60  
-SET GENERATOR developers_seq TO 10000;
61  
-
62  
-CREATE TABLE projects (
63  
-  id BIGINT NOT NULL,
64  
-  name VARCHAR(100),
65  
-  "TYPE" VARCHAR(255),
66  
-  PRIMARY KEY (id)
67  
-);
68  
-CREATE GENERATOR projects_seq;
69  
-SET GENERATOR projects_seq TO 10000;
70  
-
71  
-CREATE TABLE developers_projects (
72  
-  developer_id BIGINT NOT NULL,
73  
-  project_id BIGINT NOT NULL,
74  
-  joined_on DATE,
75  
-  access_level SMALLINT DEFAULT 1
76  
-);
77  
-
78  
-CREATE TABLE orders (
79  
-  id BIGINT NOT NULL,
80  
-  name VARCHAR(100),
81  
-  billing_customer_id BIGINT,
82  
-  shipping_customer_id BIGINT,
83  
-  PRIMARY KEY (id)
84  
-);
85  
-CREATE GENERATOR orders_seq;
86  
-SET GENERATOR orders_seq TO 10000;
87  
-
88  
-CREATE TABLE customers (
89  
-  id BIGINT NOT NULL,
90  
-  name VARCHAR(100),
91  
-  balance INTEGER DEFAULT 0,
92  
-  address_street VARCHAR(100),
93  
-  address_city VARCHAR(100),
94  
-  address_country VARCHAR(100),
95  
-  gps_location VARCHAR(100),
96  
-  PRIMARY KEY (id)
97  
-);
98  
-CREATE GENERATOR customers_seq;
99  
-SET GENERATOR customers_seq TO 10000;
100  
-
101  
-CREATE TABLE movies (
102  
-  movieid BIGINT NOT NULL,
103  
-  name varchar(100),
104  
-  PRIMARY KEY (movieid)
105  
-);
106  
-CREATE GENERATOR movies_seq;
107  
-SET GENERATOR movies_seq TO 10000;
108  
-
109  
-CREATE TABLE subscribers (
110  
-  nick VARCHAR(100) NOT NULL,
111  
-  name VARCHAR(100),
112  
-  PRIMARY KEY (nick)
113  
-);
114  
-
115  
-CREATE TABLE booleantests (
116  
-  id BIGINT NOT NULL,
117  
-  "VALUE" D_BOOLEAN,
118  
-  PRIMARY KEY (id)
119  
-);
120  
-CREATE GENERATOR booleantests_seq;
121  
-SET GENERATOR booleantests_seq TO 10000;
122  
-
123  
-CREATE TABLE auto_id_tests (
124  
-  auto_id BIGINT NOT NULL,
125  
-  "VALUE" INTEGER,
126  
-  PRIMARY KEY (auto_id)
127  
-);
128  
-CREATE GENERATOR auto_id_tests_seq;
129  
-SET GENERATOR auto_id_tests_seq TO 10000;
130  
-
131  
-CREATE TABLE entrants (
132  
-  id BIGINT NOT NULL,
133  
-  name VARCHAR(255) NOT NULL,
134  
-  course_id INTEGER NOT NULL,
135  
-  PRIMARY KEY (id)
136  
-);
137  
-CREATE GENERATOR entrants_seq;
138  
-SET GENERATOR entrants_seq TO 10000;
139  
-
140  
-CREATE TABLE colnametests (
141  
-  id BIGINT NOT NULL,
142  
-  "REFERENCES" INTEGER NOT NULL,
143  
-  PRIMARY KEY (id)
144  
-);
145  
-CREATE GENERATOR colnametests_seq;
146  
-SET GENERATOR colnametests_seq TO 10000;
147  
-
148  
-CREATE TABLE mixins (
149  
-  id BIGINT NOT NULL,
150  
-  parent_id BIGINT,
151  
-  pos INTEGER,
152  
-  created_at TIMESTAMP,
153  
-  updated_at TIMESTAMP,
154  
-  lft INTEGER,
155  
-  rgt INTEGER,
156  
-  root_id BIGINT,
157  
-  "TYPE" VARCHAR(40),
158  
-  PRIMARY KEY (id)
159  
-);
160  
-CREATE GENERATOR mixins_seq;
161  
-SET GENERATOR mixins_seq TO 10000;
162  
-
163  
-CREATE TABLE people (
164  
-  id BIGINT NOT NULL,
165  
-  first_name VARCHAR(40),
166  
-  lock_version INTEGER DEFAULT 0 NOT NULL,
167  
-  PRIMARY KEY (id)
168  
-);
169  
-CREATE GENERATOR people_seq;
170  
-SET GENERATOR people_seq TO 10000;
171  
-
172  
-CREATE TABLE readers (
173  
-    id BIGINT NOT NULL,
174  
-    post_id BIGINT NOT NULL,
175  
-    person_id BIGINT NOT NULL,
176  
-    PRIMARY KEY (id)
177  
-);
178  
-CREATE GENERATOR readers_seq;
179  
-SET GENERATOR readers_seq TO 10000;
180  
-
181  
-CREATE TABLE binaries (
182  
-  id BIGINT NOT NULL,
183  
-  data BLOB,
184  
-  PRIMARY KEY (id)
185  
-);
186  
-CREATE GENERATOR binaries_seq;
187  
-SET GENERATOR binaries_seq TO 10000;
188  
-
189  
-CREATE TABLE computers (
190  
-  id BIGINT NOT NULL,
191  
-  developer INTEGER NOT NULL,
192  
-  "extendedWarranty" INTEGER NOT NULL,
193  
-  PRIMARY KEY (id)
194  
-);
195  
-CREATE GENERATOR computers_seq;
196  
-SET GENERATOR computers_seq TO 10000;
197  
-
198  
-CREATE TABLE posts (
199  
-  id BIGINT NOT NULL,
200  
-  author_id BIGINT,
201  
-  title VARCHAR(255) NOT NULL,
202  
-  "TYPE" VARCHAR(255) NOT NULL,
203  
-  body VARCHAR(3000) NOT NULL,
204  
-  PRIMARY KEY (id)
205  
-);
206  
-CREATE GENERATOR posts_seq;
207  
-SET GENERATOR posts_seq TO 10000;
208  
-
209  
-CREATE TABLE comments (
210  
-  id BIGINT NOT NULL,
211  
-  post_id BIGINT NOT NULL,
212  
-  "TYPE" VARCHAR(255) NOT NULL,
213  
-  body VARCHAR(3000) NOT NULL,
214  
-  PRIMARY KEY (id)
215  
-);
216  
-CREATE GENERATOR comments_seq;
217  
-SET GENERATOR comments_seq TO 10000;
218  
-
219  
-CREATE TABLE authors (
220  
-  id BIGINT NOT NULL,
221  
-  name VARCHAR(255) NOT NULL,
222  
-  PRIMARY KEY (id)
223  
-);
224  
-CREATE GENERATOR authors_seq;
225  
-SET GENERATOR authors_seq TO 10000;
226  
-
227  
-CREATE TABLE tasks (
228  
-  id BIGINT NOT NULL,
229  
-  "STARTING" TIMESTAMP,
230  
-  ending TIMESTAMP,
231  
-  PRIMARY KEY (id)
232  
-);
233  
-CREATE GENERATOR tasks_seq;
234  
-SET GENERATOR tasks_seq TO 10000;
235  
-
236  
-CREATE TABLE categories (
237  
-  id BIGINT NOT NULL,
238  
-  name VARCHAR(255) NOT NULL,
239  
-  "TYPE" VARCHAR(255) NOT NULL,
240  
-  PRIMARY KEY (id)
241  
-);
242  
-CREATE GENERATOR categories_seq;
243  
-SET GENERATOR categories_seq TO 10000;
244  
-
245  
-CREATE TABLE categories_posts (
246  
-  category_id BIGINT NOT NULL,
247  
-  post_id BIGINT NOT NULL,
248  
-  PRIMARY KEY (category_id, post_id)
249  
-);
250  
-
251  
-CREATE TABLE fk_test_has_pk (
252  
-  id BIGINT NOT NULL,
253  
-  PRIMARY KEY (id)
254  
-);
255  
-
256  
-CREATE TABLE fk_test_has_fk (
257  
-  id BIGINT NOT NULL,
258  
-  fk_id BIGINT NOT NULL,
259  
-  PRIMARY KEY (id),
260  
-  FOREIGN KEY (fk_id) REFERENCES fk_test_has_pk(id)
261  
-);
262  
-
263  
-CREATE TABLE keyboards (
264  
-  key_number BIGINT NOT NULL,
265  
-  name VARCHAR(50),
266  
-  PRIMARY KEY (key_number)
267  
-);
268  
-CREATE GENERATOR keyboards_seq;
269  
-SET GENERATOR keyboards_seq TO 10000;
270  
-
271  
-CREATE TABLE defaults (
272  
-  id BIGINT NOT NULL,
273  
-  default_timestamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP
274  
-);
275  
-CREATE GENERATOR defaults_seq;
276  
-SET GENERATOR defaults_seq TO 10000;
277  
-
278  
-CREATE TABLE legacy_things (
279  
-  id BIGINT NOT NULL,
280  
-  tps_report_number INTEGER,
281  
-  version INTEGER DEFAULT 0 NOT NULL,
282  
-  PRIMARY KEY (id)
283  
-);
284  
-CREATE GENERATOR legacy_things_seq;
285  
-SET GENERATOR legacy_things_seq TO 10000;
286  
-
287  
-CREATE TABLE numeric_data (
288  
-  id BIGINT NOT NULL,
289  
-  bank_balance DECIMAL(10,2),
290  
-  big_bank_balance DECIMAL(15,2),
291  
-  world_population DECIMAL(10),
292  
-  my_house_population DECIMAL(2),
293  
-  decimal_number_with_default DECIMAL(3,2) DEFAULT 2.78,
294  
-  PRIMARY KEY (id)
295  
-);
296  
-CREATE GENERATOR numeric_data_seq;
297  
-SET GENERATOR numeric_data_seq TO 10000;
298  
-
299  
-CREATE TABLE mixed_case_monkeys (
300  
- "monkeyID" BIGINT NOT NULL,
301  
- "fleaCount" INTEGER
302  
-);
303  
-CREATE GENERATOR mixed_case_monkeys_seq;
304  
-SET GENERATOR mixed_case_monkeys_seq TO 10000;
305  
-
306  
-CREATE TABLE minimalistics (
307  
-  id BIGINT NOT NULL
308  
-);
309  
-CREATE GENERATOR minimalistics_seq;
310  
-SET GENERATOR minimalistics_seq TO 10000;
2  activerecord/test/schema/firebird2.drop.sql
... ...
@@ -1,2 +0,0 @@
1  
-DROP TABLE courses;
2  
-DROP GENERATOR courses_seq;
6  activerecord/test/schema/firebird2.sql
... ...
@@ -1,6 +0,0 @@
1  
-CREATE TABLE courses (
2  
-  id BIGINT NOT NULL PRIMARY KEY,
3  
-  name VARCHAR(255) NOT NULL
4  
-);
5  
-CREATE GENERATOR courses_seq;
6  
-SET GENERATOR courses_seq TO 10000;
33  activerecord/test/schema/frontbase.drop.sql
... ...
@@ -1,33 +0,0 @@
1  
-DROP TABLE accounts CASCADE;
2  
-DROP TABLE funny_jokes CASCADE;
3  
-DROP TABLE companies CASCADE;
4  
-DROP TABLE topics CASCADE;
5  
-DROP TABLE developers CASCADE;
6  
-DROP TABLE projects CASCADE;
7  
-DROP TABLE developers_projects CASCADE;
8  
-DROP TABLE orders CASCADE;
9  
-DROP TABLE customers CASCADE;
10  
-DROP TABLE movies CASCADE;
11  
-DROP TABLE subscribers CASCADE;
12  
-DROP TABLE booleantests CASCADE;
13  
-DROP TABLE auto_id_tests CASCADE;
14  
-DROP TABLE entrants CASCADE;
15  
-DROP TABLE colnametests CASCADE;
16  
-DROP TABLE mixins CASCADE;
17  
-DROP TABLE people CASCADE;
18  
-DROP TABLE readers CASCADE;
19  
-DROP TABLE binaries CASCADE;
20  
-DROP TABLE computers CASCADE;
21  
-DROP TABLE posts CASCADE;
22  
-DROP TABLE comments CASCADE;
23  
-DROP TABLE authors CASCADE;
24  
-DROP TABLE tasks CASCADE;
25  
-DROP TABLE categories CASCADE;
26  
-DROP TABLE categories_posts CASCADE;
27  
-DROP TABLE fk_test_has_fk CASCADE;
28  
-DROP TABLE fk_test_has_pk CASCADE;
29  
-DROP TABLE keyboards CASCADE;
30  
-DROP TABLE legacy_things CASCADE;
31  
-DROP TABLE numeric_data CASCADE;
32  
-DROP TABLE mixed_case_monkeys CASCADE;
33  
-DROP TABLE minimalistics CASCADE;
273  activerecord/test/schema/frontbase.sql
... ...
@@ -1,273 +0,0 @@
1  
-CREATE TABLE accounts (
2  
-    id integer DEFAULT unique,
3  
-    firm_id integer,
4  
-    credit_limit integer,
5  
-    PRIMARY KEY (id)
6  
-);
7  
-SET UNIQUE FOR accounts(id);
8  
-
9  
-CREATE TABLE funny_jokes (
10  
-  id integer DEFAULT unique,
11  
-  firm_id integer default NULL,
12  
-  name character varying(50),
13  
-  PRIMARY KEY (id)
14  
-);
15  
-SET UNIQUE FOR funny_jokes(id);
16  
-
17  
-CREATE TABLE companies (
18  
-  id integer DEFAULT unique,
19  
-    "type" character varying(50),
20  
-    "ruby_type" character varying(50),
21  
-    firm_id integer,
22  
-    name character varying(50),
23  
-    client_of integer,
24  
-    rating integer default 1,
25  
-    PRIMARY KEY (id)
26  
-);
27  
-SET UNIQUE FOR companies(id);
28  
-
29  
-CREATE TABLE topics (
30  
-  id integer DEFAULT unique,
31  
-    title character varying(255),
32  
-    author_name character varying(255),
33  
-    author_email_address character varying(255),
34  
-    written_on timestamp,
35  
-    bonus_time time,
36  
-    last_read date,
37  
-    content varchar(65536),
38  
-    approved boolean default true,
39  
-    replies_count integer default 0,
40  
-    parent_id integer,
41  
-    "type" character varying(50),
42  
-    PRIMARY KEY (id)
43  
-);
44  
-SET UNIQUE FOR topics(id);
45  
-
46  
-CREATE TABLE developers (
47  
-  id integer DEFAULT unique,
48  
-    name character varying(100),
49  
-    salary integer DEFAULT 70000,
50  
-    created_at timestamp,
51  
-    updated_at timestamp,
52  
-    PRIMARY KEY (id)
53  
-);
54  
-SET UNIQUE FOR developers(id);
55  
-
56  
-CREATE TABLE projects (
57  
-  id integer DEFAULT unique,
58  
-    name character varying(100),
59  
-    type varchar(255),
60  
-    PRIMARY KEY (id)
61  
-);
62  
-SET UNIQUE FOR projects(id);
63  
-
64  
-CREATE TABLE developers_projects (
65  
-    developer_id integer NOT NULL,
66  
-    project_id integer NOT NULL,
67  
-    joined_on date,
68  
-    access_level integer default 1
69  
-);
70  
-
71  
-CREATE TABLE orders (
72  
-  id integer DEFAULT unique,
73  
-    name character varying(100),
74  
-    billing_customer_id integer,
75  
-    shipping_customer_id integer,
76  
-    PRIMARY KEY (id)
77  
-);
78  
-SET UNIQUE FOR orders(id);
79  
-
80  
-CREATE TABLE customers (
81  
-  id integer DEFAULT unique,
82  
-    name character varying(100),
83  
-    balance integer default 0,
84  
-    address_street character varying(100),
85  
-    address_city character varying(100),
86  
-    address_country character varying(100),
87  
-    gps_location character varying(100),
88  
-    PRIMARY KEY (id)
89  
-);
90  
-SET UNIQUE FOR customers(id);
91  
-
92  
-CREATE TABLE movies (
93  
-    movieid integer DEFAULT unique,
94  
-    name varchar(65536),
95  
-    PRIMARY KEY (movieid)
96  
-);
97  
-SET UNIQUE FOR movies(movieid);
98  
-
99  
-CREATE TABLE subscribers (
100  
-    nick varchar(65536) NOT NULL,
101  
-    name varchar(65536),
102  
-    PRIMARY KEY (nick)
103  
-);
104  
-
105  
-CREATE TABLE booleantests (
106  
-  id integer DEFAULT unique,
107  
-    value boolean,
108  
-    PRIMARY KEY (id)
109  
-);
110  
-SET UNIQUE FOR booleantests(id);
111  
-
112  
-CREATE TABLE auto_id_tests (
113  
-  auto_id integer DEFAULT unique,
114  
-    value integer,
115  
-    PRIMARY KEY (auto_id)
116  
-);
117  
-SET UNIQUE FOR auto_id_tests(auto_id);
118  
-
119  
-CREATE TABLE entrants (
120  
-  id integer DEFAULT unique,
121  
-  name varchar(65536),
122  
-  course_id integer,
123  
-  PRIMARY KEY (id)
124  
-);
125  
-SET UNIQUE FOR entrants(id);
126  
-
127  
-CREATE TABLE colnametests (
128  
-  id integer DEFAULT unique,
129  
-  "references" integer NOT NULL,
130  
-  PRIMARY KEY (id)
131  
-);
132  
-SET UNIQUE FOR colnametests(id);
133  
-
134  
-CREATE TABLE mixins (
135  
-  id integer DEFAULT unique,
136  
-  parent_id integer,
137  
-  type character varying(100),
138  
-  pos integer,
139  
-  lft integer,
140  
-  rgt integer,
141  
-  root_id integer,
142  
-  created_at timestamp,
143  
-  updated_at timestamp,
144  
-  PRIMARY KEY (id)
145  
-);
146  
-SET UNIQUE FOR mixins(id);
147  
-
148  
-CREATE TABLE people (
149  
-  id integer DEFAULT unique,
150  
-  first_name varchar(65536),
151  
-  lock_version integer default 0,
152  
-  PRIMARY KEY  (id)
153  
-);
154  
-SET UNIQUE FOR people(id);
155  
-
156  
-CREATE TABLE readers (
157  
-  id integer DEFAULT unique,
158  
-  post_id INTEGER NOT NULL,
159  
-  person_id INTEGER NOT NULL,
160  
-  PRIMARY KEY  (id)
161  
-);
162  
-SET UNIQUE FOR readers(id);
163  
-
164  
-CREATE TABLE binaries (
165  
-  id integer DEFAULT unique,
166  
-  data BLOB,
167  
-  PRIMARY KEY (id)
168  
-);
169  
-SET UNIQUE FOR binaries(id);
170  
-
171  
-CREATE TABLE computers (
172  
-  id integer DEFAULT unique,
173  
-  developer integer NOT NULL,
174  
-  "extendedWarranty" integer NOT NULL,
175  
-  PRIMARY KEY (id)
176  
-);
177  
-SET UNIQUE FOR computers(id);
178  
-
179  
-CREATE TABLE posts (
180  
-  id integer DEFAULT unique,
181  
-  author_id integer,
182  
-  title varchar(255),
183  
-  type varchar(255),
184  
-  body varchar(65536),
185  
-  PRIMARY KEY (id)
186  
-);
187  
-SET UNIQUE FOR posts(id);
188  
-
189  
-CREATE TABLE comments (
190  
-  id integer DEFAULT unique,
191  
-  post_id integer,
192  
-  type varchar(255),
193  
-  body varchar(65536),
194  
-  PRIMARY KEY (id)
195  
-);
196  
-SET UNIQUE FOR comments(id);
197  
-
198  
-CREATE TABLE authors (
199  
-  id integer DEFAULT unique,
200  
-  name varchar(255) default NULL,
201  
-  PRIMARY KEY (id)
202  
-);
203  
-SET UNIQUE FOR authors(id);
204  
-
205  
-CREATE TABLE tasks (
206  
-  id integer DEFAULT unique,
207  
-  starting timestamp,
208  
-  ending timestamp,
209  
-  PRIMARY KEY (id)
210  
-);
211  
-SET UNIQUE FOR tasks(id);
212  
-
213  
-CREATE TABLE categories (
214  
-  id integer DEFAULT unique,
215  
-  name varchar(255),
216  
-  type varchar(255),
217  
-  PRIMARY KEY (id)
218  
-);
219  
-SET UNIQUE FOR categories(id);
220  
-
221  
-CREATE TABLE categories_posts (
222  
-  category_id integer NOT NULL,
223  
-  post_id integer NOT NULL
224  
-);
225  
-
226  
-CREATE TABLE fk_test_has_pk (
227  
-  id INTEGER NOT NULL PRIMARY KEY
228  
-);
229  
-SET UNIQUE FOR fk_test_has_pk(id);
230  
-
231  
-CREATE TABLE fk_test_has_fk (
232  
-  id    INTEGER NOT NULL PRIMARY KEY,
233  
-  fk_id INTEGER NOT NULL REFERENCES fk_test_has_fk(id)
234  
-);
235  
-SET UNIQUE FOR fk_test_has_fk(id);
236  
-
237  
-CREATE TABLE keyboards (
238  
-  key_number integer DEFAULT unique,
239  
-  "name" character varying(50),
240  
-  PRIMARY KEY (key_number)
241  
-);
242  
-SET UNIQUE FOR keyboards(key_number);
243  
-
244  
-create table "legacy_things"
245  
-(
246  
-  "id" int,
247  
-  "tps_report_number" int default NULL,
248  
-  "version" int default 0 not null,
249  
-  primary key ("id")
250  
-);
251  
-SET UNIQUE FOR legacy_things(id);
252  
-
253  
-CREATE TABLE "numeric_data" (
254  
-  "id" integer NOT NULL
255  
-  "bank_balance" DECIMAL(10,2),
256  
-  "big_bank_balance" DECIMAL(15,2),
257  
-  "world_population" DECIMAL(10),
258  
-  "my_house_population" DECIMAL(2),
259  
-  "decimal_number_with_default" DECIMAL(3,2) DEFAULT 2.78,
260  
-  primary key ("id")
261  
-);
262  
-SET UNIQUE FOR numeric_data(id);
263  
-
264  
-CREATE TABLE mixed_case_monkeys (
265  
- "monkeyID" integer DEFAULT unique,
266  
- "fleaCount" integer
267  
-);
268  
-SET UNIQUE FOR mixed_case_monkeys("monkeyID");
269  
-
270  
-CREATE TABLE minimalistics (
271  
-  "id" integer NOT NULL
272  
-);
273  
-SET UNIQUE FOR minimalistics("id");
1  activerecord/test/schema/frontbase2.drop.sql
... ...
@@ -1 +0,0 @@
1  
-DROP TABLE courses CASCADE;
4  activerecord/test/schema/frontbase2.sql
... ...
@@ -1,4 +0,0 @@
1  
-CREATE TABLE courses (
2  
-  id integer DEFAULT unique,
3  
-  name varchar(100)
4  
-);
12  activerecord/test/schema/mysql_specific_schema.rb
... ...
@@ -0,0 +1,12 @@
  1
+ActiveRecord::Schema.define do
  2
+  create_table :binary_fields, :force => true do |t|
  3
+    t.binary :tiny_blob,   :limit => 255
  4
+    t.binary :normal_blob, :limit => 65535
  5
+    t.binary :medium_blob, :limit => 16777215
  6
+    t.binary :long_blob,   :limit => 2147483647
  7
+    t.text   :tiny_text,   :limit => 255
  8
+    t.text   :normal_text, :limit => 65535
  9