mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-23 14:53:10 -06:00
Rename 'is_active' to 'is_deactivated'
Signed-off-by: Loïck Bonniot <git@lesterpig.com>
This commit is contained in:
parent
818682810e
commit
963b0076b3
|
|
@ -39,7 +39,7 @@ CREATE TABLE IF NOT EXISTS account_accounts (
|
|||
-- Identifies which application service this account belongs to, if any.
|
||||
appservice_id TEXT,
|
||||
-- If the account is currently active
|
||||
is_active BOOLEAN DEFAULT TRUE
|
||||
is_deactivated BOOLEAN DEFAULT FALSE
|
||||
-- TODO:
|
||||
-- is_guest, is_admin, upgraded_ts, devices, any email reset stuff?
|
||||
);
|
||||
|
|
@ -54,13 +54,13 @@ const updatePasswordSQL = "" +
|
|||
"UPDATE account_accounts SET password_hash = $1 WHERE localpart = $2"
|
||||
|
||||
const deactivateAccountSQL = "" +
|
||||
"UPDATE account_accounts SET is_active = FALSE WHERE localpart = $1"
|
||||
"UPDATE account_accounts SET is_deactivated = TRUE WHERE localpart = $1"
|
||||
|
||||
const selectAccountByLocalpartSQL = "" +
|
||||
"SELECT localpart, appservice_id FROM account_accounts WHERE localpart = $1"
|
||||
|
||||
const selectPasswordHashSQL = "" +
|
||||
"SELECT password_hash FROM account_accounts WHERE localpart = $1 AND is_active = TRUE"
|
||||
"SELECT password_hash FROM account_accounts WHERE localpart = $1 AND is_deactivated = FALSE"
|
||||
|
||||
const selectNewNumericLocalpartSQL = "" +
|
||||
"SELECT nextval('numeric_username_seq')"
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
-- +goose Up
|
||||
-- +goose StatementBegin
|
||||
ALTER TABLE account_accounts ADD COLUMN IF NOT EXISTS is_active BOOLEAN DEFAULT TRUE;
|
||||
ALTER TABLE account_accounts ADD COLUMN IF NOT EXISTS is_deactivated BOOLEAN DEFAULT FALSE;
|
||||
-- +goose StatementEnd
|
||||
|
||||
-- +goose Down
|
||||
-- +goose StatementBegin
|
||||
ALTER TABLE account_accounts DROP COLUMN is_active;
|
||||
ALTER TABLE account_accounts DROP COLUMN is_deactivated;
|
||||
-- +goose StatementEnd
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ CREATE TABLE IF NOT EXISTS account_accounts (
|
|||
-- Identifies which application service this account belongs to, if any.
|
||||
appservice_id TEXT,
|
||||
-- If the account is currently active
|
||||
is_active BOOLEAN DEFAULT 1
|
||||
is_deactivated BOOLEAN DEFAULT 0
|
||||
-- TODO:
|
||||
-- is_guest, is_admin, upgraded_ts, devices, any email reset stuff?
|
||||
);
|
||||
|
|
@ -52,13 +52,13 @@ const updatePasswordSQL = "" +
|
|||
"UPDATE account_accounts SET password_hash = $1 WHERE localpart = $2"
|
||||
|
||||
const deactivateAccountSQL = "" +
|
||||
"UPDATE account_accounts SET is_active = 0 WHERE localpart = $1"
|
||||
"UPDATE account_accounts SET is_deactivated = 1 WHERE localpart = $1"
|
||||
|
||||
const selectAccountByLocalpartSQL = "" +
|
||||
"SELECT localpart, appservice_id FROM account_accounts WHERE localpart = $1"
|
||||
|
||||
const selectPasswordHashSQL = "" +
|
||||
"SELECT password_hash FROM account_accounts WHERE localpart = $1 AND is_active = 1"
|
||||
"SELECT password_hash FROM account_accounts WHERE localpart = $1 AND is_deactivated = 0"
|
||||
|
||||
const selectNewNumericLocalpartSQL = "" +
|
||||
"SELECT COUNT(localpart) FROM account_accounts"
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ CREATE TABLE account_accounts (
|
|||
created_ts BIGINT NOT NULL,
|
||||
password_hash TEXT,
|
||||
appservice_id TEXT,
|
||||
is_active BOOLEAN DEFAULT 1
|
||||
is_deactivated BOOLEAN DEFAULT 0
|
||||
);
|
||||
INSERT
|
||||
INTO account_accounts (
|
||||
|
|
|
|||
Loading…
Reference in a new issue