X-Git-Url: https://git.njae.me.uk/?a=blobdiff_plain;f=vendor%2Frails%2Factiverecord%2Ftest%2Fschema%2Fsqlite_specific_schema.rb;fp=vendor%2Frails%2Factiverecord%2Ftest%2Fschema%2Fsqlite_specific_schema.rb;h=ea05b35fe0f5063d8f617bfa0c429928de22ed13;hb=d115f2e23823271635bad69229a42cd8ac68debe;hp=0000000000000000000000000000000000000000;hpb=37cb670bf3ddde90b214e591f100ed4446469484;p=depot.git

diff --git a/vendor/rails/activerecord/test/schema/sqlite_specific_schema.rb b/vendor/rails/activerecord/test/schema/sqlite_specific_schema.rb
new file mode 100644
index 0000000..ea05b35
--- /dev/null
+++ b/vendor/rails/activerecord/test/schema/sqlite_specific_schema.rb
@@ -0,0 +1,25 @@
+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
\ No newline at end of file