diff options
author | Vladimir Shushlin <vshushlin@gitlab.com> | 2019-04-09 17:46:29 +0000 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2019-04-09 17:46:29 +0000 |
commit | d69d29011cf9fe06e50a2c7d65b1ea88ea2d41d5 (patch) | |
tree | a794b2c4bfe9b00b552463928249b85957a5de05 /db | |
parent | 61ab1f7364b1ea44984a67bb6ea0f5a2b7a353c8 (diff) | |
download | gitlab-ce-d69d29011cf9fe06e50a2c7d65b1ea88ea2d41d5.tar.gz |
Mark unverified pages domains for removal
Set pages_domain.remove_at when disabling it
Add specs for marking pages domain for removal
Notify user that domain is being removed
Add documentation
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20190312113229_add_remove_at_to_pages_domains.rb | 10 | ||||
-rw-r--r-- | db/migrate/20190312113634_add_remove_at_index_to_pages_domains.rb | 19 | ||||
-rw-r--r-- | db/schema.rb | 2 |
3 files changed, 31 insertions, 0 deletions
diff --git a/db/migrate/20190312113229_add_remove_at_to_pages_domains.rb b/db/migrate/20190312113229_add_remove_at_to_pages_domains.rb new file mode 100644 index 00000000000..aa7d2841cd2 --- /dev/null +++ b/db/migrate/20190312113229_add_remove_at_to_pages_domains.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +class AddRemoveAtToPagesDomains < ActiveRecord::Migration[5.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + def change + add_column :pages_domains, :remove_at, :datetime_with_timezone + end +end diff --git a/db/migrate/20190312113634_add_remove_at_index_to_pages_domains.rb b/db/migrate/20190312113634_add_remove_at_index_to_pages_domains.rb new file mode 100644 index 00000000000..b5ccebd9cfa --- /dev/null +++ b/db/migrate/20190312113634_add_remove_at_index_to_pages_domains.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +# See http://doc.gitlab.com/ce/development/migration_style_guide.html +# for more information on how to write migrations for GitLab. + +class AddRemoveAtIndexToPagesDomains < ActiveRecord::Migration[5.0] + include Gitlab::Database::MigrationHelpers + DOWNTIME = false + + disable_ddl_transaction! + + def up + add_concurrent_index :pages_domains, :remove_at + end + + def down + remove_concurrent_index :pages_domains, :remove_at + end +end diff --git a/db/schema.rb b/db/schema.rb index c044fcc90c6..d1b3672725d 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1547,9 +1547,11 @@ ActiveRecord::Schema.define(version: 20190326164045) do t.datetime_with_timezone "verified_at" t.string "verification_code", null: false t.datetime_with_timezone "enabled_until" + t.datetime_with_timezone "remove_at" t.index ["domain"], name: "index_pages_domains_on_domain", unique: true, using: :btree t.index ["project_id", "enabled_until"], name: "index_pages_domains_on_project_id_and_enabled_until", using: :btree t.index ["project_id"], name: "index_pages_domains_on_project_id", using: :btree + t.index ["remove_at"], name: "index_pages_domains_on_remove_at", using: :btree t.index ["verified_at", "enabled_until"], name: "index_pages_domains_on_verified_at_and_enabled_until", using: :btree t.index ["verified_at"], name: "index_pages_domains_on_verified_at", using: :btree end |