mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-21 04:50:55 +01:00
bf17b12daf
Summary: Ref T5833. This fixes a few weird things with this table: - A bunch of columns were nullable for no reason. - We stored an MD5 hash of the key (unusual) but never used it and callers were responsible for manually populating it. - We didn't perform known-key-text lookups by using an index. Test Plan: - Ran migrations. - Faked duplicate keys, saw them clean up correctly. - Added new keys. - Generated new keys. - Used `bin/auth-ssh` and `bin/auth-ssh-key`. Reviewers: btrahan Reviewed By: btrahan Subscribers: epriestley Maniphest Tasks: T5833 Differential Revision: https://secure.phabricator.com/D10805
23 lines
775 B
SQL
23 lines
775 B
SQL
UPDATE {$NAMESPACE}_auth.auth_sshkey
|
|
SET name = '' WHERE name IS NULL;
|
|
|
|
ALTER TABLE {$NAMESPACE}_auth.auth_sshkey
|
|
CHANGE name name VARCHAR(255) COLLATE {$COLLATE_TEXT} NOT NULL;
|
|
|
|
UPDATE {$NAMESPACE}_auth.auth_sshkey
|
|
SET keyType = '' WHERE keyType IS NULL;
|
|
|
|
ALTER TABLE {$NAMESPACE}_auth.auth_sshkey
|
|
CHANGE keyType keyType VARCHAR(255) COLLATE {$COLLATE_TEXT} NOT NULL;
|
|
|
|
UPDATE {$NAMESPACE}_auth.auth_sshkey
|
|
SET keyBody = '' WHERE keyBody IS NULL;
|
|
|
|
ALTER TABLE {$NAMESPACE}_auth.auth_sshkey
|
|
CHANGE keyBody keyBody LONGTEXT COLLATE {$COLLATE_TEXT} NOT NULL;
|
|
|
|
UPDATE {$NAMESPACE}_auth.auth_sshkey
|
|
SET keyComment = '' WHERE keyComment IS NULL;
|
|
|
|
ALTER TABLE {$NAMESPACE}_auth.auth_sshkey
|
|
CHANGE keyComment keyComment VARCHAR(255) COLLATE {$COLLATE_TEXT} NOT NULL;
|