Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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
@fcheung fcheung authored NZKoz committed
Showing with 432 additions and 2,928 deletions.
  1. +1 −1  activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
  2. +7 −51 activerecord/test/cases/aaa_create_tables_test.rb
  3. +1 −1  activerecord/test/cases/associations/has_many_through_associations_test.rb
  4. +1 −1  activerecord/test/cases/associations_test.rb
  5. +1 −1  activerecord/test/cases/base_test.rb
  6. +0 −33 activerecord/test/schema/db2.drop.sql
  7. +0 −235 activerecord/test/schema/db2.sql
  8. +0 −1  activerecord/test/schema/db22.drop.sql
  9. +0 −4 activerecord/test/schema/db22.sql
  10. +0 −65 activerecord/test/schema/firebird.drop.sql
  11. +0 −310 activerecord/test/schema/firebird.sql
  12. +0 −2  activerecord/test/schema/firebird2.drop.sql
  13. +0 −6 activerecord/test/schema/firebird2.sql
  14. +0 −33 activerecord/test/schema/frontbase.drop.sql
  15. +0 −273 activerecord/test/schema/frontbase.sql
  16. +0 −1  activerecord/test/schema/frontbase2.drop.sql
  17. +0 −4 activerecord/test/schema/frontbase2.sql
  18. +12 −0 activerecord/test/schema/mysql_specific_schema.rb
  19. +0 −2  activerecord/test/schema/openbase.drop.sql
  20. +0 −318 activerecord/test/schema/openbase.sql
  21. +0 −2  activerecord/test/schema/openbase2.drop.sql
  22. +0 −7 activerecord/test/schema/openbase2.sql
  23. +0 −67 activerecord/test/schema/oracle.drop.sql
  24. +0 −330 activerecord/test/schema/oracle.sql
  25. +0 −2  activerecord/test/schema/oracle2.drop.sql
  26. +0 −6 activerecord/test/schema/oracle2.sql
  27. +0 −44 activerecord/test/schema/postgresql.drop.sql
  28. +0 −294 activerecord/test/schema/postgresql.sql
  29. +0 −1  activerecord/test/schema/postgresql2.drop.sql
  30. +0 −4 activerecord/test/schema/postgresql2.sql
  31. +103 −0 activerecord/test/schema/postgresql_specific_schema.rb
  32. +274 −301 activerecord/test/schema/schema.rb
  33. +2 −7 activerecord/test/schema/schema2.rb
  34. +0 −33 activerecord/test/schema/sqlite.drop.sql
  35. +0 −219 activerecord/test/schema/sqlite.sql
  36. +0 −1  activerecord/test/schema/sqlite2.drop.sql
  37. +0 −4 activerecord/test/schema/sqlite2.sql
  38. +25 −0 activerecord/test/schema/sqlite_specific_schema.rb
  39. +5 −0 activerecord/test/schema/sqlserver_specific_schema.rb
  40. +0 −35 activerecord/test/schema/sybase.drop.sql
  41. +0 −222 activerecord/test/schema/sybase.sql
  42. +0 −2  activerecord/test/schema/sybase2.drop.sql
  43. +0 −5 activerecord/test/schema/sybase2.sql
View
2  activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
@@ -617,7 +617,7 @@ def reset_pk_sequence!(table, pk = nil, sequence = nil) #:nodoc:
quoted_sequence = quote_column_name(sequence)
select_value <<-end_sql, 'Reset sequence'
- 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)
+ 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)
end_sql
else
@logger.warn "#{table} has primary key #{pk} with no default sequence" if @logger
View
58 activerecord/test/cases/aaa_create_tables_test.rb
@@ -4,65 +4,21 @@
class AAACreateTablesTest < ActiveRecord::TestCase
self.use_transactional_fixtures = false
- def test_drop_and_create_main_tables
- recreate ActiveRecord::Base unless use_migrations?
- assert true
- end
-
def test_load_schema
- if ActiveRecord::Base.connection.supports_migrations?
- eval(File.read(SCHEMA_ROOT + "/schema.rb"))
- else
- recreate ActiveRecord::Base, '3'
+ eval(File.read(SCHEMA_ROOT + "/schema.rb"))
+ if File.exists?(adapter_specific_schema_file)
+ eval(File.read(adapter_specific_schema_file))
end
assert true
end
def test_drop_and_create_courses_table
- if Course.connection.supports_migrations?
- eval(File.read(SCHEMA_ROOT + "/schema2.rb"))
- end
- recreate Course, '2' unless use_migrations_for_courses?
+ eval(File.read(SCHEMA_ROOT + "/schema2.rb"))
assert true
end
private
- def use_migrations?
- unittest_sql_filename = ActiveRecord::Base.connection.adapter_name.downcase + ".sql"
- not File.exist? SCHEMA_ROOT + "/#{unittest_sql_filename}"
- end
-
- def use_migrations_for_courses?
- unittest2_sql_filename = ActiveRecord::Base.connection.adapter_name.downcase + "2.sql"
- not File.exist? SCHEMA_ROOT + "/#{unittest2_sql_filename}"
- end
-
- def recreate(base, suffix = nil)
- connection = base.connection
- adapter_name = connection.adapter_name.downcase + suffix.to_s
- execute_sql_file SCHEMA_ROOT + "/#{adapter_name}.drop.sql", connection
- execute_sql_file SCHEMA_ROOT + "/#{adapter_name}.sql", connection
- end
-
- def execute_sql_file(path, connection)
- # OpenBase has a different format for sql files
- if current_adapter?(:OpenBaseAdapter) then
- File.read(path).split("go").each_with_index do |sql, i|
- begin
- # OpenBase does not support comments embedded in sql
- connection.execute(sql,"SQL statement ##{i}") unless sql.blank?
- rescue ActiveRecord::StatementInvalid
- #$stderr.puts "warning: #{$!}"
- end
- end
- else
- File.read(path).split(';').each_with_index do |sql, i|
- begin
- connection.execute("\n\n-- statement ##{i}\n#{sql}\n") unless sql.blank?
- rescue ActiveRecord::StatementInvalid
- #$stderr.puts "warning: #{$!}"
- end
- end
- end
- end
+ def adapter_specific_schema_file
+ SCHEMA_ROOT + '/' + ActiveRecord::Base.connection.adapter_name.downcase + '_specific_schema.rb'
+ end
end
View
2  activerecord/test/cases/associations/has_many_through_associations_test.rb
@@ -25,7 +25,7 @@ def test_associating_new
new_person = nil # so block binding catches it
assert_queries(0) do
- new_person = Person.new
+ new_person = Person.new :first_name => 'bob'
end
# Associating new records always saves them
View
2  activerecord/test/cases/associations_test.rb
@@ -41,7 +41,7 @@ def test_bad_collection_keys
end
def test_should_construct_new_finder_sql_after_create
- person = Person.new
+ person = Person.new :first_name => 'clark'
assert_equal [], person.readers.find(:all)
person.save!
reader = Reader.create! :person => person, :post => Post.new(:title => "foo", :body => "bar")
View
2  activerecord/test/cases/base_test.rb
@@ -1704,7 +1704,7 @@ def test_find_on_abstract_base_class_doesnt_use_type_condition
old_class = LooseDescendant
Object.send :remove_const, :LooseDescendant
- descendant = old_class.create!
+ descendant = old_class.create! :first_name => 'bob'
assert_not_nil LoosePerson.find(descendant.id), "Should have found instance of LooseDescendant when finding abstract LoosePerson: #{descendant.inspect}"
ensure
unless Object.const_defined?(:LooseDescendant)
View
33 activerecord/test/schema/db2.drop.sql
@@ -1,33 +0,0 @@
-DROP TABLE accounts;
-DROP TABLE funny_jokes;
-DROP TABLE companies;
-DROP TABLE topics;
-DROP TABLE developers;
-DROP TABLE projects;
-DROP TABLE developers_projects;
-DROP TABLE orders;
-DROP TABLE customers;
-DROP TABLE movies;
-DROP TABLE subscribers;
-DROP TABLE booleantests;
-DROP TABLE auto_id_tests;
-DROP TABLE entrants;
-DROP TABLE colnametests;
-DROP TABLE mixins;
-DROP TABLE people;
-DROP TABLE readers;
-DROP TABLE binaries;
-DROP TABLE computers;
-DROP TABLE posts;
-DROP TABLE comments;
-DROP TABLE authors;
-DROP TABLE tasks;
-DROP TABLE categories;
-DROP TABLE categories_posts;
-DROP TABLE fk_test_has_pk;
-DROP TABLE fk_test_has_fk;
-DROP TABLE keyboards;
-DROP TABLE legacy_things;
-DROP TABLE numeric_data;
-DROP TABLE mixed_case_monkeys;
-DROP TABLE minimalistics;
View
235 activerecord/test/schema/db2.sql
@@ -1,235 +0,0 @@
-CREATE TABLE accounts (
- id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
- firm_id INT DEFAULT NULL,
- credit_limit INT DEFAULT NULL,
- PRIMARY KEY (id)
-);
-
-CREATE TABLE funny_jokes (
- id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
- name VARCHAR(50) DEFAULT NULL,
- PRIMARY KEY (id)
-);
-
-CREATE TABLE companies (
- id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
- type VARCHAR(50) DEFAULT NULL,
- ruby_type VARCHAR(50) DEFAULT NULL,
- firm_id INT DEFAULT NULL,
- name VARCHAR(50) DEFAULT NULL,
- client_of INT DEFAULT NULL,
- rating INT DEFAULT 1,
- PRIMARY KEY (id)
-);
-
-CREATE TABLE topics (
- id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
- title VARCHAR(255) DEFAULT NULL,
- author_name VARCHAR(255) DEFAULT NULL,
- author_email_address VARCHAR(255) DEFAULT NULL,
- written_on TIMESTAMP DEFAULT NULL,
- bonus_time TIME DEFAULT NULL,
- last_read DATE DEFAULT NULL,
- content VARCHAR(3000),
- approved SMALLINT DEFAULT 1,
- replies_count INT DEFAULT 0,
- parent_id INT DEFAULT NULL,
- type VARCHAR(50) DEFAULT NULL,
- PRIMARY KEY (id)
-);
-
-CREATE TABLE developers (
- id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
- name VARCHAR(100) DEFAULT NULL,
- salary INT DEFAULT 70000,
- created_at TIMESTAMP DEFAULT NULL,
- updated_at TIMESTAMP DEFAULT NULL,
- PRIMARY KEY (id)
-);
-
-CREATE TABLE projects (
- id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
- name VARCHAR(100) DEFAULT NULL,
- type VARCHAR(255) DEFAULT NULL,
- PRIMARY KEY (id)
-);
-
-CREATE TABLE developers_projects (
- developer_id INT NOT NULL,
- project_id INT NOT NULL,
- joined_on DATE DEFAULT NULL,
- access_level SMALLINT DEFAULT 1
-);
-
-CREATE TABLE orders (
- id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
- name VARCHAR(100) DEFAULT NULL,
- billing_customer_id INT DEFAULT NULL,
- shipping_customer_id INT DEFAULT NULL,
- PRIMARY KEY (id)
-);
-
-CREATE TABLE customers (
- id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
- name VARCHAR(100) DEFAULT NULL,
- balance INT DEFAULT 0,
- address_street VARCHAR(100) DEFAULT NULL,
- address_city VARCHAR(100) DEFAULT NULL,
- address_country VARCHAR(100) DEFAULT NULL,
- gps_location VARCHAR(100) DEFAULT NULL,
- PRIMARY KEY (id)
-);
-
-CREATE TABLE movies (
- movieid INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
- name VARCHAR(100) DEFAULT NULL,
- PRIMARY KEY (movieid)
-);
-
-CREATE TABLE subscribers (
- nick VARCHAR(100) NOT NULL,
- name VARCHAR(100) DEFAULT NULL,
- PRIMARY KEY (nick)
-);
-
-CREATE TABLE booleantests (
- id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
- value INT DEFAULT NULL,
- PRIMARY KEY (id)
-);
-
-CREATE TABLE auto_id_tests (
- auto_id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
- value INT DEFAULT NULL,
- PRIMARY KEY (auto_id)
-);
-
-CREATE TABLE entrants (
- id INT NOT NULL PRIMARY KEY,
- name VARCHAR(255) NOT NULL,
- course_id INT NOT NULL
-);
-
-CREATE TABLE colnametests (
- id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
- references INT NOT NULL,
- PRIMARY KEY (id)
-);
-
-CREATE TABLE mixins (
- id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
- parent_id INT DEFAULT NULL,
- pos INT DEFAULT NULL,
- created_at TIMESTAMP DEFAULT NULL,
- updated_at TIMESTAMP DEFAULT NULL,
- lft INT DEFAULT NULL,
- rgt INT DEFAULT NULL,
- root_id INT DEFAULT NULL,
- type VARCHAR(40) DEFAULT NULL,
- PRIMARY KEY (id)
-);
-
-CREATE TABLE people (
- id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
- first_name VARCHAR(40) NOT NULL,
- lock_version INT DEFAULT 0,
- PRIMARY KEY (id)
-);
-
-CREATE TABLE readers (
- id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
- post_id INT NOT NULL,
- person_id INT NOT NULL,
- PRIMARY KEY (id)
-);
-
-CREATE TABLE binaries (
- id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
- data BLOB(50000),
- PRIMARY KEY (id)
-);
-
-CREATE TABLE computers (
- id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
- developer INT NOT NULL,
- extendedWarranty INT NOT NULL
-);
-
-CREATE TABLE posts (
- id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
- author_id INT DEFAULT NULL,
- title VARCHAR(255) DEFAULT NULL,
- type VARCHAR(255) DEFAULT NULL,
- body VARCHAR(3000) DEFAULT NULL
-);
-
-CREATE TABLE comments (
- id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
- post_id INT DEFAULT NULL,
- type VARCHAR(255) DEFAULT NULL,
- body VARCHAR(3000) DEFAULT NULL
-);
-
-CREATE TABLE authors (
- id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
- name VARCHAR(255) DEFAULT NULL
-);
-
-CREATE TABLE tasks (
- id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
- starting TIMESTAMP DEFAULT NULL,
- ending TIMESTAMP DEFAULT NULL
-);
-
-CREATE TABLE categories (
- id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
- name VARCHAR(255) NOT NULL,
- type VARCHAR(40) DEFAULT NULL
-);
-
-CREATE TABLE categories_posts (
- category_id INT NOT NULL,
- post_id INT NOT NULL
-);
-
-CREATE TABLE keyboards (
- key_number INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
- name VARCHAR(255)
-);
-
-CREATE TABLE fk_test_has_pk (
- id INT NOT NULL PRIMARY KEY
-);
-
-CREATE TABLE fk_test_has_fk (
- id INT NOT NULL PRIMARY KEY,
- fk_id INT NOT NULL,
-
- FOREIGN KEY (fk_id) REFERENCES fk_test_has_pk(id)
-);
-
---This table has an altered lock_version column name
-CREATE TABLE legacy_things (
- id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
- tps_report_number INT DEFAULT NULL,
- version INT DEFAULT 0,
- PRIMARY KEY (id)
-);
-
-CREATE TABLE numeric_data (
- id INT NOT NULL PRIMARY KEY,
- bank_balance DECIMAL(10,2),
- big_bank_balance DECIMAL(15,2),
- world_population DECIMAL(10),
- my_house_population DECIMAL(2),
- decimal_number_with_default DECIMAL(3,2) DEFAULT 2.78
-);
-
-CREATE TABLE mixed_case_monkeys (
- monkeyID INT NOT NULL PRIMARY KEY,
- fleaCount INT
-);
-
-CREATE TABLE minimalistics (
- id INT NOT NULL PRIMARY KEY
-);
View
1  activerecord/test/schema/db22.drop.sql
@@ -1 +0,0 @@
-DROP TABLE courses;
View
4 activerecord/test/schema/db22.sql
@@ -1,4 +0,0 @@
-CREATE TABLE courses (
- id INT NOT NULL PRIMARY KEY,
- name VARCHAR(255) NOT NULL
-);
View
65 activerecord/test/schema/firebird.drop.sql
@@ -1,65 +0,0 @@
-DROP TABLE accounts;
-DROP TABLE funny_jokes;
-DROP TABLE companies;
-DROP TABLE topics;
-DROP TABLE developers;
-DROP TABLE projects;
-DROP TABLE developers_projects;
-DROP TABLE orders;
-DROP TABLE customers;
-DROP TABLE movies;
-DROP TABLE subscribers;
-DROP TABLE booleantests;
-DROP TABLE auto_id_tests;
-DROP TABLE entrants;
-DROP TABLE colnametests;
-DROP TABLE mixins;
-DROP TABLE people;
-DROP TABLE readers;
-DROP TABLE binaries;
-DROP TABLE computers;
-DROP TABLE posts;
-DROP TABLE comments;
-DROP TABLE authors;
-DROP TABLE tasks;
-DROP TABLE categories;
-DROP TABLE categories_posts;
-DROP TABLE fk_test_has_fk;
-DROP TABLE fk_test_has_pk;
-DROP TABLE keyboards;
-DROP TABLE defaults;
-DROP TABLE legacy_things;
-DROP TABLE numeric_data;
-DROP TABLE mixed_case_monkeys;
-DROP TABLE minimalistics;
-
-DROP DOMAIN D_BOOLEAN;
-
-DROP GENERATOR accounts_seq;
-DROP GENERATOR funny_jokes_seq;
-DROP GENERATOR companies_nonstd_seq;
-DROP GENERATOR topics_seq;
-DROP GENERATOR developers_seq;
-DROP GENERATOR projects_seq;
-DROP GENERATOR orders_seq;
-DROP GENERATOR customers_seq;
-DROP GENERATOR movies_seq;
-DROP GENERATOR booleantests_seq;
-DROP GENERATOR auto_id_tests_seq;
-DROP GENERATOR entrants_seq;
-DROP GENERATOR colnametests_seq;
-DROP GENERATOR mixins_seq;
-DROP GENERATOR people_seq;
-DROP GENERATOR binaries_seq;
-DROP GENERATOR computers_seq;
-DROP GENERATOR posts_seq;
-DROP GENERATOR comments_seq;
-DROP GENERATOR authors_seq;
-DROP GENERATOR tasks_seq;
-DROP GENERATOR categories_seq;
-DROP GENERATOR keyboards_seq;
-DROP GENERATOR defaults_seq;
-DROP GENERATOR legacy_things_seq;
-DROP GENERATOR numeric_data_seq;
-DROP GENERATOR mixed_case_monkeys_seq;
-DROP GENERATOR minimalistics_seq;
View
310 activerecord/test/schema/firebird.sql
@@ -1,310 +0,0 @@
-CREATE DOMAIN D_BOOLEAN AS SMALLINT CHECK (VALUE IN (0, 1) OR VALUE IS NULL);
-
-CREATE TABLE accounts (
- id BIGINT NOT NULL,
- firm_id BIGINT,
- credit_limit INTEGER,
- PRIMARY KEY (id)
-);
-CREATE GENERATOR accounts_seq;
-SET GENERATOR accounts_seq TO 10000;
-
-CREATE TABLE funny_jokes (
- id BIGINT NOT NULL,
- name VARCHAR(50),
- PRIMARY KEY (id)
-);
-CREATE GENERATOR funny_jokes_seq;
-SET GENERATOR funny_jokes_seq TO 10000;
-
-CREATE TABLE companies (
- id BIGINT NOT NULL,
- "TYPE" VARCHAR(50),
- ruby_type VARCHAR(50),
- firm_id BIGINT,
- name VARCHAR(50),
- client_of INTEGER,
- rating INTEGER DEFAULT 1,
- PRIMARY KEY (id)
-);
-CREATE GENERATOR companies_nonstd_seq;
-SET GENERATOR companies_nonstd_seq TO 10000;
-
-CREATE TABLE topics (
- id BIGINT NOT NULL,
- title VARCHAR(255),
- author_name VARCHAR(255),
- author_email_address VARCHAR(255),
- written_on TIMESTAMP,
- bonus_time TIME,
- last_read DATE,
- content VARCHAR(4000),
- approved D_BOOLEAN DEFAULT 1,
- replies_count INTEGER DEFAULT 0,
- parent_id BIGINT,
- "TYPE" VARCHAR(50),
- PRIMARY KEY (id)
-);
-CREATE GENERATOR topics_seq;
-SET GENERATOR topics_seq TO 10000;
-
-CREATE TABLE developers (
- id BIGINT NOT NULL,
- name VARCHAR(100),
- salary INTEGER DEFAULT 70000,
- created_at TIMESTAMP,
- updated_at TIMESTAMP,
- PRIMARY KEY (id)
-);
-CREATE GENERATOR developers_seq;
-SET GENERATOR developers_seq TO 10000;
-
-CREATE TABLE projects (
- id BIGINT NOT NULL,
- name VARCHAR(100),
- "TYPE" VARCHAR(255),
- PRIMARY KEY (id)
-);
-CREATE GENERATOR projects_seq;
-SET GENERATOR projects_seq TO 10000;
-
-CREATE TABLE developers_projects (
- developer_id BIGINT NOT NULL,
- project_id BIGINT NOT NULL,
- joined_on DATE,
- access_level SMALLINT DEFAULT 1
-);
-
-CREATE TABLE orders (
- id BIGINT NOT NULL,
- name VARCHAR(100),
- billing_customer_id BIGINT,
- shipping_customer_id BIGINT,
- PRIMARY KEY (id)
-);
-CREATE GENERATOR orders_seq;
-SET GENERATOR orders_seq TO 10000;
-
-CREATE TABLE customers (
- id BIGINT NOT NULL,
- name VARCHAR(100),
- balance INTEGER DEFAULT 0,
- address_street VARCHAR(100),
- address_city VARCHAR(100),
- address_country VARCHAR(100),
- gps_location VARCHAR(100),
- PRIMARY KEY (id)
-);
-CREATE GENERATOR customers_seq;
-SET GENERATOR customers_seq TO 10000;
-
-CREATE TABLE movies (
- movieid BIGINT NOT NULL,
- name varchar(100),
- PRIMARY KEY (movieid)
-);
-CREATE GENERATOR movies_seq;
-SET GENERATOR movies_seq TO 10000;
-
-CREATE TABLE subscribers (
- nick VARCHAR(100) NOT NULL,
- name VARCHAR(100),
- PRIMARY KEY (nick)
-);
-
-CREATE TABLE booleantests (
- id BIGINT NOT NULL,
- "VALUE" D_BOOLEAN,
- PRIMARY KEY (id)
-);
-CREATE GENERATOR booleantests_seq;
-SET GENERATOR booleantests_seq TO 10000;
-
-CREATE TABLE auto_id_tests (
- auto_id BIGINT NOT NULL,
- "VALUE" INTEGER,
- PRIMARY KEY (auto_id)
-);
-CREATE GENERATOR auto_id_tests_seq;
-SET GENERATOR auto_id_tests_seq TO 10000;
-
-CREATE TABLE entrants (
- id BIGINT NOT NULL,
- name VARCHAR(255) NOT NULL,
- course_id INTEGER NOT NULL,
- PRIMARY KEY (id)
-);
-CREATE GENERATOR entrants_seq;
-SET GENERATOR entrants_seq TO 10000;
-
-CREATE TABLE colnametests (
- id BIGINT NOT NULL,
- "REFERENCES" INTEGER NOT NULL,
- PRIMARY KEY (id)
-);
-CREATE GENERATOR colnametests_seq;
-SET GENERATOR colnametests_seq TO 10000;
-
-CREATE TABLE mixins (
- id BIGINT NOT NULL,
- parent_id BIGINT,
- pos INTEGER,
- created_at TIMESTAMP,
- updated_at TIMESTAMP,
- lft INTEGER,
- rgt INTEGER,
- root_id BIGINT,
- "TYPE" VARCHAR(40),
- PRIMARY KEY (id)
-);
-CREATE GENERATOR mixins_seq;
-SET GENERATOR mixins_seq TO 10000;
-
-CREATE TABLE people (
- id BIGINT NOT NULL,
- first_name VARCHAR(40),
- lock_version INTEGER DEFAULT 0 NOT NULL,
- PRIMARY KEY (id)
-);
-CREATE GENERATOR people_seq;
-SET GENERATOR people_seq TO 10000;
-
-CREATE TABLE readers (
- id BIGINT NOT NULL,
- post_id BIGINT NOT NULL,
- person_id BIGINT NOT NULL,
- PRIMARY KEY (id)
-);
-CREATE GENERATOR readers_seq;
-SET GENERATOR readers_seq TO 10000;
-
-CREATE TABLE binaries (
- id BIGINT NOT NULL,
- data BLOB,
- PRIMARY KEY (id)
-);
-CREATE GENERATOR binaries_seq;
-SET GENERATOR binaries_seq TO 10000;
-
-CREATE TABLE computers (
- id BIGINT NOT NULL,
- developer INTEGER NOT NULL,
- "extendedWarranty" INTEGER NOT NULL,
- PRIMARY KEY (id)
-);
-CREATE GENERATOR computers_seq;
-SET GENERATOR computers_seq TO 10000;
-
-CREATE TABLE posts (
- id BIGINT NOT NULL,
- author_id BIGINT,
- title VARCHAR(255) NOT NULL,
- "TYPE" VARCHAR(255) NOT NULL,
- body VARCHAR(3000) NOT NULL,
- PRIMARY KEY (id)
-);
-CREATE GENERATOR posts_seq;
-SET GENERATOR posts_seq TO 10000;
-
-CREATE TABLE comments (
- id BIGINT NOT NULL,
- post_id BIGINT NOT NULL,
- "TYPE" VARCHAR(255) NOT NULL,
- body VARCHAR(3000) NOT NULL,
- PRIMARY KEY (id)
-);
-CREATE GENERATOR comments_seq;
-SET GENERATOR comments_seq TO 10000;
-
-CREATE TABLE authors (
- id BIGINT NOT NULL,
- name VARCHAR(255) NOT NULL,
- PRIMARY KEY (id)
-);
-CREATE GENERATOR authors_seq;
-SET GENERATOR authors_seq TO 10000;
-
-CREATE TABLE tasks (
- id BIGINT NOT NULL,
- "STARTING" TIMESTAMP,
- ending TIMESTAMP,
- PRIMARY KEY (id)
-);
-CREATE GENERATOR tasks_seq;
-SET GENERATOR tasks_seq TO 10000;
-
-CREATE TABLE categories (
- id BIGINT NOT NULL,
- name VARCHAR(255) NOT NULL,
- "TYPE" VARCHAR(255) NOT NULL,
- PRIMARY KEY (id)
-);
-CREATE GENERATOR categories_seq;
-SET GENERATOR categories_seq TO 10000;
-
-CREATE TABLE categories_posts (
- category_id BIGINT NOT NULL,
- post_id BIGINT NOT NULL,
- PRIMARY KEY (category_id, post_id)
-);
-
-CREATE TABLE fk_test_has_pk (
- id BIGINT NOT NULL,
- PRIMARY KEY (id)
-);
-
-CREATE TABLE fk_test_has_fk (
- id BIGINT NOT NULL,
- fk_id BIGINT NOT NULL,
- PRIMARY KEY (id),
- FOREIGN KEY (fk_id) REFERENCES fk_test_has_pk(id)
-);
-
-CREATE TABLE keyboards (
- key_number BIGINT NOT NULL,
- name VARCHAR(50),
- PRIMARY KEY (key_number)
-);
-CREATE GENERATOR keyboards_seq;
-SET GENERATOR keyboards_seq TO 10000;
-
-CREATE TABLE defaults (
- id BIGINT NOT NULL,
- default_timestamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP
-);
-CREATE GENERATOR defaults_seq;
-SET GENERATOR defaults_seq TO 10000;
-
-CREATE TABLE legacy_things (
- id BIGINT NOT NULL,
- tps_report_number INTEGER,
- version INTEGER DEFAULT 0 NOT NULL,
- PRIMARY KEY (id)
-);
-CREATE GENERATOR legacy_things_seq;
-SET GENERATOR legacy_things_seq TO 10000;
-
-CREATE TABLE numeric_data (
- id BIGINT NOT NULL,
- bank_balance DECIMAL(10,2),
- big_bank_balance DECIMAL(15,2),
- world_population DECIMAL(10),
- my_house_population DECIMAL(2),
- decimal_number_with_default DECIMAL(3,2) DEFAULT 2.78,
- PRIMARY KEY (id)
-);
-CREATE GENERATOR numeric_data_seq;
-SET GENERATOR numeric_data_seq TO 10000;
-
-CREATE TABLE mixed_case_monkeys (
- "monkeyID" BIGINT NOT NULL,
- "fleaCount" INTEGER
-);
-CREATE GENERATOR mixed_case_monkeys_seq;
-SET GENERATOR mixed_case_monkeys_seq TO 10000;
-
-CREATE TABLE minimalistics (
- id BIGINT NOT NULL
-);
-CREATE GENERATOR minimalistics_seq;
-SET GENERATOR minimalistics_seq TO 10000;
View
2  activerecord/test/schema/firebird2.drop.sql
@@ -1,2 +0,0 @@
-DROP TABLE courses;
-DROP GENERATOR courses_seq;
View
6 activerecord/test/schema/firebird2.sql
@@ -1,6 +0,0 @@
-CREATE TABLE courses (
- id BIGINT NOT NULL PRIMARY KEY,
- name VARCHAR(255) NOT NULL
-);
-CREATE GENERATOR courses_seq;
-SET GENERATOR courses_seq TO 10000;
View
33 activerecord/test/schema/frontbase.drop.sql
@@ -1,33 +0,0 @@
-DROP TABLE accounts CASCADE;
-DROP TABLE funny_jokes CASCADE;
-DROP TABLE companies CASCADE;
-DROP TABLE topics CASCADE;
-DROP TABLE developers CASCADE;
-DROP TABLE projects CASCADE;
-DROP TABLE developers_projects CASCADE;
-DROP TABLE orders CASCADE;
-DROP TABLE customers CASCADE;
-DROP TABLE movies CASCADE;
-DROP TABLE subscribers CASCADE;
-DROP TABLE booleantests CASCADE;
-DROP TABLE auto_id_tests CASCADE;
-DROP TABLE entrants CASCADE;
-DROP TABLE colnametests CASCADE;
-DROP TABLE mixins CASCADE;
-DROP TABLE people CASCADE;
-DROP TABLE readers CASCADE;
-DROP TABLE binaries CASCADE;
-DROP TABLE computers CASCADE;
-DROP TABLE posts CASCADE;
-DROP TABLE comments CASCADE;
-DROP TABLE authors CASCADE;
-DROP TABLE tasks CASCADE;
-DROP TABLE categories CASCADE;
-DROP TABLE categories_posts CASCADE;
-DROP TABLE fk_test_has_fk CASCADE;
-DROP TABLE fk_test_has_pk CASCADE;
-DROP TABLE keyboards CASCADE;
-DROP TABLE legacy_things CASCADE;
-DROP TABLE numeric_data CASCADE;
-DROP TABLE mixed_case_monkeys CASCADE;
-DROP TABLE minimalistics CASCADE;
View
273 activerecord/test/schema/frontbase.sql
@@ -1,273 +0,0 @@
-CREATE TABLE accounts (
- id integer DEFAULT unique,
- firm_id integer,
- credit_limit integer,
- PRIMARY KEY (id)
-);
-SET UNIQUE FOR accounts(id);
-
-CREATE TABLE funny_jokes (
- id integer DEFAULT unique,
- firm_id integer default NULL,
- name character varying(50),
- PRIMARY KEY (id)
-);
-SET UNIQUE FOR funny_jokes(id);
-
-CREATE TABLE companies (
- id integer DEFAULT unique,
- "type" character varying(50),
- "ruby_type" character varying(50),
- firm_id integer,
- name character varying(50),
- client_of integer,
- rating integer default 1,
- PRIMARY KEY (id)
-);
-SET UNIQUE FOR companies(id);
-
-CREATE TABLE topics (
- id integer DEFAULT unique,
- title character varying(255),
- author_name character varying(255),
- author_email_address character varying(255),
- written_on timestamp,
- bonus_time time,
- last_read date,
- content varchar(65536),
- approved boolean default true,
- replies_count integer default 0,
- parent_id integer,
- "type" character varying(50),
- PRIMARY KEY (id)
-);
-SET UNIQUE FOR topics(id);
-
-CREATE TABLE developers (
- id integer DEFAULT unique,
- name character varying(100),
- salary integer DEFAULT 70000,
- created_at timestamp,
- updated_at timestamp,
- PRIMARY KEY (id)
-);
-SET UNIQUE FOR developers(id);
-
-CREATE TABLE projects (
- id integer DEFAULT unique,
- name character varying(100),
- type varchar(255),
- PRIMARY KEY (id)
-);
-SET UNIQUE FOR projects(id);
-
-CREATE TABLE developers_projects (
- developer_id integer NOT NULL,
- project_id integer NOT NULL,
- joined_on date,
- access_level integer default 1
-);
-
-CREATE TABLE orders (
- id integer DEFAULT unique,
- name character varying(100),
- billing_customer_id integer,
- shipping_customer_id integer,
- PRIMARY KEY (id)
-);
-SET UNIQUE FOR orders(id);
-
-CREATE TABLE customers (
- id integer DEFAULT unique,
- name character varying(100),
- balance integer default 0,
- address_street character varying(100),
- address_city character varying(100),
- address_country character varying(100),
- gps_location character varying(100),
- PRIMARY KEY (id)
-);
-SET UNIQUE FOR customers(id);
-
-CREATE TABLE movies (
- movieid integer DEFAULT unique,
- name varchar(65536),
- PRIMARY KEY (movieid)
-);
-SET UNIQUE FOR movies(movieid);
-
-CREATE TABLE subscribers (
- nick varchar(65536) NOT NULL,
- name varchar(65536),
- PRIMARY KEY (nick)
-);
-
-CREATE TABLE booleantests (
- id integer DEFAULT unique,
- value boolean,
- PRIMARY KEY (id)
-);
-SET UNIQUE FOR booleantests(id);
-
-CREATE TABLE auto_id_tests (
- auto_id integer DEFAULT unique,
- value integer,
- PRIMARY KEY (auto_id)
-);
-SET UNIQUE FOR auto_id_tests(auto_id);
-
-CREATE TABLE entrants (
- id integer DEFAULT unique,
- name varchar(65536),
- course_id integer,
- PRIMARY KEY (id)
-);
-SET UNIQUE FOR entrants(id);
-
-CREATE TABLE colnametests (
- id integer DEFAULT unique,
- "references" integer NOT NULL,
- PRIMARY KEY (id)
-);
-SET UNIQUE FOR colnametests(id);
-
-CREATE TABLE mixins (
- id integer DEFAULT unique,
- parent_id integer,
- type character varying(100),
- pos integer,
- lft integer,
- rgt integer,
- root_id integer,
- created_at timestamp,
- updated_at timestamp,
- PRIMARY KEY (id)
-);
-SET UNIQUE FOR mixins(id);
-
-CREATE TABLE people (
- id integer DEFAULT unique,
- first_name varchar(65536),
- lock_version integer default 0,
- PRIMARY KEY (id)
-);
-SET UNIQUE FOR people(id);
-
-CREATE TABLE readers (
- id integer DEFAULT unique,
- post_id INTEGER NOT NULL,
- person_id INTEGER NOT NULL,
- PRIMARY KEY (id)
-);
-SET UNIQUE FOR readers(id);
-
-CREATE TABLE binaries (
- id integer DEFAULT unique,
- data BLOB,
- PRIMARY KEY (id)
-);
-SET UNIQUE FOR binaries(id);
-
-CREATE TABLE computers (
- id integer DEFAULT unique,
- developer integer NOT NULL,
- "extendedWarranty" integer NOT NULL,
- PRIMARY KEY (id)
-);
-SET UNIQUE FOR computers(id);
-
-CREATE TABLE posts (
- id integer DEFAULT unique,
- author_id integer,
- title varchar(255),
- type varchar(255),
- body varchar(65536),
- PRIMARY KEY (id)
-);
-SET UNIQUE FOR posts(id);
-
-CREATE TABLE comments (
- id integer DEFAULT unique,
- post_id integer,
- type varchar(255),
- body varchar(65536),
- PRIMARY KEY (id)
-);
-SET UNIQUE FOR comments(id);
-
-CREATE TABLE authors (
- id integer DEFAULT unique,
- name varchar(255) default NULL,
- PRIMARY KEY (id)
-);
-SET UNIQUE FOR authors(id);
-
-CREATE TABLE tasks (
- id integer DEFAULT unique,
- starting timestamp,
- ending timestamp,
- PRIMARY KEY (id)
-);
-SET UNIQUE FOR tasks(id);
-
-CREATE TABLE categories (
- id integer DEFAULT unique,
- name varchar(255),
- type varchar(255),
- PRIMARY KEY (id)
-);
-SET UNIQUE FOR categories(id);
-
-CREATE TABLE categories_posts (
- category_id integer NOT NULL,
- post_id integer NOT NULL
-);
-
-CREATE TABLE fk_test_has_pk (
- id INTEGER NOT NULL PRIMARY KEY
-);
-SET UNIQUE FOR fk_test_has_pk(id);
-
-CREATE TABLE fk_test_has_fk (
- id INTEGER NOT NULL PRIMARY KEY,
- fk_id INTEGER NOT NULL REFERENCES fk_test_has_fk(id)
-);
-SET UNIQUE FOR fk_test_has_fk(id);
-
-CREATE TABLE keyboards (
- key_number integer DEFAULT unique,
- "name" character varying(50),
- PRIMARY KEY (key_number)
-);
-SET UNIQUE FOR keyboards(key_number);
-
-create table "legacy_things"
-(
- "id" int,
- "tps_report_number" int default NULL,
- "version" int default 0 not null,
- primary key ("id")
-);
-SET UNIQUE FOR legacy_things(id);
-
-CREATE TABLE "numeric_data" (
- "id" integer NOT NULL
- "bank_balance" DECIMAL(10,2),
- "big_bank_balance" DECIMAL(15,2),
- "world_population" DECIMAL(10),
- "my_house_population" DECIMAL(2),
- "decimal_number_with_default" DECIMAL(3,2) DEFAULT 2.78,
- primary key ("id")
-);
-SET UNIQUE FOR numeric_data(id);
-
-CREATE TABLE mixed_case_monkeys (
- "monkeyID" integer DEFAULT unique,
- "fleaCount" integer
-);
-SET UNIQUE FOR mixed_case_monkeys("monkeyID");
-
-CREATE TABLE minimalistics (
- "id" integer NOT NULL
-);
-SET UNIQUE FOR minimalistics("id");
View
1  activerecord/test/schema/frontbase2.drop.sql
@@ -1 +0,0 @@
-DROP TABLE courses CASCADE;
View
4 activerecord/test/schema/frontbase2.sql
@@ -1,4 +0,0 @@
-CREATE TABLE courses (
- id integer DEFAULT unique,
- name varchar(100)
-);
View
12 activerecord/test/schema/mysql_specific_schema.rb
@@ -0,0 +1,12 @@
+ActiveRecord::Schema.define do
+ create_table :binary_fields, :force => true do |t|
+ t.binary :tiny_blob, :limit => 255
+ t.binary :normal_blob, :limit => 65535
+ t.binary :medium_blob, :limit => 16777215
+ t.binary :long_blob, :limit => 2147483647
+ t.text :tiny_text, :limit => 255
+ t.text :normal_text, :limit => 65535
+ t.text :medium_text, :limit => 16777215
+ t.text :long_text, :limit => 2147483647
+ end
+end
View
2  activerecord/test/schema/openbase.drop.sql
@@ -1,2 +0,0 @@
-DROP ALL
-go
View
318 activerecord/test/schema/openbase.sql
@@ -1,318 +0,0 @@
-CREATE TABLE accounts (
- id integer NOT NULL UNIQUE INDEX DEFAULT _rowid,
- firm_id integer,
- credit_limit integer
-)
-go
-CREATE PRIMARY KEY accounts (id)
-go
-
-CREATE TABLE funny_jokes (
- id integer NOT NULL UNIQUE INDEX DEFAULT _rowid,
- name char(50) DEFAULT NULL
-)
-go
-CREATE PRIMARY KEY funny_jokes (id)
-go
-
-CREATE TABLE companies (
- id integer NOT NULL UNIQUE INDEX DEFAULT _rowid,
- type char(50),
- ruby_type char(50),
- firm_id integer,
- name char(50),
- client_of integer,
- rating integer default 1
-)
-go
-CREATE PRIMARY KEY companies (id)
-go
-
-CREATE TABLE developers_projects (
- developer_id integer NOT NULL,
- project_id integer NOT NULL,
- joined_on date,
- access_level integer default 1
-)
-go
-
-CREATE TABLE developers (
- id integer NOT NULL UNIQUE INDEX DEFAULT _rowid,
- name char(100),
- salary integer DEFAULT 70000,
- created_at datetime,
- updated_at datetime
-)
-go
-CREATE PRIMARY KEY developers (id)
-go
-
-CREATE TABLE projects (
- id integer NOT NULL UNIQUE INDEX DEFAULT _rowid,
- name char(100),
- type char(255)
-)
-go
-CREATE PRIMARY KEY projects (id)
-go
-
-CREATE TABLE topics (
- id integer NOT NULL UNIQUE INDEX DEFAULT _rowid,
- title char(255),
- author_name char(255),
- author_email_address char(255),
- written_on datetime,
- bonus_time time,
- last_read date,
- content char(4096),
- approved boolean default true,
- replies_count integer default 0,
- parent_id integer,
- type char(50)
-)
-go
-CREATE PRIMARY KEY topics (id)
-go
-
-CREATE TABLE customers (
- id integer NOT NULL UNIQUE INDEX DEFAULT _rowid,
- name char,
- balance integer default 0,
- address_street char,
- address_city char,
- address_country char,
- gps_location char
-)
-go
-CREATE PRIMARY KEY customers (id)
-go
-
-CREATE TABLE orders (
- id integer NOT NULL UNIQUE INDEX DEFAULT _rowid,
- name char,
- billing_customer_id integer,
- shipping_customer_id integer
-)
-go
-CREATE PRIMARY KEY orders (id)
-go
-
-CREATE TABLE movies (
- movieid integer NOT NULL UNIQUE INDEX DEFAULT _rowid,
- name text
-)
-go
-CREATE PRIMARY KEY movies (movieid)
-go
-
-CREATE TABLE subscribers (
- nick CHAR(100) NOT NULL DEFAULT _rowid,
- name CHAR(100)
-)
-go
-CREATE PRIMARY KEY subscribers (nick)
-go
-
-CREATE TABLE booleantests (
- id integer NOT NULL UNIQUE INDEX DEFAULT _rowid,
- value boolean
-)
-go
-CREATE PRIMARY KEY booleantests (id)
-go
-
-CREATE TABLE defaults (
- id integer UNIQUE INDEX ,
- modified_date date default CURDATE(),
- modified_date_function date default NOW(),
- fixed_date date default '2004-01-01',
- modified_time timestamp default NOW(),
- modified_time_function timestamp default NOW(),
- fixed_time timestamp default '2004-01-01 00:00:00.000000-00',
- char1 char(1) default 'Y',
- char2 char(50) default 'a char field',
- char3 text default 'a text field',
- positive_integer integer default 1,
- negative_integer integer default -1,
- decimal_number money default 2.78
-)
-go
-CREATE PRIMARY KEY defaults (id)
-go
-
-CREATE TABLE auto_id_tests (
- auto_id integer NOT NULL UNIQUE INDEX DEFAULT _rowid,
- value integer
-)
-go
-CREATE PRIMARY KEY auto_id_tests (auto_id)
-go
-
-CREATE TABLE entrants (
- id integer NOT NULL UNIQUE INDEX,
- name text NOT NULL,
- course_id integer NOT NULL
-)
-go
-CREATE PRIMARY KEY entrants (id)
-go
-
-CREATE TABLE colnametests (
- id integer UNIQUE INDEX ,
- references integer NOT NULL
-)
-go
-CREATE PRIMARY KEY colnametests (id)
-go
-
-CREATE TABLE mixins (
- id integer NOT NULL UNIQUE INDEX DEFAULT _rowid,
- parent_id integer,
- type char,
- pos integer,
- lft integer,
- rgt integer,
- root_id integer,
- created_at timestamp,
- updated_at timestamp
-)
-go
-CREATE PRIMARY KEY mixins (id)
-go
-
-CREATE TABLE people (
- id integer NOT NULL UNIQUE INDEX DEFAULT _rowid,
- first_name text,
- lock_version integer default 0
-)
-go
-CREATE PRIMARY KEY people (id)
-go
-
-CREATE TABLE readers (
- id integer NOT NULL UNIQUE INDEX DEFAULT _rowid,
- post_id integer NOT NULL,
- person_id integer NOT NULL
-)
-go
-CREATE PRIMARY KEY readers (id)
-go
-
-CREATE TABLE binaries (
- id integer NOT NULL UNIQUE INDEX DEFAULT _rowid,
- data object
-)
-go
-CREATE PRIMARY KEY binaries (id)
-go
-
-CREATE TABLE computers (
- id integer UNIQUE INDEX ,
- developer integer NOT NULL,
- extendedWarranty integer NOT NULL
-)
-go
-
-CREATE TABLE posts (
- id integer UNIQUE INDEX ,
- author_id integer,
- title char(255),
- type char(255),
- body text
-)
-go
-
-CREATE TABLE comments (
- id integer UNIQUE INDEX ,
- post_id integer,
- type char(255),
- body text
-)
-go
-
-CREATE TABLE authors (
- id integer UNIQUE INDEX ,
- name char(255) default NULL
-)
-go
-
-CREATE TABLE tasks (
- id integer NOT NULL UNIQUE INDEX DEFAULT _rowid,
- starting datetime,
- ending datetime
-)
-go
-CREATE PRIMARY KEY tasks (id)
-go
-
-CREATE TABLE categories (
- id integer UNIQUE INDEX ,
- name char(255),
- type char(255)
-)
-go
-
-CREATE TABLE categories_posts (
- category_id integer NOT NULL,
- post_id integer NOT NULL
-)
-go
-
-CREATE TABLE fk_test_has_pk (
- id INTEGER NOT NULL DEFAULT _rowid
-)
-go
-CREATE PRIMARY KEY fk_test_has_pk (id)
-go
-
-CREATE TABLE fk_test_has_fk (
- id INTEGER NOT NULL DEFAULT _rowid,
- fk_id INTEGER NOT NULL REFERENCES fk_test_has_pk.id
-)
-go
-CREATE PRIMARY KEY fk_test_has_fk (id)
-go
-
-CREATE TABLE keyboards (
- key_number integer UNIQUE INDEX DEFAULT _rowid,
- name char(50)
-)
-go
-CREATE PRIMARY KEY keyboards (key_number)
-go
-
-CREATE TABLE legacy_things (
- id INTEGER NOT NULL DEFAULT _rowid,
- tps_report_number INTEGER default NULL,
- version integer NOT NULL default 0
-)
-go
-CREATE PRIMARY KEY legacy_things (id)
-go
-
-CREATE TABLE numeric_data (
- id INTEGER NOT NULL DEFAULT _rowid,
- bank_balance MONEY,
- big_bank_balance MONEY,
- world_population longlong,
- my_house_population longlong,
- decimal_number_with_default MONEY DEFAULT 2.78
-);
-go
-CREATE PRIMARY KEY numeric_data (id)
-go
-
-CREATE TABLE mixed_case_monkeys (
- monkeyID INTEGER NOT NULL DEFAULT _rowid,
- fleaCount INTEGER
-);
-go
-CREATE PRIMARY KEY mixed_case_monkeys (monkeyID)
-go
-
-CREATE TABLE minimalistics (
- id INTEGER NOT NULL DEFAULT _rowid
-);
-go
-CREATE PRIMARY KEY minimalistics (id)
-go
View
2  activerecord/test/schema/openbase2.drop.sql
@@ -1,2 +0,0 @@
-DROP TABLE courses
-go
View
7 activerecord/test/schema/openbase2.sql
@@ -1,7 +0,0 @@
-CREATE TABLE courses (
- id integer UNIQUE INDEX DEFAULT _rowid,
- name text
-)
-go
-CREATE PRIMARY KEY courses (id)
-go
View
67 activerecord/test/schema/oracle.drop.sql
@@ -1,67 +0,0 @@
-drop table accounts;
-drop table funny_jokes;
-drop table companies;
-drop table topics;
-drop synonym subjects;
-drop table developers_projects;
-drop table computers;
-drop table developers;
-drop table projects;
-drop table customers;
-drop table orders;
-drop table movies;
-drop table subscribers;
-drop table booleantests;
-drop table auto_id_tests;
-drop table entrants;
-drop table colnametests;
-drop table mixins;
-drop table people;
-drop table readers;
-drop table binaries;
-drop table comments;
-drop table authors;
-drop table tasks;
-drop table categories_posts;
-drop table categories;
-drop table posts;
-drop table fk_test_has_pk;
-drop table fk_test_has_fk;
-drop table keyboards;
-drop table legacy_things;
-drop table numeric_data;
-drop table mixed_case_monkeys;
-drop table minimalistics;
-
-drop sequence accounts_seq;
-drop sequence funny_jokes_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 orders_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;
-drop sequence keyboards_seq;
-drop sequence legacy_things_seq;
-drop sequence numeric_data_seq;
-drop sequence mixed_case_monkeys_seq;
-drop sequence minimalistics_seq;
View
330 activerecord/test/schema/oracle.sql
@@ -1,330 +0,0 @@
-create table companies (
- id integer not null,
- type varchar(50) default null,
- ruby_type varchar(50) default null,
- firm_id integer default null references companies initially deferred disable,
- name varchar(50) default null,
- client_of integer default null references companies initially deferred disable,
- companies_count integer default 0,
- rating integer default 1,
- primary key (id)
-);
-
--- non-standard sequence name used to test set_sequence_name
---
-create sequence companies_nonstd_seq minvalue 10000;
-
-create table funny_jokes (
- id integer not null,
- name varchar(50) default null,
- primary key (id)
-);
-create sequence funny_jokes_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
-);
-create sequence accounts_seq minvalue 10000;
-
-create table topics (
- id integer not null,
- title varchar(255) default null,
- author_name varchar(255) default null,
- author_email_address varchar(255) default null,
- written_on timestamp default null,
- bonus_time timestamp default null,
- last_read timestamp default null,
- content varchar(4000),
- approved number(1) default 1,
- replies_count integer default 0,
- parent_id integer references topics initially deferred disable,
- type varchar(50) default null,
- primary key (id)
-);
--- try again for 8i
-create table topics (
- id integer not null,
- title varchar(255) default null,
- author_name varchar(255) default null,
- author_email_address varchar(255) default null,
- written_on date default null,
- bonus_time date default null,
- last_read date default null,
- content varchar(4000),
- approved number(1) default 1,
- replies_count integer default 0,
- parent_id integer references topics initially deferred disable,
- 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,
- name varchar(100) default null,
- salary integer default 70000,
- created_at timestamp default null,
- updated_at timestamp default null,
- primary key (id)
-);
-create sequence developers_seq minvalue 10000;
-
-create table projects (
- id integer not null,
- name varchar(100) default null,
- 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,
- project_id integer not null references projects initially deferred disable,
- joined_on timestamp default null,
- access_level integer default 1
-);
--- Try again for 8i
-create table developers_projects (
- developer_id integer not null references developers initially deferred disable,
- project_id integer not null references projects initially deferred disable,
- joined_on date default null
-);
-create sequence developers_projects_seq minvalue 10000;
-
-create table orders (
- id integer not null,
- name varchar(100) default null,
- billing_customer_id integer default null,
- shipping_customer_id integer default null,
- primary key (id)
-);
-create sequence orders_seq minvalue 10000;
-
-create table customers (
- id integer not null,
- name varchar(100) default null,
- balance integer default 0,
- address_street varchar(100) default null,
- address_city varchar(100) default null,
- address_country varchar(100) default null,
- 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 defaults (
- id integer not null,
- modified_date date default sysdate,
- modified_date_function date default sysdate,
- fixed_date date default to_date('2004-01-01', 'YYYY-MM-DD'),
- modified_time date default sysdate,
- modified_time_function date default sysdate,
- fixed_time date default TO_DATE('2004-01-01 00:00:00', 'YYYY-MM-DD HH24:MI:SS'),
- char1 varchar2(1) default 'Y',
- char2 varchar2(50) default 'a varchar field',
- char3 clob default 'a text field',
- positive_integer integer default 1,
- negative_integer integer default -1,
- decimal_number number(3,2) default 2.78
-);
-create sequence defaults_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,
- parent_id integer default null references mixins initially deferred disable,
- type varchar(40) default null,
- pos integer default null,
- lft integer default null,
- rgt integer default null,
- root_id integer default null,
- created_at timestamp default null,
- updated_at timestamp default null,
- primary key (id)
-);
--- try again for 8i
-create table mixins (
- id integer not null,
- parent_id integer default null references mixins initially deferred disable,
- type varchar(40) default null,
- pos integer default null,
- lft integer default null,
- rgt integer default null,
- root_id integer default null,
- created_at date default null,
- updated_at date default null,
- primary key (id)
-);
-create sequence mixins_seq minvalue 10000;
-
-create table people (
- id integer not null,
- first_name varchar(40) null,
- lock_version integer default 0,
- primary key (id)
-);
-create sequence people_seq minvalue 10000;
-
-create table readers (
- id integer not null,
- post_id integer not null,
- person_id integer not null,
- primary key (id)
-);
-create sequence readers_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
-);
-create sequence computers_seq minvalue 10000;
-
-create table posts (
- id integer not null primary key,
- author_id integer default null,
- title varchar(255) default null,
- 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,
- post_id integer default null,
- 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;
-
-create table keyboards (
- key_number integer not null,
- name varchar(50) default null
-);
-create sequence keyboards_seq minvalue 10000;
-
-create table test_oracle_defaults (
- id integer not null primary key,
- test_char char(1) default 'X' not null,
- test_string varchar2(20) default 'hello' not null,
- test_int integer default 3 not null
-);
-create sequence test_oracle_defaults_seq minvalue 10000;
-
---This table has an altered lock_version column name.
-create table legacy_things (
- id integer not null primary key,
- tps_report_number integer default null,
- version integer default 0
-);
-create sequence legacy_things_seq minvalue 10000;
-
-CREATE TABLE numeric_data (
- id integer NOT NULL PRIMARY KEY,
- bank_balance decimal(10,2),
- big_bank_balance decimal(15,2),
- world_population decimal(10),
- my_house_population decimal(2),
- decimal_number_with_default decimal(3,2) DEFAULT 2.78
-);
-create sequence numeric_data_seq minvalue 10000;
-
-CREATE TABLE mixed_case_monkeys (
- "monkeyID" INTEGER NOT NULL PRIMARY KEY,
- "fleaCount" INTEGER
-);
-create sequence mixed_case_monkeys_seq minvalue 10000;
-
-CREATE TABLE minimalistics (
- id INTEGER NOT NULL PRIMARY KEY
-);
-create sequence minimalistics_seq minvalue 10000;
View
2  activerecord/test/schema/oracle2.drop.sql
@@ -1,2 +0,0 @@
-drop table courses;
-drop sequence courses_seq;
View
6 activerecord/test/schema/oracle2.sql
@@ -1,6 +0,0 @@
-create table courses (
- id int not null primary key,
- name varchar(255) not null
-);
-
-create sequence courses_seq minvalue 10000;
View
44 activerecord/test/schema/postgresql.drop.sql
@@ -1,44 +0,0 @@
-DROP TABLE accounts;
-DROP SEQUENCE accounts_id_seq;
-DROP TABLE funny_jokes;
-DROP TABLE companies;
-DROP SEQUENCE companies_nonstd_seq;
-DROP TABLE topics;
-DROP TABLE developers;
-DROP TABLE projects;
-DROP TABLE developers_projects;
-DROP TABLE customers;
-DROP TABLE orders;
-DROP TABLE movies;
-DROP TABLE subscribers;
-DROP TABLE booleantests;
-DROP TABLE auto_id_tests;
-DROP TABLE entrants;
-DROP TABLE colnametests;
-DROP TABLE mixins;
-DROP TABLE people;
-DROP TABLE readers;
-DROP TABLE binaries;
-DROP TABLE computers;
-DROP TABLE posts;
-DROP TABLE comments;
-DROP TABLE authors;
-DROP TABLE tasks;
-DROP TABLE categories;
-DROP TABLE categories_posts;
-DROP TABLE defaults;
-DROP TABLE fk_test_has_fk;
-DROP TABLE fk_test_has_pk;
-DROP TABLE geometrics;
-DROP TABLE keyboards;
-DROP TABLE legacy_things;
-DROP TABLE numeric_data;
-DROP TABLE column_data;
-DROP TABLE mixed_case_monkeys;
-DROP TABLE postgresql_arrays;
-DROP TABLE postgresql_moneys;
-DROP TABLE postgresql_numbers;
-DROP TABLE postgresql_times;
-DROP TABLE postgresql_network_addresses;
-DROP TABLE postgresql_bit_strings;
-DROP TABLE postgresql_oids;
View
294 activerecord/test/schema/postgresql.sql
@@ -1,294 +0,0 @@
-CREATE SEQUENCE public.accounts_id_seq START 100;
-
-CREATE TABLE accounts (
- id integer primary key DEFAULT nextval('public.accounts_id_seq'),
- firm_id integer,
- credit_limit integer
-);
-
-CREATE TABLE funny_jokes (
- id serial,
- name character varying(50)
-);
-
-CREATE SEQUENCE companies_nonstd_seq START 101;
-
-CREATE TABLE companies (
- id integer primary key DEFAULT nextval('companies_nonstd_seq'),
- "type" character varying(50),
- "ruby_type" character varying(50),
- firm_id integer,
- name character varying(50),
- client_of integer,
- rating integer default 1
-);
-
-CREATE TABLE developers_projects (
- developer_id integer NOT NULL,
- project_id integer NOT NULL,
- joined_on date,
- access_level integer default 1
-);
-
-CREATE TABLE developers (
- id serial primary key,
- name character varying(100),
- salary integer DEFAULT 70000,
- created_at timestamp,
- updated_at timestamp
-);
-SELECT setval('developers_id_seq', 100);
-
-CREATE TABLE projects (
- id serial primary key,
- name character varying(100),
- type varchar(255)
-);
-SELECT setval('projects_id_seq', 100);
-
-CREATE TABLE topics (
- id serial primary key,
- title character varying(255),
- author_name character varying(255),
- author_email_address character varying(255),
- written_on timestamp without time zone,
- bonus_time time,
- last_read date,
- content text,
- approved boolean default true,
- replies_count integer default 0,
- parent_id integer,
- "type" character varying(50)
-);
-SELECT setval('topics_id_seq', 100);
-
-CREATE TABLE customers (
- id serial primary key,
- name character varying,
- balance integer default 0,
- address_street character varying,
- address_city character varying,
- address_country character varying,
- gps_location character varying
-);
-SELECT setval('customers_id_seq', 100);
-
-CREATE TABLE orders (
- id serial primary key,
- name character varying,
- billing_customer_id integer,
- shipping_customer_id integer
-);
-SELECT setval('orders_id_seq', 100);
-
-CREATE TABLE movies (
- movieid serial primary key,
- name text
-);
-
-CREATE TABLE subscribers (
- nick text primary key NOT NULL,
- name text
-);
-
-CREATE TABLE booleantests (
- id serial primary key,
- value boolean
-);
-
-CREATE TABLE defaults (
- id serial primary key,
- modified_date date default CURRENT_DATE,
- modified_date_function date default now(),
- fixed_date date default '2004-01-01',
- modified_time timestamp default CURRENT_TIMESTAMP,
- modified_time_function timestamp default now(),
- fixed_time timestamp default '2004-01-01 00:00:00.000000-00',
- char1 char(1) default 'Y',
- char2 character varying(50) default 'a varchar field',
- char3 text default 'a text field',
- positive_integer integer default 1,
- negative_integer integer default -1,
- decimal_number decimal(3,2) default 2.78,
- multiline_default text DEFAULT '--- []
-
-'::text
-);
-
-CREATE TABLE auto_id_tests (
- auto_id serial primary key,
- value integer
-);
-
-CREATE TABLE entrants (
- id serial primary key,
- name text not null,
- course_id integer not null
-);
-
-CREATE TABLE colnametests (
- id serial primary key,
- "references" integer NOT NULL
-);
-
-CREATE TABLE mixins (
- id serial primary key,
- parent_id integer,
- type character varying,
- pos integer,
- lft integer,
- rgt integer,
- root_id integer,
- created_at timestamp,
- updated_at timestamp
-);
-
-CREATE TABLE people (
- id serial primary key,
- first_name text,
- lock_version integer default 0
-);
-
-CREATE TABLE readers (
- id serial primary key,
- post_id integer NOT NULL,
- person_id integer NOT NULL
-);
-
-CREATE TABLE binaries (
- id serial primary key,
- data bytea
-);
-
-CREATE TABLE computers (
- id serial primary key,
- developer integer NOT NULL,
- "extendedWarranty" integer NOT NULL
-);
-
-CREATE TABLE posts (
- id serial primary key,
- author_id integer,
- title varchar(255),
- type varchar(255),
- body text
-);
-
-CREATE TABLE comments (
- id serial primary key,
- post_id integer,
- type varchar(255),
- body text
-);
-
-CREATE TABLE authors (
- id serial primary key,
- name varchar(255) default NULL
-);
-
-CREATE TABLE tasks (
- id serial primary key,
- starting timestamp,
- ending timestamp
-);
-
-CREATE TABLE categories (
- id serial primary key,
- name varchar(255),
- type varchar(255)
-);
-
-CREATE TABLE categories_posts (
- category_id integer NOT NULL,
- post_id integer NOT NULL
-);
-
-CREATE TABLE fk_test_has_pk (
- id INTEGER NOT NULL PRIMARY KEY
-);
-
-CREATE TABLE fk_test_has_fk (
- id INTEGER NOT NULL PRIMARY KEY,
- fk_id INTEGER NOT NULL REFERENCES fk_test_has_fk(id)
-);
-
-CREATE TABLE geometrics (
- id serial primary key,
- a_point point,
- -- a_line line, (the line type is currently not implemented in postgresql)
- a_line_segment lseg,
- a_box box,
- a_path path,
- a_polygon polygon,
- a_circle circle
-);
-
-CREATE TABLE keyboards (
- key_number serial primary key,
- "name" character varying(50)
-);
-
---Altered lock_version column name.
-CREATE TABLE legacy_things (
- id serial primary key,
- tps_report_number integer,
- version integer default 0
-);
-
-CREATE TABLE numeric_data (
- id serial primary key,
- bank_balance decimal(10,2),
- big_bank_balance decimal(15,2),
- world_population decimal(10),
- my_house_population decimal(2),
- decimal_number_with_default decimal(3,2) default 2.78
-);
-
-CREATE TABLE mixed_case_monkeys (
- "monkeyID" INTEGER PRIMARY KEY,
- "fleaCount" INTEGER
-);
-
-CREATE TABLE postgresql_arrays (
- id SERIAL PRIMARY KEY,
- commission_by_quarter INTEGER[],
- nicknames TEXT[]
-);
-
-CREATE TABLE postgresql_moneys (
- id SERIAL PRIMARY KEY,
- wealth MONEY
-);
-
-CREATE TABLE postgresql_numbers (
- id SERIAL PRIMARY KEY,
- single REAL,
- double DOUBLE PRECISION
-);
-
-CREATE TABLE postgresql_times (
- id SERIAL PRIMARY KEY,
- time_interval INTERVAL
-);
-
-CREATE TABLE postgresql_network_addresses (
- id SERIAL PRIMARY KEY,
- cidr_address CIDR,
- inet_address INET,
- mac_address MACADDR
-);
-
-CREATE TABLE postgresql_bit_strings (
- id SERIAL PRIMARY KEY,
- bit_string BIT(8),
- bit_string_varying BIT VARYING(8)
-);
-
-CREATE TABLE postgresql_oids (
- id SERIAL PRIMARY KEY,
- obj_id OID
-);
-
-CREATE TABLE minimalistics (
- id serial primary key
-);
View
1  activerecord/test/schema/postgresql2.drop.sql
@@ -1 +0,0 @@
-DROP TABLE courses;
View
4 activerecord/test/schema/postgresql2.sql
@@ -1,4 +0,0 @@
-CREATE TABLE courses (
- id serial primary key,
- name text
-);
View
103 activerecord/test/schema/postgresql_specific_schema.rb
@@ -0,0 +1,103 @@
+ActiveRecord::Schema.define do
+
+ %w(postgresql_arrays postgresql_moneys postgresql_numbers postgresql_times postgresql_network_addresses postgresql_bit_strings
+ postgresql_oids defaults geometrics).each do |table_name|
+ drop_table table_name
+ end
+
+ execute 'DROP SEQUENCE IF EXISTS companies_nonstd_seq CASCADE'
+ execute 'CREATE SEQUENCE companies_nonstd_seq START 101 OWNED BY companies.id'
+ execute "ALTER TABLE companies ALTER COLUMN id SET DEFAULT nextval('companies_nonstd_seq')"
+ execute 'DROP SEQUENCE IF EXISTS companies_id_seq'
+
+ %w(accounts_id_seq developers_id_seq projects_id_seq topics_id_seq customers_id_seq orders_id_seq).each do |seq_name|
+ execute "SELECT setval('#{seq_name}', 100)"
+ end
+
+ execute <<_SQL
+ CREATE TABLE defaults (
+ id serial primary key,
+ modified_date date default CURRENT_DATE,
+ modified_date_function date default now(),
+ fixed_date date default '2004-01-01',
+ modified_time timestamp default CURRENT_TIMESTAMP,
+ modified_time_function timestamp default now(),
+ fixed_time timestamp default '2004-01-01 00:00:00.000000-00',
+ char1 char(1) default 'Y',
+ char2 character varying(50) default 'a varchar field',
+ char3 text default 'a text field',
+ positive_integer integer default 1,
+ negative_integer integer default -1,
+ decimal_number decimal(3,2) default 2.78,
+ multiline_default text DEFAULT '--- []
+
+'::text
+);
+_SQL
+
+ execute <<_SQL
+ CREATE TABLE geometrics (
+ id serial primary key,
+ a_point point,
+ -- a_line line, (the line type is currently not implemented in postgresql)
+ a_line_segment lseg,
+ a_box box,
+ a_path path,
+ a_polygon polygon,
+ a_circle circle
+ );
+_SQL
+
+ execute <<_SQL
+ CREATE TABLE postgresql_arrays (
+ id SERIAL PRIMARY KEY,
+ commission_by_quarter INTEGER[],
+ nicknames TEXT[]
+ );
+_SQL
+ execute <<_SQL
+ CREATE TABLE postgresql_moneys (
+ id SERIAL PRIMARY KEY,
+ wealth MONEY
+ );
+_SQL
+
+ execute <<_SQL
+ CREATE TABLE postgresql_numbers (
+ id SERIAL PRIMARY KEY,
+ single REAL,
+ double DOUBLE PRECISION
+ );
+_SQL
+
+ execute <<_SQL
+ CREATE TABLE postgresql_times (
+ id SERIAL PRIMARY KEY,
+ time_interval INTERVAL
+ );
+_SQL
+
+ execute <<_SQL
+ CREATE TABLE postgresql_network_addresses (
+ id SERIAL PRIMARY KEY,
+ cidr_address CIDR,
+ inet_address INET,
+ mac_address MACADDR
+ );
+_SQL
+
+ execute <<_SQL
+ CREATE TABLE postgresql_bit_strings (
+ id SERIAL PRIMARY KEY,
+ bit_string BIT(8),
+ bit_string_varying BIT VARYING(8)
+ );
+_SQL
+
+ execute <<_SQL
+ CREATE TABLE postgresql_oids (
+ id SERIAL PRIMARY KEY,
+ obj_id OID
+ );
+_SQL
+end
View
575 activerecord/test/schema/schema.rb
@@ -1,322 +1,251 @@
-ActiveRecord::Schema.define do
-
- # adapter name is checked because we are under a transition of
- # moving the sql files under activerecord/test/fixtures/db_definitions
- # to this file, schema.rb.
- if adapter_name == "MySQL"
-
- # Please keep these create table statements in alphabetical order
- # unless the ordering matters. In which case, define them below
- create_table :accounts, :force => true do |t|
- t.integer :firm_id
- t.integer :credit_limit
- end
-
- create_table :authors, :force => true do |t|
- t.string :name, :null => false
- end
-
- create_table :auto_id_tests, :force => true, :id => false do |t|
- t.primary_key :auto_id
- t.integer :value
- end
-
- create_table :binaries, :force => true do |t|
- t.binary :data
- end
- create_table :binary_fields, :force => true do |t|
- t.binary :tiny_blob, :limit => 255
- t.binary :normal_blob, :limit => 65535
- t.binary :medium_blob, :limit => 16777215
- t.binary :long_blob, :limit => 2147483647
- t.text :tiny_text, :limit => 255
- t.text :normal_text, :limit => 65535
- t.text :medium_text, :limit => 16777215
- t.text :long_text, :limit => 2147483647
- end
-
- create_table :booleantests, :force => true do |t|
- t.integer :value
- end
-
- create_table :categories, :force => true do |t|
- t.string :name, :null => false
- t.string :type
- end
-
- create_table :categories_posts, :force => true, :id => false do |t|
- t.integer :category_id, :null => false
- t.integer :post_id, :null => false
- end
-