Sha256: de8c5a916de2780d03f849ef00f75d4920f8b107f271f74eeedf02242e573094
Contents?: true
Size: 723 Bytes
Versions: 21
Compression:
Stored size: 723 Bytes
Contents
class ChangeReferenceInInvoiceToPolymorphic < ActiveRecord::Migration[7.1] def change add_reference :comee_core_invoice_items, :invoiceable, polymorphic: true, index: {name: "invoiceable_on_ccii_indx"} reversible do |dir| dir.up do execute <<-SQL.squish UPDATE comee_core_invoice_items SET invoiceable_type = 'Comee::Core::ShipmentInstructionItem', invoiceable_id = shipment_instruction_item_id SQL end end remove_reference :comee_core_invoice_items, :shipment_instruction_item, foreign_key: {to_table: :comee_core_shipment_instruction_items} end end
Version data entries
21 entries across 21 versions & 1 rubygems