diff --git a/backend/.sqlc/migrations/20241219000000_add_token_salt_to_users.sql b/backend/.sqlc/migrations/20241219000000_add_token_salt_to_users.sql index 6e754d1e..012f7e25 100644 --- a/backend/.sqlc/migrations/20241219000000_add_token_salt_to_users.sql +++ b/backend/.sqlc/migrations/20241219000000_add_token_salt_to_users.sql @@ -7,8 +7,9 @@ ALTER TABLE users ADD COLUMN token_salt BYTEA; -- backfill existing users with random salt UPDATE users SET token_salt = gen_random_bytes(32); --- make token_salt non-nullable +-- make token_salt non-nullable and unique ALTER TABLE users ALTER COLUMN token_salt SET NOT NULL; +ALTER TABLE users ADD CONSTRAINT users_token_salt_key UNIQUE (token_salt); -- +goose StatementEnd -- +goose Down