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