Files
fab-store/db/migrate/20250210131695_create_spree_coupon_codes.spree.rb
2025-10-27 04:17:14 +00:00

17 lines
527 B
Ruby

# This migration comes from spree (originally 20241004181911)
class CreateSpreeCouponCodes < ActiveRecord::Migration[6.1]
def change
return if table_exists?(:spree_coupon_codes)
create_table :spree_coupon_codes do |t|
t.string :code, index: { unique: true, where: 'deleted_at IS NULL' }
t.references :promotion, index: true
t.references :order, index: true
t.integer :state, default: 0, null: false, index: true
t.datetime :deleted_at, index: true
t.timestamps
end
end
end