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
2016-04-19 17:17:19 +09:00

18 lines
433 B
Ruby

ActiveRecord::Schema.define do
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' (
'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'('pk_id')
);
_SQL
end