0
0
Fork 0

Add ability to disable login and mark accounts as memorial (#5615)

Fix #5597
This commit is contained in:
Eugen Rochko 2017-11-07 19:06:44 +01:00 committed by GitHub
parent cbbeec05be
commit 1032f3994f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 168 additions and 39 deletions

View file

@ -0,0 +1,15 @@
require Rails.root.join('lib', 'mastodon', 'migration_helpers')
class AddMemorialToAccounts < ActiveRecord::Migration[5.1]
include Mastodon::MigrationHelpers
disable_ddl_transaction!
def up
safety_assured { add_column_with_default :accounts, :memorial, :bool, default: false }
end
def down
remove_column :accounts, :memorial
end
end

View file

@ -0,0 +1,15 @@
require Rails.root.join('lib', 'mastodon', 'migration_helpers')
class AddDisabledToUsers < ActiveRecord::Migration[5.1]
include Mastodon::MigrationHelpers
disable_ddl_transaction!
def up
safety_assured { add_column_with_default :users, :disabled, :bool, default: false }
end
def down
remove_column :users, :disabled
end
end

View file

@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20171020084748) do
ActiveRecord::Schema.define(version: 20171107143624) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@ -71,6 +71,7 @@ ActiveRecord::Schema.define(version: 20171020084748) do
t.string "shared_inbox_url", default: "", null: false
t.string "followers_url", default: "", null: false
t.integer "protocol", default: 0, null: false
t.boolean "memorial", default: false, null: false
t.index "(((setweight(to_tsvector('simple'::regconfig, (display_name)::text), 'A'::\"char\") || setweight(to_tsvector('simple'::regconfig, (username)::text), 'B'::\"char\")) || setweight(to_tsvector('simple'::regconfig, (COALESCE(domain, ''::character varying))::text), 'C'::\"char\")))", name: "search_index", using: :gin
t.index "lower((username)::text), lower((domain)::text)", name: "index_accounts_on_username_and_domain_lower"
t.index ["uri"], name: "index_accounts_on_uri"
@ -435,6 +436,7 @@ ActiveRecord::Schema.define(version: 20171020084748) do
t.string "otp_backup_codes", array: true
t.string "filtered_languages", default: [], null: false, array: true
t.bigint "account_id", null: false
t.boolean "disabled", default: false, null: false
t.index ["account_id"], name: "index_users_on_account_id"
t.index ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true
t.index ["email"], name: "index_users_on_email", unique: true