26 lines
914 B
Ruby
26 lines
914 B
Ruby
# frozen_string_literal: true
|
|
|
|
class CreateCharacterSheetFeatures < ActiveRecord::Migration[7.1]
|
|
def change
|
|
create_table :character_sheet_features, primary_key: [ :character_sheet_section_id, :featurable_id ] do |t|
|
|
t.belongs_to :character_sheet_section, null: false, foreign_key: true
|
|
t.belongs_to :featurable, null: false, polymorphic: true
|
|
t.integer :order, null: false
|
|
t.string :slug, null: false
|
|
|
|
t.timestamps
|
|
end
|
|
|
|
remove_column :counters, :character_sheet_section_id, :integer
|
|
remove_column :stats, :character_sheet_section_id, :integer
|
|
remove_column :text_fields, :character_sheet_section_id, :integer
|
|
|
|
remove_column :counters, :order_index, :integer
|
|
remove_column :stats, :order_index, :integer
|
|
remove_column :text_fields, :order_index, :integer
|
|
|
|
remove_column :counters, :slug, :string
|
|
remove_column :stats, :slug, :string
|
|
end
|
|
end
|