A project's Display gains the Calendar layout: Upcoming's week strip and agenda, now shared as DayAgenda, over the project's tasks it keeps, with No date beside the month and Future occurrences, each repeating task also on the days it will come back (calendarOf on Repeat.next), muted, neither ticked off nor dragged. Upcoming gets a Display of its own, the same sheet over another target (DisplayTarget): Agenda or 3-day, done tasks, future occurrences, sorting, the filters by deadline, priority and label, and in the grid Colouring by priority, label or project. It is kept in the person's settings, one sealed row under an ID keyed by the account in the new synced table todo_settings (migration settings: the table, its index on spaceId and its foreign key to the space, cascading on delete). The 3-day grid shows today and the two days after, stepped or swiped three at a time: tasks without a time all day, timed ones as blocks as long as they last, overlapping ones side by side (layOutDay). A long press on a half hour adds a task there for half an hour; Overdue opens the overdue tasks with Reschedule. The board's separator builder names its BuildContext, as the root's analyzer plugin asks (never_discard_build_context). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
1712 lines
74 KiB
Dart
1712 lines
74 KiB
Dart
/// AUTOGENERATED BY SERVERPOD create-migration - DO NOT EDIT BY HAND
|
|
/// Merging: resolve registry conflicts the same as migration_registry.txt.
|
|
part of '../migration_registry.dart';
|
|
|
|
class _Migration20261101180755366_settings implements MigrationVersionSql {
|
|
@override
|
|
String get version => '20261101180755366-settings';
|
|
|
|
@override
|
|
String get moduleName => 'halkyon_todo';
|
|
|
|
@override
|
|
String get migrationSql => '''BEGIN;
|
|
|
|
--
|
|
-- ACTION CREATE TABLE
|
|
--
|
|
CREATE TABLE "todo_settings" (
|
|
"id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))),
|
|
"spaceId" INTEGER,
|
|
"keyId" TEXT,
|
|
"payload" BLOB NOT NULL,
|
|
"nonce" BLOB,
|
|
CONSTRAINT "todo_settings_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION
|
|
) STRICT;
|
|
|
|
-- Indexes
|
|
CREATE INDEX "todo_settings_space_idx" ON "todo_settings" ("spaceId");
|
|
|
|
--
|
|
-- STORE COLUMN TYPES FOR MIGRATIONS
|
|
--
|
|
DROP TABLE IF EXISTS "serverpod_sqlite_schema";
|
|
|
|
CREATE TABLE "serverpod_sqlite_schema" (
|
|
"table_name" TEXT NOT NULL,
|
|
"column_name" TEXT NOT NULL,
|
|
"column_type" TEXT NOT NULL,
|
|
"column_vector_dimension" INTEGER,
|
|
PRIMARY KEY ("table_name", "column_name")
|
|
);
|
|
|
|
INSERT INTO "serverpod_sqlite_schema" VALUES
|
|
('content_key', 'id', 'uuid', NULL),
|
|
('label', 'id', 'uuid', NULL),
|
|
('project', 'id', 'uuid', NULL),
|
|
('section', 'id', 'uuid', NULL),
|
|
('task', 'id', 'uuid', NULL),
|
|
('todo_settings', 'id', 'uuid', NULL),
|
|
('account_deletion_notice', 'account', 'uuid', NULL),
|
|
('account_deletion_notice', 'createdAt', 'timestampWithoutTimeZone', NULL),
|
|
('account_deletion_notice', 'lastAttemptAt', 'timestampWithoutTimeZone', NULL),
|
|
('account_password', 'authUserId', 'uuid', NULL),
|
|
('account_password', 'sessionEndedForProofsAt', 'timestampWithoutTimeZone', NULL),
|
|
('account_password', 'createdAt', 'timestampWithoutTimeZone', NULL),
|
|
('account_password', 'updatedAt', 'timestampWithoutTimeZone', NULL),
|
|
('account_reset', 'authUserId', 'uuid', NULL),
|
|
('account_reset', 'takesEffectAt', 'timestampWithoutTimeZone', NULL),
|
|
('account_reset', 'heldOutUntil', 'timestampWithoutTimeZone', NULL),
|
|
('account_reset', 'createdAt', 'timestampWithoutTimeZone', NULL),
|
|
('assistant_budget', 'authUserId', 'uuid', NULL),
|
|
('assistant_figures', 'authUserId', 'uuid', NULL),
|
|
('assistant_figures', 'day', 'timestampWithoutTimeZone', NULL),
|
|
('assistant_grant', 'authUserId', 'uuid', NULL),
|
|
('assistant_grant', 'grantedAt', 'timestampWithoutTimeZone', NULL),
|
|
('assistant_grant', 'agreedAt', 'timestampWithoutTimeZone', NULL),
|
|
('email_code_request', 'id', 'uuid', NULL),
|
|
('email_code_request', 'challengeId', 'uuid', NULL),
|
|
('email_code_request', 'switchChallengeId', 'uuid', NULL),
|
|
('email_code_request', 'createdAt', 'timestampWithoutTimeZone', NULL),
|
|
('email_identity', 'authUserId', 'uuid', NULL),
|
|
('email_identity', 'createdAt', 'timestampWithoutTimeZone', NULL),
|
|
('public_profile', 'authUserId', 'uuid', NULL),
|
|
('public_profile', 'links', 'json', NULL),
|
|
('public_profile', 'verifiedLinks', 'json', NULL),
|
|
('public_profile', 'firstPublishedAt', 'timestampWithoutTimeZone', NULL),
|
|
('public_profile', 'updatedAt', 'timestampWithoutTimeZone', NULL),
|
|
('recovery_code', 'authUserId', 'uuid', NULL),
|
|
('second_factor_failures', 'authUserId', 'uuid', NULL),
|
|
('second_factor_failures', 'waitUntil', 'timestampWithoutTimeZone', NULL),
|
|
('second_factor_failures', 'updatedAt', 'timestampWithoutTimeZone', NULL),
|
|
('session_code_failures', 'sessionId', 'uuid', NULL),
|
|
('session_code_failures', 'authUserId', 'uuid', NULL),
|
|
('session_code_failures', 'updatedAt', 'timestampWithoutTimeZone', NULL),
|
|
('sessions_ended_notice', 'account', 'uuid', NULL),
|
|
('sessions_ended_notice', 'endedBefore', 'timestampWithoutTimeZone', NULL),
|
|
('sessions_ended_notice', 'keepSession', 'uuid', NULL),
|
|
('sessions_ended_notice', 'lastAttemptAt', 'timestampWithoutTimeZone', NULL),
|
|
('sign_in_challenge', 'id', 'uuid', NULL),
|
|
('sign_in_challenge', 'authUserId', 'uuid', NULL),
|
|
('sign_in_challenge', 'createdAt', 'timestampWithoutTimeZone', NULL),
|
|
('totp_authenticator', 'id', 'uuid', NULL),
|
|
('totp_authenticator', 'authUserId', 'uuid', NULL),
|
|
('totp_authenticator', 'confirmedAt', 'timestampWithoutTimeZone', NULL),
|
|
('totp_authenticator', 'createdAt', 'timestampWithoutTimeZone', NULL),
|
|
('waiting_account', 'authUserId', 'uuid', NULL),
|
|
('waiting_account', 'since', 'timestampWithoutTimeZone', NULL),
|
|
('waiting_account', 'suspendedAt', 'timestampWithoutTimeZone', NULL),
|
|
('waiting_pass', 'authUserId', 'uuid', NULL),
|
|
('waiting_pass', 'madeAt', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_cloud_storage', 'addedTime', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_cloud_storage', 'expiration', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_cloud_storage', 'verified', 'boolean', NULL),
|
|
('serverpod_cloud_storage_direct_download', 'expiration', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_cloud_storage_direct_upload', 'expiration', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_cloud_storage_direct_upload', 'preventOverwrite', 'boolean', NULL),
|
|
('serverpod_future_call', 'time', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_future_call', 'scheduling', 'json', NULL),
|
|
('serverpod_future_call_claim', 'lastHeartbeatTime', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_health_connection_info', 'timestamp', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_health_metric', 'timestamp', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_health_metric', 'isHealthy', 'boolean', NULL),
|
|
('serverpod_log', 'time', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_message_log', 'slow', 'boolean', NULL),
|
|
('serverpod_migrations', 'timestamp', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_query_log', 'slow', 'boolean', NULL),
|
|
('serverpod_runtime_settings', 'logSettings', 'json', NULL),
|
|
('serverpod_runtime_settings', 'logSettingsOverrides', 'json', NULL),
|
|
('serverpod_runtime_settings', 'logServiceCalls', 'boolean', NULL),
|
|
('serverpod_runtime_settings', 'logMalformedCalls', 'boolean', NULL),
|
|
('serverpod_session_log', 'time', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_session_log', 'slow', 'boolean', NULL),
|
|
('serverpod_session_log', 'isOpen', 'boolean', NULL),
|
|
('serverpod_session_log', 'touched', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_auth_idp_anonymous_account', 'id', 'uuid', NULL),
|
|
('serverpod_auth_idp_anonymous_account', 'authUserId', 'uuid', NULL),
|
|
('serverpod_auth_idp_anonymous_account', 'createdAt', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_auth_idp_apple_account', 'id', 'uuid', NULL),
|
|
('serverpod_auth_idp_apple_account', 'refreshTokenRequestedWithBundleIdentifier', 'boolean', NULL),
|
|
('serverpod_auth_idp_apple_account', 'lastRefreshedAt', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_auth_idp_apple_account', 'authUserId', 'uuid', NULL),
|
|
('serverpod_auth_idp_apple_account', 'createdAt', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_auth_idp_apple_account', 'isEmailVerified', 'boolean', NULL),
|
|
('serverpod_auth_idp_apple_account', 'isPrivateEmail', 'boolean', NULL),
|
|
('serverpod_auth_idp_email_account', 'id', 'uuid', NULL),
|
|
('serverpod_auth_idp_email_account', 'authUserId', 'uuid', NULL),
|
|
('serverpod_auth_idp_email_account', 'createdAt', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_auth_idp_email_account_password_reset_request', 'id', 'uuid', NULL),
|
|
('serverpod_auth_idp_email_account_password_reset_request', 'emailAccountId', 'uuid', NULL),
|
|
('serverpod_auth_idp_email_account_password_reset_request', 'createdAt', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_auth_idp_email_account_password_reset_request', 'challengeId', 'uuid', NULL),
|
|
('serverpod_auth_idp_email_account_password_reset_request', 'setPasswordChallengeId', 'uuid', NULL),
|
|
('serverpod_auth_idp_email_account_request', 'id', 'uuid', NULL),
|
|
('serverpod_auth_idp_email_account_request', 'createdAt', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_auth_idp_email_account_request', 'challengeId', 'uuid', NULL),
|
|
('serverpod_auth_idp_email_account_request', 'createAccountChallengeId', 'uuid', NULL),
|
|
('serverpod_auth_idp_facebook_account', 'id', 'uuid', NULL),
|
|
('serverpod_auth_idp_facebook_account', 'authUserId', 'uuid', NULL),
|
|
('serverpod_auth_idp_facebook_account', 'createdAt', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_auth_idp_firebase_account', 'id', 'uuid', NULL),
|
|
('serverpod_auth_idp_firebase_account', 'authUserId', 'uuid', NULL),
|
|
('serverpod_auth_idp_firebase_account', 'created', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_auth_idp_github_account', 'id', 'uuid', NULL),
|
|
('serverpod_auth_idp_github_account', 'authUserId', 'uuid', NULL),
|
|
('serverpod_auth_idp_github_account', 'created', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_auth_idp_google_account', 'id', 'uuid', NULL),
|
|
('serverpod_auth_idp_google_account', 'authUserId', 'uuid', NULL),
|
|
('serverpod_auth_idp_google_account', 'created', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_auth_idp_microsoft_account', 'id', 'uuid', NULL),
|
|
('serverpod_auth_idp_microsoft_account', 'authUserId', 'uuid', NULL),
|
|
('serverpod_auth_idp_microsoft_account', 'created', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_auth_idp_passkey_account', 'id', 'uuid', NULL),
|
|
('serverpod_auth_idp_passkey_account', 'authUserId', 'uuid', NULL),
|
|
('serverpod_auth_idp_passkey_account', 'createdAt', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_auth_idp_passkey_challenge', 'id', 'uuid', NULL),
|
|
('serverpod_auth_idp_passkey_challenge', 'createdAt', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_auth_idp_rate_limited_request_attempt', 'id', 'uuid', NULL),
|
|
('serverpod_auth_idp_rate_limited_request_attempt', 'attemptedAt', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_auth_idp_rate_limited_request_attempt', 'extraData', 'json', NULL),
|
|
('serverpod_auth_idp_secret_challenge', 'id', 'uuid', NULL),
|
|
('crdt_data_attempted_value', 'value', 'jsonb', NULL),
|
|
('crdt_data_fields', 'hlcDatetime', 'timestampWithoutTimeZone', NULL),
|
|
('crdt_data_rows', 'hlcDatetime', 'timestampWithoutTimeZone', NULL),
|
|
('crdt_data_rows', 'uuidRowId', 'uuid', NULL),
|
|
('crdt_data_tombstone', 'hlcDatetime', 'timestampWithoutTimeZone', NULL),
|
|
('crdt_nodes', 'uuidNodeId', 'uuid', NULL),
|
|
('crdt_nodes', 'lastHlc', 'jsonb', NULL),
|
|
('crdt_schema_columns', 'isNullable', 'boolean', NULL),
|
|
('offline_sync_integrity_violations', 'uuidRowId', 'uuid', NULL),
|
|
('offline_sync_integrity_violations', 'ownerSpaceUuid', 'uuid', NULL),
|
|
('offline_sync_integrity_violations', 'incomingSpaceUuid', 'uuid', NULL),
|
|
('offline_sync_integrity_violations', 'uuidNodeId', 'uuid', NULL),
|
|
('offline_sync_integrity_violations', 'hlcDatetime', 'timestampWithoutTimeZone', NULL),
|
|
('offline_sync_integrity_violations', 'firstSeenAt', 'timestampWithoutTimeZone', NULL),
|
|
('offline_sync_integrity_violations', 'lastSeenAt', 'timestampWithoutTimeZone', NULL),
|
|
('offline_sync_space_members', 'userUuid', 'uuid', NULL),
|
|
('offline_sync_space_nodes', 'lastReceivedHlc', 'jsonb', NULL),
|
|
('offline_sync_spaces', 'uuidSpaceId', 'uuid', NULL),
|
|
('halkyon_oidc_attempt', 'id', 'uuid', NULL),
|
|
('halkyon_oidc_attempt', 'callerId', 'uuid', NULL),
|
|
('halkyon_oidc_attempt', 'expiresAt', 'timestampWithoutTimeZone', NULL),
|
|
('halkyon_oidc_identity', 'id', 'uuid', NULL),
|
|
('halkyon_oidc_identity', 'authUserId', 'uuid', NULL),
|
|
('halkyon_oidc_identity', 'createdAt', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_auth_core_jwt_refresh_token', 'id', 'uuid', NULL),
|
|
('serverpod_auth_core_jwt_refresh_token', 'authUserId', 'uuid', NULL),
|
|
('serverpod_auth_core_jwt_refresh_token', 'scopeNames', 'json', NULL),
|
|
('serverpod_auth_core_jwt_refresh_token', 'lastUpdatedAt', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_auth_core_jwt_refresh_token', 'createdAt', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_auth_core_profile', 'id', 'uuid', NULL),
|
|
('serverpod_auth_core_profile', 'authUserId', 'uuid', NULL),
|
|
('serverpod_auth_core_profile', 'createdAt', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_auth_core_profile', 'imageId', 'uuid', NULL),
|
|
('serverpod_auth_core_profile_image', 'id', 'uuid', NULL),
|
|
('serverpod_auth_core_profile_image', 'userProfileId', 'uuid', NULL),
|
|
('serverpod_auth_core_profile_image', 'createdAt', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_auth_core_session', 'id', 'uuid', NULL),
|
|
('serverpod_auth_core_session', 'authUserId', 'uuid', NULL),
|
|
('serverpod_auth_core_session', 'scopeNames', 'json', NULL),
|
|
('serverpod_auth_core_session', 'createdAt', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_auth_core_session', 'lastUsedAt', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_auth_core_session', 'expiresAt', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_auth_core_user', 'id', 'uuid', NULL),
|
|
('serverpod_auth_core_user', 'createdAt', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_auth_core_user', 'scopeNames', 'json', NULL),
|
|
('serverpod_auth_core_user', 'blocked', 'boolean', NULL);
|
|
|
|
--
|
|
-- MIGRATION VERSION FOR halkyon_todo
|
|
--
|
|
INSERT INTO "serverpod_migrations" ("module", "version", "timestamp")
|
|
VALUES ('halkyon_todo', '20261101180755366-settings', (unixepoch('now', 'subsecond') * 1000))
|
|
ON CONFLICT ("module")
|
|
DO UPDATE SET "version" = '20261101180755366-settings', "timestamp" = (unixepoch('now', 'subsecond') * 1000);
|
|
|
|
--
|
|
-- MIGRATION VERSION FOR halkyon_base
|
|
--
|
|
INSERT INTO "serverpod_migrations" ("module", "version", "timestamp")
|
|
VALUES ('halkyon_base', '20261026140329453-assistant-budgets', (unixepoch('now', 'subsecond') * 1000))
|
|
ON CONFLICT ("module")
|
|
DO UPDATE SET "version" = '20261026140329453-assistant-budgets', "timestamp" = (unixepoch('now', 'subsecond') * 1000);
|
|
|
|
--
|
|
-- MIGRATION VERSION FOR serverpod
|
|
--
|
|
INSERT INTO "serverpod_migrations" ("module", "version", "timestamp")
|
|
VALUES ('serverpod', '20260824182259319', (unixepoch('now', 'subsecond') * 1000))
|
|
ON CONFLICT ("module")
|
|
DO UPDATE SET "version" = '20260824182259319', "timestamp" = (unixepoch('now', 'subsecond') * 1000);
|
|
|
|
--
|
|
-- MIGRATION VERSION FOR serverpod_auth_idp
|
|
--
|
|
INSERT INTO "serverpod_migrations" ("module", "version", "timestamp")
|
|
VALUES ('serverpod_auth_idp', '20260924105404509', (unixepoch('now', 'subsecond') * 1000))
|
|
ON CONFLICT ("module")
|
|
DO UPDATE SET "version" = '20260924105404509', "timestamp" = (unixepoch('now', 'subsecond') * 1000);
|
|
|
|
--
|
|
-- MIGRATION VERSION FOR serverpod_offline_sync
|
|
--
|
|
INSERT INTO "serverpod_migrations" ("module", "version", "timestamp")
|
|
VALUES ('serverpod_offline_sync', '20260914143806119', (unixepoch('now', 'subsecond') * 1000))
|
|
ON CONFLICT ("module")
|
|
DO UPDATE SET "version" = '20260914143806119', "timestamp" = (unixepoch('now', 'subsecond') * 1000);
|
|
|
|
--
|
|
-- MIGRATION VERSION FOR halkyon_oidc
|
|
--
|
|
INSERT INTO "serverpod_migrations" ("module", "version", "timestamp")
|
|
VALUES ('halkyon_oidc', '20261023180644988', (unixepoch('now', 'subsecond') * 1000))
|
|
ON CONFLICT ("module")
|
|
DO UPDATE SET "version" = '20261023180644988', "timestamp" = (unixepoch('now', 'subsecond') * 1000);
|
|
|
|
--
|
|
-- MIGRATION VERSION FOR serverpod_auth_core
|
|
--
|
|
INSERT INTO "serverpod_migrations" ("module", "version", "timestamp")
|
|
VALUES ('serverpod_auth_core', '20260924105232991', (unixepoch('now', 'subsecond') * 1000))
|
|
ON CONFLICT ("module")
|
|
DO UPDATE SET "version" = '20260924105232991', "timestamp" = (unixepoch('now', 'subsecond') * 1000);
|
|
|
|
|
|
COMMIT;
|
|
''';
|
|
|
|
@override
|
|
String get definitionSql => '''BEGIN;
|
|
|
|
--
|
|
-- Class ContentKey as table content_key
|
|
--
|
|
CREATE TABLE "content_key" (
|
|
"id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))),
|
|
"spaceId" INTEGER,
|
|
"dataKeyId" TEXT NOT NULL,
|
|
"sealedKey" BLOB NOT NULL,
|
|
CONSTRAINT "content_key_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION
|
|
) STRICT;
|
|
|
|
-- Indexes
|
|
CREATE INDEX "content_key_space_idx" ON "content_key" ("spaceId");
|
|
|
|
|
|
--
|
|
-- Class Label as table label
|
|
--
|
|
CREATE TABLE "label" (
|
|
"id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))),
|
|
"spaceId" INTEGER,
|
|
"keyId" TEXT,
|
|
"payload" BLOB NOT NULL,
|
|
"nonce" BLOB,
|
|
CONSTRAINT "label_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION
|
|
) STRICT;
|
|
|
|
-- Indexes
|
|
CREATE INDEX "label_space_idx" ON "label" ("spaceId");
|
|
|
|
|
|
--
|
|
-- Class Project as table project
|
|
--
|
|
CREATE TABLE "project" (
|
|
"id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))),
|
|
"spaceId" INTEGER,
|
|
"keyId" TEXT,
|
|
"payload" BLOB NOT NULL,
|
|
"nonce" BLOB,
|
|
CONSTRAINT "project_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION
|
|
) STRICT;
|
|
|
|
-- Indexes
|
|
CREATE INDEX "project_space_idx" ON "project" ("spaceId");
|
|
|
|
|
|
--
|
|
-- Class Section as table section
|
|
--
|
|
CREATE TABLE "section" (
|
|
"id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))),
|
|
"spaceId" INTEGER,
|
|
"keyId" TEXT,
|
|
"payload" BLOB NOT NULL,
|
|
"nonce" BLOB,
|
|
CONSTRAINT "section_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION
|
|
) STRICT;
|
|
|
|
-- Indexes
|
|
CREATE INDEX "section_space_idx" ON "section" ("spaceId");
|
|
|
|
|
|
--
|
|
-- Class Task as table task
|
|
--
|
|
CREATE TABLE "task" (
|
|
"id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))),
|
|
"spaceId" INTEGER,
|
|
"keyId" TEXT,
|
|
"payload" BLOB NOT NULL,
|
|
"nonce" BLOB,
|
|
CONSTRAINT "task_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION
|
|
) STRICT;
|
|
|
|
-- Indexes
|
|
CREATE INDEX "task_space_idx" ON "task" ("spaceId");
|
|
|
|
|
|
--
|
|
-- Class TodoSettings as table todo_settings
|
|
--
|
|
CREATE TABLE "todo_settings" (
|
|
"id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))),
|
|
"spaceId" INTEGER,
|
|
"keyId" TEXT,
|
|
"payload" BLOB NOT NULL,
|
|
"nonce" BLOB,
|
|
CONSTRAINT "todo_settings_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION
|
|
) STRICT;
|
|
|
|
-- Indexes
|
|
CREATE INDEX "todo_settings_space_idx" ON "todo_settings" ("spaceId");
|
|
|
|
|
|
--
|
|
-- Class AccountDeletionNotice as table account_deletion_notice
|
|
--
|
|
CREATE TABLE "account_deletion_notice" (
|
|
"id" INTEGER PRIMARY KEY,
|
|
"account" BLOB NOT NULL,
|
|
"member" TEXT NOT NULL,
|
|
"createdAt" INTEGER NOT NULL,
|
|
"attempts" INTEGER NOT NULL,
|
|
"lastAttemptAt" INTEGER
|
|
) STRICT;
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "account_deletion_notice_idx" ON "account_deletion_notice" ("account", "member");
|
|
|
|
|
|
--
|
|
-- Class AccountPassword as table account_password
|
|
--
|
|
CREATE TABLE "account_password" (
|
|
"id" INTEGER PRIMARY KEY,
|
|
"authUserId" BLOB NOT NULL,
|
|
"salt" BLOB NOT NULL,
|
|
"kdfAlgorithm" TEXT NOT NULL,
|
|
"kdfOpsLimit" INTEGER NOT NULL,
|
|
"kdfMemLimit" INTEGER NOT NULL,
|
|
"verifier" BLOB,
|
|
"passwordProofKey" BLOB,
|
|
"encryptionPublicKey" BLOB NOT NULL,
|
|
"signingPublicKey" BLOB NOT NULL,
|
|
"passwordKeysNonce" BLOB NOT NULL,
|
|
"passwordKeysCipherText" BLOB NOT NULL,
|
|
"recoveryKeysNonce" BLOB NOT NULL,
|
|
"recoveryKeysCipherText" BLOB NOT NULL,
|
|
"recoveryProofKey" BLOB,
|
|
"sessionEndedForProofsAt" INTEGER,
|
|
"createdAt" INTEGER NOT NULL,
|
|
"updatedAt" INTEGER NOT NULL
|
|
) STRICT;
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "account_password_person_idx" ON "account_password" ("authUserId");
|
|
|
|
|
|
--
|
|
-- Class AccountReset as table account_reset
|
|
--
|
|
CREATE TABLE "account_reset" (
|
|
"id" INTEGER PRIMARY KEY,
|
|
"authUserId" BLOB NOT NULL,
|
|
"kind" TEXT NOT NULL,
|
|
"takesEffectAt" INTEGER NOT NULL,
|
|
"heldOutUntil" INTEGER,
|
|
"createdAt" INTEGER NOT NULL
|
|
) STRICT;
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "account_reset_person_kind_idx" ON "account_reset" ("authUserId", "kind");
|
|
|
|
|
|
--
|
|
-- Class AssistantBudget as table assistant_budget
|
|
--
|
|
CREATE TABLE "assistant_budget" (
|
|
"id" INTEGER PRIMARY KEY,
|
|
"authUserId" BLOB NOT NULL,
|
|
"dailyCostMicros" INTEGER,
|
|
"monthlyCostMicros" INTEGER,
|
|
"dailyTokens" INTEGER,
|
|
"monthlyTokens" INTEGER
|
|
) STRICT;
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "assistant_budget_person_idx" ON "assistant_budget" ("authUserId");
|
|
|
|
|
|
--
|
|
-- Class AssistantFigures as table assistant_figures
|
|
--
|
|
CREATE TABLE "assistant_figures" (
|
|
"id" INTEGER PRIMARY KEY,
|
|
"authUserId" BLOB NOT NULL,
|
|
"assistant" TEXT NOT NULL,
|
|
"day" INTEGER NOT NULL,
|
|
"requests" INTEGER NOT NULL,
|
|
"inputTokens" INTEGER NOT NULL,
|
|
"outputTokens" INTEGER NOT NULL,
|
|
"costMicros" INTEGER NOT NULL
|
|
) STRICT;
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "assistant_figures_day_idx" ON "assistant_figures" ("authUserId", "assistant", "day");
|
|
CREATE INDEX "assistant_figures_age_idx" ON "assistant_figures" ("day");
|
|
|
|
|
|
--
|
|
-- Class AssistantGrant as table assistant_grant
|
|
--
|
|
CREATE TABLE "assistant_grant" (
|
|
"id" INTEGER PRIMARY KEY,
|
|
"authUserId" BLOB NOT NULL,
|
|
"assistant" TEXT NOT NULL,
|
|
"grantedAt" INTEGER NOT NULL,
|
|
"agreedAt" INTEGER,
|
|
"agreedTo" TEXT
|
|
) STRICT;
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "assistant_grant_person_idx" ON "assistant_grant" ("authUserId", "assistant");
|
|
|
|
|
|
--
|
|
-- Class EmailCodeRequest as table email_code_request
|
|
--
|
|
CREATE TABLE "email_code_request" (
|
|
"id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))),
|
|
"addressHash" TEXT NOT NULL,
|
|
"challengeId" BLOB NOT NULL,
|
|
"switchChallengeId" BLOB,
|
|
"purpose" TEXT,
|
|
"createdAt" INTEGER NOT NULL,
|
|
CONSTRAINT "email_code_request_fk_0" FOREIGN KEY ("challengeId") REFERENCES "serverpod_auth_idp_secret_challenge" ("id") ON DELETE CASCADE ON UPDATE NO ACTION,
|
|
CONSTRAINT "email_code_request_fk_1" FOREIGN KEY ("switchChallengeId") REFERENCES "serverpod_auth_idp_secret_challenge" ("id") ON DELETE CASCADE ON UPDATE NO ACTION
|
|
) STRICT;
|
|
|
|
-- Indexes
|
|
CREATE INDEX "email_code_request_address_idx" ON "email_code_request" ("addressHash");
|
|
|
|
|
|
--
|
|
-- Class EmailIdentity as table email_identity
|
|
--
|
|
CREATE TABLE "email_identity" (
|
|
"id" INTEGER PRIMARY KEY,
|
|
"authUserId" BLOB NOT NULL,
|
|
"addressHash" TEXT NOT NULL,
|
|
"createdAt" INTEGER NOT NULL
|
|
) STRICT;
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "email_identity_person_idx" ON "email_identity" ("authUserId");
|
|
CREATE UNIQUE INDEX "email_identity_address_idx" ON "email_identity" ("addressHash");
|
|
|
|
|
|
--
|
|
-- Class PublicProfile as table public_profile
|
|
--
|
|
CREATE TABLE "public_profile" (
|
|
"id" INTEGER PRIMARY KEY,
|
|
"authUserId" BLOB NOT NULL,
|
|
"handle" TEXT NOT NULL,
|
|
"handleKey" TEXT NOT NULL,
|
|
"displayName" TEXT NOT NULL,
|
|
"bio" TEXT NOT NULL,
|
|
"links" TEXT NOT NULL,
|
|
"verifiedLinks" TEXT,
|
|
"avatarHash" TEXT,
|
|
"firstPublishedAt" INTEGER,
|
|
"updatedAt" INTEGER NOT NULL
|
|
) STRICT;
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "public_profile_person_idx" ON "public_profile" ("authUserId");
|
|
CREATE UNIQUE INDEX "public_profile_handle_idx" ON "public_profile" ("handleKey");
|
|
|
|
|
|
--
|
|
-- Class RecoveryCode as table recovery_code
|
|
--
|
|
CREATE TABLE "recovery_code" (
|
|
"id" INTEGER PRIMARY KEY,
|
|
"authUserId" BLOB NOT NULL,
|
|
"hash" TEXT NOT NULL
|
|
) STRICT;
|
|
|
|
-- Indexes
|
|
CREATE INDEX "recovery_code_person_idx" ON "recovery_code" ("authUserId");
|
|
|
|
|
|
--
|
|
-- Class SecondFactorFailures as table second_factor_failures
|
|
--
|
|
CREATE TABLE "second_factor_failures" (
|
|
"id" INTEGER PRIMARY KEY,
|
|
"authUserId" BLOB NOT NULL,
|
|
"path" TEXT NOT NULL DEFAULT ('password'),
|
|
"failures" INTEGER NOT NULL,
|
|
"waits" INTEGER NOT NULL,
|
|
"waitUntil" INTEGER,
|
|
"updatedAt" INTEGER NOT NULL
|
|
) STRICT;
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "second_factor_failures_person_idx" ON "second_factor_failures" ("authUserId", "path");
|
|
|
|
|
|
--
|
|
-- Class SessionCodeFailures as table session_code_failures
|
|
--
|
|
CREATE TABLE "session_code_failures" (
|
|
"id" INTEGER PRIMARY KEY,
|
|
"sessionId" BLOB NOT NULL,
|
|
"authUserId" BLOB NOT NULL,
|
|
"failures" INTEGER NOT NULL,
|
|
"updatedAt" INTEGER NOT NULL
|
|
) STRICT;
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "session_code_failures_session_idx" ON "session_code_failures" ("sessionId");
|
|
|
|
|
|
--
|
|
-- Class SessionsEndedNotice as table sessions_ended_notice
|
|
--
|
|
CREATE TABLE "sessions_ended_notice" (
|
|
"id" INTEGER PRIMARY KEY,
|
|
"account" BLOB NOT NULL,
|
|
"member" TEXT NOT NULL,
|
|
"endedBefore" INTEGER NOT NULL,
|
|
"keepSession" BLOB,
|
|
"attempts" INTEGER NOT NULL,
|
|
"lastAttemptAt" INTEGER
|
|
) STRICT;
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "sessions_ended_notice_idx" ON "sessions_ended_notice" ("account", "member");
|
|
|
|
|
|
--
|
|
-- Class SignInChallenge as table sign_in_challenge
|
|
--
|
|
CREATE TABLE "sign_in_challenge" (
|
|
"id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))),
|
|
"authUserId" BLOB,
|
|
"purpose" TEXT NOT NULL,
|
|
"addressHash" TEXT NOT NULL,
|
|
"secret" TEXT NOT NULL,
|
|
"serverValue" TEXT,
|
|
"createdAt" INTEGER NOT NULL
|
|
) STRICT;
|
|
|
|
-- Indexes
|
|
CREATE INDEX "sign_in_challenge_created_idx" ON "sign_in_challenge" ("createdAt");
|
|
|
|
|
|
--
|
|
-- Class TotpAuthenticator as table totp_authenticator
|
|
--
|
|
CREATE TABLE "totp_authenticator" (
|
|
"id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))),
|
|
"authUserId" BLOB NOT NULL,
|
|
"name" TEXT NOT NULL,
|
|
"secret" BLOB NOT NULL,
|
|
"confirmedAt" INTEGER,
|
|
"lastStep" INTEGER,
|
|
"createdAt" INTEGER NOT NULL
|
|
) STRICT;
|
|
|
|
-- Indexes
|
|
CREATE INDEX "totp_authenticator_person_idx" ON "totp_authenticator" ("authUserId");
|
|
|
|
|
|
--
|
|
-- Class WaitingAccount as table waiting_account
|
|
--
|
|
CREATE TABLE "waiting_account" (
|
|
"id" INTEGER PRIMARY KEY,
|
|
"authUserId" BLOB NOT NULL,
|
|
"since" INTEGER NOT NULL,
|
|
"words" TEXT NOT NULL,
|
|
"suspendedAt" INTEGER
|
|
) STRICT;
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "waiting_account_person_idx" ON "waiting_account" ("authUserId");
|
|
|
|
|
|
--
|
|
-- Class WaitingPass as table waiting_pass
|
|
--
|
|
CREATE TABLE "waiting_pass" (
|
|
"id" INTEGER PRIMARY KEY,
|
|
"authUserId" BLOB NOT NULL,
|
|
"passHash" TEXT NOT NULL,
|
|
"madeAt" INTEGER NOT NULL
|
|
) STRICT;
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "waiting_pass_hash_idx" ON "waiting_pass" ("passHash");
|
|
CREATE INDEX "waiting_pass_person_idx" ON "waiting_pass" ("authUserId");
|
|
|
|
|
|
--
|
|
-- Class CloudStorageEntry as table serverpod_cloud_storage
|
|
--
|
|
CREATE TABLE "serverpod_cloud_storage" (
|
|
"id" INTEGER PRIMARY KEY,
|
|
"storageId" TEXT NOT NULL,
|
|
"path" TEXT NOT NULL,
|
|
"addedTime" INTEGER NOT NULL,
|
|
"expiration" INTEGER,
|
|
"byteData" BLOB NOT NULL,
|
|
"verified" INTEGER NOT NULL,
|
|
"contentType" TEXT,
|
|
"cacheControl" TEXT,
|
|
"contentDisposition" TEXT,
|
|
"contentEncoding" TEXT,
|
|
"customMetadata" TEXT
|
|
) STRICT;
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "serverpod_cloud_storage_path_idx" ON "serverpod_cloud_storage" ("storageId", "path");
|
|
CREATE INDEX "serverpod_cloud_storage_expiration" ON "serverpod_cloud_storage" ("expiration");
|
|
|
|
|
|
--
|
|
-- Class CloudStorageDirectDownloadEntry as table serverpod_cloud_storage_direct_download
|
|
--
|
|
CREATE TABLE "serverpod_cloud_storage_direct_download" (
|
|
"id" INTEGER PRIMARY KEY,
|
|
"storageId" TEXT NOT NULL,
|
|
"path" TEXT NOT NULL,
|
|
"expiration" INTEGER NOT NULL,
|
|
"authKey" TEXT NOT NULL,
|
|
"downloadFileName" TEXT,
|
|
"contentType" TEXT
|
|
) STRICT;
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "serverpod_cloud_storage_direct_download_auth_key" ON "serverpod_cloud_storage_direct_download" ("authKey");
|
|
CREATE INDEX "serverpod_cloud_storage_direct_download_expiration" ON "serverpod_cloud_storage_direct_download" ("expiration");
|
|
|
|
|
|
--
|
|
-- Class CloudStorageDirectUploadEntry as table serverpod_cloud_storage_direct_upload
|
|
--
|
|
CREATE TABLE "serverpod_cloud_storage_direct_upload" (
|
|
"id" INTEGER PRIMARY KEY,
|
|
"storageId" TEXT NOT NULL,
|
|
"path" TEXT NOT NULL,
|
|
"expiration" INTEGER NOT NULL,
|
|
"authKey" TEXT NOT NULL,
|
|
"maxFileSize" INTEGER NOT NULL DEFAULT (10485760),
|
|
"contentLength" INTEGER,
|
|
"preventOverwrite" INTEGER NOT NULL DEFAULT (0),
|
|
"contentType" TEXT,
|
|
"cacheControl" TEXT,
|
|
"contentDisposition" TEXT,
|
|
"contentEncoding" TEXT,
|
|
"customMetadata" TEXT
|
|
) STRICT;
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "serverpod_cloud_storage_direct_upload_storage_path" ON "serverpod_cloud_storage_direct_upload" ("storageId", "path");
|
|
|
|
|
|
--
|
|
-- Class FutureCallEntry as table serverpod_future_call
|
|
--
|
|
CREATE TABLE "serverpod_future_call" (
|
|
"id" INTEGER PRIMARY KEY,
|
|
"name" TEXT NOT NULL,
|
|
"time" INTEGER NOT NULL,
|
|
"serializedObject" TEXT,
|
|
"serverId" TEXT NOT NULL,
|
|
"identifier" TEXT,
|
|
"scheduling" TEXT
|
|
) STRICT;
|
|
|
|
-- Indexes
|
|
CREATE INDEX "serverpod_future_call_time_idx" ON "serverpod_future_call" ("time");
|
|
CREATE INDEX "serverpod_future_call_serverId_idx" ON "serverpod_future_call" ("serverId");
|
|
CREATE INDEX "serverpod_future_call_identifier_idx" ON "serverpod_future_call" ("identifier");
|
|
|
|
|
|
--
|
|
-- Class FutureCallClaimEntry as table serverpod_future_call_claim
|
|
--
|
|
CREATE TABLE "serverpod_future_call_claim" (
|
|
"id" INTEGER PRIMARY KEY,
|
|
"futureCallId" INTEGER,
|
|
"lastHeartbeatTime" INTEGER NOT NULL,
|
|
CONSTRAINT "serverpod_future_call_claim_fk_0" FOREIGN KEY ("futureCallId") REFERENCES "serverpod_future_call" ("id") ON DELETE CASCADE ON UPDATE NO ACTION
|
|
) STRICT;
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "future_call_unique_idx" ON "serverpod_future_call_claim" ("futureCallId");
|
|
|
|
|
|
--
|
|
-- Class ServerHealthConnectionInfo as table serverpod_health_connection_info
|
|
--
|
|
CREATE TABLE "serverpod_health_connection_info" (
|
|
"id" INTEGER PRIMARY KEY,
|
|
"serverId" TEXT NOT NULL,
|
|
"timestamp" INTEGER NOT NULL,
|
|
"active" INTEGER NOT NULL,
|
|
"closing" INTEGER NOT NULL,
|
|
"idle" INTEGER NOT NULL,
|
|
"granularity" INTEGER NOT NULL
|
|
) STRICT;
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "serverpod_health_connection_info_timestamp_idx" ON "serverpod_health_connection_info" ("timestamp", "serverId", "granularity");
|
|
|
|
|
|
--
|
|
-- Class ServerHealthMetric as table serverpod_health_metric
|
|
--
|
|
CREATE TABLE "serverpod_health_metric" (
|
|
"id" INTEGER PRIMARY KEY,
|
|
"name" TEXT NOT NULL,
|
|
"serverId" TEXT NOT NULL,
|
|
"timestamp" INTEGER NOT NULL,
|
|
"isHealthy" INTEGER NOT NULL,
|
|
"value" REAL NOT NULL,
|
|
"granularity" INTEGER NOT NULL
|
|
) STRICT;
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "serverpod_health_metric_timestamp_idx" ON "serverpod_health_metric" ("timestamp", "serverId", "name", "granularity");
|
|
|
|
|
|
--
|
|
-- Class LogEntry as table serverpod_log
|
|
--
|
|
CREATE TABLE "serverpod_log" (
|
|
"id" INTEGER PRIMARY KEY,
|
|
"sessionLogId" INTEGER NOT NULL,
|
|
"messageId" INTEGER,
|
|
"reference" TEXT,
|
|
"serverId" TEXT NOT NULL,
|
|
"time" INTEGER NOT NULL,
|
|
"logLevel" INTEGER NOT NULL,
|
|
"message" TEXT NOT NULL,
|
|
"error" TEXT,
|
|
"stackTrace" TEXT,
|
|
"order" INTEGER NOT NULL,
|
|
CONSTRAINT "serverpod_log_fk_0" FOREIGN KEY ("sessionLogId") REFERENCES "serverpod_session_log" ("id") ON DELETE CASCADE ON UPDATE NO ACTION
|
|
) STRICT;
|
|
|
|
-- Indexes
|
|
CREATE INDEX "serverpod_log_sessionLogId_idx" ON "serverpod_log" ("sessionLogId", "order");
|
|
|
|
|
|
--
|
|
-- Class MessageLogEntry as table serverpod_message_log
|
|
--
|
|
CREATE TABLE "serverpod_message_log" (
|
|
"id" INTEGER PRIMARY KEY,
|
|
"sessionLogId" INTEGER NOT NULL,
|
|
"serverId" TEXT NOT NULL,
|
|
"messageId" INTEGER NOT NULL,
|
|
"endpoint" TEXT NOT NULL,
|
|
"messageName" TEXT NOT NULL,
|
|
"duration" REAL NOT NULL,
|
|
"error" TEXT,
|
|
"stackTrace" TEXT,
|
|
"slow" INTEGER NOT NULL,
|
|
"order" INTEGER NOT NULL,
|
|
CONSTRAINT "serverpod_message_log_fk_0" FOREIGN KEY ("sessionLogId") REFERENCES "serverpod_session_log" ("id") ON DELETE CASCADE ON UPDATE NO ACTION
|
|
) STRICT;
|
|
|
|
-- Indexes
|
|
CREATE INDEX "serverpod_message_log_sessionLogId_idx" ON "serverpod_message_log" ("sessionLogId", "order");
|
|
|
|
|
|
--
|
|
-- Class MethodInfo as table serverpod_method
|
|
--
|
|
CREATE TABLE "serverpod_method" (
|
|
"id" INTEGER PRIMARY KEY,
|
|
"endpoint" TEXT NOT NULL,
|
|
"method" TEXT NOT NULL
|
|
) STRICT;
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "serverpod_method_endpoint_method_idx" ON "serverpod_method" ("endpoint", "method");
|
|
|
|
|
|
--
|
|
-- Class DatabaseMigrationVersion as table serverpod_migrations
|
|
--
|
|
CREATE TABLE "serverpod_migrations" (
|
|
"id" INTEGER PRIMARY KEY,
|
|
"module" TEXT NOT NULL,
|
|
"version" TEXT NOT NULL,
|
|
"timestamp" INTEGER
|
|
) STRICT;
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "serverpod_migrations_ids" ON "serverpod_migrations" ("module");
|
|
|
|
|
|
--
|
|
-- Class QueryLogEntry as table serverpod_query_log
|
|
--
|
|
CREATE TABLE "serverpod_query_log" (
|
|
"id" INTEGER PRIMARY KEY,
|
|
"serverId" TEXT NOT NULL,
|
|
"sessionLogId" INTEGER NOT NULL,
|
|
"messageId" INTEGER,
|
|
"query" TEXT NOT NULL,
|
|
"duration" REAL NOT NULL,
|
|
"numRows" INTEGER,
|
|
"error" TEXT,
|
|
"stackTrace" TEXT,
|
|
"slow" INTEGER NOT NULL,
|
|
"order" INTEGER NOT NULL,
|
|
CONSTRAINT "serverpod_query_log_fk_0" FOREIGN KEY ("sessionLogId") REFERENCES "serverpod_session_log" ("id") ON DELETE CASCADE ON UPDATE NO ACTION
|
|
) STRICT;
|
|
|
|
-- Indexes
|
|
CREATE INDEX "serverpod_query_log_sessionLogId_idx" ON "serverpod_query_log" ("sessionLogId", "order");
|
|
|
|
|
|
--
|
|
-- Class ReadWriteTestEntry as table serverpod_readwrite_test
|
|
--
|
|
CREATE TABLE "serverpod_readwrite_test" (
|
|
"id" INTEGER PRIMARY KEY,
|
|
"number" INTEGER NOT NULL
|
|
) STRICT;
|
|
|
|
|
|
--
|
|
-- Class RuntimeSettings as table serverpod_runtime_settings
|
|
--
|
|
CREATE TABLE "serverpod_runtime_settings" (
|
|
"id" INTEGER PRIMARY KEY,
|
|
"logSettings" TEXT NOT NULL,
|
|
"logSettingsOverrides" TEXT NOT NULL,
|
|
"logServiceCalls" INTEGER NOT NULL,
|
|
"logMalformedCalls" INTEGER NOT NULL
|
|
) STRICT;
|
|
|
|
|
|
--
|
|
-- Class SessionLogEntry as table serverpod_session_log
|
|
--
|
|
CREATE TABLE "serverpod_session_log" (
|
|
"id" INTEGER PRIMARY KEY,
|
|
"serverId" TEXT NOT NULL,
|
|
"time" INTEGER NOT NULL,
|
|
"module" TEXT,
|
|
"endpoint" TEXT,
|
|
"method" TEXT,
|
|
"duration" REAL,
|
|
"numQueries" INTEGER,
|
|
"slow" INTEGER,
|
|
"error" TEXT,
|
|
"stackTrace" TEXT,
|
|
"authenticatedUserId" INTEGER,
|
|
"userId" TEXT,
|
|
"isOpen" INTEGER,
|
|
"touched" INTEGER NOT NULL
|
|
) STRICT;
|
|
|
|
-- Indexes
|
|
CREATE INDEX "serverpod_session_log_serverid_idx" ON "serverpod_session_log" ("serverId");
|
|
CREATE INDEX "serverpod_session_log_time_idx" ON "serverpod_session_log" ("time");
|
|
CREATE INDEX "serverpod_session_log_touched_idx" ON "serverpod_session_log" ("touched");
|
|
CREATE INDEX "serverpod_session_log_isopen_idx" ON "serverpod_session_log" ("isOpen");
|
|
|
|
|
|
--
|
|
-- Class AnonymousAccount as table serverpod_auth_idp_anonymous_account
|
|
--
|
|
CREATE TABLE "serverpod_auth_idp_anonymous_account" (
|
|
"id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))),
|
|
"authUserId" BLOB NOT NULL,
|
|
"createdAt" INTEGER NOT NULL,
|
|
CONSTRAINT "serverpod_auth_idp_anonymous_account_fk_0" FOREIGN KEY ("authUserId") REFERENCES "serverpod_auth_core_user" ("id") ON DELETE CASCADE ON UPDATE NO ACTION
|
|
) STRICT;
|
|
|
|
|
|
--
|
|
-- Class AppleAccount as table serverpod_auth_idp_apple_account
|
|
--
|
|
CREATE TABLE "serverpod_auth_idp_apple_account" (
|
|
"id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))),
|
|
"userIdentifier" TEXT NOT NULL,
|
|
"refreshToken" TEXT NOT NULL,
|
|
"refreshTokenRequestedWithBundleIdentifier" INTEGER NOT NULL,
|
|
"lastRefreshedAt" INTEGER NOT NULL DEFAULT (CAST(unixepoch('subsecond') * 1000 AS INTEGER)),
|
|
"authUserId" BLOB NOT NULL,
|
|
"createdAt" INTEGER NOT NULL,
|
|
"email" TEXT,
|
|
"isEmailVerified" INTEGER,
|
|
"isPrivateEmail" INTEGER,
|
|
"firstName" TEXT,
|
|
"lastName" TEXT,
|
|
CONSTRAINT "serverpod_auth_idp_apple_account_fk_0" FOREIGN KEY ("authUserId") REFERENCES "serverpod_auth_core_user" ("id") ON DELETE CASCADE ON UPDATE NO ACTION
|
|
) STRICT;
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "serverpod_auth_apple_account_identifier" ON "serverpod_auth_idp_apple_account" ("userIdentifier");
|
|
|
|
|
|
--
|
|
-- Class EmailAccount as table serverpod_auth_idp_email_account
|
|
--
|
|
CREATE TABLE "serverpod_auth_idp_email_account" (
|
|
"id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))),
|
|
"authUserId" BLOB NOT NULL,
|
|
"createdAt" INTEGER NOT NULL,
|
|
"email" TEXT NOT NULL,
|
|
"passwordHash" TEXT NOT NULL,
|
|
CONSTRAINT "serverpod_auth_idp_email_account_fk_0" FOREIGN KEY ("authUserId") REFERENCES "serverpod_auth_core_user" ("id") ON DELETE CASCADE ON UPDATE NO ACTION
|
|
) STRICT;
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "serverpod_auth_idp_email_account_email" ON "serverpod_auth_idp_email_account" ("email");
|
|
|
|
|
|
--
|
|
-- Class EmailAccountPasswordResetRequest as table serverpod_auth_idp_email_account_password_reset_request
|
|
--
|
|
CREATE TABLE "serverpod_auth_idp_email_account_password_reset_request" (
|
|
"id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))),
|
|
"emailAccountId" BLOB NOT NULL,
|
|
"createdAt" INTEGER NOT NULL DEFAULT (CAST(unixepoch('subsecond') * 1000 AS INTEGER)),
|
|
"challengeId" BLOB NOT NULL,
|
|
"setPasswordChallengeId" BLOB,
|
|
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,
|
|
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,
|
|
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
|
|
) STRICT;
|
|
|
|
|
|
--
|
|
-- Class EmailAccountRequest as table serverpod_auth_idp_email_account_request
|
|
--
|
|
CREATE TABLE "serverpod_auth_idp_email_account_request" (
|
|
"id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))),
|
|
"createdAt" INTEGER NOT NULL DEFAULT (CAST(unixepoch('subsecond') * 1000 AS INTEGER)),
|
|
"email" TEXT NOT NULL,
|
|
"challengeId" BLOB NOT NULL,
|
|
"createAccountChallengeId" BLOB,
|
|
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,
|
|
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
|
|
) STRICT;
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "serverpod_auth_idp_email_account_request_email" ON "serverpod_auth_idp_email_account_request" ("email");
|
|
|
|
|
|
--
|
|
-- Class FacebookAccount as table serverpod_auth_idp_facebook_account
|
|
--
|
|
CREATE TABLE "serverpod_auth_idp_facebook_account" (
|
|
"id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))),
|
|
"authUserId" BLOB NOT NULL,
|
|
"createdAt" INTEGER NOT NULL,
|
|
"userIdentifier" TEXT NOT NULL,
|
|
"email" TEXT,
|
|
"fullName" TEXT,
|
|
"firstName" TEXT,
|
|
"lastName" TEXT,
|
|
CONSTRAINT "serverpod_auth_idp_facebook_account_fk_0" FOREIGN KEY ("authUserId") REFERENCES "serverpod_auth_core_user" ("id") ON DELETE CASCADE ON UPDATE NO ACTION
|
|
) STRICT;
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "serverpod_auth_facebook_account_user_identifier" ON "serverpod_auth_idp_facebook_account" ("userIdentifier");
|
|
|
|
|
|
--
|
|
-- Class FirebaseAccount as table serverpod_auth_idp_firebase_account
|
|
--
|
|
CREATE TABLE "serverpod_auth_idp_firebase_account" (
|
|
"id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))),
|
|
"authUserId" BLOB NOT NULL,
|
|
"created" INTEGER NOT NULL,
|
|
"email" TEXT,
|
|
"phone" TEXT,
|
|
"userIdentifier" TEXT NOT NULL,
|
|
CONSTRAINT "serverpod_auth_idp_firebase_account_fk_0" FOREIGN KEY ("authUserId") REFERENCES "serverpod_auth_core_user" ("id") ON DELETE CASCADE ON UPDATE NO ACTION
|
|
) STRICT;
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "serverpod_auth_firebase_account_user_identifier" ON "serverpod_auth_idp_firebase_account" ("userIdentifier");
|
|
|
|
|
|
--
|
|
-- Class GitHubAccount as table serverpod_auth_idp_github_account
|
|
--
|
|
CREATE TABLE "serverpod_auth_idp_github_account" (
|
|
"id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))),
|
|
"authUserId" BLOB NOT NULL,
|
|
"userIdentifier" TEXT NOT NULL,
|
|
"email" TEXT,
|
|
"created" INTEGER NOT NULL,
|
|
CONSTRAINT "serverpod_auth_idp_github_account_fk_0" FOREIGN KEY ("authUserId") REFERENCES "serverpod_auth_core_user" ("id") ON DELETE CASCADE ON UPDATE NO ACTION
|
|
) STRICT;
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "serverpod_auth_github_account_user_identifier" ON "serverpod_auth_idp_github_account" ("userIdentifier");
|
|
|
|
|
|
--
|
|
-- Class GoogleAccount as table serverpod_auth_idp_google_account
|
|
--
|
|
CREATE TABLE "serverpod_auth_idp_google_account" (
|
|
"id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))),
|
|
"authUserId" BLOB NOT NULL,
|
|
"created" INTEGER NOT NULL,
|
|
"email" TEXT NOT NULL,
|
|
"userIdentifier" TEXT NOT NULL,
|
|
CONSTRAINT "serverpod_auth_idp_google_account_fk_0" FOREIGN KEY ("authUserId") REFERENCES "serverpod_auth_core_user" ("id") ON DELETE CASCADE ON UPDATE NO ACTION
|
|
) STRICT;
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "serverpod_auth_google_account_user_identifier" ON "serverpod_auth_idp_google_account" ("userIdentifier");
|
|
|
|
|
|
--
|
|
-- Class MicrosoftAccount as table serverpod_auth_idp_microsoft_account
|
|
--
|
|
CREATE TABLE "serverpod_auth_idp_microsoft_account" (
|
|
"id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))),
|
|
"authUserId" BLOB NOT NULL,
|
|
"userIdentifier" TEXT NOT NULL,
|
|
"email" TEXT,
|
|
"created" INTEGER NOT NULL,
|
|
CONSTRAINT "serverpod_auth_idp_microsoft_account_fk_0" FOREIGN KEY ("authUserId") REFERENCES "serverpod_auth_core_user" ("id") ON DELETE CASCADE ON UPDATE NO ACTION
|
|
) STRICT;
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "serverpod_auth_microsoft_account_user_identifier" ON "serverpod_auth_idp_microsoft_account" ("userIdentifier");
|
|
|
|
|
|
--
|
|
-- Class PasskeyAccount as table serverpod_auth_idp_passkey_account
|
|
--
|
|
CREATE TABLE "serverpod_auth_idp_passkey_account" (
|
|
"id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))),
|
|
"authUserId" BLOB NOT NULL,
|
|
"createdAt" INTEGER NOT NULL,
|
|
"keyId" BLOB NOT NULL,
|
|
"keyIdBase64" TEXT NOT NULL,
|
|
"clientDataJSON" BLOB NOT NULL,
|
|
"attestationObject" BLOB NOT NULL,
|
|
"originalChallenge" BLOB NOT NULL,
|
|
CONSTRAINT "serverpod_auth_idp_passkey_account_fk_0" FOREIGN KEY ("authUserId") REFERENCES "serverpod_auth_core_user" ("id") ON DELETE CASCADE ON UPDATE NO ACTION
|
|
) STRICT;
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "serverpod_auth_idp_passkey_account_key_id_base64" ON "serverpod_auth_idp_passkey_account" ("keyIdBase64");
|
|
|
|
|
|
--
|
|
-- Class PasskeyChallenge as table serverpod_auth_idp_passkey_challenge
|
|
--
|
|
CREATE TABLE "serverpod_auth_idp_passkey_challenge" (
|
|
"id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))),
|
|
"createdAt" INTEGER NOT NULL,
|
|
"challenge" BLOB NOT NULL
|
|
) STRICT;
|
|
|
|
|
|
--
|
|
-- Class RateLimitedRequestAttempt as table serverpod_auth_idp_rate_limited_request_attempt
|
|
--
|
|
CREATE TABLE "serverpod_auth_idp_rate_limited_request_attempt" (
|
|
"id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))),
|
|
"domain" TEXT NOT NULL,
|
|
"source" TEXT NOT NULL,
|
|
"key" TEXT NOT NULL,
|
|
"ipAddress" TEXT,
|
|
"attemptedAt" INTEGER NOT NULL,
|
|
"extraData" TEXT
|
|
) STRICT;
|
|
|
|
-- Indexes
|
|
CREATE INDEX "serverpod_auth_idp_rate_limited_request_attempt_composite" ON "serverpod_auth_idp_rate_limited_request_attempt" ("domain", "source", "key", "attemptedAt");
|
|
|
|
|
|
--
|
|
-- Class SecretChallenge as table serverpod_auth_idp_secret_challenge
|
|
--
|
|
CREATE TABLE "serverpod_auth_idp_secret_challenge" (
|
|
"id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))),
|
|
"challengeCodeHash" TEXT NOT NULL
|
|
) STRICT;
|
|
|
|
|
|
--
|
|
-- Class CrdtDataAttemptedValue as table crdt_data_attempted_value
|
|
--
|
|
CREATE TABLE "crdt_data_attempted_value" (
|
|
"id" INTEGER PRIMARY KEY,
|
|
"fieldId" INTEGER NOT NULL,
|
|
"value" BLOB NOT NULL,
|
|
"projectionReason" INTEGER NOT NULL,
|
|
CONSTRAINT "crdt_data_attempted_value_fk_0" FOREIGN KEY ("fieldId") REFERENCES "crdt_data_fields" ("id") ON DELETE CASCADE ON UPDATE NO ACTION
|
|
) STRICT;
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "crdt_data_attempted_value__fieldId__unique_idx" ON "crdt_data_attempted_value" ("fieldId");
|
|
|
|
|
|
--
|
|
-- Class CrdtDataField as table crdt_data_fields
|
|
--
|
|
CREATE TABLE "crdt_data_fields" (
|
|
"id" INTEGER PRIMARY KEY,
|
|
"hlcDatetime" INTEGER NOT NULL,
|
|
"hlcCounter" INTEGER NOT NULL,
|
|
"rowId" INTEGER NOT NULL,
|
|
"columnId" INTEGER NOT NULL,
|
|
"nodeId" INTEGER NOT NULL,
|
|
CONSTRAINT "crdt_data_fields_fk_0" FOREIGN KEY ("rowId") REFERENCES "crdt_data_rows" ("id") ON DELETE CASCADE ON UPDATE NO ACTION,
|
|
CONSTRAINT "crdt_data_fields_fk_1" FOREIGN KEY ("columnId") REFERENCES "crdt_schema_columns" ("id") ON DELETE CASCADE ON UPDATE NO ACTION,
|
|
CONSTRAINT "crdt_data_fields_fk_2" FOREIGN KEY ("nodeId") REFERENCES "crdt_nodes" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION
|
|
) STRICT;
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "crdt_data_fields_row_column_idx" ON "crdt_data_fields" ("rowId", "columnId");
|
|
|
|
|
|
--
|
|
-- Class CrdtDataRow as table crdt_data_rows
|
|
--
|
|
CREATE TABLE "crdt_data_rows" (
|
|
"id" INTEGER PRIMARY KEY,
|
|
"hlcDatetime" INTEGER NOT NULL,
|
|
"hlcCounter" INTEGER NOT NULL,
|
|
"spaceId" INTEGER NOT NULL,
|
|
"tblId" INTEGER NOT NULL,
|
|
"uuidRowId" BLOB NOT NULL,
|
|
"nodeId" INTEGER NOT NULL,
|
|
"visibility" INTEGER NOT NULL DEFAULT (0),
|
|
CONSTRAINT "crdt_data_rows_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION,
|
|
CONSTRAINT "crdt_data_rows_fk_1" FOREIGN KEY ("tblId") REFERENCES "crdt_schema_tables" ("id") ON DELETE CASCADE ON UPDATE NO ACTION,
|
|
CONSTRAINT "crdt_data_rows_fk_2" FOREIGN KEY ("nodeId") REFERENCES "crdt_nodes" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION
|
|
) STRICT;
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "crdt_data_rows_space_tbl_row_idx" ON "crdt_data_rows" ("spaceId", "tblId", "uuidRowId");
|
|
|
|
|
|
--
|
|
-- Class CrdtDataDeleted as table crdt_data_tombstone
|
|
--
|
|
CREATE TABLE "crdt_data_tombstone" (
|
|
"id" INTEGER PRIMARY KEY,
|
|
"hlcDatetime" INTEGER NOT NULL,
|
|
"hlcCounter" INTEGER NOT NULL,
|
|
"rowId" INTEGER NOT NULL,
|
|
"nodeId" INTEGER NOT NULL,
|
|
"clFlag" INTEGER NOT NULL,
|
|
"reason" INTEGER NOT NULL,
|
|
CONSTRAINT "crdt_data_tombstone_fk_0" FOREIGN KEY ("rowId") REFERENCES "crdt_data_rows" ("id") ON DELETE CASCADE ON UPDATE NO ACTION,
|
|
CONSTRAINT "crdt_data_tombstone_fk_1" FOREIGN KEY ("nodeId") REFERENCES "crdt_nodes" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION
|
|
) STRICT;
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "crdt_data_tombstone_row_idx" ON "crdt_data_tombstone" ("rowId");
|
|
|
|
|
|
--
|
|
-- Class CrdtNode as table crdt_nodes
|
|
--
|
|
CREATE TABLE "crdt_nodes" (
|
|
"id" INTEGER PRIMARY KEY,
|
|
"uuidNodeId" BLOB NOT NULL DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))),
|
|
"lastHlc" BLOB
|
|
) STRICT;
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "crdt_nodes__uuidNodeId__unique_idx" ON "crdt_nodes" ("uuidNodeId");
|
|
|
|
|
|
--
|
|
-- Class CrdtSchemaColumn as table crdt_schema_columns
|
|
--
|
|
CREATE TABLE "crdt_schema_columns" (
|
|
"id" INTEGER PRIMARY KEY,
|
|
"tblId" INTEGER NOT NULL,
|
|
"name" TEXT NOT NULL,
|
|
"columnType" TEXT NOT NULL,
|
|
"dartType" TEXT NOT NULL,
|
|
"isNullable" INTEGER NOT NULL,
|
|
CONSTRAINT "crdt_schema_columns_fk_0" FOREIGN KEY ("tblId") REFERENCES "crdt_schema_tables" ("id") ON DELETE CASCADE ON UPDATE NO ACTION
|
|
) STRICT;
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "crdt_schema_columns_table_column_idx" ON "crdt_schema_columns" ("tblId", "name");
|
|
|
|
|
|
--
|
|
-- Class CrdtSchemaTable as table crdt_schema_tables
|
|
--
|
|
CREATE TABLE "crdt_schema_tables" (
|
|
"id" INTEGER PRIMARY KEY,
|
|
"name" TEXT NOT NULL
|
|
) STRICT;
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "crdt_schema_tables__name__unique_idx" ON "crdt_schema_tables" ("name");
|
|
|
|
|
|
--
|
|
-- Class OfflineSyncIntegrityViolation as table offline_sync_integrity_violations
|
|
--
|
|
CREATE TABLE "offline_sync_integrity_violations" (
|
|
"id" INTEGER PRIMARY KEY,
|
|
"type" TEXT NOT NULL,
|
|
"domainTableName" TEXT NOT NULL,
|
|
"uuidRowId" BLOB NOT NULL,
|
|
"ownerSpaceUuid" BLOB,
|
|
"incomingSpaceUuid" BLOB NOT NULL,
|
|
"operation" TEXT NOT NULL,
|
|
"uuidNodeId" BLOB,
|
|
"crdtDataRowId" INTEGER,
|
|
"hlcDatetime" INTEGER,
|
|
"hlcCounter" INTEGER,
|
|
"firstSeenAt" INTEGER NOT NULL,
|
|
"lastSeenAt" INTEGER NOT NULL,
|
|
"occurrences" INTEGER NOT NULL
|
|
) STRICT;
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "offline_sync_integrity_violations_key_idx" ON "offline_sync_integrity_violations" ("type", "operation", "domainTableName", "uuidRowId", "ownerSpaceUuid", "incomingSpaceUuid");
|
|
|
|
|
|
--
|
|
-- Class OfflineSyncSpaceMember as table offline_sync_space_members
|
|
--
|
|
CREATE TABLE "offline_sync_space_members" (
|
|
"id" INTEGER PRIMARY KEY,
|
|
"spaceId" INTEGER NOT NULL,
|
|
"userUuid" BLOB NOT NULL,
|
|
"role" TEXT NOT NULL,
|
|
CONSTRAINT "offline_sync_space_members_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION
|
|
) STRICT;
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "offline_sync_space_member_unique_idx" ON "offline_sync_space_members" ("userUuid", "spaceId");
|
|
|
|
|
|
--
|
|
-- Class OfflineSyncSpaceNode as table offline_sync_space_nodes
|
|
--
|
|
CREATE TABLE "offline_sync_space_nodes" (
|
|
"id" INTEGER PRIMARY KEY,
|
|
"spaceId" INTEGER NOT NULL,
|
|
"nodeId" INTEGER NOT NULL,
|
|
"lastReceivedHlc" BLOB,
|
|
CONSTRAINT "offline_sync_space_nodes_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION,
|
|
CONSTRAINT "offline_sync_space_nodes_fk_1" FOREIGN KEY ("nodeId") REFERENCES "crdt_nodes" ("id") ON DELETE CASCADE ON UPDATE NO ACTION
|
|
) STRICT;
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "offline_sync_space_node_unique_idx" ON "offline_sync_space_nodes" ("spaceId", "nodeId");
|
|
|
|
|
|
--
|
|
-- Class OfflineSyncSpace as table offline_sync_spaces
|
|
--
|
|
CREATE TABLE "offline_sync_spaces" (
|
|
"id" INTEGER PRIMARY KEY,
|
|
"uuidSpaceId" BLOB NOT NULL DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))),
|
|
"currentNodeId" INTEGER,
|
|
CONSTRAINT "offline_sync_spaces_fk_0" FOREIGN KEY ("currentNodeId") REFERENCES "crdt_nodes" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION
|
|
) STRICT;
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "offline_sync_spaces__uuidSpaceId__unique_idx" ON "offline_sync_spaces" ("uuidSpaceId");
|
|
|
|
|
|
--
|
|
-- Class OidcAttempt as table halkyon_oidc_attempt
|
|
--
|
|
CREATE TABLE "halkyon_oidc_attempt" (
|
|
"id" BLOB PRIMARY KEY DEFAULT (unhex(hex(randomblob(6)) || '4' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))),
|
|
"provider" TEXT NOT NULL,
|
|
"state" TEXT NOT NULL,
|
|
"nonce" TEXT NOT NULL,
|
|
"codeVerifier" TEXT,
|
|
"callerId" BLOB,
|
|
"subject" TEXT,
|
|
"expiresAt" INTEGER NOT NULL,
|
|
CONSTRAINT "halkyon_oidc_attempt_fk_0" FOREIGN KEY ("callerId") REFERENCES "serverpod_auth_core_user" ("id") ON DELETE CASCADE ON UPDATE NO ACTION
|
|
) STRICT;
|
|
|
|
-- Indexes
|
|
CREATE INDEX "halkyon_oidc_attempt_expires_idx" ON "halkyon_oidc_attempt" ("expiresAt");
|
|
|
|
|
|
--
|
|
-- Class OidcIdentity as table halkyon_oidc_identity
|
|
--
|
|
CREATE TABLE "halkyon_oidc_identity" (
|
|
"id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))),
|
|
"authUserId" BLOB NOT NULL,
|
|
"provider" TEXT NOT NULL,
|
|
"subject" TEXT NOT NULL,
|
|
"createdAt" INTEGER NOT NULL,
|
|
CONSTRAINT "halkyon_oidc_identity_fk_0" FOREIGN KEY ("authUserId") REFERENCES "serverpod_auth_core_user" ("id") ON DELETE CASCADE ON UPDATE NO ACTION
|
|
) STRICT;
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "halkyon_oidc_identity_subject_idx" ON "halkyon_oidc_identity" ("provider", "subject");
|
|
CREATE UNIQUE INDEX "halkyon_oidc_identity_person_idx" ON "halkyon_oidc_identity" ("authUserId", "provider");
|
|
|
|
|
|
--
|
|
-- Class RefreshToken as table serverpod_auth_core_jwt_refresh_token
|
|
--
|
|
CREATE TABLE "serverpod_auth_core_jwt_refresh_token" (
|
|
"id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))),
|
|
"authUserId" BLOB NOT NULL,
|
|
"scopeNames" TEXT NOT NULL,
|
|
"extraClaims" TEXT,
|
|
"method" TEXT NOT NULL,
|
|
"fixedSecret" BLOB NOT NULL,
|
|
"rotatingSecretHash" TEXT NOT NULL,
|
|
"lastUpdatedAt" INTEGER NOT NULL DEFAULT (CAST(unixepoch('subsecond') * 1000 AS INTEGER)),
|
|
"createdAt" INTEGER NOT NULL DEFAULT (CAST(unixepoch('subsecond') * 1000 AS INTEGER)),
|
|
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
|
|
) STRICT;
|
|
|
|
-- Indexes
|
|
CREATE INDEX "serverpod_auth_core_jwt_refresh_token_last_updated_at" ON "serverpod_auth_core_jwt_refresh_token" ("lastUpdatedAt");
|
|
|
|
|
|
--
|
|
-- Class UserProfile as table serverpod_auth_core_profile
|
|
--
|
|
CREATE TABLE "serverpod_auth_core_profile" (
|
|
"id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))),
|
|
"authUserId" BLOB NOT NULL,
|
|
"userName" TEXT,
|
|
"fullName" TEXT,
|
|
"email" TEXT,
|
|
"createdAt" INTEGER NOT NULL DEFAULT (CAST(unixepoch('subsecond') * 1000 AS INTEGER)),
|
|
"imageId" BLOB,
|
|
CONSTRAINT "serverpod_auth_core_profile_fk_0" FOREIGN KEY ("authUserId") REFERENCES "serverpod_auth_core_user" ("id") ON DELETE CASCADE ON UPDATE NO ACTION,
|
|
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
|
|
) STRICT;
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "serverpod_auth_profile_user_profile_email_auth_user_id" ON "serverpod_auth_core_profile" ("authUserId");
|
|
|
|
|
|
--
|
|
-- Class UserProfileImage as table serverpod_auth_core_profile_image
|
|
--
|
|
CREATE TABLE "serverpod_auth_core_profile_image" (
|
|
"id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))),
|
|
"userProfileId" BLOB NOT NULL,
|
|
"createdAt" INTEGER NOT NULL DEFAULT (CAST(unixepoch('subsecond') * 1000 AS INTEGER)),
|
|
"storageId" TEXT NOT NULL,
|
|
"path" TEXT NOT NULL,
|
|
"url" TEXT NOT NULL,
|
|
CONSTRAINT "serverpod_auth_core_profile_image_fk_0" FOREIGN KEY ("userProfileId") REFERENCES "serverpod_auth_core_profile" ("id") ON DELETE CASCADE ON UPDATE NO ACTION
|
|
) STRICT;
|
|
|
|
|
|
--
|
|
-- Class ServerSideSession as table serverpod_auth_core_session
|
|
--
|
|
CREATE TABLE "serverpod_auth_core_session" (
|
|
"id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))),
|
|
"authUserId" BLOB NOT NULL,
|
|
"scopeNames" TEXT NOT NULL,
|
|
"createdAt" INTEGER NOT NULL DEFAULT (CAST(unixepoch('subsecond') * 1000 AS INTEGER)),
|
|
"lastUsedAt" INTEGER NOT NULL DEFAULT (CAST(unixepoch('subsecond') * 1000 AS INTEGER)),
|
|
"expiresAt" INTEGER,
|
|
"expireAfterUnusedFor" INTEGER,
|
|
"sessionKeyHash" BLOB NOT NULL,
|
|
"sessionKeySalt" BLOB NOT NULL,
|
|
"method" TEXT NOT NULL,
|
|
CONSTRAINT "serverpod_auth_core_session_fk_0" FOREIGN KEY ("authUserId") REFERENCES "serverpod_auth_core_user" ("id") ON DELETE CASCADE ON UPDATE NO ACTION
|
|
) STRICT;
|
|
|
|
|
|
--
|
|
-- Class AuthUser as table serverpod_auth_core_user
|
|
--
|
|
CREATE TABLE "serverpod_auth_core_user" (
|
|
"id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))),
|
|
"createdAt" INTEGER NOT NULL,
|
|
"scopeNames" TEXT NOT NULL,
|
|
"blocked" INTEGER NOT NULL
|
|
) STRICT;
|
|
|
|
|
|
--
|
|
-- STORE COLUMN TYPES FOR MIGRATIONS
|
|
--
|
|
DROP TABLE IF EXISTS "serverpod_sqlite_schema";
|
|
|
|
CREATE TABLE "serverpod_sqlite_schema" (
|
|
"table_name" TEXT NOT NULL,
|
|
"column_name" TEXT NOT NULL,
|
|
"column_type" TEXT NOT NULL,
|
|
"column_vector_dimension" INTEGER,
|
|
PRIMARY KEY ("table_name", "column_name")
|
|
);
|
|
|
|
INSERT INTO "serverpod_sqlite_schema" VALUES
|
|
('content_key', 'id', 'uuid', NULL),
|
|
('label', 'id', 'uuid', NULL),
|
|
('project', 'id', 'uuid', NULL),
|
|
('section', 'id', 'uuid', NULL),
|
|
('task', 'id', 'uuid', NULL),
|
|
('todo_settings', 'id', 'uuid', NULL),
|
|
('account_deletion_notice', 'account', 'uuid', NULL),
|
|
('account_deletion_notice', 'createdAt', 'timestampWithoutTimeZone', NULL),
|
|
('account_deletion_notice', 'lastAttemptAt', 'timestampWithoutTimeZone', NULL),
|
|
('account_password', 'authUserId', 'uuid', NULL),
|
|
('account_password', 'sessionEndedForProofsAt', 'timestampWithoutTimeZone', NULL),
|
|
('account_password', 'createdAt', 'timestampWithoutTimeZone', NULL),
|
|
('account_password', 'updatedAt', 'timestampWithoutTimeZone', NULL),
|
|
('account_reset', 'authUserId', 'uuid', NULL),
|
|
('account_reset', 'takesEffectAt', 'timestampWithoutTimeZone', NULL),
|
|
('account_reset', 'heldOutUntil', 'timestampWithoutTimeZone', NULL),
|
|
('account_reset', 'createdAt', 'timestampWithoutTimeZone', NULL),
|
|
('assistant_budget', 'authUserId', 'uuid', NULL),
|
|
('assistant_figures', 'authUserId', 'uuid', NULL),
|
|
('assistant_figures', 'day', 'timestampWithoutTimeZone', NULL),
|
|
('assistant_grant', 'authUserId', 'uuid', NULL),
|
|
('assistant_grant', 'grantedAt', 'timestampWithoutTimeZone', NULL),
|
|
('assistant_grant', 'agreedAt', 'timestampWithoutTimeZone', NULL),
|
|
('email_code_request', 'id', 'uuid', NULL),
|
|
('email_code_request', 'challengeId', 'uuid', NULL),
|
|
('email_code_request', 'switchChallengeId', 'uuid', NULL),
|
|
('email_code_request', 'createdAt', 'timestampWithoutTimeZone', NULL),
|
|
('email_identity', 'authUserId', 'uuid', NULL),
|
|
('email_identity', 'createdAt', 'timestampWithoutTimeZone', NULL),
|
|
('public_profile', 'authUserId', 'uuid', NULL),
|
|
('public_profile', 'links', 'json', NULL),
|
|
('public_profile', 'verifiedLinks', 'json', NULL),
|
|
('public_profile', 'firstPublishedAt', 'timestampWithoutTimeZone', NULL),
|
|
('public_profile', 'updatedAt', 'timestampWithoutTimeZone', NULL),
|
|
('recovery_code', 'authUserId', 'uuid', NULL),
|
|
('second_factor_failures', 'authUserId', 'uuid', NULL),
|
|
('second_factor_failures', 'waitUntil', 'timestampWithoutTimeZone', NULL),
|
|
('second_factor_failures', 'updatedAt', 'timestampWithoutTimeZone', NULL),
|
|
('session_code_failures', 'sessionId', 'uuid', NULL),
|
|
('session_code_failures', 'authUserId', 'uuid', NULL),
|
|
('session_code_failures', 'updatedAt', 'timestampWithoutTimeZone', NULL),
|
|
('sessions_ended_notice', 'account', 'uuid', NULL),
|
|
('sessions_ended_notice', 'endedBefore', 'timestampWithoutTimeZone', NULL),
|
|
('sessions_ended_notice', 'keepSession', 'uuid', NULL),
|
|
('sessions_ended_notice', 'lastAttemptAt', 'timestampWithoutTimeZone', NULL),
|
|
('sign_in_challenge', 'id', 'uuid', NULL),
|
|
('sign_in_challenge', 'authUserId', 'uuid', NULL),
|
|
('sign_in_challenge', 'createdAt', 'timestampWithoutTimeZone', NULL),
|
|
('totp_authenticator', 'id', 'uuid', NULL),
|
|
('totp_authenticator', 'authUserId', 'uuid', NULL),
|
|
('totp_authenticator', 'confirmedAt', 'timestampWithoutTimeZone', NULL),
|
|
('totp_authenticator', 'createdAt', 'timestampWithoutTimeZone', NULL),
|
|
('waiting_account', 'authUserId', 'uuid', NULL),
|
|
('waiting_account', 'since', 'timestampWithoutTimeZone', NULL),
|
|
('waiting_account', 'suspendedAt', 'timestampWithoutTimeZone', NULL),
|
|
('waiting_pass', 'authUserId', 'uuid', NULL),
|
|
('waiting_pass', 'madeAt', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_cloud_storage', 'addedTime', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_cloud_storage', 'expiration', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_cloud_storage', 'verified', 'boolean', NULL),
|
|
('serverpod_cloud_storage_direct_download', 'expiration', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_cloud_storage_direct_upload', 'expiration', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_cloud_storage_direct_upload', 'preventOverwrite', 'boolean', NULL),
|
|
('serverpod_future_call', 'time', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_future_call', 'scheduling', 'json', NULL),
|
|
('serverpod_future_call_claim', 'lastHeartbeatTime', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_health_connection_info', 'timestamp', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_health_metric', 'timestamp', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_health_metric', 'isHealthy', 'boolean', NULL),
|
|
('serverpod_log', 'time', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_message_log', 'slow', 'boolean', NULL),
|
|
('serverpod_migrations', 'timestamp', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_query_log', 'slow', 'boolean', NULL),
|
|
('serverpod_runtime_settings', 'logSettings', 'json', NULL),
|
|
('serverpod_runtime_settings', 'logSettingsOverrides', 'json', NULL),
|
|
('serverpod_runtime_settings', 'logServiceCalls', 'boolean', NULL),
|
|
('serverpod_runtime_settings', 'logMalformedCalls', 'boolean', NULL),
|
|
('serverpod_session_log', 'time', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_session_log', 'slow', 'boolean', NULL),
|
|
('serverpod_session_log', 'isOpen', 'boolean', NULL),
|
|
('serverpod_session_log', 'touched', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_auth_idp_anonymous_account', 'id', 'uuid', NULL),
|
|
('serverpod_auth_idp_anonymous_account', 'authUserId', 'uuid', NULL),
|
|
('serverpod_auth_idp_anonymous_account', 'createdAt', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_auth_idp_apple_account', 'id', 'uuid', NULL),
|
|
('serverpod_auth_idp_apple_account', 'refreshTokenRequestedWithBundleIdentifier', 'boolean', NULL),
|
|
('serverpod_auth_idp_apple_account', 'lastRefreshedAt', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_auth_idp_apple_account', 'authUserId', 'uuid', NULL),
|
|
('serverpod_auth_idp_apple_account', 'createdAt', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_auth_idp_apple_account', 'isEmailVerified', 'boolean', NULL),
|
|
('serverpod_auth_idp_apple_account', 'isPrivateEmail', 'boolean', NULL),
|
|
('serverpod_auth_idp_email_account', 'id', 'uuid', NULL),
|
|
('serverpod_auth_idp_email_account', 'authUserId', 'uuid', NULL),
|
|
('serverpod_auth_idp_email_account', 'createdAt', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_auth_idp_email_account_password_reset_request', 'id', 'uuid', NULL),
|
|
('serverpod_auth_idp_email_account_password_reset_request', 'emailAccountId', 'uuid', NULL),
|
|
('serverpod_auth_idp_email_account_password_reset_request', 'createdAt', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_auth_idp_email_account_password_reset_request', 'challengeId', 'uuid', NULL),
|
|
('serverpod_auth_idp_email_account_password_reset_request', 'setPasswordChallengeId', 'uuid', NULL),
|
|
('serverpod_auth_idp_email_account_request', 'id', 'uuid', NULL),
|
|
('serverpod_auth_idp_email_account_request', 'createdAt', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_auth_idp_email_account_request', 'challengeId', 'uuid', NULL),
|
|
('serverpod_auth_idp_email_account_request', 'createAccountChallengeId', 'uuid', NULL),
|
|
('serverpod_auth_idp_facebook_account', 'id', 'uuid', NULL),
|
|
('serverpod_auth_idp_facebook_account', 'authUserId', 'uuid', NULL),
|
|
('serverpod_auth_idp_facebook_account', 'createdAt', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_auth_idp_firebase_account', 'id', 'uuid', NULL),
|
|
('serverpod_auth_idp_firebase_account', 'authUserId', 'uuid', NULL),
|
|
('serverpod_auth_idp_firebase_account', 'created', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_auth_idp_github_account', 'id', 'uuid', NULL),
|
|
('serverpod_auth_idp_github_account', 'authUserId', 'uuid', NULL),
|
|
('serverpod_auth_idp_github_account', 'created', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_auth_idp_google_account', 'id', 'uuid', NULL),
|
|
('serverpod_auth_idp_google_account', 'authUserId', 'uuid', NULL),
|
|
('serverpod_auth_idp_google_account', 'created', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_auth_idp_microsoft_account', 'id', 'uuid', NULL),
|
|
('serverpod_auth_idp_microsoft_account', 'authUserId', 'uuid', NULL),
|
|
('serverpod_auth_idp_microsoft_account', 'created', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_auth_idp_passkey_account', 'id', 'uuid', NULL),
|
|
('serverpod_auth_idp_passkey_account', 'authUserId', 'uuid', NULL),
|
|
('serverpod_auth_idp_passkey_account', 'createdAt', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_auth_idp_passkey_challenge', 'id', 'uuid', NULL),
|
|
('serverpod_auth_idp_passkey_challenge', 'createdAt', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_auth_idp_rate_limited_request_attempt', 'id', 'uuid', NULL),
|
|
('serverpod_auth_idp_rate_limited_request_attempt', 'attemptedAt', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_auth_idp_rate_limited_request_attempt', 'extraData', 'json', NULL),
|
|
('serverpod_auth_idp_secret_challenge', 'id', 'uuid', NULL),
|
|
('crdt_data_attempted_value', 'value', 'jsonb', NULL),
|
|
('crdt_data_fields', 'hlcDatetime', 'timestampWithoutTimeZone', NULL),
|
|
('crdt_data_rows', 'hlcDatetime', 'timestampWithoutTimeZone', NULL),
|
|
('crdt_data_rows', 'uuidRowId', 'uuid', NULL),
|
|
('crdt_data_tombstone', 'hlcDatetime', 'timestampWithoutTimeZone', NULL),
|
|
('crdt_nodes', 'uuidNodeId', 'uuid', NULL),
|
|
('crdt_nodes', 'lastHlc', 'jsonb', NULL),
|
|
('crdt_schema_columns', 'isNullable', 'boolean', NULL),
|
|
('offline_sync_integrity_violations', 'uuidRowId', 'uuid', NULL),
|
|
('offline_sync_integrity_violations', 'ownerSpaceUuid', 'uuid', NULL),
|
|
('offline_sync_integrity_violations', 'incomingSpaceUuid', 'uuid', NULL),
|
|
('offline_sync_integrity_violations', 'uuidNodeId', 'uuid', NULL),
|
|
('offline_sync_integrity_violations', 'hlcDatetime', 'timestampWithoutTimeZone', NULL),
|
|
('offline_sync_integrity_violations', 'firstSeenAt', 'timestampWithoutTimeZone', NULL),
|
|
('offline_sync_integrity_violations', 'lastSeenAt', 'timestampWithoutTimeZone', NULL),
|
|
('offline_sync_space_members', 'userUuid', 'uuid', NULL),
|
|
('offline_sync_space_nodes', 'lastReceivedHlc', 'jsonb', NULL),
|
|
('offline_sync_spaces', 'uuidSpaceId', 'uuid', NULL),
|
|
('halkyon_oidc_attempt', 'id', 'uuid', NULL),
|
|
('halkyon_oidc_attempt', 'callerId', 'uuid', NULL),
|
|
('halkyon_oidc_attempt', 'expiresAt', 'timestampWithoutTimeZone', NULL),
|
|
('halkyon_oidc_identity', 'id', 'uuid', NULL),
|
|
('halkyon_oidc_identity', 'authUserId', 'uuid', NULL),
|
|
('halkyon_oidc_identity', 'createdAt', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_auth_core_jwt_refresh_token', 'id', 'uuid', NULL),
|
|
('serverpod_auth_core_jwt_refresh_token', 'authUserId', 'uuid', NULL),
|
|
('serverpod_auth_core_jwt_refresh_token', 'scopeNames', 'json', NULL),
|
|
('serverpod_auth_core_jwt_refresh_token', 'lastUpdatedAt', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_auth_core_jwt_refresh_token', 'createdAt', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_auth_core_profile', 'id', 'uuid', NULL),
|
|
('serverpod_auth_core_profile', 'authUserId', 'uuid', NULL),
|
|
('serverpod_auth_core_profile', 'createdAt', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_auth_core_profile', 'imageId', 'uuid', NULL),
|
|
('serverpod_auth_core_profile_image', 'id', 'uuid', NULL),
|
|
('serverpod_auth_core_profile_image', 'userProfileId', 'uuid', NULL),
|
|
('serverpod_auth_core_profile_image', 'createdAt', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_auth_core_session', 'id', 'uuid', NULL),
|
|
('serverpod_auth_core_session', 'authUserId', 'uuid', NULL),
|
|
('serverpod_auth_core_session', 'scopeNames', 'json', NULL),
|
|
('serverpod_auth_core_session', 'createdAt', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_auth_core_session', 'lastUsedAt', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_auth_core_session', 'expiresAt', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_auth_core_user', 'id', 'uuid', NULL),
|
|
('serverpod_auth_core_user', 'createdAt', 'timestampWithoutTimeZone', NULL),
|
|
('serverpod_auth_core_user', 'scopeNames', 'json', NULL),
|
|
('serverpod_auth_core_user', 'blocked', 'boolean', NULL);
|
|
|
|
--
|
|
-- MIGRATION VERSION FOR halkyon_todo
|
|
--
|
|
INSERT INTO "serverpod_migrations" ("module", "version", "timestamp")
|
|
VALUES ('halkyon_todo', '20261101180755366-settings', (unixepoch('now', 'subsecond') * 1000))
|
|
ON CONFLICT ("module")
|
|
DO UPDATE SET "version" = '20261101180755366-settings', "timestamp" = (unixepoch('now', 'subsecond') * 1000);
|
|
|
|
--
|
|
-- MIGRATION VERSION FOR halkyon_base
|
|
--
|
|
INSERT INTO "serverpod_migrations" ("module", "version", "timestamp")
|
|
VALUES ('halkyon_base', '20261026140329453-assistant-budgets', (unixepoch('now', 'subsecond') * 1000))
|
|
ON CONFLICT ("module")
|
|
DO UPDATE SET "version" = '20261026140329453-assistant-budgets', "timestamp" = (unixepoch('now', 'subsecond') * 1000);
|
|
|
|
--
|
|
-- MIGRATION VERSION FOR serverpod
|
|
--
|
|
INSERT INTO "serverpod_migrations" ("module", "version", "timestamp")
|
|
VALUES ('serverpod', '20260824182259319', (unixepoch('now', 'subsecond') * 1000))
|
|
ON CONFLICT ("module")
|
|
DO UPDATE SET "version" = '20260824182259319', "timestamp" = (unixepoch('now', 'subsecond') * 1000);
|
|
|
|
--
|
|
-- MIGRATION VERSION FOR serverpod_auth_idp
|
|
--
|
|
INSERT INTO "serverpod_migrations" ("module", "version", "timestamp")
|
|
VALUES ('serverpod_auth_idp', '20260924105404509', (unixepoch('now', 'subsecond') * 1000))
|
|
ON CONFLICT ("module")
|
|
DO UPDATE SET "version" = '20260924105404509', "timestamp" = (unixepoch('now', 'subsecond') * 1000);
|
|
|
|
--
|
|
-- MIGRATION VERSION FOR serverpod_offline_sync
|
|
--
|
|
INSERT INTO "serverpod_migrations" ("module", "version", "timestamp")
|
|
VALUES ('serverpod_offline_sync', '20260914143806119', (unixepoch('now', 'subsecond') * 1000))
|
|
ON CONFLICT ("module")
|
|
DO UPDATE SET "version" = '20260914143806119', "timestamp" = (unixepoch('now', 'subsecond') * 1000);
|
|
|
|
--
|
|
-- MIGRATION VERSION FOR halkyon_oidc
|
|
--
|
|
INSERT INTO "serverpod_migrations" ("module", "version", "timestamp")
|
|
VALUES ('halkyon_oidc', '20261023180644988', (unixepoch('now', 'subsecond') * 1000))
|
|
ON CONFLICT ("module")
|
|
DO UPDATE SET "version" = '20261023180644988', "timestamp" = (unixepoch('now', 'subsecond') * 1000);
|
|
|
|
--
|
|
-- MIGRATION VERSION FOR serverpod_auth_core
|
|
--
|
|
INSERT INTO "serverpod_migrations" ("module", "version", "timestamp")
|
|
VALUES ('serverpod_auth_core', '20260924105232991', (unixepoch('now', 'subsecond') * 1000))
|
|
ON CONFLICT ("module")
|
|
DO UPDATE SET "version" = '20260924105232991', "timestamp" = (unixepoch('now', 'subsecond') * 1000);
|
|
|
|
|
|
COMMIT;
|
|
''';
|
|
}
|