tabletop-companion/db/migrate/20240614084224_create_text_...

15 lines
385 B
Ruby
Raw Normal View History

2024-06-14 08:57:13 +00:00
# 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