diff options
Diffstat (limited to 'activestorage/test/database')
-rw-r--r-- | activestorage/test/database/create_users_migration.rb | 9 | ||||
-rw-r--r-- | activestorage/test/database/setup.rb | 7 |
2 files changed, 16 insertions, 0 deletions
diff --git a/activestorage/test/database/create_users_migration.rb b/activestorage/test/database/create_users_migration.rb new file mode 100644 index 0000000000..fdba87cacf --- /dev/null +++ b/activestorage/test/database/create_users_migration.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class ActiveStorageCreateUsers < ActiveRecord::Migration[5.2] + def change + create_table :users do |t| + t.string :name + end + end +end diff --git a/activestorage/test/database/setup.rb b/activestorage/test/database/setup.rb new file mode 100644 index 0000000000..daeeb5695b --- /dev/null +++ b/activestorage/test/database/setup.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +require_relative "create_users_migration" + +ActiveRecord::Base.establish_connection(adapter: "sqlite3", database: ":memory:") +ActiveRecord::Base.connection.migration_context.migrate +ActiveStorageCreateUsers.migrate(:up) |