perf(struct): ddd
This commit is contained in:
14
scripts/db/migrations/0009_tenant_oauth_clients.sql
Normal file
14
scripts/db/migrations/0009_tenant_oauth_clients.sql
Normal file
@@ -0,0 +1,14 @@
|
||||
BEGIN;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS tenant_oauth_clients (
|
||||
tenant_id UUID NOT NULL REFERENCES tenants(id) ON DELETE CASCADE,
|
||||
client_id VARCHAR(64) NOT NULL REFERENCES oauth_clients(client_id) ON DELETE CASCADE,
|
||||
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
|
||||
PRIMARY KEY (tenant_id, client_id)
|
||||
);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_tenant_oauth_clients_tenant_id ON tenant_oauth_clients(tenant_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_tenant_oauth_clients_client_id ON tenant_oauth_clients(client_id);
|
||||
|
||||
COMMIT;
|
||||
|
||||
Reference in New Issue
Block a user