1
0
Fork 0
This repository has been archived on 2023-03-27. You can view files and clone it, but cannot push or open issues or pull requests.
lpr-partynest/db/migrate/20190921142404_create_relation_statuses.rb

23 lines
542 B
Ruby
Raw Permalink Normal View History

2019-09-21 10:37:06 -04:00
# frozen_string_literal: true
class CreateRelationStatuses < ActiveRecord::Migration[6.0]
include Partynest::Migration
def change
create_table :relation_statuses do |t|
t.timestamps null: false
t.string :codename, null: false, index: { unique: true }
t.string :name, null: false, index: { unique: true }
end
2019-09-29 10:00:55 -04:00
add_constraint :relation_statuses, :codename, <<~SQL
2019-09-21 10:37:06 -04:00
is_codename(codename)
SQL
2019-09-29 10:00:55 -04:00
add_constraint :relation_statuses, :name, <<~SQL
2019-09-21 10:37:06 -04:00
is_good_small_text(name)
SQL
end
end