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/20190930210852_remove_regional_offices.rb

28 lines
714 B
Ruby

# frozen_string_literal: true
class RemoveRegionalOffices < ActiveRecord::Migration[6.0]
include Partynest::Migration
def change
remove_reference :relationships,
:regional_office,
null: false,
index: true,
foreign_key: true
remove_constraint :regional_offices, :name, <<~SQL
is_good_small_text(name)
SQL
drop_table :regional_offices do |t|
t.timestamps null: false
t.references :federal_subject,
null: false,
index: { unique: true },
foreign_key: true
t.string :name, null: false, index: { unique: true }
end
end
end