tabletop-companion/db/migrate/20240621141219_create_dice_...

17 lines
522 B
Ruby
Raw Normal View History

2024-06-21 14:47:07 +00:00
# frozen_string_literal: true
class CreateDiceRollTypes < ActiveRecord::Migration[7.1]
def change
create_table :dice_roll_types do |t|
t.string :name, null: false
t.string :roll_command, null: false
t.belongs_to :rollable, null: false, polymorphic: true
t.timestamps
end
add_check_constraint :dice_roll_types, "length(name) <= 100", name: "chk_name_max_length"
add_check_constraint :dice_roll_types, "length(roll_command) <= 100", name: "chk_roll_command_max_length"
end
end