feat(migrations): Add promotion code migrations
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
class CreatePromotionCodes < ActiveRecord::Migration[8.0]
|
||||
def change
|
||||
create_table :promotion_codes do |t|
|
||||
t.string :code, null: false, unique: true
|
||||
t.string :code, null: false
|
||||
t.integer :discount_amount_cents, null: false, default: 0
|
||||
t.datetime :expires_at
|
||||
t.boolean :active, default: true, null: false
|
||||
@@ -11,6 +11,7 @@ class CreatePromotionCodes < ActiveRecord::Migration[8.0]
|
||||
t.datetime :updated_at, null: false
|
||||
end
|
||||
|
||||
# Unique index for code
|
||||
add_index :promotion_codes, :code, unique: true
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user