From 11748bb68e7c5b3773c9b6b78d9d074f243be934 Mon Sep 17 00:00:00 2001 From: LandaMm Date: Sun, 25 May 2025 15:38:40 +0200 Subject: [PATCH] feat: api services table migration --- migrations/00004_create_services_table.sql | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 migrations/00004_create_services_table.sql diff --git a/migrations/00004_create_services_table.sql b/migrations/00004_create_services_table.sql new file mode 100644 index 0000000..f5bda20 --- /dev/null +++ b/migrations/00004_create_services_table.sql @@ -0,0 +1,27 @@ +-- +goose Up +-- +goose StatementBegin +CREATE TABLE api_services ( + id UUID PRIMARY KEY DEFAULT gen_random_uuid(), -- Unique identifier + + -- OIDC-required fields + client_id TEXT UNIQUE NOT NULL, + client_secret TEXT NOT NULL, -- Store as hashed value + + -- Metadata + name TEXT NOT NULL, + + redirect_uris TEXT[] DEFAULT '{}', + scopes TEXT[] DEFAULT '{openid}', + grant_types TEXT[] DEFAULT '{authorization_code}', + + created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), + updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), + + is_active BOOLEAN NOT NULL DEFAULT true +); +-- +goose StatementEnd + +-- +goose Down +-- +goose StatementBegin +DROP TABLE api_services; +-- +goose StatementEnd