From c1957cb51c0e2783944957a7a265922ac42a8282 Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Fri, 14 May 2021 17:17:03 -0700 Subject: [PATCH] Use Schema.define [skip ci] --- .github/ISSUE_TEMPLATE/bug_report.md | 6 ++++-- test/support/activerecord.rb | 90 ++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------- 2 files changed, 50 insertions(+), 46 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 452e850..c7081fa 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -34,8 +34,10 @@ puts "Elasticsearch version: #{Searchkick.server_version}" ActiveRecord::Base.establish_connection adapter: "sqlite3", database: ":memory:" ActiveJob::Base.queue_adapter = :inline -ActiveRecord::Migration.create_table :products do |t| - t.string :name +ActiveRecord::Schema.define do + create_table :products do |t| + t.string :name + end end class Product < ActiveRecord::Base diff --git a/test/support/activerecord.rb b/test/support/activerecord.rb index 149b329..12ce9ec 100644 --- a/test/support/activerecord.rb +++ b/test/support/activerecord.rb @@ -14,50 +14,52 @@ require_relative "apartment" if defined?(Apartment) ActiveRecord::Migration.verbose = ENV["VERBOSE"] -ActiveRecord::Migration.create_table :products do |t| - t.string :name - t.integer :store_id - t.boolean :in_stock - t.boolean :backordered - t.integer :orders_count - t.decimal :found_rate - t.integer :price - t.string :color - t.decimal :latitude, precision: 10, scale: 7 - t.decimal :longitude, precision: 10, scale: 7 - t.text :description - t.text :alt_description - t.timestamps null: true -end - -ActiveRecord::Migration.create_table :stores do |t| - t.string :name -end - -ActiveRecord::Migration.create_table :regions do |t| - t.string :name - t.text :text -end - -ActiveRecord::Migration.create_table :speakers do |t| - t.string :name -end - -ActiveRecord::Migration.create_table :animals do |t| - t.string :name - t.string :type -end - -ActiveRecord::Migration.create_table :skus, id: :uuid do |t| - t.string :name -end - -ActiveRecord::Migration.create_table :songs do |t| - t.string :name -end - -ActiveRecord::Migration.create_table :bands do |t| - t.string :name +ActiveRecord::Schema.define do + create_table :products do |t| + t.string :name + t.integer :store_id + t.boolean :in_stock + t.boolean :backordered + t.integer :orders_count + t.decimal :found_rate + t.integer :price + t.string :color + t.decimal :latitude, precision: 10, scale: 7 + t.decimal :longitude, precision: 10, scale: 7 + t.text :description + t.text :alt_description + t.timestamps null: true + end + + create_table :stores do |t| + t.string :name + end + + create_table :regions do |t| + t.string :name + t.text :text + end + + create_table :speakers do |t| + t.string :name + end + + create_table :animals do |t| + t.string :name + t.string :type + end + + create_table :skus, id: :uuid do |t| + t.string :name + end + + create_table :songs do |t| + t.string :name + end + + create_table :bands do |t| + t.string :name + end end class Product < ActiveRecord::Base -- libgit2 0.21.0