feat: api services table migration
This commit is contained in:
27
migrations/00004_create_services_table.sql
Normal file
27
migrations/00004_create_services_table.sql
Normal file
@ -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
|
Reference in New Issue
Block a user