1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activerecord/test/schema/sqlite_specific_schema.rb
Frederick Cheung a4fc93c3a9 Use schema.rb for all databases
Move adapter specific schema into their own files

Signed-off-by: Michael Koziarski <michael@koziarski.com>
2008-04-22 13:55:13 +12:00

25 lines
No EOL
630 B
Ruby

ActiveRecord::Schema.define do
# For sqlite 3.1.0+, make a table with a autoincrement column
if supports_autoincrement?
create_table :table_with_autoincrement, :force => true do |t|
t.column :name, :string
end
end
execute "DROP TABLE fk_test_has_fk" rescue nil
execute "DROP TABLE fk_test_has_pk" rescue nil
execute <<_SQL
CREATE TABLE 'fk_test_has_pk' (
'id' INTEGER NOT NULL PRIMARY KEY
);
_SQL
execute <<_SQL
CREATE TABLE 'fk_test_has_fk' (
'id' INTEGER NOT NULL PRIMARY KEY,
'fk_id' INTEGER NOT NULL,
FOREIGN KEY ('fk_id') REFERENCES 'fk_test_has_pk'('id')
);
_SQL
end