api-key-mgmt-v2/migrations/1686524106-create_api_keys.sql
ndiezel0 6e02444fbd
TD-651: Implement RevokeApiKey (#8)
* 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>
2023-07-21 14:40:50 +03:00

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;