Use reference command

For uniformity

Co-authored-by: Maikel <maikel@email.org.au>
This commit is contained in:
David Cook
2026-03-10 14:17:10 +11:00
parent 05c31db46a
commit 7da6adfe4f
2 changed files with 3 additions and 3 deletions

View File

@@ -2,7 +2,6 @@
class AddOwnerToSpreeVariants < ActiveRecord::Migration[7.1]
def change
add_column :spree_variants, :owner_id, :integer
add_foreign_key :spree_variants, :enterprises, column: :owner_id
add_reference :spree_variants, :owner, foreign_key: { to_table: :enterprises }
end
end

View File

@@ -1009,7 +1009,8 @@ ActiveRecord::Schema[7.1].define(version: 2026_03_06_015040) do
t.bigint "supplier_id"
t.float "variant_unit_scale"
t.string "variant_unit_name", limit: 255
t.integer "owner_id"
t.bigint "owner_id"
t.index ["owner_id"], name: "index_spree_variants_on_owner_id"
t.index ["primary_taxon_id"], name: "index_spree_variants_on_primary_taxon_id"
t.index ["product_id"], name: "index_variants_on_product_id"
t.index ["shipping_category_id"], name: "index_spree_variants_on_shipping_category_id"