1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-11-29 10:24:20 +01:00
fab-manager/db/migrate/20230307123841_create_plan_limitations.rb
2023-03-13 14:19:49 +01:00

17 lines
573 B
Ruby

# frozen_string_literal: true
# This table saves the restrictions settings, per plan and resource
class CreatePlanLimitations < ActiveRecord::Migration[5.2]
def change
create_table :plan_limitations do |t|
t.references :plan, foreign_key: true, index: true, null: false
t.references :limitable, polymorphic: true, null: false
t.integer :limit, null: false, default: 0
t.timestamps
end
add_index :plan_limitations, %i[plan_id limitable_id limitable_type], unique: true, name: 'index_plan_limitations_on_plan_and_limitable'
end
end