Commit c1957cb51c0e2783944957a7a265922ac42a8282

Authored by Andrew Kane
1 parent 0d5b3f0c

Use Schema.define [skip ci]

.github/ISSUE_TEMPLATE/bug_report.md
... ... @@ -34,8 +34,10 @@ puts "Elasticsearch version: #{Searchkick.server_version}"
34 34 ActiveRecord::Base.establish_connection adapter: "sqlite3", database: ":memory:"
35 35 ActiveJob::Base.queue_adapter = :inline
36 36  
37   -ActiveRecord::Migration.create_table :products do |t|
38   - t.string :name
  37 +ActiveRecord::Schema.define do
  38 + create_table :products do |t|
  39 + t.string :name
  40 + end
39 41 end
40 42  
41 43 class Product < ActiveRecord::Base
... ...
test/support/activerecord.rb
... ... @@ -14,50 +14,52 @@ require_relative &quot;apartment&quot; if defined?(Apartment)
14 14  
15 15 ActiveRecord::Migration.verbose = ENV["VERBOSE"]
16 16  
17   -ActiveRecord::Migration.create_table :products do |t|
18   - t.string :name
19   - t.integer :store_id
20   - t.boolean :in_stock
21   - t.boolean :backordered
22   - t.integer :orders_count
23   - t.decimal :found_rate
24   - t.integer :price
25   - t.string :color
26   - t.decimal :latitude, precision: 10, scale: 7
27   - t.decimal :longitude, precision: 10, scale: 7
28   - t.text :description
29   - t.text :alt_description
30   - t.timestamps null: true
31   -end
32   -
33   -ActiveRecord::Migration.create_table :stores do |t|
34   - t.string :name
35   -end
36   -
37   -ActiveRecord::Migration.create_table :regions do |t|
38   - t.string :name
39   - t.text :text
40   -end
41   -
42   -ActiveRecord::Migration.create_table :speakers do |t|
43   - t.string :name
44   -end
45   -
46   -ActiveRecord::Migration.create_table :animals do |t|
47   - t.string :name
48   - t.string :type
49   -end
50   -
51   -ActiveRecord::Migration.create_table :skus, id: :uuid do |t|
52   - t.string :name
53   -end
54   -
55   -ActiveRecord::Migration.create_table :songs do |t|
56   - t.string :name
57   -end
58   -
59   -ActiveRecord::Migration.create_table :bands do |t|
60   - t.string :name
  17 +ActiveRecord::Schema.define do
  18 + create_table :products do |t|
  19 + t.string :name
  20 + t.integer :store_id
  21 + t.boolean :in_stock
  22 + t.boolean :backordered
  23 + t.integer :orders_count
  24 + t.decimal :found_rate
  25 + t.integer :price
  26 + t.string :color
  27 + t.decimal :latitude, precision: 10, scale: 7
  28 + t.decimal :longitude, precision: 10, scale: 7
  29 + t.text :description
  30 + t.text :alt_description
  31 + t.timestamps null: true
  32 + end
  33 +
  34 + create_table :stores do |t|
  35 + t.string :name
  36 + end
  37 +
  38 + create_table :regions do |t|
  39 + t.string :name
  40 + t.text :text
  41 + end
  42 +
  43 + create_table :speakers do |t|
  44 + t.string :name
  45 + end
  46 +
  47 + create_table :animals do |t|
  48 + t.string :name
  49 + t.string :type
  50 + end
  51 +
  52 + create_table :skus, id: :uuid do |t|
  53 + t.string :name
  54 + end
  55 +
  56 + create_table :songs do |t|
  57 + t.string :name
  58 + end
  59 +
  60 + create_table :bands do |t|
  61 + t.string :name
  62 + end
61 63 end
62 64  
63 65 class Product < ActiveRecord::Base
... ...