4 changed files with 35 additions and 2 deletions
@ -0,0 +1,2 @@ |
|||||||
|
class LocationDeactivation < ApplicationRecord |
||||||
|
end |
||||||
@ -0,0 +1,10 @@ |
|||||||
|
class AddDeactivationsTable < ActiveRecord::Migration[7.0] |
||||||
|
def change |
||||||
|
create_table :location_deactivations do |t| |
||||||
|
t.datetime :deactivation_date |
||||||
|
t.datetime :reactivation_date |
||||||
|
t.belongs_to :location |
||||||
|
t.timestamps |
||||||
|
end |
||||||
|
end |
||||||
|
end |
||||||
@ -0,0 +1,13 @@ |
|||||||
|
class RemoveDeactivatioDate < ActiveRecord::Migration[7.0] |
||||||
|
def up |
||||||
|
change_table :locations, bulk: true do |t| |
||||||
|
t.remove :deactivation_date |
||||||
|
end |
||||||
|
end |
||||||
|
|
||||||
|
def down |
||||||
|
change_table :locations, bulk: true do |t| |
||||||
|
t.column :deactivation_date, :datetime |
||||||
|
end |
||||||
|
end |
||||||
|
end |
||||||
Loading…
Reference in new issue