-- 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;