Files
tenant-registry/migrations/0015_api_keys_scoped.down.sql
T
sharang 97284b5008
ci / shared (push) Successful in 14s
ci / test (push) Successful in 25m3s
ci / image (push) Successful in 39s
feat(api-keys): Scope catalogue, kinds, expiry and sha256 keys (#70)
2026-10-13 21:21:16 +00:00

14 lines
525 B
SQL

-- Keys created with only a sha256 hash cannot be represented before 0015;
-- rolling back drops them (they stop working either way).
DELETE FROM api_keys WHERE hash IS NULL;
DROP INDEX IF EXISTS api_keys_hash_sha256_idx;
ALTER TABLE api_keys
DROP CONSTRAINT IF EXISTS api_keys_holder_kind,
DROP CONSTRAINT IF EXISTS api_keys_hash_present;
ALTER TABLE api_keys ALTER COLUMN hash SET NOT NULL;
ALTER TABLE api_keys
DROP COLUMN hash_sha256,
DROP COLUMN expires_at,
DROP COLUMN holder,
DROP COLUMN kind;