17 lines
522 B
Ruby
17 lines
522 B
Ruby
# 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
|