mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-17 04:34:24 +00:00
Add Foreign Key Column to Migrations
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
class AddForeignKeyToSpreeStockMovementsStockItem < ActiveRecord::Migration[6.0]
|
||||
class AddForeignKeyToSpreeStockMovementsSpreeStockItems < ActiveRecord::Migration[6.0]
|
||||
def change
|
||||
add_foreign_key :spree_stock_movements, :spree_stock_items, on_delete: :cascade
|
||||
add_foreign_key :spree_stock_movements, :spree_stock_items, column: :stock_item_id
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
class AddForeignKeyToInventoryItemsEnterprises < ActiveRecord::Migration[6.0]
|
||||
def change
|
||||
add_foreign_key :inventory_items, :enterprises, column: :enterprise_id, on_delete: :cascade
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,5 @@
|
||||
class AddForeignKeyToInventoryItemsSpreeVariants < ActiveRecord::Migration[6.0]
|
||||
def change
|
||||
add_foreign_key :inventory_items, :spree_variants, column: :variant_id, on_delete: :cascade
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,5 @@
|
||||
class AddForeignKeyToReportRenderingOptionsSpreeUsers < ActiveRecord::Migration[6.0]
|
||||
def change
|
||||
add_foreign_key :report_rendering_options, :spree_users, column: :user_id, on_delete: :cascade
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,5 @@
|
||||
class AddForeignKeyToSpreeShipmentsSpreeStockLocations < ActiveRecord::Migration[6.0]
|
||||
def change
|
||||
add_foreign_key :spree_shipments, :spree_stock_locations, column: :stock_location_id
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,5 @@
|
||||
class AddForeignKeyToSpreeShippingMethodCategoriesSpreeShippingCategories < ActiveRecord::Migration[6.0]
|
||||
def change
|
||||
add_foreign_key :spree_shipping_method_categories, :spree_shipping_categories, column: :shipping_category_id, on_delete: :cascade
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,5 @@
|
||||
class AddForeignKeyToSpreeShippingMethodCategoriesSpreeShippingMethods < ActiveRecord::Migration[6.0]
|
||||
def change
|
||||
add_foreign_key :spree_shipping_method_categories, :spree_shipping_methods, column: :shipping_method_id, on_delete: :cascade
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,5 @@
|
||||
class AddForeignKeyToSpreeStockLocationsSpreeCountries < ActiveRecord::Migration[6.0]
|
||||
def change
|
||||
add_foreign_key :spree_stock_locations, :spree_countries, column: :country_id
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,5 @@
|
||||
class AddForeignKeyToSpreeStockLocationsSpreeStates < ActiveRecord::Migration[6.0]
|
||||
def change
|
||||
add_foreign_key :spree_stock_locations, :spree_states, column: :state_id
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user