15 lines
385 B
Ruby
15 lines
385 B
Ruby
# frozen_string_literal: true
|
|
|
|
class CreateTextFields < ActiveRecord::Migration[7.1]
|
|
def change
|
|
create_table :text_fields do |t|
|
|
t.belongs_to :character_sheet_section, null: false, foreign_key: true
|
|
t.string :name, null: false
|
|
|
|
t.timestamps
|
|
end
|
|
|
|
add_check_constraint :text_fields, "length(name) <= 100", name: "chk_text_field_name_max_length"
|
|
end
|
|
end
|