Open clokep opened 1 year ago
I think this is just ancient history. I managed to dig up:
we should migrate this to be NOT NULL as a matter of principle. Thank goodness there aren't any entries with NULL values!
matrix=> \d users
Table "matrix.users"
Column │ Type │ Collation │ Nullable │ Default
════════════════════════════╪══════════╪═══════════╪══════════╪═════════
name │ text │ │ │
password_hash │ text │ │ │
creation_ts │ bigint │ │ │
admin │ smallint │ │ not null │ 0
upgrade_ts │ bigint │ │ │
is_guest │ smallint │ │ not null │ 0
appservice_id │ text │ │ │
consent_version │ text │ │ │
consent_server_notice_sent │ text │ │ │
user_type │ text │ │ │
deactivated │ smallint │ │ not null │ 0
shadow_banned │ boolean │ │ │
consent_ts │ bigint │ │ │
approved │ boolean │ │ │
locked │ boolean │ │ not null │ false
Indexes:
"users_creation_ts" btree (creation_ts)
"users_lower_name" btree (lower(name))
"users_name_key" UNIQUE CONSTRAINT, btree (name)
Referenced by:
TABLE "per_user_experimental_features" CONSTRAINT "per_user_experimental_features_user_id_fkey" FOREIGN KEY (user_id) REFERENCES users(name)
TABLE "users_to_send_full_presence_to" CONSTRAINT "users_to_send_full_presence_to_user_id_fkey" FOREIGN KEY (user_id) REFERENCES users(name)
Lots of other surprisingly nullable fields here, e.g. creation_ts.
_Originally posted by @DMRobertson in https://github.com/matrix-org/synapse/pull/16434#discussion_r1347991716_