mirror of
https://github.com/valitydev/api-key-mgmt-v2.git
synced 2024-11-06 02:15:19 +00:00
6e02444fbd
* TD-651: Implement RevokeApiKey * Fix specs and checks * Format * Fix tests * Add revoke * Fix lint * Add test * TD-651: fix formatting * TD-651: fix dialyzer checks * TD-651: fix style * TD-651: fix build * TD-651: fix typo * TD-651: fix formatting * TD-651: implement revoke tokens * TD-651: add party_id checking to sql query * TD-651:fix sql migrations --------- Co-authored-by: anatoliy.losev <losto@nix>
20 lines
480 B
SQL
20 lines
480 B
SQL
-- migrations/1686524106-create_api_keys.sql
|
|
-- :up
|
|
-- Up migration
|
|
CREATE TYPE apikeys_status AS ENUM ('active', 'revoked');
|
|
|
|
CREATE TABLE apikeys (
|
|
id TEXT,
|
|
name TEXT,
|
|
party_id TEXT,
|
|
status apikeys_status,
|
|
revoke_token TEXT,
|
|
metadata TEXT,
|
|
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW()
|
|
);
|
|
-- :down
|
|
-- Down migration
|
|
DROP TABLE apikeys;
|
|
|
|
DROP TYPE apikeys_status;
|