apps/train with halkyon_train_server, _client and _flutter, as Todo's: halkyon_base configured by trainBase(), its own register alone and a member of the instance's where the operator names one, the app on halkyon_app's gates with Train's frame, account sheet and About, texts in British English and German that speak of workouts, app.halkyon.train on Android, iOS, Linux, macOS and Windows. Where it differs from Todo: development ports of its own (8180 to 8190), so it runs beside Learn's server; one initial migration with the schema Todo's migrations end at (the same tables, compared line by line), not Todo's seventeen; and Todo's icon as a placeholder until the icon tool of ADR 0031 draws Train's bike. The workspace, the licences, the READMEs and AGENTS.md name it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
1157 lines
33 KiB
PL/PgSQL
1157 lines
33 KiB
PL/PgSQL
BEGIN;
|
|
|
|
--
|
|
-- Function: gen_random_uuid_v7()
|
|
-- Source: https://gist.github.com/kjmph/5bd772b2c2df145aa645b837da7eca74
|
|
-- License: MIT (copyright notice included on the generator source code).
|
|
--
|
|
create or replace function gen_random_uuid_v7()
|
|
returns uuid
|
|
as $$
|
|
begin
|
|
-- use random v4 uuid as starting point (which has the same variant we need)
|
|
-- then overlay timestamp
|
|
-- then set version 7 by flipping the 2 and 1 bit in the version 4 string
|
|
return encode(
|
|
set_bit(
|
|
set_bit(
|
|
overlay(uuid_send(gen_random_uuid())
|
|
placing substring(int8send(floor(extract(epoch from clock_timestamp()) * 1000)::bigint) from 3)
|
|
from 1 for 6
|
|
),
|
|
52, 1
|
|
),
|
|
53, 1
|
|
),
|
|
'hex')::uuid;
|
|
end
|
|
$$
|
|
language plpgsql
|
|
volatile;
|
|
|
|
--
|
|
-- ACTION CREATE TABLE
|
|
--
|
|
CREATE TABLE "account_deletion_notice" (
|
|
"id" bigserial PRIMARY KEY,
|
|
"account" uuid NOT NULL,
|
|
"member" text NOT NULL,
|
|
"createdAt" timestamp without time zone NOT NULL,
|
|
"attempts" bigint NOT NULL,
|
|
"lastAttemptAt" timestamp without time zone
|
|
);
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "account_deletion_notice_idx" ON "account_deletion_notice" USING btree ("account", "member");
|
|
|
|
--
|
|
-- ACTION CREATE TABLE
|
|
--
|
|
CREATE TABLE "account_password" (
|
|
"id" bigserial PRIMARY KEY,
|
|
"authUserId" uuid NOT NULL,
|
|
"salt" bytea NOT NULL,
|
|
"kdfAlgorithm" text NOT NULL,
|
|
"kdfOpsLimit" bigint NOT NULL,
|
|
"kdfMemLimit" bigint NOT NULL,
|
|
"verifier" bytea,
|
|
"passwordProofKey" bytea,
|
|
"encryptionPublicKey" bytea NOT NULL,
|
|
"signingPublicKey" bytea NOT NULL,
|
|
"passwordKeysNonce" bytea NOT NULL,
|
|
"passwordKeysCipherText" bytea NOT NULL,
|
|
"recoveryKeysNonce" bytea NOT NULL,
|
|
"recoveryKeysCipherText" bytea NOT NULL,
|
|
"recoveryProofKey" bytea,
|
|
"sessionEndedForProofsAt" timestamp without time zone,
|
|
"createdAt" timestamp without time zone NOT NULL,
|
|
"updatedAt" timestamp without time zone NOT NULL
|
|
);
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "account_password_person_idx" ON "account_password" USING btree ("authUserId");
|
|
|
|
--
|
|
-- ACTION CREATE TABLE
|
|
--
|
|
CREATE TABLE "account_reset" (
|
|
"id" bigserial PRIMARY KEY,
|
|
"authUserId" uuid NOT NULL,
|
|
"kind" text NOT NULL,
|
|
"takesEffectAt" timestamp without time zone NOT NULL,
|
|
"heldOutUntil" timestamp without time zone,
|
|
"createdAt" timestamp without time zone NOT NULL
|
|
);
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "account_reset_person_kind_idx" ON "account_reset" USING btree ("authUserId", "kind");
|
|
|
|
--
|
|
-- ACTION CREATE TABLE
|
|
--
|
|
CREATE TABLE "assistant_budget" (
|
|
"id" bigserial PRIMARY KEY,
|
|
"authUserId" uuid NOT NULL,
|
|
"dailyCostMicros" bigint,
|
|
"monthlyCostMicros" bigint,
|
|
"dailyTokens" bigint,
|
|
"monthlyTokens" bigint
|
|
);
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "assistant_budget_person_idx" ON "assistant_budget" USING btree ("authUserId");
|
|
|
|
--
|
|
-- ACTION CREATE TABLE
|
|
--
|
|
CREATE TABLE "assistant_figures" (
|
|
"id" bigserial PRIMARY KEY,
|
|
"authUserId" uuid NOT NULL,
|
|
"assistant" text NOT NULL,
|
|
"day" timestamp without time zone NOT NULL,
|
|
"requests" bigint NOT NULL,
|
|
"inputTokens" bigint NOT NULL,
|
|
"outputTokens" bigint NOT NULL,
|
|
"costMicros" bigint NOT NULL
|
|
);
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "assistant_figures_day_idx" ON "assistant_figures" USING btree ("authUserId", "assistant", "day");
|
|
CREATE INDEX "assistant_figures_age_idx" ON "assistant_figures" USING btree ("day");
|
|
|
|
--
|
|
-- ACTION CREATE TABLE
|
|
--
|
|
CREATE TABLE "assistant_grant" (
|
|
"id" bigserial PRIMARY KEY,
|
|
"authUserId" uuid NOT NULL,
|
|
"assistant" text NOT NULL,
|
|
"grantedAt" timestamp without time zone NOT NULL,
|
|
"agreedAt" timestamp without time zone,
|
|
"agreedTo" text
|
|
);
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "assistant_grant_person_idx" ON "assistant_grant" USING btree ("authUserId", "assistant");
|
|
|
|
--
|
|
-- ACTION CREATE TABLE
|
|
--
|
|
CREATE TABLE "email_code_request" (
|
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(),
|
|
"addressHash" text NOT NULL,
|
|
"challengeId" uuid NOT NULL,
|
|
"switchChallengeId" uuid,
|
|
"purpose" text,
|
|
"createdAt" timestamp without time zone NOT NULL
|
|
);
|
|
|
|
-- Indexes
|
|
CREATE INDEX "email_code_request_address_idx" ON "email_code_request" USING btree ("addressHash");
|
|
|
|
--
|
|
-- ACTION CREATE TABLE
|
|
--
|
|
CREATE TABLE "email_identity" (
|
|
"id" bigserial PRIMARY KEY,
|
|
"authUserId" uuid NOT NULL,
|
|
"addressHash" text NOT NULL,
|
|
"createdAt" timestamp without time zone NOT NULL
|
|
);
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "email_identity_person_idx" ON "email_identity" USING btree ("authUserId");
|
|
CREATE UNIQUE INDEX "email_identity_address_idx" ON "email_identity" USING btree ("addressHash");
|
|
|
|
--
|
|
-- ACTION CREATE TABLE
|
|
--
|
|
CREATE TABLE "public_profile" (
|
|
"id" bigserial PRIMARY KEY,
|
|
"authUserId" uuid NOT NULL,
|
|
"handle" text NOT NULL,
|
|
"handleKey" text NOT NULL,
|
|
"displayName" text NOT NULL,
|
|
"bio" text NOT NULL,
|
|
"links" json NOT NULL,
|
|
"verifiedLinks" json,
|
|
"avatarHash" text,
|
|
"firstPublishedAt" timestamp without time zone,
|
|
"updatedAt" timestamp without time zone NOT NULL
|
|
);
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "public_profile_person_idx" ON "public_profile" USING btree ("authUserId");
|
|
CREATE UNIQUE INDEX "public_profile_handle_idx" ON "public_profile" USING btree ("handleKey");
|
|
|
|
--
|
|
-- ACTION CREATE TABLE
|
|
--
|
|
CREATE TABLE "recovery_code" (
|
|
"id" bigserial PRIMARY KEY,
|
|
"authUserId" uuid NOT NULL,
|
|
"hash" text NOT NULL
|
|
);
|
|
|
|
-- Indexes
|
|
CREATE INDEX "recovery_code_person_idx" ON "recovery_code" USING btree ("authUserId");
|
|
|
|
--
|
|
-- ACTION CREATE TABLE
|
|
--
|
|
CREATE TABLE "second_factor_failures" (
|
|
"id" bigserial PRIMARY KEY,
|
|
"authUserId" uuid NOT NULL,
|
|
"path" text NOT NULL DEFAULT 'password'::text,
|
|
"failures" bigint NOT NULL,
|
|
"waits" bigint NOT NULL,
|
|
"waitUntil" timestamp without time zone,
|
|
"updatedAt" timestamp without time zone NOT NULL
|
|
);
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "second_factor_failures_person_idx" ON "second_factor_failures" USING btree ("authUserId", "path");
|
|
|
|
--
|
|
-- ACTION CREATE TABLE
|
|
--
|
|
CREATE TABLE "session_code_failures" (
|
|
"id" bigserial PRIMARY KEY,
|
|
"sessionId" uuid NOT NULL,
|
|
"authUserId" uuid NOT NULL,
|
|
"failures" bigint NOT NULL,
|
|
"updatedAt" timestamp without time zone NOT NULL
|
|
);
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "session_code_failures_session_idx" ON "session_code_failures" USING btree ("sessionId");
|
|
|
|
--
|
|
-- ACTION CREATE TABLE
|
|
--
|
|
CREATE TABLE "sessions_ended_notice" (
|
|
"id" bigserial PRIMARY KEY,
|
|
"account" uuid NOT NULL,
|
|
"member" text NOT NULL,
|
|
"endedBefore" timestamp without time zone NOT NULL,
|
|
"keepSession" uuid,
|
|
"attempts" bigint NOT NULL,
|
|
"lastAttemptAt" timestamp without time zone
|
|
);
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "sessions_ended_notice_idx" ON "sessions_ended_notice" USING btree ("account", "member");
|
|
|
|
--
|
|
-- ACTION CREATE TABLE
|
|
--
|
|
CREATE TABLE "sign_in_challenge" (
|
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(),
|
|
"authUserId" uuid,
|
|
"purpose" text NOT NULL,
|
|
"addressHash" text NOT NULL,
|
|
"secret" text NOT NULL,
|
|
"serverValue" text,
|
|
"createdAt" timestamp without time zone NOT NULL
|
|
);
|
|
|
|
-- Indexes
|
|
CREATE INDEX "sign_in_challenge_created_idx" ON "sign_in_challenge" USING btree ("createdAt");
|
|
|
|
--
|
|
-- ACTION CREATE TABLE
|
|
--
|
|
CREATE TABLE "totp_authenticator" (
|
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(),
|
|
"authUserId" uuid NOT NULL,
|
|
"name" text NOT NULL,
|
|
"secret" bytea NOT NULL,
|
|
"confirmedAt" timestamp without time zone,
|
|
"lastStep" bigint,
|
|
"createdAt" timestamp without time zone NOT NULL
|
|
);
|
|
|
|
-- Indexes
|
|
CREATE INDEX "totp_authenticator_person_idx" ON "totp_authenticator" USING btree ("authUserId");
|
|
|
|
--
|
|
-- ACTION CREATE TABLE
|
|
--
|
|
CREATE TABLE "waiting_account" (
|
|
"id" bigserial PRIMARY KEY,
|
|
"authUserId" uuid NOT NULL,
|
|
"since" timestamp without time zone NOT NULL,
|
|
"words" text NOT NULL,
|
|
"suspendedAt" timestamp without time zone
|
|
);
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "waiting_account_person_idx" ON "waiting_account" USING btree ("authUserId");
|
|
|
|
--
|
|
-- ACTION CREATE TABLE
|
|
--
|
|
CREATE TABLE "waiting_pass" (
|
|
"id" bigserial PRIMARY KEY,
|
|
"authUserId" uuid NOT NULL,
|
|
"passHash" text NOT NULL,
|
|
"madeAt" timestamp without time zone NOT NULL
|
|
);
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "waiting_pass_hash_idx" ON "waiting_pass" USING btree ("passHash");
|
|
CREATE INDEX "waiting_pass_person_idx" ON "waiting_pass" USING btree ("authUserId");
|
|
|
|
--
|
|
-- ACTION CREATE TABLE
|
|
--
|
|
CREATE TABLE "serverpod_cloud_storage" (
|
|
"id" bigserial PRIMARY KEY,
|
|
"storageId" text NOT NULL,
|
|
"path" text NOT NULL,
|
|
"addedTime" timestamp without time zone NOT NULL,
|
|
"expiration" timestamp without time zone,
|
|
"byteData" bytea NOT NULL,
|
|
"verified" boolean NOT NULL,
|
|
"contentType" text,
|
|
"cacheControl" text,
|
|
"contentDisposition" text,
|
|
"contentEncoding" text,
|
|
"customMetadata" text
|
|
);
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "serverpod_cloud_storage_path_idx" ON "serverpod_cloud_storage" USING btree ("storageId", "path");
|
|
CREATE INDEX "serverpod_cloud_storage_expiration" ON "serverpod_cloud_storage" USING btree ("expiration");
|
|
|
|
--
|
|
-- ACTION CREATE TABLE
|
|
--
|
|
CREATE TABLE "serverpod_cloud_storage_direct_download" (
|
|
"id" bigserial PRIMARY KEY,
|
|
"storageId" text NOT NULL,
|
|
"path" text NOT NULL,
|
|
"expiration" timestamp without time zone NOT NULL,
|
|
"authKey" text NOT NULL,
|
|
"downloadFileName" text,
|
|
"contentType" text
|
|
);
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "serverpod_cloud_storage_direct_download_auth_key" ON "serverpod_cloud_storage_direct_download" USING btree ("authKey");
|
|
CREATE INDEX "serverpod_cloud_storage_direct_download_expiration" ON "serverpod_cloud_storage_direct_download" USING btree ("expiration");
|
|
|
|
--
|
|
-- ACTION CREATE TABLE
|
|
--
|
|
CREATE TABLE "serverpod_cloud_storage_direct_upload" (
|
|
"id" bigserial PRIMARY KEY,
|
|
"storageId" text NOT NULL,
|
|
"path" text NOT NULL,
|
|
"expiration" timestamp without time zone NOT NULL,
|
|
"authKey" text NOT NULL,
|
|
"maxFileSize" bigint NOT NULL DEFAULT 10485760,
|
|
"contentLength" bigint,
|
|
"preventOverwrite" boolean NOT NULL DEFAULT false,
|
|
"contentType" text,
|
|
"cacheControl" text,
|
|
"contentDisposition" text,
|
|
"contentEncoding" text,
|
|
"customMetadata" text
|
|
);
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "serverpod_cloud_storage_direct_upload_storage_path" ON "serverpod_cloud_storage_direct_upload" USING btree ("storageId", "path");
|
|
|
|
--
|
|
-- ACTION CREATE TABLE
|
|
--
|
|
CREATE TABLE "serverpod_future_call" (
|
|
"id" bigserial PRIMARY KEY,
|
|
"name" text NOT NULL,
|
|
"time" timestamp without time zone NOT NULL,
|
|
"serializedObject" text,
|
|
"serverId" text NOT NULL,
|
|
"identifier" text,
|
|
"scheduling" json
|
|
);
|
|
|
|
-- Indexes
|
|
CREATE INDEX "serverpod_future_call_time_idx" ON "serverpod_future_call" USING btree ("time");
|
|
CREATE INDEX "serverpod_future_call_serverId_idx" ON "serverpod_future_call" USING btree ("serverId");
|
|
CREATE INDEX "serverpod_future_call_identifier_idx" ON "serverpod_future_call" USING btree ("identifier");
|
|
|
|
--
|
|
-- ACTION CREATE TABLE
|
|
--
|
|
CREATE TABLE "serverpod_future_call_claim" (
|
|
"id" bigserial PRIMARY KEY,
|
|
"futureCallId" bigint,
|
|
"lastHeartbeatTime" timestamp without time zone NOT NULL
|
|
);
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "future_call_unique_idx" ON "serverpod_future_call_claim" USING btree ("futureCallId");
|
|
|
|
--
|
|
-- ACTION CREATE TABLE
|
|
--
|
|
CREATE TABLE "serverpod_health_connection_info" (
|
|
"id" bigserial PRIMARY KEY,
|
|
"serverId" text NOT NULL,
|
|
"timestamp" timestamp without time zone NOT NULL,
|
|
"active" bigint NOT NULL,
|
|
"closing" bigint NOT NULL,
|
|
"idle" bigint NOT NULL,
|
|
"granularity" bigint NOT NULL
|
|
);
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "serverpod_health_connection_info_timestamp_idx" ON "serverpod_health_connection_info" USING btree ("timestamp", "serverId", "granularity");
|
|
|
|
--
|
|
-- ACTION CREATE TABLE
|
|
--
|
|
CREATE TABLE "serverpod_health_metric" (
|
|
"id" bigserial PRIMARY KEY,
|
|
"name" text NOT NULL,
|
|
"serverId" text NOT NULL,
|
|
"timestamp" timestamp without time zone NOT NULL,
|
|
"isHealthy" boolean NOT NULL,
|
|
"value" double precision NOT NULL,
|
|
"granularity" bigint NOT NULL
|
|
);
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "serverpod_health_metric_timestamp_idx" ON "serverpod_health_metric" USING btree ("timestamp", "serverId", "name", "granularity");
|
|
|
|
--
|
|
-- ACTION CREATE TABLE
|
|
--
|
|
CREATE TABLE "serverpod_log" (
|
|
"id" bigserial PRIMARY KEY,
|
|
"sessionLogId" bigint NOT NULL,
|
|
"messageId" bigint,
|
|
"reference" text,
|
|
"serverId" text NOT NULL,
|
|
"time" timestamp without time zone NOT NULL,
|
|
"logLevel" bigint NOT NULL,
|
|
"message" text NOT NULL,
|
|
"error" text,
|
|
"stackTrace" text,
|
|
"order" bigint NOT NULL
|
|
);
|
|
|
|
-- Indexes
|
|
CREATE INDEX "serverpod_log_sessionLogId_idx" ON "serverpod_log" USING btree ("sessionLogId", "order");
|
|
|
|
--
|
|
-- ACTION CREATE TABLE
|
|
--
|
|
CREATE TABLE "serverpod_message_log" (
|
|
"id" bigserial PRIMARY KEY,
|
|
"sessionLogId" bigint NOT NULL,
|
|
"serverId" text NOT NULL,
|
|
"messageId" bigint NOT NULL,
|
|
"endpoint" text NOT NULL,
|
|
"messageName" text NOT NULL,
|
|
"duration" double precision NOT NULL,
|
|
"error" text,
|
|
"stackTrace" text,
|
|
"slow" boolean NOT NULL,
|
|
"order" bigint NOT NULL
|
|
);
|
|
|
|
-- Indexes
|
|
CREATE INDEX "serverpod_message_log_sessionLogId_idx" ON "serverpod_message_log" USING btree ("sessionLogId", "order");
|
|
|
|
--
|
|
-- ACTION CREATE TABLE
|
|
--
|
|
CREATE TABLE "serverpod_method" (
|
|
"id" bigserial PRIMARY KEY,
|
|
"endpoint" text NOT NULL,
|
|
"method" text NOT NULL
|
|
);
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "serverpod_method_endpoint_method_idx" ON "serverpod_method" USING btree ("endpoint", "method");
|
|
|
|
--
|
|
-- ACTION CREATE TABLE
|
|
--
|
|
CREATE TABLE "serverpod_migrations" (
|
|
"id" bigserial PRIMARY KEY,
|
|
"module" text NOT NULL,
|
|
"version" text NOT NULL,
|
|
"timestamp" timestamp without time zone
|
|
);
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "serverpod_migrations_ids" ON "serverpod_migrations" USING btree ("module");
|
|
|
|
--
|
|
-- ACTION CREATE TABLE
|
|
--
|
|
CREATE TABLE "serverpod_query_log" (
|
|
"id" bigserial PRIMARY KEY,
|
|
"serverId" text NOT NULL,
|
|
"sessionLogId" bigint NOT NULL,
|
|
"messageId" bigint,
|
|
"query" text NOT NULL,
|
|
"duration" double precision NOT NULL,
|
|
"numRows" bigint,
|
|
"error" text,
|
|
"stackTrace" text,
|
|
"slow" boolean NOT NULL,
|
|
"order" bigint NOT NULL
|
|
);
|
|
|
|
-- Indexes
|
|
CREATE INDEX "serverpod_query_log_sessionLogId_idx" ON "serverpod_query_log" USING btree ("sessionLogId", "order");
|
|
|
|
--
|
|
-- ACTION CREATE TABLE
|
|
--
|
|
CREATE TABLE "serverpod_readwrite_test" (
|
|
"id" bigserial PRIMARY KEY,
|
|
"number" bigint NOT NULL
|
|
);
|
|
|
|
--
|
|
-- ACTION CREATE TABLE
|
|
--
|
|
CREATE TABLE "serverpod_runtime_settings" (
|
|
"id" bigserial PRIMARY KEY,
|
|
"logSettings" json NOT NULL,
|
|
"logSettingsOverrides" json NOT NULL,
|
|
"logServiceCalls" boolean NOT NULL,
|
|
"logMalformedCalls" boolean NOT NULL
|
|
);
|
|
|
|
--
|
|
-- ACTION CREATE TABLE
|
|
--
|
|
CREATE TABLE "serverpod_session_log" (
|
|
"id" bigserial PRIMARY KEY,
|
|
"serverId" text NOT NULL,
|
|
"time" timestamp without time zone NOT NULL,
|
|
"module" text,
|
|
"endpoint" text,
|
|
"method" text,
|
|
"duration" double precision,
|
|
"numQueries" bigint,
|
|
"slow" boolean,
|
|
"error" text,
|
|
"stackTrace" text,
|
|
"authenticatedUserId" bigint,
|
|
"userId" text,
|
|
"isOpen" boolean,
|
|
"touched" timestamp without time zone NOT NULL
|
|
);
|
|
|
|
-- Indexes
|
|
CREATE INDEX "serverpod_session_log_serverid_idx" ON "serverpod_session_log" USING btree ("serverId");
|
|
CREATE INDEX "serverpod_session_log_time_idx" ON "serverpod_session_log" USING btree ("time");
|
|
CREATE INDEX "serverpod_session_log_touched_idx" ON "serverpod_session_log" USING btree ("touched");
|
|
CREATE INDEX "serverpod_session_log_isopen_idx" ON "serverpod_session_log" USING btree ("isOpen");
|
|
|
|
--
|
|
-- ACTION CREATE TABLE
|
|
--
|
|
CREATE TABLE "serverpod_auth_idp_anonymous_account" (
|
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(),
|
|
"authUserId" uuid NOT NULL,
|
|
"createdAt" timestamp without time zone NOT NULL
|
|
);
|
|
|
|
--
|
|
-- ACTION CREATE TABLE
|
|
--
|
|
CREATE TABLE "serverpod_auth_idp_apple_account" (
|
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(),
|
|
"userIdentifier" text NOT NULL,
|
|
"refreshToken" text NOT NULL,
|
|
"refreshTokenRequestedWithBundleIdentifier" boolean NOT NULL,
|
|
"lastRefreshedAt" timestamp without time zone NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
"authUserId" uuid NOT NULL,
|
|
"createdAt" timestamp without time zone NOT NULL,
|
|
"email" text,
|
|
"isEmailVerified" boolean,
|
|
"isPrivateEmail" boolean,
|
|
"firstName" text,
|
|
"lastName" text
|
|
);
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "serverpod_auth_apple_account_identifier" ON "serverpod_auth_idp_apple_account" USING btree ("userIdentifier");
|
|
|
|
--
|
|
-- ACTION CREATE TABLE
|
|
--
|
|
CREATE TABLE "serverpod_auth_idp_email_account" (
|
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(),
|
|
"authUserId" uuid NOT NULL,
|
|
"createdAt" timestamp without time zone NOT NULL,
|
|
"email" text NOT NULL,
|
|
"passwordHash" text NOT NULL
|
|
);
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "serverpod_auth_idp_email_account_email" ON "serverpod_auth_idp_email_account" USING btree ("email");
|
|
|
|
--
|
|
-- ACTION CREATE TABLE
|
|
--
|
|
CREATE TABLE "serverpod_auth_idp_email_account_password_reset_request" (
|
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(),
|
|
"emailAccountId" uuid NOT NULL,
|
|
"createdAt" timestamp without time zone NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
"challengeId" uuid NOT NULL,
|
|
"setPasswordChallengeId" uuid
|
|
);
|
|
|
|
--
|
|
-- ACTION CREATE TABLE
|
|
--
|
|
CREATE TABLE "serverpod_auth_idp_email_account_request" (
|
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(),
|
|
"createdAt" timestamp without time zone NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
"email" text NOT NULL,
|
|
"challengeId" uuid NOT NULL,
|
|
"createAccountChallengeId" uuid
|
|
);
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "serverpod_auth_idp_email_account_request_email" ON "serverpod_auth_idp_email_account_request" USING btree ("email");
|
|
|
|
--
|
|
-- ACTION CREATE TABLE
|
|
--
|
|
CREATE TABLE "serverpod_auth_idp_facebook_account" (
|
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(),
|
|
"authUserId" uuid NOT NULL,
|
|
"createdAt" timestamp without time zone NOT NULL,
|
|
"userIdentifier" text NOT NULL,
|
|
"email" text,
|
|
"fullName" text,
|
|
"firstName" text,
|
|
"lastName" text
|
|
);
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "serverpod_auth_facebook_account_user_identifier" ON "serverpod_auth_idp_facebook_account" USING btree ("userIdentifier");
|
|
|
|
--
|
|
-- ACTION CREATE TABLE
|
|
--
|
|
CREATE TABLE "serverpod_auth_idp_firebase_account" (
|
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(),
|
|
"authUserId" uuid NOT NULL,
|
|
"created" timestamp without time zone NOT NULL,
|
|
"email" text,
|
|
"phone" text,
|
|
"userIdentifier" text NOT NULL
|
|
);
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "serverpod_auth_firebase_account_user_identifier" ON "serverpod_auth_idp_firebase_account" USING btree ("userIdentifier");
|
|
|
|
--
|
|
-- ACTION CREATE TABLE
|
|
--
|
|
CREATE TABLE "serverpod_auth_idp_github_account" (
|
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(),
|
|
"authUserId" uuid NOT NULL,
|
|
"userIdentifier" text NOT NULL,
|
|
"email" text,
|
|
"created" timestamp without time zone NOT NULL
|
|
);
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "serverpod_auth_github_account_user_identifier" ON "serverpod_auth_idp_github_account" USING btree ("userIdentifier");
|
|
|
|
--
|
|
-- ACTION CREATE TABLE
|
|
--
|
|
CREATE TABLE "serverpod_auth_idp_google_account" (
|
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(),
|
|
"authUserId" uuid NOT NULL,
|
|
"created" timestamp without time zone NOT NULL,
|
|
"email" text NOT NULL,
|
|
"userIdentifier" text NOT NULL
|
|
);
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "serverpod_auth_google_account_user_identifier" ON "serverpod_auth_idp_google_account" USING btree ("userIdentifier");
|
|
|
|
--
|
|
-- ACTION CREATE TABLE
|
|
--
|
|
CREATE TABLE "serverpod_auth_idp_microsoft_account" (
|
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(),
|
|
"authUserId" uuid NOT NULL,
|
|
"userIdentifier" text NOT NULL,
|
|
"email" text,
|
|
"created" timestamp without time zone NOT NULL
|
|
);
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "serverpod_auth_microsoft_account_user_identifier" ON "serverpod_auth_idp_microsoft_account" USING btree ("userIdentifier");
|
|
|
|
--
|
|
-- ACTION CREATE TABLE
|
|
--
|
|
CREATE TABLE "serverpod_auth_idp_passkey_account" (
|
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(),
|
|
"authUserId" uuid NOT NULL,
|
|
"createdAt" timestamp without time zone NOT NULL,
|
|
"keyId" bytea NOT NULL,
|
|
"keyIdBase64" text NOT NULL,
|
|
"clientDataJSON" bytea NOT NULL,
|
|
"attestationObject" bytea NOT NULL,
|
|
"originalChallenge" bytea NOT NULL
|
|
);
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "serverpod_auth_idp_passkey_account_key_id_base64" ON "serverpod_auth_idp_passkey_account" USING btree ("keyIdBase64");
|
|
|
|
--
|
|
-- ACTION CREATE TABLE
|
|
--
|
|
CREATE TABLE "serverpod_auth_idp_passkey_challenge" (
|
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(),
|
|
"createdAt" timestamp without time zone NOT NULL,
|
|
"challenge" bytea NOT NULL
|
|
);
|
|
|
|
--
|
|
-- ACTION CREATE TABLE
|
|
--
|
|
CREATE TABLE "serverpod_auth_idp_rate_limited_request_attempt" (
|
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(),
|
|
"domain" text NOT NULL,
|
|
"source" text NOT NULL,
|
|
"key" text NOT NULL,
|
|
"ipAddress" text,
|
|
"attemptedAt" timestamp without time zone NOT NULL,
|
|
"extraData" json
|
|
);
|
|
|
|
-- Indexes
|
|
CREATE INDEX "serverpod_auth_idp_rate_limited_request_attempt_composite" ON "serverpod_auth_idp_rate_limited_request_attempt" USING btree ("domain", "source", "key", "attemptedAt");
|
|
|
|
--
|
|
-- ACTION CREATE TABLE
|
|
--
|
|
CREATE TABLE "serverpod_auth_idp_secret_challenge" (
|
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(),
|
|
"challengeCodeHash" text NOT NULL
|
|
);
|
|
|
|
--
|
|
-- ACTION CREATE TABLE
|
|
--
|
|
CREATE TABLE "halkyon_oidc_attempt" (
|
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
"provider" text NOT NULL,
|
|
"state" text NOT NULL,
|
|
"nonce" text NOT NULL,
|
|
"codeVerifier" text,
|
|
"callerId" uuid,
|
|
"subject" text,
|
|
"expiresAt" timestamp without time zone NOT NULL
|
|
);
|
|
|
|
-- Indexes
|
|
CREATE INDEX "halkyon_oidc_attempt_expires_idx" ON "halkyon_oidc_attempt" USING btree ("expiresAt");
|
|
|
|
--
|
|
-- ACTION CREATE TABLE
|
|
--
|
|
CREATE TABLE "halkyon_oidc_identity" (
|
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(),
|
|
"authUserId" uuid NOT NULL,
|
|
"provider" text NOT NULL,
|
|
"subject" text NOT NULL,
|
|
"createdAt" timestamp without time zone NOT NULL
|
|
);
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "halkyon_oidc_identity_subject_idx" ON "halkyon_oidc_identity" USING btree ("provider", "subject");
|
|
CREATE UNIQUE INDEX "halkyon_oidc_identity_person_idx" ON "halkyon_oidc_identity" USING btree ("authUserId", "provider");
|
|
|
|
--
|
|
-- ACTION CREATE TABLE
|
|
--
|
|
CREATE TABLE "serverpod_auth_core_jwt_refresh_token" (
|
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(),
|
|
"authUserId" uuid NOT NULL,
|
|
"scopeNames" json NOT NULL,
|
|
"extraClaims" text,
|
|
"method" text NOT NULL,
|
|
"fixedSecret" bytea NOT NULL,
|
|
"rotatingSecretHash" text NOT NULL,
|
|
"lastUpdatedAt" timestamp without time zone NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
"createdAt" timestamp without time zone NOT NULL DEFAULT CURRENT_TIMESTAMP
|
|
);
|
|
|
|
-- Indexes
|
|
CREATE INDEX "serverpod_auth_core_jwt_refresh_token_last_updated_at" ON "serverpod_auth_core_jwt_refresh_token" USING btree ("lastUpdatedAt");
|
|
|
|
--
|
|
-- ACTION CREATE TABLE
|
|
--
|
|
CREATE TABLE "serverpod_auth_core_profile" (
|
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(),
|
|
"authUserId" uuid NOT NULL,
|
|
"userName" text,
|
|
"fullName" text,
|
|
"email" text,
|
|
"createdAt" timestamp without time zone NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
"imageId" uuid
|
|
);
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "serverpod_auth_profile_user_profile_email_auth_user_id" ON "serverpod_auth_core_profile" USING btree ("authUserId");
|
|
|
|
--
|
|
-- ACTION CREATE TABLE
|
|
--
|
|
CREATE TABLE "serverpod_auth_core_profile_image" (
|
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(),
|
|
"userProfileId" uuid NOT NULL,
|
|
"createdAt" timestamp without time zone NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
"storageId" text NOT NULL,
|
|
"path" text NOT NULL,
|
|
"url" text NOT NULL
|
|
);
|
|
|
|
--
|
|
-- ACTION CREATE TABLE
|
|
--
|
|
CREATE TABLE "serverpod_auth_core_session" (
|
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(),
|
|
"authUserId" uuid NOT NULL,
|
|
"scopeNames" json NOT NULL,
|
|
"createdAt" timestamp without time zone NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
"lastUsedAt" timestamp without time zone NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
"expiresAt" timestamp without time zone,
|
|
"expireAfterUnusedFor" bigint,
|
|
"sessionKeyHash" bytea NOT NULL,
|
|
"sessionKeySalt" bytea NOT NULL,
|
|
"method" text NOT NULL
|
|
);
|
|
|
|
--
|
|
-- ACTION CREATE TABLE
|
|
--
|
|
CREATE TABLE "serverpod_auth_core_user" (
|
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(),
|
|
"createdAt" timestamp without time zone NOT NULL,
|
|
"scopeNames" json NOT NULL,
|
|
"blocked" boolean NOT NULL
|
|
);
|
|
|
|
--
|
|
-- ACTION CREATE FOREIGN KEY
|
|
--
|
|
ALTER TABLE ONLY "email_code_request"
|
|
ADD CONSTRAINT "email_code_request_fk_0"
|
|
FOREIGN KEY("challengeId")
|
|
REFERENCES "serverpod_auth_idp_secret_challenge"("id")
|
|
ON DELETE CASCADE
|
|
ON UPDATE NO ACTION;
|
|
ALTER TABLE ONLY "email_code_request"
|
|
ADD CONSTRAINT "email_code_request_fk_1"
|
|
FOREIGN KEY("switchChallengeId")
|
|
REFERENCES "serverpod_auth_idp_secret_challenge"("id")
|
|
ON DELETE CASCADE
|
|
ON UPDATE NO ACTION;
|
|
|
|
--
|
|
-- ACTION CREATE FOREIGN KEY
|
|
--
|
|
ALTER TABLE ONLY "serverpod_future_call_claim"
|
|
ADD CONSTRAINT "serverpod_future_call_claim_fk_0"
|
|
FOREIGN KEY("futureCallId")
|
|
REFERENCES "serverpod_future_call"("id")
|
|
ON DELETE CASCADE
|
|
ON UPDATE NO ACTION;
|
|
|
|
--
|
|
-- ACTION CREATE FOREIGN KEY
|
|
--
|
|
ALTER TABLE ONLY "serverpod_log"
|
|
ADD CONSTRAINT "serverpod_log_fk_0"
|
|
FOREIGN KEY("sessionLogId")
|
|
REFERENCES "serverpod_session_log"("id")
|
|
ON DELETE CASCADE
|
|
ON UPDATE NO ACTION;
|
|
|
|
--
|
|
-- ACTION CREATE FOREIGN KEY
|
|
--
|
|
ALTER TABLE ONLY "serverpod_message_log"
|
|
ADD CONSTRAINT "serverpod_message_log_fk_0"
|
|
FOREIGN KEY("sessionLogId")
|
|
REFERENCES "serverpod_session_log"("id")
|
|
ON DELETE CASCADE
|
|
ON UPDATE NO ACTION;
|
|
|
|
--
|
|
-- ACTION CREATE FOREIGN KEY
|
|
--
|
|
ALTER TABLE ONLY "serverpod_query_log"
|
|
ADD CONSTRAINT "serverpod_query_log_fk_0"
|
|
FOREIGN KEY("sessionLogId")
|
|
REFERENCES "serverpod_session_log"("id")
|
|
ON DELETE CASCADE
|
|
ON UPDATE NO ACTION;
|
|
|
|
--
|
|
-- ACTION CREATE FOREIGN KEY
|
|
--
|
|
ALTER TABLE ONLY "serverpod_auth_idp_anonymous_account"
|
|
ADD CONSTRAINT "serverpod_auth_idp_anonymous_account_fk_0"
|
|
FOREIGN KEY("authUserId")
|
|
REFERENCES "serverpod_auth_core_user"("id")
|
|
ON DELETE CASCADE
|
|
ON UPDATE NO ACTION;
|
|
|
|
--
|
|
-- ACTION CREATE FOREIGN KEY
|
|
--
|
|
ALTER TABLE ONLY "serverpod_auth_idp_apple_account"
|
|
ADD CONSTRAINT "serverpod_auth_idp_apple_account_fk_0"
|
|
FOREIGN KEY("authUserId")
|
|
REFERENCES "serverpod_auth_core_user"("id")
|
|
ON DELETE CASCADE
|
|
ON UPDATE NO ACTION;
|
|
|
|
--
|
|
-- ACTION CREATE FOREIGN KEY
|
|
--
|
|
ALTER TABLE ONLY "serverpod_auth_idp_email_account"
|
|
ADD CONSTRAINT "serverpod_auth_idp_email_account_fk_0"
|
|
FOREIGN KEY("authUserId")
|
|
REFERENCES "serverpod_auth_core_user"("id")
|
|
ON DELETE CASCADE
|
|
ON UPDATE NO ACTION;
|
|
|
|
--
|
|
-- ACTION CREATE FOREIGN KEY
|
|
--
|
|
ALTER TABLE ONLY "serverpod_auth_idp_email_account_password_reset_request"
|
|
ADD CONSTRAINT "serverpod_auth_idp_email_account_password_reset_request_fk_0"
|
|
FOREIGN KEY("emailAccountId")
|
|
REFERENCES "serverpod_auth_idp_email_account"("id")
|
|
ON DELETE CASCADE
|
|
ON UPDATE NO ACTION;
|
|
ALTER TABLE ONLY "serverpod_auth_idp_email_account_password_reset_request"
|
|
ADD CONSTRAINT "serverpod_auth_idp_email_account_password_reset_request_fk_1"
|
|
FOREIGN KEY("challengeId")
|
|
REFERENCES "serverpod_auth_idp_secret_challenge"("id")
|
|
ON DELETE CASCADE
|
|
ON UPDATE NO ACTION;
|
|
ALTER TABLE ONLY "serverpod_auth_idp_email_account_password_reset_request"
|
|
ADD CONSTRAINT "serverpod_auth_idp_email_account_password_reset_request_fk_2"
|
|
FOREIGN KEY("setPasswordChallengeId")
|
|
REFERENCES "serverpod_auth_idp_secret_challenge"("id")
|
|
ON DELETE CASCADE
|
|
ON UPDATE NO ACTION;
|
|
|
|
--
|
|
-- ACTION CREATE FOREIGN KEY
|
|
--
|
|
ALTER TABLE ONLY "serverpod_auth_idp_email_account_request"
|
|
ADD CONSTRAINT "serverpod_auth_idp_email_account_request_fk_0"
|
|
FOREIGN KEY("challengeId")
|
|
REFERENCES "serverpod_auth_idp_secret_challenge"("id")
|
|
ON DELETE CASCADE
|
|
ON UPDATE NO ACTION;
|
|
ALTER TABLE ONLY "serverpod_auth_idp_email_account_request"
|
|
ADD CONSTRAINT "serverpod_auth_idp_email_account_request_fk_1"
|
|
FOREIGN KEY("createAccountChallengeId")
|
|
REFERENCES "serverpod_auth_idp_secret_challenge"("id")
|
|
ON DELETE CASCADE
|
|
ON UPDATE NO ACTION;
|
|
|
|
--
|
|
-- ACTION CREATE FOREIGN KEY
|
|
--
|
|
ALTER TABLE ONLY "serverpod_auth_idp_facebook_account"
|
|
ADD CONSTRAINT "serverpod_auth_idp_facebook_account_fk_0"
|
|
FOREIGN KEY("authUserId")
|
|
REFERENCES "serverpod_auth_core_user"("id")
|
|
ON DELETE CASCADE
|
|
ON UPDATE NO ACTION;
|
|
|
|
--
|
|
-- ACTION CREATE FOREIGN KEY
|
|
--
|
|
ALTER TABLE ONLY "serverpod_auth_idp_firebase_account"
|
|
ADD CONSTRAINT "serverpod_auth_idp_firebase_account_fk_0"
|
|
FOREIGN KEY("authUserId")
|
|
REFERENCES "serverpod_auth_core_user"("id")
|
|
ON DELETE CASCADE
|
|
ON UPDATE NO ACTION;
|
|
|
|
--
|
|
-- ACTION CREATE FOREIGN KEY
|
|
--
|
|
ALTER TABLE ONLY "serverpod_auth_idp_github_account"
|
|
ADD CONSTRAINT "serverpod_auth_idp_github_account_fk_0"
|
|
FOREIGN KEY("authUserId")
|
|
REFERENCES "serverpod_auth_core_user"("id")
|
|
ON DELETE CASCADE
|
|
ON UPDATE NO ACTION;
|
|
|
|
--
|
|
-- ACTION CREATE FOREIGN KEY
|
|
--
|
|
ALTER TABLE ONLY "serverpod_auth_idp_google_account"
|
|
ADD CONSTRAINT "serverpod_auth_idp_google_account_fk_0"
|
|
FOREIGN KEY("authUserId")
|
|
REFERENCES "serverpod_auth_core_user"("id")
|
|
ON DELETE CASCADE
|
|
ON UPDATE NO ACTION;
|
|
|
|
--
|
|
-- ACTION CREATE FOREIGN KEY
|
|
--
|
|
ALTER TABLE ONLY "serverpod_auth_idp_microsoft_account"
|
|
ADD CONSTRAINT "serverpod_auth_idp_microsoft_account_fk_0"
|
|
FOREIGN KEY("authUserId")
|
|
REFERENCES "serverpod_auth_core_user"("id")
|
|
ON DELETE CASCADE
|
|
ON UPDATE NO ACTION;
|
|
|
|
--
|
|
-- ACTION CREATE FOREIGN KEY
|
|
--
|
|
ALTER TABLE ONLY "serverpod_auth_idp_passkey_account"
|
|
ADD CONSTRAINT "serverpod_auth_idp_passkey_account_fk_0"
|
|
FOREIGN KEY("authUserId")
|
|
REFERENCES "serverpod_auth_core_user"("id")
|
|
ON DELETE CASCADE
|
|
ON UPDATE NO ACTION;
|
|
|
|
--
|
|
-- ACTION CREATE FOREIGN KEY
|
|
--
|
|
ALTER TABLE ONLY "halkyon_oidc_attempt"
|
|
ADD CONSTRAINT "halkyon_oidc_attempt_fk_0"
|
|
FOREIGN KEY("callerId")
|
|
REFERENCES "serverpod_auth_core_user"("id")
|
|
ON DELETE CASCADE
|
|
ON UPDATE NO ACTION;
|
|
|
|
--
|
|
-- ACTION CREATE FOREIGN KEY
|
|
--
|
|
ALTER TABLE ONLY "halkyon_oidc_identity"
|
|
ADD CONSTRAINT "halkyon_oidc_identity_fk_0"
|
|
FOREIGN KEY("authUserId")
|
|
REFERENCES "serverpod_auth_core_user"("id")
|
|
ON DELETE CASCADE
|
|
ON UPDATE NO ACTION;
|
|
|
|
--
|
|
-- ACTION CREATE FOREIGN KEY
|
|
--
|
|
ALTER TABLE ONLY "serverpod_auth_core_jwt_refresh_token"
|
|
ADD CONSTRAINT "serverpod_auth_core_jwt_refresh_token_fk_0"
|
|
FOREIGN KEY("authUserId")
|
|
REFERENCES "serverpod_auth_core_user"("id")
|
|
ON DELETE CASCADE
|
|
ON UPDATE NO ACTION;
|
|
|
|
--
|
|
-- ACTION CREATE FOREIGN KEY
|
|
--
|
|
ALTER TABLE ONLY "serverpod_auth_core_profile"
|
|
ADD CONSTRAINT "serverpod_auth_core_profile_fk_0"
|
|
FOREIGN KEY("authUserId")
|
|
REFERENCES "serverpod_auth_core_user"("id")
|
|
ON DELETE CASCADE
|
|
ON UPDATE NO ACTION;
|
|
ALTER TABLE ONLY "serverpod_auth_core_profile"
|
|
ADD CONSTRAINT "serverpod_auth_core_profile_fk_1"
|
|
FOREIGN KEY("imageId")
|
|
REFERENCES "serverpod_auth_core_profile_image"("id")
|
|
ON DELETE NO ACTION
|
|
ON UPDATE NO ACTION
|
|
DEFERRABLE INITIALLY DEFERRED;
|
|
|
|
--
|
|
-- ACTION CREATE FOREIGN KEY
|
|
--
|
|
ALTER TABLE ONLY "serverpod_auth_core_profile_image"
|
|
ADD CONSTRAINT "serverpod_auth_core_profile_image_fk_0"
|
|
FOREIGN KEY("userProfileId")
|
|
REFERENCES "serverpod_auth_core_profile"("id")
|
|
ON DELETE CASCADE
|
|
ON UPDATE NO ACTION;
|
|
|
|
--
|
|
-- ACTION CREATE FOREIGN KEY
|
|
--
|
|
ALTER TABLE ONLY "serverpod_auth_core_session"
|
|
ADD CONSTRAINT "serverpod_auth_core_session_fk_0"
|
|
FOREIGN KEY("authUserId")
|
|
REFERENCES "serverpod_auth_core_user"("id")
|
|
ON DELETE CASCADE
|
|
ON UPDATE NO ACTION;
|
|
|
|
|
|
--
|
|
-- MIGRATION VERSION FOR halkyon_train
|
|
--
|
|
INSERT INTO "serverpod_migrations" ("module", "version", "timestamp")
|
|
VALUES ('halkyon_train', '20261028075229917-initial', now())
|
|
ON CONFLICT ("module")
|
|
DO UPDATE SET "version" = '20261028075229917-initial', "timestamp" = now();
|
|
|
|
--
|
|
-- MIGRATION VERSION FOR halkyon_base
|
|
--
|
|
INSERT INTO "serverpod_migrations" ("module", "version", "timestamp")
|
|
VALUES ('halkyon_base', '20261026140329453-assistant-budgets', now())
|
|
ON CONFLICT ("module")
|
|
DO UPDATE SET "version" = '20261026140329453-assistant-budgets', "timestamp" = now();
|
|
|
|
--
|
|
-- MIGRATION VERSION FOR serverpod
|
|
--
|
|
INSERT INTO "serverpod_migrations" ("module", "version", "timestamp")
|
|
VALUES ('serverpod', '20260824182259319', now())
|
|
ON CONFLICT ("module")
|
|
DO UPDATE SET "version" = '20260824182259319', "timestamp" = now();
|
|
|
|
--
|
|
-- MIGRATION VERSION FOR serverpod_auth_idp
|
|
--
|
|
INSERT INTO "serverpod_migrations" ("module", "version", "timestamp")
|
|
VALUES ('serverpod_auth_idp', '20260924105404509', now())
|
|
ON CONFLICT ("module")
|
|
DO UPDATE SET "version" = '20260924105404509', "timestamp" = now();
|
|
|
|
--
|
|
-- MIGRATION VERSION FOR halkyon_oidc
|
|
--
|
|
INSERT INTO "serverpod_migrations" ("module", "version", "timestamp")
|
|
VALUES ('halkyon_oidc', '20261023180644988', now())
|
|
ON CONFLICT ("module")
|
|
DO UPDATE SET "version" = '20261023180644988', "timestamp" = now();
|
|
|
|
--
|
|
-- MIGRATION VERSION FOR serverpod_auth_core
|
|
--
|
|
INSERT INTO "serverpod_migrations" ("module", "version", "timestamp")
|
|
VALUES ('serverpod_auth_core', '20260924105232991', now())
|
|
ON CONFLICT ("module")
|
|
DO UPDATE SET "version" = '20260924105232991', "timestamp" = now();
|
|
|
|
|
|
COMMIT;
|