Add ability to disable login and mark accounts as memorial (#5615)
Fix #5597
This commit is contained in:
parent
cbbeec05be
commit
1032f3994f
17 changed files with 168 additions and 39 deletions
15
db/migrate/20171107143332_add_memorial_to_accounts.rb
Normal file
15
db/migrate/20171107143332_add_memorial_to_accounts.rb
Normal 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
|
15
db/migrate/20171107143624_add_disabled_to_users.rb
Normal file
15
db/migrate/20171107143624_add_disabled_to_users.rb
Normal 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
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue