Save and restore statuses when setting and unsetting force delete #2845

This commit is contained in:
Martin Lensment 2015-08-10 17:18:45 +03:00
parent 2c0de95363
commit 9157f861d8
4 changed files with 32 additions and 13 deletions

View file

@ -0,0 +1,5 @@
class AddStatusesBackupForDomains < ActiveRecord::Migration
def change
add_column :domains, :statuses_backup, :string, array: true, default: []
end
end

View file

@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20150803080914) do
ActiveRecord::Schema.define(version: 20150810114746) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@ -329,6 +329,7 @@ ActiveRecord::Schema.define(version: 20150803080914) do
t.string "statuses", array: true
t.boolean "reserved", default: false
t.hstore "status_notes"
t.string "statuses_backup", default: [], array: true
end
add_index "domains", ["delete_at"], name: "index_domains_on_delete_at", using: :btree

View file

@ -910,7 +910,8 @@ CREATE TABLE domains (
force_delete_at timestamp without time zone,
statuses character varying[],
reserved boolean DEFAULT false,
status_notes hstore
status_notes hstore,
statuses_backup character varying[] DEFAULT '{}'::character varying[]
);
@ -4871,3 +4872,5 @@ INSERT INTO schema_migrations (version) VALUES ('20150722071128');
INSERT INTO schema_migrations (version) VALUES ('20150803080914');
INSERT INTO schema_migrations (version) VALUES ('20150810114746');