16 lines
523 B
Ruby
16 lines
523 B
Ruby
# frozen_string_literal: true
|
|
|
|
class CreateCharacterSheetSections < ActiveRecord::Migration[7.1]
|
|
def change
|
|
create_table :character_sheet_sections do |t|
|
|
t.string :name, null: false
|
|
t.belongs_to :character, null: false, foreign_key: true
|
|
t.references :parent_section, null: true, foreign_key: { to_table: :character_sheet_sections }
|
|
|
|
t.timestamps
|
|
end
|
|
|
|
add_check_constraint :character_sheet_sections, "length(name) <= 255", name: "chk_character_sheet_section_name_max_length"
|
|
end
|
|
end
|