From 10ebef03b2fb33a95dac88cc5460d4b2275139e6 Mon Sep 17 00:00:00 2001 From: Viktor Lidholt Date: Tue, 20 Oct 2026 16:37:51 +0200 Subject: [PATCH] feat(drive): first-party usage analytics for admins Admins get an Analytics page in Wonky Drive (/drive/analytics, admin-only left-menu entry and `drive.analytics.show`): accounts, active today, weekly and monthly active users, stickiness, active users by app, sign-ups, content now and created, collaboration, AI and MCP use, and weekly sign-up cohorts. Aggregates only; admins are left out unless *Include admins* is on. Recording is first-party and minimal (specs/19): one `user_activity_day` row per person, UTC day and app, from the apps' ping at start/resume, item opens, creations and edits (the activity log) and MCP tool calls. Welcome content, scripts and the system don't count. Rows are kept 400 days. Finished days are rolled up once into `usage_day_stats` (a past day never changes), so the rolling DAU/WAU/MAU windows stay off the request path; new indexes cover the date-range scans (activity_event type+at, comment, permission grantedAt, ai_usage at, user_profile createdAt). The charts are drawn in Drive with the app's tokens, colors checked for color vision deficiency, each with a table view. The privacy policy names usage data. Co-Authored-By: Claude Opus 5.5 --- AGENTS.md | 2 +- packages/wonky_app/lib/l10n/wonky_app_en.arb | 4 + .../wonky_app/lib/l10n/wonky_app_en_XA.arb | 1 + .../wonky_app/lib/src/config/home_scope.dart | 16 +- .../wonky_app/lib/src/drive/home_sidebar.dart | 69 +- .../lib/src/l10n/wonky_app_localizations.dart | 6 + .../src/l10n/wonky_app_localizations_en.dart | 6 + .../wonky_app/lib/src/shell/usage_ping.dart | 56 + .../wonky_app/lib/src/shell/wonky_shell.dart | 5 + .../test/drive/mobile_home_test.dart | 3 +- specs/13-security-and-operations.md | 3 + specs/16-bugs-and-improvements.md | 1 + specs/19-usage-analytics.md | 176 + specs/README.md | 1 + specs/wonky_drive/04-screens-menus.md | 8 + wonky_client/lib/src/protocol/client.dart | 40 + .../analytics/models/analytics_cohort.dart | 112 + .../analytics/models/analytics_count.dart | 107 + .../analytics/models/analytics_day.dart | 340 + .../analytics/models/analytics_overview.dart | 376 + .../platform/analytics/models/usage_app.dart | 46 + wonky_client/lib/src/protocol/protocol.dart | 108 + wonky_drive/lib/commands/drive_commands.dart | 36 +- wonky_drive/lib/config/drive_app_config.dart | 15 +- .../lib/features/analytics/analytics_api.dart | 30 + .../features/analytics/analytics_charts.dart | 1032 + .../analytics/analytics_controller.dart | 151 + .../features/analytics/analytics_screen.dart | 822 + .../analytics/analytics_sections.dart | 648 + wonky_drive/lib/l10n/drive_en.arb | 413 + wonky_drive/lib/l10n/drive_en_XA.arb | 77 +- .../lib/l10n/gen/drive_localizations.dart | 450 + .../lib/l10n/gen/drive_localizations_en.dart | 533 + .../analytics/analytics_controller_test.dart | 50 + .../analytics/analytics_screen_test.dart | 200 + wonky_drive/test/support/analytics_fakes.dart | 121 + wonky_drive/test/support/storage_fakes.dart | 13 +- wonky_server/lib/src/generated/endpoints.dart | 59 + .../lib/src/generated/future_calls.dart | 4 +- .../analytics/models/analytics_cohort.dart | 112 + .../analytics/models/analytics_count.dart | 107 + .../analytics/models/analytics_day.dart | 340 + .../analytics/models/analytics_overview.dart | 376 + .../platform/analytics/models/usage_app.dart | 46 + .../analytics/models/usage_counter_day.dart | 689 + .../analytics/models/usage_day_stats.dart | 904 + .../analytics/models/user_activity_day.dart | 726 + wonky_server/lib/src/generated/protocol.dart | 475 + wonky_server/lib/src/generated/protocol.yaml | 3 + .../platform/activity/activity_event.spy.yaml | 3 + .../platform/activity/activity_service.dart | 18 + .../lib/src/platform/ai/ai_usage_service.dart | 10 +- .../src/platform/ai/models/ai_usage.spy.yaml | 3 + .../analytics/analytics_endpoint.dart | 34 + .../platform/analytics/analytics_service.dart | 534 + .../models/analytics_cohort.spy.yaml | 11 + .../analytics/models/analytics_count.spy.yaml | 9 + .../analytics/models/analytics_day.spy.yaml | 33 + .../models/analytics_overview.spy.yaml | 39 + .../analytics/models/usage_app.spy.yaml | 10 + .../models/usage_counter_day.spy.yaml | 13 + .../analytics/models/usage_day_stats.spy.yaml | 27 + .../models/user_activity_day.spy.yaml | 23 + .../src/platform/analytics/usage_tracker.dart | 202 + .../src/platform/board/ai/spec_index.g.dart | 13 + .../src/platform/comments/comment.spy.yaml | 3 + .../src/platform/drive/drive_user_state.dart | 2 + .../jobs/maintenance_future_call.dart | 10 +- .../lib/src/platform/mcp/tool_executor.dart | 7 +- .../sharing/drive_item_permission.spy.yaml | 3 + .../src/platform/users/user_profile.spy.yaml | 3 + .../definition.json | 19940 +++++++++++++++ .../definition.sql | 4327 ++++ .../definition_project.json | 16733 +++++++++++++ .../migration.json | 174 + .../migration.sql | 65 + .../definition.json | 20152 ++++++++++++++++ .../definition.sql | 4354 ++++ .../definition_project.json | 16945 +++++++++++++ .../migration.json | 313 + .../migration.sql | 79 + .../migrations/migration_registry.txt | 2 + .../analytics/analytics_endpoint_test.dart | 358 + .../test_tools/serverpod_test_tools.dart | 87 + wonky_server/web/pages/privacy.html | 7 +- 85 files changed, 94416 insertions(+), 48 deletions(-) create mode 100644 packages/wonky_app/lib/src/shell/usage_ping.dart create mode 100644 specs/19-usage-analytics.md create mode 100644 wonky_client/lib/src/protocol/platform/analytics/models/analytics_cohort.dart create mode 100644 wonky_client/lib/src/protocol/platform/analytics/models/analytics_count.dart create mode 100644 wonky_client/lib/src/protocol/platform/analytics/models/analytics_day.dart create mode 100644 wonky_client/lib/src/protocol/platform/analytics/models/analytics_overview.dart create mode 100644 wonky_client/lib/src/protocol/platform/analytics/models/usage_app.dart create mode 100644 wonky_drive/lib/features/analytics/analytics_api.dart create mode 100644 wonky_drive/lib/features/analytics/analytics_charts.dart create mode 100644 wonky_drive/lib/features/analytics/analytics_controller.dart create mode 100644 wonky_drive/lib/features/analytics/analytics_screen.dart create mode 100644 wonky_drive/lib/features/analytics/analytics_sections.dart create mode 100644 wonky_drive/test/features/analytics/analytics_controller_test.dart create mode 100644 wonky_drive/test/features/analytics/analytics_screen_test.dart create mode 100644 wonky_drive/test/support/analytics_fakes.dart create mode 100644 wonky_server/lib/src/generated/platform/analytics/models/analytics_cohort.dart create mode 100644 wonky_server/lib/src/generated/platform/analytics/models/analytics_count.dart create mode 100644 wonky_server/lib/src/generated/platform/analytics/models/analytics_day.dart create mode 100644 wonky_server/lib/src/generated/platform/analytics/models/analytics_overview.dart create mode 100644 wonky_server/lib/src/generated/platform/analytics/models/usage_app.dart create mode 100644 wonky_server/lib/src/generated/platform/analytics/models/usage_counter_day.dart create mode 100644 wonky_server/lib/src/generated/platform/analytics/models/usage_day_stats.dart create mode 100644 wonky_server/lib/src/generated/platform/analytics/models/user_activity_day.dart create mode 100644 wonky_server/lib/src/platform/analytics/analytics_endpoint.dart create mode 100644 wonky_server/lib/src/platform/analytics/analytics_service.dart create mode 100644 wonky_server/lib/src/platform/analytics/models/analytics_cohort.spy.yaml create mode 100644 wonky_server/lib/src/platform/analytics/models/analytics_count.spy.yaml create mode 100644 wonky_server/lib/src/platform/analytics/models/analytics_day.spy.yaml create mode 100644 wonky_server/lib/src/platform/analytics/models/analytics_overview.spy.yaml create mode 100644 wonky_server/lib/src/platform/analytics/models/usage_app.spy.yaml create mode 100644 wonky_server/lib/src/platform/analytics/models/usage_counter_day.spy.yaml create mode 100644 wonky_server/lib/src/platform/analytics/models/usage_day_stats.spy.yaml create mode 100644 wonky_server/lib/src/platform/analytics/models/user_activity_day.spy.yaml create mode 100644 wonky_server/lib/src/platform/analytics/usage_tracker.dart create mode 100644 wonky_server/migrations/20261020133251149-usage-analytics/definition.json create mode 100644 wonky_server/migrations/20261020133251149-usage-analytics/definition.sql create mode 100644 wonky_server/migrations/20261020133251149-usage-analytics/definition_project.json create mode 100644 wonky_server/migrations/20261020133251149-usage-analytics/migration.json create mode 100644 wonky_server/migrations/20261020133251149-usage-analytics/migration.sql create mode 100644 wonky_server/migrations/20261020142413171-analytics-indexes/definition.json create mode 100644 wonky_server/migrations/20261020142413171-analytics-indexes/definition.sql create mode 100644 wonky_server/migrations/20261020142413171-analytics-indexes/definition_project.json create mode 100644 wonky_server/migrations/20261020142413171-analytics-indexes/migration.json create mode 100644 wonky_server/migrations/20261020142413171-analytics-indexes/migration.sql create mode 100644 wonky_server/test/integration/platform/analytics/analytics_endpoint_test.dart diff --git a/AGENTS.md b/AGENTS.md index ff2aefec..b97a2157 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -4,7 +4,7 @@ ## Specs -The specs in `specs/` are the source of truth. Start with `specs/README.md` (reading order, conventions), then `specs/01-architecture.md` (layout, package rules, how the apps are served). App specs: `specs/wonky_write/`, `specs/wonky_sheets/`, `specs/wonky_drive/` and `specs/wonky_slides/` (v2 decisions: `specs/v2-review.md`). Cross-app features: `specs/16-bugs-and-improvements.md` (Bugs & improvements board, M12); the RevLog sync of Sheets and Slides: `specs/17-revlog-sync.md`. Blog submissions from Wonky Write (M14, built): `specs/18-publications-and-submissions.md`; the guide for blog owners is `docs/blog-integration.md`. When implementation reveals a better approach, update the spec in the same change. +The specs in `specs/` are the source of truth. Start with `specs/README.md` (reading order, conventions), then `specs/01-architecture.md` (layout, package rules, how the apps are served). App specs: `specs/wonky_write/`, `specs/wonky_sheets/`, `specs/wonky_drive/` and `specs/wonky_slides/` (v2 decisions: `specs/v2-review.md`). Cross-app features: `specs/16-bugs-and-improvements.md` (Bugs & improvements board, M12); the RevLog sync of Sheets and Slides: `specs/17-revlog-sync.md`. Blog submissions from Wonky Write (M14, built): `specs/18-publications-and-submissions.md`; the guide for blog owners is `docs/blog-integration.md`. First-party usage analytics for admins in Wonky Drive (`/drive/analytics`, built): `specs/19-usage-analytics.md`. When implementation reveals a better approach, update the spec in the same change. Key rules from the specs: every user-visible action is a command and every state change is undoable (`specs/08-commands-and-undo.md`); single window, never open new tabs or windows (`specs/03-app-shell-and-navigation.md`); UI is built with `shad` and custom widgets in `wonky_ui` (`specs/02-design-system.md`); everything works in light and dark. diff --git a/packages/wonky_app/lib/l10n/wonky_app_en.arb b/packages/wonky_app/lib/l10n/wonky_app_en.arb index e0ef9cf2..581ba667 100644 --- a/packages/wonky_app/lib/l10n/wonky_app_en.arb +++ b/packages/wonky_app/lib/l10n/wonky_app_en.arb @@ -666,6 +666,10 @@ "@navStorage": { "description": "Left menu (Drive): the Storage page; storage meter label." }, + "navAnalytics": "Analytics", + "@navAnalytics": { + "description": "Left menu (Drive, admins only): the usage analytics page (specs/19)." + }, "navTrash": "Trash", "newButton": "New", "newFolderLabel": "Folder name", diff --git a/packages/wonky_app/lib/l10n/wonky_app_en_XA.arb b/packages/wonky_app/lib/l10n/wonky_app_en_XA.arb index bf87d530..73f5335b 100644 --- a/packages/wonky_app/lib/l10n/wonky_app_en_XA.arb +++ b/packages/wonky_app/lib/l10n/wonky_app_en_XA.arb @@ -372,6 +372,7 @@ "navShared": "[Šĥåŕéð ŵîţĥ ɱé one t]", "navStarred": "[Šţåŕŕéð one]", "navStorage": "[Šţöŕåĝé one]", + "navAnalytics": "[Åñåļýţîçš one]", "navTrash": "[Ţŕåšĥ on]", "newButton": "[Ñéŵ on]", "newFolderLabel": "[Ƒöļðéŕ ñåɱé one]", diff --git a/packages/wonky_app/lib/src/config/home_scope.dart b/packages/wonky_app/lib/src/config/home_scope.dart index 9f5b959c..be8b3a7a 100644 --- a/packages/wonky_app/lib/src/config/home_scope.dart +++ b/packages/wonky_app/lib/src/config/home_scope.dart @@ -102,26 +102,33 @@ enum HomeNavDestination { /// Drive only: the Storage page (`/storage`). storage, + + /// Drive only, admins only: usage analytics (`/analytics`, specs/19). + analytics, } /// One entry of the left menu's navigation. @immutable class HomeNavItem { - const HomeNavItem(this.destination, this.route); + const HomeNavItem(this.destination, this.route, {this.adminOnly = false}); final HomeNavDestination destination; /// The route relative to the app's base href, e.g. `/my-files`. final String route; + /// Shown to admins only (the board's admin rule, specs/16 §9.1). + final bool adminOnly; + @override bool operator ==(Object other) => other is HomeNavItem && other.destination == destination && - other.route == route; + other.route == route && + other.adminOnly == adminOnly; @override - int get hashCode => Object.hash(destination, route); + int get hashCode => Object.hash(destination, route, adminOnly); } /// The navigation section of an app's left menu (`WonkyAppConfig.homeNav`, @@ -145,7 +152,7 @@ class HomeNavSpec { ); /// Wonky Drive: Home, My Drive (+ folder tree), Shared with me, Recent, - /// Starred, Trash, Storage. + /// Starred, Trash, Storage, and for admins Analytics. static const drive = HomeNavSpec( items: [ HomeNavItem(HomeNavDestination.home, '/'), @@ -155,6 +162,7 @@ class HomeNavSpec { HomeNavItem(HomeNavDestination.starred, '/starred'), HomeNavItem(HomeNavDestination.trash, '/trash'), HomeNavItem(HomeNavDestination.storage, '/storage'), + HomeNavItem(HomeNavDestination.analytics, '/analytics', adminOnly: true), ], folderTree: true, ); diff --git a/packages/wonky_app/lib/src/drive/home_sidebar.dart b/packages/wonky_app/lib/src/drive/home_sidebar.dart index 939a2061..61a8e9d9 100644 --- a/packages/wonky_app/lib/src/drive/home_sidebar.dart +++ b/packages/wonky_app/lib/src/drive/home_sidebar.dart @@ -7,6 +7,7 @@ import 'package:wonky_client/wonky_client.dart'; import 'package:wonky_core/wonky_core.dart' show InvocationSource; import 'package:wonky_ui/wonky_ui.dart'; +import '../board/board_hub.dart'; import '../bootstrap/app_urls.dart'; import '../branding/product_icon.dart'; import '../config/home_scope.dart'; @@ -60,16 +61,29 @@ class _HomeSidebarState extends State { ShellServices get s => widget.services; + /// Whether the menu has admin-only destinations (Drive's Analytics). + bool get _hasAdminItems => s.config.homeNav.items.any((i) => i.adminOnly); + @override void initState() { super.initState(); _sub = s.driveChanges.listen((c) { if (c.item?.isFolder ?? true) _tree.refresh(c.item?.parentUuid?.uuid); }); + if (_hasAdminItems) { + final hub = BoardHub.of(s); + hub.me.addListener(_onAdminChanged); + unawaited(hub.loadMe()); + } + } + + void _onAdminChanged() { + if (mounted) setState(() {}); } @override void dispose() { + if (_hasAdminItems) BoardHub.of(s).me.removeListener(_onAdminChanged); _sub?.cancel(); _tree.dispose(); super.dispose(); @@ -132,7 +146,7 @@ class _HomeSidebarState extends State { HomeNavDestination.starred => k == DriveLocationKind.starred, HomeNavDestination.offline => k == DriveLocationKind.offline, HomeNavDestination.trash => k == DriveLocationKind.trash, - HomeNavDestination.storage => false, + HomeNavDestination.storage || HomeNavDestination.analytics => false, }; } @@ -191,32 +205,34 @@ class _HomeSidebarState extends State { HomeNewButton(services: s, onNavigate: widget.onNavigate) else const SizedBox(height: 4), - for (final item in nav.items) ...[ - navRow(item), - if (_treeOpen && - nav.folderTree && - item.destination == HomeNavDestination.myFiles) - SizedBox( - height: 240, - child: WonkyTreeView( - keyPrefix: 'drive.tree', - controller: _tree, - semanticLabel: l.folderTree, - onActivate: (n) => _go('/f/${n.id}'), - dragData: (n) => - dragMoves && n.value.canManage ? DriveDragData([n.id]) : null, - canAcceptDrop: (data, target, pos) => - dragMoves && - data is DriveDragData && - pos == WonkyTreeDropPosition.inside && - target.value.canEdit && - !data.uuids.contains(target.id), - onDrop: (data, target, pos) { - if (data is DriveDragData) dropIntoFolder(s, data, target.id); - }, + for (final item in nav.items) + if (!item.adminOnly || BoardHub.of(s).isAdmin) ...[ + navRow(item), + if (_treeOpen && + nav.folderTree && + item.destination == HomeNavDestination.myFiles) + SizedBox( + height: 240, + child: WonkyTreeView( + keyPrefix: 'drive.tree', + controller: _tree, + semanticLabel: l.folderTree, + onActivate: (n) => _go('/f/${n.id}'), + dragData: (n) => dragMoves && n.value.canManage + ? DriveDragData([n.id]) + : null, + canAcceptDrop: (data, target, pos) => + dragMoves && + data is DriveDragData && + pos == WonkyTreeDropPosition.inside && + target.value.canEdit && + !data.uuids.contains(target.id), + onDrop: (data, target, pos) { + if (data is DriveDragData) dropIntoFolder(s, data, target.id); + }, + ), ), - ), - ], + ], ]; return SizedBox( @@ -264,6 +280,7 @@ class _HomeSidebarState extends State { HomeNavDestination.offline => (LucideIcons.cloudDownload, l.navOffline), HomeNavDestination.trash => (LucideIcons.trash2, l.navTrash), HomeNavDestination.storage => (LucideIcons.chartPie, l.navStorage), + HomeNavDestination.analytics => (LucideIcons.chartLine, l.navAnalytics), }; /// Whether the home of [scope] has a *+ New* button: Drive and v1 homes; diff --git a/packages/wonky_app/lib/src/l10n/wonky_app_localizations.dart b/packages/wonky_app/lib/src/l10n/wonky_app_localizations.dart index 5d760d2d..bd7ceeeb 100644 --- a/packages/wonky_app/lib/src/l10n/wonky_app_localizations.dart +++ b/packages/wonky_app/lib/src/l10n/wonky_app_localizations.dart @@ -2326,6 +2326,12 @@ abstract class WonkyAppLocalizations { /// **'Storage'** String get navStorage; + /// Left menu (Drive, admins only): the usage analytics page (specs/19). + /// + /// In en, this message translates to: + /// **'Analytics'** + String get navAnalytics; + /// No description provided for @navTrash. /// /// In en, this message translates to: diff --git a/packages/wonky_app/lib/src/l10n/wonky_app_localizations_en.dart b/packages/wonky_app/lib/src/l10n/wonky_app_localizations_en.dart index 926be716..924ec14f 100644 --- a/packages/wonky_app/lib/src/l10n/wonky_app_localizations_en.dart +++ b/packages/wonky_app/lib/src/l10n/wonky_app_localizations_en.dart @@ -1217,6 +1217,9 @@ class WonkyAppLocalizationsEn extends WonkyAppLocalizations { @override String get navStorage => 'Storage'; + @override + String get navAnalytics => 'Analytics'; + @override String get navTrash => 'Trash'; @@ -6264,6 +6267,9 @@ class WonkyAppLocalizationsEnXa extends WonkyAppLocalizationsEn { @override String get navStorage => '[Šţöŕåĝé one]'; + @override + String get navAnalytics => '[Åñåļýţîçš one]'; + @override String get navTrash => '[Ţŕåšĥ on]'; diff --git a/packages/wonky_app/lib/src/shell/usage_ping.dart b/packages/wonky_app/lib/src/shell/usage_ping.dart new file mode 100644 index 00000000..aacb9cfe --- /dev/null +++ b/packages/wonky_app/lib/src/shell/usage_ping.dart @@ -0,0 +1,56 @@ +import 'dart:async'; + +import 'package:clock/clock.dart'; +import 'package:flutter/widgets.dart'; +import 'package:wonky_client/wonky_client.dart'; + +import 'shell_services.dart'; + +/// Tells the server that the signed-in user is using this app, for the +/// usage analytics (specs/19 §2): at sign-in and whenever the app comes +/// back to the foreground, at most every [interval]. Best effort: a failed +/// ping is dropped. +class UsagePing with WidgetsBindingObserver { + UsagePing(this.services); + + final ShellServices services; + + /// The shortest time between two pings. + static const interval = Duration(minutes: 30); + + DateTime? _last; + bool _started = false; + + void start() { + if (_started) return; + _started = true; + WidgetsBinding.instance.addObserver(this); + unawaited(ping()); + } + + void stop() { + if (!_started) return; + _started = false; + WidgetsBinding.instance.removeObserver(this); + _last = null; + } + + @override + void didChangeAppLifecycleState(AppLifecycleState state) { + if (state == AppLifecycleState.resumed) unawaited(ping()); + } + + Future ping() async { + final c = services.client; + if (c == null || !services.auth.isSignedIn) return; + final now = clock.now(); + final last = _last; + if (last != null && now.difference(last) < interval) return; + _last = now; + try { + await c.analytics.ping(UsageApp.values.byName(services.config.app.name)); + } catch (_) { + // Best effort: analytics never disturb the app. + } + } +} diff --git a/packages/wonky_app/lib/src/shell/wonky_shell.dart b/packages/wonky_app/lib/src/shell/wonky_shell.dart index 3a37ab36..c43e6da6 100644 --- a/packages/wonky_app/lib/src/shell/wonky_shell.dart +++ b/packages/wonky_app/lib/src/shell/wonky_shell.dart @@ -35,6 +35,7 @@ import '../board/board_repository.dart'; import '../publications/publication_repository.dart'; import 'overlays/shell_overlays.dart'; import 'shell_services.dart'; +import 'usage_ping.dart'; import '../undo/undo_service.dart'; /// The locale tag forced at build time with @@ -169,6 +170,7 @@ class _WonkyShellState extends State { bool _ready = false; final Locale? _locale = forcedLocale(); StreamSubscription? _undoSub; + late final UsagePing _usagePing = UsagePing(s); late final AppLifecycleListener _lifecycle; @override @@ -310,10 +312,12 @@ class _WonkyShellState extends State { ); } _undoSub ??= s.undo.outcomes.listen((_) => s.registry.notifyStateChanged()); + _usagePing.start(); await widget.config.onSignedIn(s); } Future _beforeSignOut() async { + _usagePing.stop(); await widget.config.onSigningOut(s); await s.supervisor.cancelAll(); final storage = s.storage; @@ -350,6 +354,7 @@ class _WonkyShellState extends State { void dispose() { HardwareKeyboard.instance.removeHandler(_onUnfocusedKey); _lifecycle.dispose(); + _usagePing.stop(); _undoSub?.cancel(); s.auth.removeListener(_onAuth); s.router.routerDelegate.removeListener(_onRoute); diff --git a/packages/wonky_app/test/drive/mobile_home_test.dart b/packages/wonky_app/test/drive/mobile_home_test.dart index 78f7fb34..4d1841ad 100644 --- a/packages/wonky_app/test/drive/mobile_home_test.dart +++ b/packages/wonky_app/test/drive/mobile_home_test.dart @@ -222,8 +222,9 @@ void main() { expect(key('home.footer.reportBug'), findsOneWidget); expect(key('home.storage'), findsOneWidget); final rows = [ + // Admin-only entries (Drive's Analytics) are hidden here. for (final item in h.services.config.homeNav.items) - 'drive.nav.${item.destination.name}', + if (!item.adminOnly) 'drive.nav.${item.destination.name}', for (final a in WonkyAppKind.values) 'home.app.${a.name}', 'home.footer.reportBug', ]; diff --git a/specs/13-security-and-operations.md b/specs/13-security-and-operations.md index c4a55fce..4fe2d742 100644 --- a/specs/13-security-and-operations.md +++ b/specs/13-security-and-operations.md @@ -51,6 +51,9 @@ - (M14) Submissions send a document's text, images, fields and the submitter's display name to the publication the user chose, after a consent dialog; publication signing secrets are stored unencrypted because they must sign ([18 §11](18-publications-and-submissions.md)). +- Usage analytics ([19](19-usage-analytics.md)): one row per person, UTC day and app (ids, a + day, an app and an *edited* flag; never content), kept 400 days; shown to admins only, and + named in the privacy policy (*Usage data*). - Export of all user data (*Settings › Account › Download your data*: zip of documents as Markdown, spreadsheets as XLSX, comments as JSON) — P1. diff --git a/specs/16-bugs-and-improvements.md b/specs/16-bugs-and-improvements.md index aea98ae4..f132578b 100644 --- a/specs/16-bugs-and-improvements.md +++ b/specs/16-bugs-and-improvements.md @@ -1169,6 +1169,7 @@ wonky: re-verification, or if `validateGoogleAccountDetails` is overridden. - Admin status is never stored. Removing the domain from the config removes admin rights at the next request. +- The same rule decides who sees the usage analytics in Wonky Drive ([19](19-usage-analytics.md)). - `board.me()` returns `{signedIn, isAdmin, blocked, activeClaims, maxActiveClaims, claimBlockedUntil?, claimBlockedReason?, githubLogin?}` for the client. It is used to show admin UI only; every admin endpoint checks again on the server. diff --git a/specs/19-usage-analytics.md b/specs/19-usage-analytics.md new file mode 100644 index 00000000..c50606c9 --- /dev/null +++ b/specs/19-usage-analytics.md @@ -0,0 +1,176 @@ +# 19 · Usage analytics + +First-party usage analytics for the Wonky Work team: how many accounts there are, how many people +use the suite (DAU/WAU/MAU), which apps they use, what they create, how they collaborate, AI and +MCP use, and whether new accounts come back. Aggregates only, no per-person list. Shown on an admin-only page in Wonky Drive +(`/drive/analytics`). Built, October 2026. + +## 1. Decisions + +| # | Decision | Why | +|---|----------|-----| +| U1 | **First-party, in our own Postgres.** No third-party tracker (PostHog, GA, Plausible…) | The source of truth (accounts, sign-ins, items) is already in the database. Client-side trackers are blocked by ad blockers, conflict with the apps' cross-origin isolation (COOP/COEP, 13 §3), and would need consent banners and a new data processor | +| U2 | **Ids and counts only.** One row per person, UTC day and app; no content, no URLs, no events stream | Data minimization (13 §2) | +| U3 | **Admins only**, with the board's admin rule (16 §9.1: account email in `board.adminEmailDomains` / `board.adminEmails`), checked on the server for every call | One admin notion for the suite | +| U4 | **Tracking starts at deploy**, with no backfill. Accounts, content, comments, shares and AI use come from tables that already have history; activity (DAU/WAU/MAU, apps, retention) starts empty | User decision: exact numbers over reconstructed ones | +| U5 | **Active** = used an app while signed in (app start or resume, opening an item, an edit) or an MCP client with the person's token. A second line, **Created or edited**, counts people who created, uploaded, edited or restored something that day | User decision | +| U6 | **Admins are left out of every count by default**; the page has an *Include admins* switch | The team's own use would distort small numbers | +| U7 | **No per-person list.** The page shows aggregates only | User decision | +| U8 | **Custom lightweight charts in `wonky_drive`**, not the shared chart engine (`wonky_charts_flutter`) | The engine pulls `flutter_scene` (environment map, LUTs, shader bundles) into Drive's bundle, the app everyone lands on, for one admin page | + +## 2. Recording (server) + +`UsageTracker` (`wonky_server/lib/src/platform/analytics/usage_tracker.dart`) writes: + +- **`user_activity_day`** (`UserActivityDay`, `serverOnly`): `userId`, `day` (UTC midnight), `app` + (`UsageApp`: `drive`, `write`, `sheets`, `slides`, `mcp`), `edited` (bool). Unique per + (user, day, app); upserted with `ON CONFLICT … edited = edited OR EXCLUDED.edited`. + `userId` has **no foreign key** on purpose: rows are written beside transactions that may + lock the profile, and past days' counts stay put when an account is deleted (the row keeps + only the bare id until it is purged). +- **`usage_counter_day`** (`UsageCounterDay`): daily counters by name; today only + `mcp.calls`. + +Sources: + +| Source | Hook | App | Edited | +|--------|------|-----|--------| +| App start and resume (at most every 30 min per app) | `analytics.ping(app)` from the shell's `UsagePing` | the app | — | +| Opening an item (Write document stream, RevLog open, `drive.markOpened`) | `DriveUserStates.recordOpen` | by kind: document → Write, spreadsheet → Sheets, presentation → Slides, folder/file → Drive; MCP actors → `mcp` | — | +| Creating, uploading, restoring a version | `ActivityService.log` (`created`, `uploaded`, `restoredVersion`) | by kind | ✓ | +| Edits | `ActivityService.logEdit` | by kind | ✓ | +| MCP tool calls by a person's token (`ActorKind.mcp`, not the assistant) | `McpToolExecutor.call` | `mcp`, plus `mcp.calls` + 1 | — | + +- The assistant's edits (`ActorKind.ai`) count for the person who asked; scripts and the system + don't count. +- The **welcome content** (the welcome document and spreadsheet every account gets, + `write.welcome` / `sheets.welcome`) is not counted as created and does not make anyone an + editor. +- Each instance remembers which (user, day, app) keys it wrote (LRU of 50,000), so the hot paths + cost a map lookup. Pings, opens and MCP calls also refresh `user_profile.lastSeenAt` (at most + every 15 min per user). Edits don't, because they can run inside a transaction that locks the + profile. +- Tracking never fails the request that triggers it: database errors are logged at `warning`. +- **Retention**: rows older than 400 days are deleted by the daily job + `analytics.purgeActivity` (a year-over-year view of the last 30 days). AI usage has its own + 90 days (`AiUsageService.retentionDays`). + +### 2.1 Rollup and indexes + +- **`usage_day_stats`** (`UsageDayStats`, `serverOnly`): one row per finished UTC day and + `includeAdmins` (unique), with active, editors, the five apps, weekly and monthly. + - The overview computes a missing finished day once from `user_activity_day` and inserts it + (`ON CONFLICT DO NOTHING`), then reads it from there. Only today is computed live. + - A finished day never changes, because activity is only written for the current day. The + rows also outlive the 400-day purge. + - The admin rule is frozen at the time a day was computed: admins added later still count + in older days. + - This keeps the rolling `count(DISTINCT)` windows (days × 30 × daily active users) off the + request path after the first view. +- **Indexes** for the date-range scans: + - `user_activity_day` (`day`), and the unique (`userId`, `day`, `app`) for cohorts. + - `activity_event` (`type`, `at`). + - `comment` (`createdAt`). + - `drive_item_permission` (`grantedAt`). + - `ai_usage` (`at`), which also serves the daily purge. + - `user_profile` (`createdAt`). + - `usage_counter_day` (`day`, `name`). +- **Full scans** remain for the "now" totals (items by kind, storage, sign-in methods, shared + items). They are bounded by the table sizes and covered by the overview cache. + +## 3. Dashboard + +`AnalyticsEndpoint` (`analytics.*`, sign-in required): + +| Method | Who | What | +|--------|-----|------| +| `ping(UsageApp app)` | anyone signed in | records activity (§2) | +| `overview(int days, bool includeAdmins)` | admins | `AnalyticsOverview` for 7, 30, 90 or 365 days ending today (UTC); other periods are `invalidArgument`. Cached for 1 minute per (days, includeAdmins) | + +Non-admins get `forbidden`. Aggregates are computed in SQL (`AnalyticsService`). + +### 3.1 Page (`/drive/analytics[?days=…&admins=1]`) + +- **Access.** An admin-only left-menu destination *Analytics* (`HomeNavItem(adminOnly: true)`) + below *Storage*, shown when `BoardHub.me.isAdmin`. The command `drive.analytics.show + {days?, includeAdmins?}` (category *Analytics*) is enabled for admins only. Opened directly by + someone else, the page shows *Analytics are for admins*. +- **Frame and controls.** The Storage page's frame (top bar, left menu, content card). The header + has the period (7/30/90/365 days, as tabs; a select below 600 px), *Include admins* and + *Refresh*, plus the note *Updated hh:mm*, and *Activity recorded since …* when tracking + started inside the period. +- **Sections:** + 1. **KPIs**: accounts (+ new in period), active today (and how many created or edited), + weekly active, monthly active, stickiness (average daily active users of the last 30 days + ÷ MAU) and items created. Sparklines where the measure has a trend. + 2. **Active users**: Daily (Active + *Created or edited*), Weekly and Monthly tabs. + 3. **Active users by app**: Drive, Write, Sheets, Slides and MCP clients (dashed). + 4. **Sign-ups** (bars) beside **Content now** (items by kind, storage) and **Sign-in + methods** (email / Google). + 5. **Content created**: stacked bars by kind (documents, spreadsheets, presentations, files). + Counts creations and uploads by people, the assistant and MCP. + 6. **Collaboration**: items shared now, items co-edited by 2+ people in the period, + commenters, and a chart of comments and shares per day. + 7. **AI assistant**: requests per day, and by feature and by model (requests and tokens). + 8. **MCP tool calls** per day. Admins are always included here, because the counter is not + per person. + 9. **Retention**: weekly sign-up cohorts (Monday, UTC, last 12 weeks), one cell per week + since sign-up with the share still active, shaded with the ink. Weeks before tracking + started are blank. + +### 3.2 Charts + +`analytics_charts.dart` holds the line chart (crosshair, dots, tooltip), the stacked bars (2 px +gaps, rounded tops, highlight band, tooltip with total), the rank bars, the sparklines and the +legend (a click hides a series). Charts follow the dataviz rules: + +- 2 px lines and 4 px rounded data ends. +- Recessive gridlines. +- Text in text tokens. +- A legend for two or more series. +- Bars daily up to 90 days, weekly beyond (the last bar ends today). +- Every card can switch to a **table view**. + +Colors (`AnalyticsColors`): + +- The apps keep the drive kind colors: Write blue `#2563eb`, Sheets green `#16a34a`, Slides + amber `#d97706`. +- Drive is pink (`#db2777` / dark `#ec4899`) and MCP cyan `#0891b2`. Drive's violet can't be + told from blue with deuteranopia. +- Other measures use the ink and violet (`#7c3aed` / `#a78bfa`). + +The palette was validated for color vision deficiency in light and dark. The worst pair is +ΔE 6.1, in the floor band, so series are always named in legends and tooltips. + +## 4. Privacy + +13 §2 lists it: activity rows hold a user id, a day, an app and a flag, kept 400 days. The page +shows aggregates only. The privacy policy (`/privacy`) +names it under *What we collect › Usage data* and *How we use it* (aggregate statistics for the +team). + +## 5. Tests + +- **Server** (`test/integration/platform/analytics/analytics_endpoint_test.dart`): + - Permissions and period validation. + - Ping dedupe, per-app counts and admins left out or included. + - Creation makes an editor, and the welcome content is excluded. + - Rolling 7/30-day windows, MCP calls, shares and cohorts. + - Finished days read from the rollup, purge after 400 days, scripts not counting. + - The test database is shared and not rolled back. Each test therefore works under a fixed + clock in a far-future 500-day window of its own, and clears that window first. People are + created with the real clock (unique emails) and then signed up inside the window. +- **Drive** (`test/features/analytics/`): + - Left menu for admins and non-admins, the forbidden state. + - Period and switch through the command and route. + - Hover tooltip, table view and the Monthly tab. + - Dark, 360 px and the pseudo-locale. + - The bucketing helpers. + +## 6. Later + +- MCP calls per person, so *Include admins* applies to them too. +- Funnels (signed up → created → shared) and per-command feature usage: commands are the one + place every action passes (08), so counting command ids per day would need no client tracker. +- Rollups for the other per-day series (sign-ups, content, comments, shares, AI) if their + indexed range scans get slow. diff --git a/specs/README.md b/specs/README.md index 4e8ba85e..807116f7 100644 --- a/specs/README.md +++ b/specs/README.md @@ -72,6 +72,7 @@ charts). | 16 | [Bugs & improvements](16-bugs-and-improvements.md) | Public board for bug reports and improvement ideas: report dialog with annotated screenshots, votes, comments, AI triage and moderation, admins, tasks with contributor prompts, claims, GitHub PR rules (M12, built) | | 17 | [RevLog sync](17-revlog-sync.md) | Server-sequenced op log of Sheets and Slides: decisions, data model, change sets and apply rules, protocol, server (sequencer, hooks, pages, headless cache), client (cache, outbox, bootstrap, conflicts), performance gates, as-built notes (M13) | | 18 | [Publications & submissions](18-publications-and-submissions.md) | Blogs register a publication; contributors write in Wonky Write and *Submit* to the blog's review queue (signed webhooks, publication API, moderators with comment access, feedback in the document) (M14, built) | +| 19 | [Usage analytics](19-usage-analytics.md) | First-party analytics for admins in Wonky Drive: daily activity per person and app (ids and counts only), DAU/WAU/MAU, content, collaboration, AI and MCP use, sign-up cohorts, a daily rollup (built) | ## Conventions used in all specs diff --git a/specs/wonky_drive/04-screens-menus.md b/specs/wonky_drive/04-screens-menus.md index 981c8384..4128ee31 100644 --- a/specs/wonky_drive/04-screens-menus.md +++ b/specs/wonky_drive/04-screens-menus.md @@ -50,6 +50,7 @@ and is configured by the app (`WonkyAppConfig.homeNav`, suite 03 §3.3). Drive v │ ☆ Starred │ │ 🗑 Trash │ │ ◔ Storage │ +│ 📈 Analytics │ ← admins only (specs/19 §3.1) │ │ ← flexible space │ ──────────────────────────── │ │ ⚙ Drive settings │ → /settings/app (shell.settings.openApp) @@ -304,6 +305,12 @@ Specified in [03 §6.4](03-storage-quota.md). Reached from the left-menu item *S `StorageMeter`, banners, dialogs (*Manage storage*), Settings › Wonky Work › Storage and `shell.storage.open`. +### 7.1 Analytics page (`/drive/analytics`, admins only) + +Specified in [suite 19 §3](../19-usage-analytics.md). Reached from the admin-only left-menu item +*Analytics* (`HomeNavItem(adminOnly: true)`, shown when `BoardHub.me.isAdmin`) and +`drive.analytics.show`; same frame as the Storage page. + ## 8. Drive settings (`/settings/app`) Shown in the settings frame's app group "Wonky Drive" (suite 04 §4). One section `drive`: @@ -362,6 +369,7 @@ Drive-only commands use `drive..` and are registered by `wonky_dri | `drive.view.toggleFoldersOnTop` | Folders on top | — | — | — | | `drive.prefs.set` | (settings) | `{key, value}` | — | — | | `drive.storage.show` | Show storage | `{filter?: all\|documents\|spreadsheets\|presentations\|files\|trash\|large\|notOpened}` → `/storage?filter=` | — | — | +| `drive.analytics.show` | Show analytics (admins only, suite 19 §3.1) | `{days?: 7\|30\|90\|365, includeAdmins?}` | — | — | | `drive.ai.askAboutItem` (P1) | Ask the assistant about this file | `{uuid}` | — | — | Shell commands used (unchanged ids): `shell.drive.newFolder` (`Shift+F`), `rename` (`F2`), diff --git a/wonky_client/lib/src/protocol/client.dart b/wonky_client/lib/src/protocol/client.dart index 2031470f..778114f4 100644 --- a/wonky_client/lib/src/protocol/client.dart +++ b/wonky_client/lib/src/protocol/client.dart @@ -42,6 +42,10 @@ import 'package:wonky_client/src/protocol/platform/ai/models/inline_ai_request.d as _i31mo4jy; import 'package:wonky_client/src/protocol/platform/ai/models/proofread_event.dart' as _irtrv5vw; +import 'package:wonky_client/src/protocol/platform/analytics/models/analytics_overview.dart' + as _iu8mc7mo; +import 'package:wonky_client/src/protocol/platform/analytics/models/usage_app.dart' + as _izdyac9h; import 'package:wonky_client/src/protocol/platform/board/models/board_area.dart' as _ix53eas0; import 'package:wonky_client/src/protocol/platform/board/models/board_bundle_suggestion_view.dart' @@ -754,6 +758,38 @@ class EndpointAssistant extends _isc.EndpointRef { ); } +/// Usage analytics (specs/19): the apps' activity ping, and the admin +/// dashboard of Wonky Drive (overview, admins only). +/// {@category Endpoint} +class EndpointAnalytics extends _isc.EndpointRef { + EndpointAnalytics(_isc.EndpointCaller caller) : super(caller); + + @override + String get name => 'analytics'; + + /// The caller is using [app] (sent at app start and on resume). + _ida.Future ping(_izdyac9h.UsageApp app) => + caller.callServerEndpoint( + 'analytics', + 'ping', + {'app': app}, + ); + + /// The dashboard for the last [days] days (7, 30, 90 or 365); admins are + /// left out of every count unless [includeAdmins]. + _ida.Future<_iu8mc7mo.AnalyticsOverview> overview( + int days, + bool includeAdmins, + ) => caller.callServerEndpoint<_iu8mc7mo.AnalyticsOverview>( + 'analytics', + 'overview', + { + 'days': days, + 'includeAdmins': includeAdmins, + }, + ); +} + /// Bugs & improvements (specs/16 §12). Read methods work signed out; write /// methods need a signed-in user who is not blocked; admin methods need an /// admin (specs/16 §9.1). Posts and tasks are addressed by their public @@ -4434,6 +4470,7 @@ class Client extends _isc.ServerpodClientShared { jwtRefresh = EndpointJwtRefresh(this); activity = EndpointActivity(this); assistant = EndpointAssistant(this); + analytics = EndpointAnalytics(this); board = EndpointBoard(this); comment = EndpointComment(this); drive = EndpointDrive(this); @@ -4480,6 +4517,8 @@ class Client extends _isc.ServerpodClientShared { late final EndpointAssistant assistant; + late final EndpointAnalytics analytics; + late final EndpointBoard board; late final EndpointComment comment; @@ -4558,6 +4597,7 @@ class Client extends _isc.ServerpodClientShared { 'jwtRefresh': jwtRefresh, 'activity': activity, 'assistant': assistant, + 'analytics': analytics, 'board': board, 'comment': comment, 'drive': drive, diff --git a/wonky_client/lib/src/protocol/platform/analytics/models/analytics_cohort.dart b/wonky_client/lib/src/protocol/platform/analytics/models/analytics_cohort.dart new file mode 100644 index 00000000..7199ebff --- /dev/null +++ b/wonky_client/lib/src/protocol/platform/analytics/models/analytics_cohort.dart @@ -0,0 +1,112 @@ +/* AUTOMATICALLY GENERATED CODE DO NOT MODIFY */ +/* To generate run: "serverpod generate" */ + +// ignore_for_file: implementation_imports +// ignore_for_file: library_private_types_in_public_api +// ignore_for_file: non_constant_identifier_names +// ignore_for_file: public_member_api_docs +// ignore_for_file: type_literal_in_constant_pattern +// ignore_for_file: use_super_parameters +// ignore_for_file: invalid_use_of_internal_member + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'package:serverpod_client/serverpod_client.dart' as _isc; +import 'package:wonky_client/src/protocol/protocol.dart' as _i8pkqg1o; + +/// A weekly sign-up cohort (specs/19 §3.5): accounts created in the week +/// starting [week] (Monday, UTC) and how many of them were active N weeks +/// later. +abstract class AnalyticsCohort + implements _isc.SerializableModel, _isc.ProtocolSerialization { + AnalyticsCohort._({ + required this.week, + required this.size, + required this.active, + }); + + factory AnalyticsCohort({ + required DateTime week, + required int size, + required List active, + }) = _AnalyticsCohortImpl; + + factory AnalyticsCohort.fromJson(Map jsonSerialization) { + return AnalyticsCohort( + week: _isc.DateTimeJsonExtension.fromJson(jsonSerialization['week']), + size: jsonSerialization['size'] as int, + active: _i8pkqg1o.Protocol().deserialize>( + jsonSerialization['active'], + ), + ); + } + + DateTime week; + + int size; + + /// Index N: active users of the cohort in week N after sign-up (0 = the + /// sign-up week). Null where the week is in the future or ended before + /// activity was recorded. + List active; + + /// Returns a shallow copy of this [AnalyticsCohort] + /// with some or all fields replaced by the given arguments. + @_isc.useResult + AnalyticsCohort copyWith({ + DateTime? week, + int? size, + List? active, + }); + @override + Map toJson() { + return { + '__className__': 'AnalyticsCohort', + 'week': week.toJson(), + 'size': size, + 'active': active.toJson(), + }; + } + + @override + Map toJsonForProtocol() { + return { + '__className__': 'AnalyticsCohort', + 'week': week.toJson(), + 'size': size, + 'active': active.toJson(), + }; + } + + @override + String toString() { + return _isc.SerializationManager.encode(this); + } +} + +class _AnalyticsCohortImpl extends AnalyticsCohort { + _AnalyticsCohortImpl({ + required DateTime week, + required int size, + required List active, + }) : super._( + week: week, + size: size, + active: active, + ); + + /// Returns a shallow copy of this [AnalyticsCohort] + /// with some or all fields replaced by the given arguments. + @_isc.useResult + @override + AnalyticsCohort copyWith({ + DateTime? week, + int? size, + List? active, + }) { + return AnalyticsCohort( + week: week ?? this.week, + size: size ?? this.size, + active: active ?? this.active.map((e0) => e0).toList(), + ); + } +} diff --git a/wonky_client/lib/src/protocol/platform/analytics/models/analytics_count.dart b/wonky_client/lib/src/protocol/platform/analytics/models/analytics_count.dart new file mode 100644 index 00000000..f4b97794 --- /dev/null +++ b/wonky_client/lib/src/protocol/platform/analytics/models/analytics_count.dart @@ -0,0 +1,107 @@ +/* AUTOMATICALLY GENERATED CODE DO NOT MODIFY */ +/* To generate run: "serverpod generate" */ + +// ignore_for_file: implementation_imports +// ignore_for_file: library_private_types_in_public_api +// ignore_for_file: non_constant_identifier_names +// ignore_for_file: public_member_api_docs +// ignore_for_file: type_literal_in_constant_pattern +// ignore_for_file: use_super_parameters +// ignore_for_file: invalid_use_of_internal_member + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'package:serverpod_client/serverpod_client.dart' as _isc; + +/// A labeled count of the usage analytics (specs/19 §3): items by kind, +/// sign-in methods, AI requests by feature or model. +abstract class AnalyticsCount + implements _isc.SerializableModel, _isc.ProtocolSerialization { + AnalyticsCount._({ + required this.key, + required this.count, + int? amount, + }) : amount = amount ?? 0; + + factory AnalyticsCount({ + required String key, + required int count, + int? amount, + }) = _AnalyticsCountImpl; + + factory AnalyticsCount.fromJson(Map jsonSerialization) { + return AnalyticsCount( + key: jsonSerialization['key'] as String, + count: jsonSerialization['count'] as int, + amount: jsonSerialization['amount'] as int?, + ); + } + + String key; + + int count; + + /// A second measure where one applies (bytes of items, AI tokens); 0 + /// otherwise. + int amount; + + /// Returns a shallow copy of this [AnalyticsCount] + /// with some or all fields replaced by the given arguments. + @_isc.useResult + AnalyticsCount copyWith({ + String? key, + int? count, + int? amount, + }); + @override + Map toJson() { + return { + '__className__': 'AnalyticsCount', + 'key': key, + 'count': count, + 'amount': amount, + }; + } + + @override + Map toJsonForProtocol() { + return { + '__className__': 'AnalyticsCount', + 'key': key, + 'count': count, + 'amount': amount, + }; + } + + @override + String toString() { + return _isc.SerializationManager.encode(this); + } +} + +class _AnalyticsCountImpl extends AnalyticsCount { + _AnalyticsCountImpl({ + required String key, + required int count, + int? amount, + }) : super._( + key: key, + count: count, + amount: amount, + ); + + /// Returns a shallow copy of this [AnalyticsCount] + /// with some or all fields replaced by the given arguments. + @_isc.useResult + @override + AnalyticsCount copyWith({ + String? key, + int? count, + int? amount, + }) { + return AnalyticsCount( + key: key ?? this.key, + count: count ?? this.count, + amount: amount ?? this.amount, + ); + } +} diff --git a/wonky_client/lib/src/protocol/platform/analytics/models/analytics_day.dart b/wonky_client/lib/src/protocol/platform/analytics/models/analytics_day.dart new file mode 100644 index 00000000..516f2c7a --- /dev/null +++ b/wonky_client/lib/src/protocol/platform/analytics/models/analytics_day.dart @@ -0,0 +1,340 @@ +/* AUTOMATICALLY GENERATED CODE DO NOT MODIFY */ +/* To generate run: "serverpod generate" */ + +// ignore_for_file: implementation_imports +// ignore_for_file: library_private_types_in_public_api +// ignore_for_file: non_constant_identifier_names +// ignore_for_file: public_member_api_docs +// ignore_for_file: type_literal_in_constant_pattern +// ignore_for_file: use_super_parameters +// ignore_for_file: invalid_use_of_internal_member + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'package:serverpod_client/serverpod_client.dart' as _isc; + +/// One UTC day of the usage analytics (specs/19 §3). Users are counted +/// once per day; the rolling counts are distinct users in the 7 and 30 +/// days ending with [day]. +abstract class AnalyticsDay + implements _isc.SerializableModel, _isc.ProtocolSerialization { + AnalyticsDay._({ + required this.day, + required this.active, + required this.editors, + required this.weekly, + required this.monthly, + required this.drive, + required this.write, + required this.sheets, + required this.slides, + required this.mcp, + required this.signups, + required this.accounts, + required this.documents, + required this.spreadsheets, + required this.presentations, + required this.files, + required this.folders, + required this.comments, + required this.shares, + required this.aiRequests, + required this.aiTokens, + required this.mcpCalls, + }); + + factory AnalyticsDay({ + required DateTime day, + required int active, + required int editors, + required int weekly, + required int monthly, + required int drive, + required int write, + required int sheets, + required int slides, + required int mcp, + required int signups, + required int accounts, + required int documents, + required int spreadsheets, + required int presentations, + required int files, + required int folders, + required int comments, + required int shares, + required int aiRequests, + required int aiTokens, + required int mcpCalls, + }) = _AnalyticsDayImpl; + + factory AnalyticsDay.fromJson(Map jsonSerialization) { + return AnalyticsDay( + day: _isc.DateTimeJsonExtension.fromJson(jsonSerialization['day']), + active: jsonSerialization['active'] as int, + editors: jsonSerialization['editors'] as int, + weekly: jsonSerialization['weekly'] as int, + monthly: jsonSerialization['monthly'] as int, + drive: jsonSerialization['drive'] as int, + write: jsonSerialization['write'] as int, + sheets: jsonSerialization['sheets'] as int, + slides: jsonSerialization['slides'] as int, + mcp: jsonSerialization['mcp'] as int, + signups: jsonSerialization['signups'] as int, + accounts: jsonSerialization['accounts'] as int, + documents: jsonSerialization['documents'] as int, + spreadsheets: jsonSerialization['spreadsheets'] as int, + presentations: jsonSerialization['presentations'] as int, + files: jsonSerialization['files'] as int, + folders: jsonSerialization['folders'] as int, + comments: jsonSerialization['comments'] as int, + shares: jsonSerialization['shares'] as int, + aiRequests: jsonSerialization['aiRequests'] as int, + aiTokens: jsonSerialization['aiTokens'] as int, + mcpCalls: jsonSerialization['mcpCalls'] as int, + ); + } + + DateTime day; + + /// Users active in any app or through MCP. + int active; + + /// Users who created or edited something. + int editors; + + int weekly; + + int monthly; + + int drive; + + int write; + + int sheets; + + int slides; + + int mcp; + + /// Accounts created that day, and all accounts at its end. + int signups; + + int accounts; + + /// Items created that day by kind (templates of the gallery left out). + int documents; + + int spreadsheets; + + int presentations; + + int files; + + int folders; + + /// Comments and replies by people (not system events). + int comments; + + /// Direct grants to people (not inherited from a folder). + int shares; + + int aiRequests; + + int aiTokens; + + int mcpCalls; + + /// Returns a shallow copy of this [AnalyticsDay] + /// with some or all fields replaced by the given arguments. + @_isc.useResult + AnalyticsDay copyWith({ + DateTime? day, + int? active, + int? editors, + int? weekly, + int? monthly, + int? drive, + int? write, + int? sheets, + int? slides, + int? mcp, + int? signups, + int? accounts, + int? documents, + int? spreadsheets, + int? presentations, + int? files, + int? folders, + int? comments, + int? shares, + int? aiRequests, + int? aiTokens, + int? mcpCalls, + }); + @override + Map toJson() { + return { + '__className__': 'AnalyticsDay', + 'day': day.toJson(), + 'active': active, + 'editors': editors, + 'weekly': weekly, + 'monthly': monthly, + 'drive': drive, + 'write': write, + 'sheets': sheets, + 'slides': slides, + 'mcp': mcp, + 'signups': signups, + 'accounts': accounts, + 'documents': documents, + 'spreadsheets': spreadsheets, + 'presentations': presentations, + 'files': files, + 'folders': folders, + 'comments': comments, + 'shares': shares, + 'aiRequests': aiRequests, + 'aiTokens': aiTokens, + 'mcpCalls': mcpCalls, + }; + } + + @override + Map toJsonForProtocol() { + return { + '__className__': 'AnalyticsDay', + 'day': day.toJson(), + 'active': active, + 'editors': editors, + 'weekly': weekly, + 'monthly': monthly, + 'drive': drive, + 'write': write, + 'sheets': sheets, + 'slides': slides, + 'mcp': mcp, + 'signups': signups, + 'accounts': accounts, + 'documents': documents, + 'spreadsheets': spreadsheets, + 'presentations': presentations, + 'files': files, + 'folders': folders, + 'comments': comments, + 'shares': shares, + 'aiRequests': aiRequests, + 'aiTokens': aiTokens, + 'mcpCalls': mcpCalls, + }; + } + + @override + String toString() { + return _isc.SerializationManager.encode(this); + } +} + +class _AnalyticsDayImpl extends AnalyticsDay { + _AnalyticsDayImpl({ + required DateTime day, + required int active, + required int editors, + required int weekly, + required int monthly, + required int drive, + required int write, + required int sheets, + required int slides, + required int mcp, + required int signups, + required int accounts, + required int documents, + required int spreadsheets, + required int presentations, + required int files, + required int folders, + required int comments, + required int shares, + required int aiRequests, + required int aiTokens, + required int mcpCalls, + }) : super._( + day: day, + active: active, + editors: editors, + weekly: weekly, + monthly: monthly, + drive: drive, + write: write, + sheets: sheets, + slides: slides, + mcp: mcp, + signups: signups, + accounts: accounts, + documents: documents, + spreadsheets: spreadsheets, + presentations: presentations, + files: files, + folders: folders, + comments: comments, + shares: shares, + aiRequests: aiRequests, + aiTokens: aiTokens, + mcpCalls: mcpCalls, + ); + + /// Returns a shallow copy of this [AnalyticsDay] + /// with some or all fields replaced by the given arguments. + @_isc.useResult + @override + AnalyticsDay copyWith({ + DateTime? day, + int? active, + int? editors, + int? weekly, + int? monthly, + int? drive, + int? write, + int? sheets, + int? slides, + int? mcp, + int? signups, + int? accounts, + int? documents, + int? spreadsheets, + int? presentations, + int? files, + int? folders, + int? comments, + int? shares, + int? aiRequests, + int? aiTokens, + int? mcpCalls, + }) { + return AnalyticsDay( + day: day ?? this.day, + active: active ?? this.active, + editors: editors ?? this.editors, + weekly: weekly ?? this.weekly, + monthly: monthly ?? this.monthly, + drive: drive ?? this.drive, + write: write ?? this.write, + sheets: sheets ?? this.sheets, + slides: slides ?? this.slides, + mcp: mcp ?? this.mcp, + signups: signups ?? this.signups, + accounts: accounts ?? this.accounts, + documents: documents ?? this.documents, + spreadsheets: spreadsheets ?? this.spreadsheets, + presentations: presentations ?? this.presentations, + files: files ?? this.files, + folders: folders ?? this.folders, + comments: comments ?? this.comments, + shares: shares ?? this.shares, + aiRequests: aiRequests ?? this.aiRequests, + aiTokens: aiTokens ?? this.aiTokens, + mcpCalls: mcpCalls ?? this.mcpCalls, + ); + } +} diff --git a/wonky_client/lib/src/protocol/platform/analytics/models/analytics_overview.dart b/wonky_client/lib/src/protocol/platform/analytics/models/analytics_overview.dart new file mode 100644 index 00000000..fdab3ab7 --- /dev/null +++ b/wonky_client/lib/src/protocol/platform/analytics/models/analytics_overview.dart @@ -0,0 +1,376 @@ +/* AUTOMATICALLY GENERATED CODE DO NOT MODIFY */ +/* To generate run: "serverpod generate" */ + +// ignore_for_file: implementation_imports +// ignore_for_file: library_private_types_in_public_api +// ignore_for_file: non_constant_identifier_names +// ignore_for_file: public_member_api_docs +// ignore_for_file: type_literal_in_constant_pattern +// ignore_for_file: use_super_parameters +// ignore_for_file: invalid_use_of_internal_member + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'package:serverpod_client/serverpod_client.dart' as _isc; +import 'package:wonky_client/src/protocol/protocol.dart' as _i8pkqg1o; +import '../../../platform/analytics/models/analytics_cohort.dart' as _i3uny1ae; +import '../../../platform/analytics/models/analytics_count.dart' as _iucqk5df; +import '../../../platform/analytics/models/analytics_day.dart' as _ii75e3xb; + +/// The usage analytics dashboard of Wonky Drive (specs/19 §3), for admins. +abstract class AnalyticsOverview + implements _isc.SerializableModel, _isc.ProtocolSerialization { + AnalyticsOverview._({ + required this.days, + required this.includeAdmins, + required this.generatedAt, + this.trackingSince, + required this.accounts, + required this.newAccounts, + required this.activeToday, + required this.weekly, + required this.monthly, + required this.stickiness, + required this.series, + required this.itemTotals, + required this.storageBytes, + required this.signInMethods, + required this.aiFeatures, + required this.aiModels, + required this.aiRetentionDays, + required this.sharedItems, + required this.coEditedItems, + required this.commenters, + required this.cohorts, + }); + + factory AnalyticsOverview({ + required int days, + required bool includeAdmins, + required DateTime generatedAt, + DateTime? trackingSince, + required int accounts, + required int newAccounts, + required int activeToday, + required int weekly, + required int monthly, + required double stickiness, + required List<_ii75e3xb.AnalyticsDay> series, + required List<_iucqk5df.AnalyticsCount> itemTotals, + required int storageBytes, + required List<_iucqk5df.AnalyticsCount> signInMethods, + required List<_iucqk5df.AnalyticsCount> aiFeatures, + required List<_iucqk5df.AnalyticsCount> aiModels, + required int aiRetentionDays, + required int sharedItems, + required int coEditedItems, + required int commenters, + required List<_i3uny1ae.AnalyticsCohort> cohorts, + }) = _AnalyticsOverviewImpl; + + factory AnalyticsOverview.fromJson(Map jsonSerialization) { + return AnalyticsOverview( + days: jsonSerialization['days'] as int, + includeAdmins: _isc.BoolJsonExtension.fromJson( + jsonSerialization['includeAdmins'], + ), + generatedAt: _isc.DateTimeJsonExtension.fromJson( + jsonSerialization['generatedAt'], + ), + trackingSince: jsonSerialization['trackingSince'] == null + ? null + : _isc.DateTimeJsonExtension.fromJson( + jsonSerialization['trackingSince'], + ), + accounts: jsonSerialization['accounts'] as int, + newAccounts: jsonSerialization['newAccounts'] as int, + activeToday: jsonSerialization['activeToday'] as int, + weekly: jsonSerialization['weekly'] as int, + monthly: jsonSerialization['monthly'] as int, + stickiness: (jsonSerialization['stickiness'] as num).toDouble(), + series: _i8pkqg1o.Protocol().deserialize>( + jsonSerialization['series'], + ), + itemTotals: _i8pkqg1o.Protocol() + .deserialize>( + jsonSerialization['itemTotals'], + ), + storageBytes: jsonSerialization['storageBytes'] as int, + signInMethods: _i8pkqg1o.Protocol() + .deserialize>( + jsonSerialization['signInMethods'], + ), + aiFeatures: _i8pkqg1o.Protocol() + .deserialize>( + jsonSerialization['aiFeatures'], + ), + aiModels: _i8pkqg1o.Protocol() + .deserialize>( + jsonSerialization['aiModels'], + ), + aiRetentionDays: jsonSerialization['aiRetentionDays'] as int, + sharedItems: jsonSerialization['sharedItems'] as int, + coEditedItems: jsonSerialization['coEditedItems'] as int, + commenters: jsonSerialization['commenters'] as int, + cohorts: _i8pkqg1o.Protocol() + .deserialize>( + jsonSerialization['cohorts'], + ), + ); + } + + /// Period length in days; [series] has one entry per day, oldest first, + /// ending today (UTC). + int days; + + bool includeAdmins; + + DateTime generatedAt; + + /// The first day with recorded activity (null: none yet). + DateTime? trackingSince; + + /// All accounts now, and those created in the period. + int accounts; + + int newAccounts; + + /// Distinct active users today, in the last 7 and the last 30 days. + int activeToday; + + int weekly; + + int monthly; + + /// The average daily active users of the last 30 days over [monthly] + /// (0–1). + double stickiness; + + List<_ii75e3xb.AnalyticsDay> series; + + /// Items now (not trashed) by kind: count and bytes. + List<_iucqk5df.AnalyticsCount> itemTotals; + + int storageBytes; + + /// Accounts by sign-in method (`email`, `google`, …); an account with + /// two methods counts for both. + List<_iucqk5df.AnalyticsCount> signInMethods; + + /// AI requests and tokens in the period by feature and by model. + List<_iucqk5df.AnalyticsCount> aiFeatures; + + List<_iucqk5df.AnalyticsCount> aiModels; + + /// How many days of AI usage the server keeps. + int aiRetentionDays; + + /// Items now shared with at least one other person. + int sharedItems; + + /// Items edited by two or more people in the period. + int coEditedItems; + + /// People who commented in the period. + int commenters; + + List<_i3uny1ae.AnalyticsCohort> cohorts; + + /// Returns a shallow copy of this [AnalyticsOverview] + /// with some or all fields replaced by the given arguments. + @_isc.useResult + AnalyticsOverview copyWith({ + int? days, + bool? includeAdmins, + DateTime? generatedAt, + DateTime? trackingSince = const _isc.$UndefinedDateTime(), + int? accounts, + int? newAccounts, + int? activeToday, + int? weekly, + int? monthly, + double? stickiness, + List<_ii75e3xb.AnalyticsDay>? series, + List<_iucqk5df.AnalyticsCount>? itemTotals, + int? storageBytes, + List<_iucqk5df.AnalyticsCount>? signInMethods, + List<_iucqk5df.AnalyticsCount>? aiFeatures, + List<_iucqk5df.AnalyticsCount>? aiModels, + int? aiRetentionDays, + int? sharedItems, + int? coEditedItems, + int? commenters, + List<_i3uny1ae.AnalyticsCohort>? cohorts, + }); + @override + Map toJson() { + return { + '__className__': 'AnalyticsOverview', + 'days': days, + 'includeAdmins': includeAdmins, + 'generatedAt': generatedAt.toJson(), + if (trackingSince != null) 'trackingSince': trackingSince?.toJson(), + 'accounts': accounts, + 'newAccounts': newAccounts, + 'activeToday': activeToday, + 'weekly': weekly, + 'monthly': monthly, + 'stickiness': stickiness, + 'series': series.toJson(valueToJson: (v) => v.toJson()), + 'itemTotals': itemTotals.toJson(valueToJson: (v) => v.toJson()), + 'storageBytes': storageBytes, + 'signInMethods': signInMethods.toJson(valueToJson: (v) => v.toJson()), + 'aiFeatures': aiFeatures.toJson(valueToJson: (v) => v.toJson()), + 'aiModels': aiModels.toJson(valueToJson: (v) => v.toJson()), + 'aiRetentionDays': aiRetentionDays, + 'sharedItems': sharedItems, + 'coEditedItems': coEditedItems, + 'commenters': commenters, + 'cohorts': cohorts.toJson(valueToJson: (v) => v.toJson()), + }; + } + + @override + Map toJsonForProtocol() { + return { + '__className__': 'AnalyticsOverview', + 'days': days, + 'includeAdmins': includeAdmins, + 'generatedAt': generatedAt.toJson(), + if (trackingSince != null) 'trackingSince': trackingSince?.toJson(), + 'accounts': accounts, + 'newAccounts': newAccounts, + 'activeToday': activeToday, + 'weekly': weekly, + 'monthly': monthly, + 'stickiness': stickiness, + 'series': series.toJson(valueToJson: (v) => v.toJsonForProtocol()), + 'itemTotals': itemTotals.toJson( + valueToJson: (v) => v.toJsonForProtocol(), + ), + 'storageBytes': storageBytes, + 'signInMethods': signInMethods.toJson( + valueToJson: (v) => v.toJsonForProtocol(), + ), + 'aiFeatures': aiFeatures.toJson( + valueToJson: (v) => v.toJsonForProtocol(), + ), + 'aiModels': aiModels.toJson(valueToJson: (v) => v.toJsonForProtocol()), + 'aiRetentionDays': aiRetentionDays, + 'sharedItems': sharedItems, + 'coEditedItems': coEditedItems, + 'commenters': commenters, + 'cohorts': cohorts.toJson(valueToJson: (v) => v.toJsonForProtocol()), + }; + } + + @override + String toString() { + return _isc.SerializationManager.encode(this); + } +} + +class _AnalyticsOverviewImpl extends AnalyticsOverview { + _AnalyticsOverviewImpl({ + required int days, + required bool includeAdmins, + required DateTime generatedAt, + DateTime? trackingSince, + required int accounts, + required int newAccounts, + required int activeToday, + required int weekly, + required int monthly, + required double stickiness, + required List<_ii75e3xb.AnalyticsDay> series, + required List<_iucqk5df.AnalyticsCount> itemTotals, + required int storageBytes, + required List<_iucqk5df.AnalyticsCount> signInMethods, + required List<_iucqk5df.AnalyticsCount> aiFeatures, + required List<_iucqk5df.AnalyticsCount> aiModels, + required int aiRetentionDays, + required int sharedItems, + required int coEditedItems, + required int commenters, + required List<_i3uny1ae.AnalyticsCohort> cohorts, + }) : super._( + days: days, + includeAdmins: includeAdmins, + generatedAt: generatedAt, + trackingSince: trackingSince, + accounts: accounts, + newAccounts: newAccounts, + activeToday: activeToday, + weekly: weekly, + monthly: monthly, + stickiness: stickiness, + series: series, + itemTotals: itemTotals, + storageBytes: storageBytes, + signInMethods: signInMethods, + aiFeatures: aiFeatures, + aiModels: aiModels, + aiRetentionDays: aiRetentionDays, + sharedItems: sharedItems, + coEditedItems: coEditedItems, + commenters: commenters, + cohorts: cohorts, + ); + + /// Returns a shallow copy of this [AnalyticsOverview] + /// with some or all fields replaced by the given arguments. + @_isc.useResult + @override + AnalyticsOverview copyWith({ + int? days, + bool? includeAdmins, + DateTime? generatedAt, + DateTime? trackingSince = const _isc.$UndefinedDateTime(), + int? accounts, + int? newAccounts, + int? activeToday, + int? weekly, + int? monthly, + double? stickiness, + List<_ii75e3xb.AnalyticsDay>? series, + List<_iucqk5df.AnalyticsCount>? itemTotals, + int? storageBytes, + List<_iucqk5df.AnalyticsCount>? signInMethods, + List<_iucqk5df.AnalyticsCount>? aiFeatures, + List<_iucqk5df.AnalyticsCount>? aiModels, + int? aiRetentionDays, + int? sharedItems, + int? coEditedItems, + int? commenters, + List<_i3uny1ae.AnalyticsCohort>? cohorts, + }) { + return AnalyticsOverview( + days: days ?? this.days, + includeAdmins: includeAdmins ?? this.includeAdmins, + generatedAt: generatedAt ?? this.generatedAt, + trackingSince: trackingSince is _isc.UndefinedSentinel + ? this.trackingSince + : trackingSince, + accounts: accounts ?? this.accounts, + newAccounts: newAccounts ?? this.newAccounts, + activeToday: activeToday ?? this.activeToday, + weekly: weekly ?? this.weekly, + monthly: monthly ?? this.monthly, + stickiness: stickiness ?? this.stickiness, + series: series ?? this.series.map((e0) => e0.copyWith()).toList(), + itemTotals: + itemTotals ?? this.itemTotals.map((e0) => e0.copyWith()).toList(), + storageBytes: storageBytes ?? this.storageBytes, + signInMethods: + signInMethods ?? + this.signInMethods.map((e0) => e0.copyWith()).toList(), + aiFeatures: + aiFeatures ?? this.aiFeatures.map((e0) => e0.copyWith()).toList(), + aiModels: aiModels ?? this.aiModels.map((e0) => e0.copyWith()).toList(), + aiRetentionDays: aiRetentionDays ?? this.aiRetentionDays, + sharedItems: sharedItems ?? this.sharedItems, + coEditedItems: coEditedItems ?? this.coEditedItems, + commenters: commenters ?? this.commenters, + cohorts: cohorts ?? this.cohorts.map((e0) => e0.copyWith()).toList(), + ); + } +} diff --git a/wonky_client/lib/src/protocol/platform/analytics/models/usage_app.dart b/wonky_client/lib/src/protocol/platform/analytics/models/usage_app.dart new file mode 100644 index 00000000..bdb8ae32 --- /dev/null +++ b/wonky_client/lib/src/protocol/platform/analytics/models/usage_app.dart @@ -0,0 +1,46 @@ +/* AUTOMATICALLY GENERATED CODE DO NOT MODIFY */ +/* To generate run: "serverpod generate" */ + +// ignore_for_file: implementation_imports +// ignore_for_file: library_private_types_in_public_api +// ignore_for_file: non_constant_identifier_names +// ignore_for_file: public_member_api_docs +// ignore_for_file: type_literal_in_constant_pattern +// ignore_for_file: use_super_parameters +// ignore_for_file: invalid_use_of_internal_member + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'package:serverpod_client/serverpod_client.dart' as _isc; + +/// Where a user was active (usage analytics, specs/19 §2): one of the +/// apps, or an MCP client with a personal access token. +enum UsageApp implements _isc.SerializableModel { + drive, + write, + sheets, + slides, + mcp; + + static UsageApp fromJson(String name) { + switch (name) { + case 'drive': + return UsageApp.drive; + case 'write': + return UsageApp.write; + case 'sheets': + return UsageApp.sheets; + case 'slides': + return UsageApp.slides; + case 'mcp': + return UsageApp.mcp; + default: + throw ArgumentError('Value "$name" cannot be converted to "UsageApp"'); + } + } + + @override + String toJson() => name; + + @override + String toString() => name; +} diff --git a/wonky_client/lib/src/protocol/protocol.dart b/wonky_client/lib/src/protocol/protocol.dart index 93e58340..b4c0fb03 100644 --- a/wonky_client/lib/src/protocol/protocol.dart +++ b/wonky_client/lib/src/protocol/protocol.dart @@ -100,6 +100,11 @@ import 'platform/ai/models/inline_ai_event_type.dart' as _i6pcz5z6; import 'platform/ai/models/inline_ai_request.dart' as _i4m43iwr; import 'platform/ai/models/proofread_event.dart' as _ie0jt2ne; import 'platform/ai/models/proofread_issue.dart' as _ivmxemza; +import 'platform/analytics/models/analytics_cohort.dart' as _ixradasp; +import 'platform/analytics/models/analytics_count.dart' as _innm1rwe; +import 'platform/analytics/models/analytics_day.dart' as _is2u4stz; +import 'platform/analytics/models/analytics_overview.dart' as _i61uxw4p; +import 'platform/analytics/models/usage_app.dart' as _id3chnrt; import 'platform/board/models/board_area.dart' as _i0ag0upm; import 'platform/board/models/board_author.dart' as _ika8r7fc; import 'platform/board/models/board_bundle_suggestion.dart' as _ilo15wk2; @@ -375,6 +380,11 @@ export 'platform/ai/models/inline_ai_event_type.dart'; export 'platform/ai/models/inline_ai_request.dart'; export 'platform/ai/models/proofread_event.dart'; export 'platform/ai/models/proofread_issue.dart'; +export 'platform/analytics/models/analytics_cohort.dart'; +export 'platform/analytics/models/analytics_count.dart'; +export 'platform/analytics/models/analytics_day.dart'; +export 'platform/analytics/models/analytics_overview.dart'; +export 'platform/analytics/models/usage_app.dart'; export 'platform/board/models/board_area.dart'; export 'platform/board/models/board_author.dart'; export 'platform/board/models/board_bundle_suggestion.dart'; @@ -659,6 +669,11 @@ class Protocol extends _isc.SerializationManager _isc.getType<_i4m43iwr.InlineAiRequest>, _isc.getType<_ie0jt2ne.ProofreadEvent>, _isc.getType<_ivmxemza.ProofreadIssue>, + _isc.getType<_ixradasp.AnalyticsCohort>, + _isc.getType<_innm1rwe.AnalyticsCount>, + _isc.getType<_is2u4stz.AnalyticsDay>, + _isc.getType<_i61uxw4p.AnalyticsOverview>, + _isc.getType<_id3chnrt.UsageApp>, _isc.getType<_i0ag0upm.BoardArea>, _isc.getType<_ika8r7fc.BoardAuthor>, _isc.getType<_ilo15wk2.BoardBundleSuggestion>, @@ -975,6 +990,11 @@ class Protocol extends _isc.SerializationManager _isc.getType<_i4m43iwr.InlineAiRequest?>, _isc.getType<_ie0jt2ne.ProofreadEvent?>, _isc.getType<_ivmxemza.ProofreadIssue?>, + _isc.getType<_ixradasp.AnalyticsCohort?>, + _isc.getType<_innm1rwe.AnalyticsCount?>, + _isc.getType<_is2u4stz.AnalyticsDay?>, + _isc.getType<_i61uxw4p.AnalyticsOverview?>, + _isc.getType<_id3chnrt.UsageApp?>, _isc.getType<_i0ag0upm.BoardArea?>, _isc.getType<_ika8r7fc.BoardAuthor?>, _isc.getType<_ilo15wk2.BoardBundleSuggestion?>, @@ -1272,6 +1292,10 @@ class Protocol extends _isc.SerializationManager _isc.getType>, _isc.getType>, _isc.getType?>, + _isc.getType>, + _isc.getType>, + _isc.getType>, + _isc.getType>, _isc.getType>, _isc.getType>, _isc.getType>, @@ -1468,6 +1492,21 @@ class Protocol extends _isc.SerializationManager if (t == _ivmxemza.ProofreadIssue) { return _ivmxemza.ProofreadIssue.fromJson(data) as T; } + if (t == _ixradasp.AnalyticsCohort) { + return _ixradasp.AnalyticsCohort.fromJson(data) as T; + } + if (t == _innm1rwe.AnalyticsCount) { + return _innm1rwe.AnalyticsCount.fromJson(data) as T; + } + if (t == _is2u4stz.AnalyticsDay) { + return _is2u4stz.AnalyticsDay.fromJson(data) as T; + } + if (t == _i61uxw4p.AnalyticsOverview) { + return _i61uxw4p.AnalyticsOverview.fromJson(data) as T; + } + if (t == _id3chnrt.UsageApp) { + return _id3chnrt.UsageApp.fromJson(data) as T; + } if (t == _i0ag0upm.BoardArea) { return _i0ag0upm.BoardArea.fromJson(data) as T; } @@ -2445,6 +2484,24 @@ class Protocol extends _isc.SerializationManager return (data != null ? _ivmxemza.ProofreadIssue.fromJson(data) : null) as T; } + if (t == _isc.getType<_ixradasp.AnalyticsCohort?>()) { + return (data != null ? _ixradasp.AnalyticsCohort.fromJson(data) : null) + as T; + } + if (t == _isc.getType<_innm1rwe.AnalyticsCount?>()) { + return (data != null ? _innm1rwe.AnalyticsCount.fromJson(data) : null) + as T; + } + if (t == _isc.getType<_is2u4stz.AnalyticsDay?>()) { + return (data != null ? _is2u4stz.AnalyticsDay.fromJson(data) : null) as T; + } + if (t == _isc.getType<_i61uxw4p.AnalyticsOverview?>()) { + return (data != null ? _i61uxw4p.AnalyticsOverview.fromJson(data) : null) + as T; + } + if (t == _isc.getType<_id3chnrt.UsageApp?>()) { + return (data != null ? _id3chnrt.UsageApp.fromJson(data) : null) as T; + } if (t == _isc.getType<_i0ag0upm.BoardArea?>()) { return (data != null ? _i0ag0upm.BoardArea.fromJson(data) : null) as T; } @@ -3698,6 +3755,27 @@ class Protocol extends _isc.SerializationManager : null) as T; } + if (t == List) { + return (data as List).map((e) => deserialize(e)).toList() as T; + } + if (t == List<_is2u4stz.AnalyticsDay>) { + return (data as List) + .map((e) => deserialize<_is2u4stz.AnalyticsDay>(e)) + .toList() + as T; + } + if (t == List<_innm1rwe.AnalyticsCount>) { + return (data as List) + .map((e) => deserialize<_innm1rwe.AnalyticsCount>(e)) + .toList() + as T; + } + if (t == List<_ixradasp.AnalyticsCohort>) { + return (data as List) + .map((e) => deserialize<_ixradasp.AnalyticsCohort>(e)) + .toList() + as T; + } if (t == List) { return (data as List).map((e) => deserialize(e)).toList() as T; } @@ -4253,6 +4331,11 @@ class Protocol extends _isc.SerializationManager _i4m43iwr.InlineAiRequest => 'InlineAiRequest', _ie0jt2ne.ProofreadEvent => 'ProofreadEvent', _ivmxemza.ProofreadIssue => 'ProofreadIssue', + _ixradasp.AnalyticsCohort => 'AnalyticsCohort', + _innm1rwe.AnalyticsCount => 'AnalyticsCount', + _is2u4stz.AnalyticsDay => 'AnalyticsDay', + _i61uxw4p.AnalyticsOverview => 'AnalyticsOverview', + _id3chnrt.UsageApp => 'UsageApp', _i0ag0upm.BoardArea => 'BoardArea', _ika8r7fc.BoardAuthor => 'BoardAuthor', _ilo15wk2.BoardBundleSuggestion => 'BoardBundleSuggestion', @@ -4609,6 +4692,16 @@ class Protocol extends _isc.SerializationManager return 'ProofreadEvent'; case _ivmxemza.ProofreadIssue(): return 'ProofreadIssue'; + case _ixradasp.AnalyticsCohort(): + return 'AnalyticsCohort'; + case _innm1rwe.AnalyticsCount(): + return 'AnalyticsCount'; + case _is2u4stz.AnalyticsDay(): + return 'AnalyticsDay'; + case _i61uxw4p.AnalyticsOverview(): + return 'AnalyticsOverview'; + case _id3chnrt.UsageApp(): + return 'UsageApp'; case _i0ag0upm.BoardArea(): return 'BoardArea'; case _ika8r7fc.BoardAuthor(): @@ -5289,6 +5382,21 @@ class Protocol extends _isc.SerializationManager if (dataClassName == 'ProofreadIssue') { return deserialize<_ivmxemza.ProofreadIssue>(data['data']); } + if (dataClassName == 'AnalyticsCohort') { + return deserialize<_ixradasp.AnalyticsCohort>(data['data']); + } + if (dataClassName == 'AnalyticsCount') { + return deserialize<_innm1rwe.AnalyticsCount>(data['data']); + } + if (dataClassName == 'AnalyticsDay') { + return deserialize<_is2u4stz.AnalyticsDay>(data['data']); + } + if (dataClassName == 'AnalyticsOverview') { + return deserialize<_i61uxw4p.AnalyticsOverview>(data['data']); + } + if (dataClassName == 'UsageApp') { + return deserialize<_id3chnrt.UsageApp>(data['data']); + } if (dataClassName == 'BoardArea') { return deserialize<_i0ag0upm.BoardArea>(data['data']); } diff --git a/wonky_drive/lib/commands/drive_commands.dart b/wonky_drive/lib/commands/drive_commands.dart index b8151f85..d701b3a9 100644 --- a/wonky_drive/lib/commands/drive_commands.dart +++ b/wonky_drive/lib/commands/drive_commands.dart @@ -5,12 +5,14 @@ import 'package:wonky_client/wonky_client.dart'; import 'package:wonky_core/wonky_core.dart'; import '../features/settings/drive_settings_keys.dart'; +import '../features/analytics/analytics_controller.dart'; import '../features/storage/storage_controller.dart'; import '../l10n/drive_l10n.dart'; /// Drive's view, settings and Storage page commands (Drive 04 §9): /// `drive.view.setLayout/sort/toggleFoldersOnTop` (the shown list), -/// `drive.prefs.set` (Drive settings) and `drive.storage.show`. View state +/// `drive.prefs.set` (Drive settings), `drive.storage.show` and (admins) +/// `drive.analytics.show`. View state /// and settings are not undoable (suite 08 §2). List> driveCommands(ShellServices s) { DriveController? view() => s.driveView.value; @@ -166,6 +168,38 @@ List> driveCommands(ShellServices s) { return CommandResult.ok({'filter': filter.name}); }, ), + cmd( + 'drive.analytics.show', + title: (l) => l.cmdAnalyticsShow, + category: (l) => l.categoryAnalytics, + icon: LucideIcons.chartLine, + args: JsonSchema.object( + properties: { + 'days': JsonSchema.integer( + minimum: analyticsPeriods.first, + maximum: analyticsPeriods.last, + description: + 'The period in days, ending today (UTC): one of ' + '${analyticsPeriods.join(', ')}. Default: ' + '$analyticsDefaultDays.', + ), + 'includeAdmins': const JsonSchema.boolean( + description: 'Count admins too. Default: false.', + ), + }, + ), + // Admins only (specs/19 §1): the board's admin rule. + enabled: (ctx, a) => BoardHub.of(s).isAdmin, + run: (ctx, a) async { + final days = a.integer('days') ?? analyticsDefaultDays; + if (!analyticsPeriods.contains(days)) { + return CommandResult.failed('Unknown period $days'); + } + final admins = a.boolean('includeAdmins') ?? false; + s.router.go(analyticsPath(days: days, admins: admins)); + return CommandResult.ok({'days': days, 'includeAdmins': admins}); + }, + ), ]; } diff --git a/wonky_drive/lib/config/drive_app_config.dart b/wonky_drive/lib/config/drive_app_config.dart index 22e1ff36..35ac00bb 100644 --- a/wonky_drive/lib/config/drive_app_config.dart +++ b/wonky_drive/lib/config/drive_app_config.dart @@ -7,6 +7,7 @@ import 'package:wonky_core/wonky_core.dart' show CommandArgs; import '../commands/drive_commands.dart'; import '../commands/upload_commands.dart'; +import '../features/analytics/analytics_screen.dart'; import '../features/preview/file_preview_screen.dart'; import '../features/preview/preview_commands.dart'; import '../features/settings/drive_settings.dart'; @@ -67,8 +68,8 @@ class DriveAppConfig extends WonkyAppConfig { /// The Drive commands (Drive 04 §9): previews (`drive.file.*`, /// `drive.preview.*`), uploads (`drive.upload.*`), the list view - /// (`drive.view.*`), settings (`drive.prefs.set`) and the Storage page - /// (`drive.storage.show`). + /// (`drive.view.*`), settings (`drive.prefs.set`), the Storage page + /// (`drive.storage.show`) and the Analytics page (`drive.analytics.show`). @override List> commands(ShellServices services) => [ ...previewCommands(services), @@ -127,7 +128,8 @@ class DriveAppConfig extends WonkyAppConfig { await super.onSigningOut(services); } - /// `/storage[?filter=…]` (Drive 04 §7, Drive 03 §6.4). + /// `/storage[?filter=…]` (Drive 04 §7, Drive 03 §6.4) and, for admins, + /// `/analytics[?days=…&admins=1]` (specs/19 §3). @override List routes(ShellServices services) => [ GoRoute( @@ -137,6 +139,13 @@ class DriveAppConfig extends WonkyAppConfig { child: storageRoutePage(services, state.uri), ), ), + GoRoute( + path: '/analytics', + pageBuilder: (context, state) => NoTransitionPage( + key: const ValueKey('drive.analyticsPage'), + child: analyticsRoutePage(services, state.uri), + ), + ), ]; /// Drive settings (`/settings/app/drive`, Drive 04 §8). diff --git a/wonky_drive/lib/features/analytics/analytics_api.dart b/wonky_drive/lib/features/analytics/analytics_api.dart new file mode 100644 index 00000000..074ef9ba --- /dev/null +++ b/wonky_drive/lib/features/analytics/analytics_api.dart @@ -0,0 +1,30 @@ +import 'package:wonky_app/wonky_app.dart'; +import 'package:wonky_client/wonky_client.dart'; + +/// Server access of the Analytics page (specs/19 §3), replaceable in tests. +abstract class AnalyticsApi { + /// `analytics.overview`: the dashboard of the last [days] days. + Future overview(int days, {required bool includeAdmins}); +} + +/// [AnalyticsApi] on the generated client (errors become `WonkyException` / +/// `OfflineException` through [Api.guard]). +class ServerAnalyticsApi implements AnalyticsApi { + ServerAnalyticsApi(this.services); + + final ShellServices services; + + Client _client() { + final c = services.client; + if (c == null || + Api.simulatedOffline || + services.connectivity.forcedOffline) { + throw const OfflineException('offline'); + } + return c; + } + + @override + Future overview(int days, {required bool includeAdmins}) => + Api(_client()).guard((c) => c.analytics.overview(days, includeAdmins)); +} diff --git a/wonky_drive/lib/features/analytics/analytics_charts.dart b/wonky_drive/lib/features/analytics/analytics_charts.dart new file mode 100644 index 00000000..e168240a --- /dev/null +++ b/wonky_drive/lib/features/analytics/analytics_charts.dart @@ -0,0 +1,1032 @@ +import 'dart:math' as math; + +import 'package:flutter/gestures.dart'; +import 'package:flutter/widgets.dart'; +import 'package:shad/shad.dart'; + +/// Colors of the analytics charts (specs/19 §3.2). The apps keep the kind +/// colors of the drive icons (Write blue, Sheets green, Slides amber); +/// Drive is pink and MCP cyan, because Drive's violet cannot be told from +/// blue with deuteranopia. The set was checked for color vision deficiency +/// in light and dark (worst pair ΔE 6.1, so legends and tooltips always +/// name the series). Measures that are no app use the ink and [accent]. +abstract final class AnalyticsColors { + static const write = Color(0xff2563eb); + static const sheets = Color(0xff16a34a); + static const slides = Color(0xffd97706); + static const mcp = Color(0xff0891b2); + + static Color drive(Brightness b) => + b == Brightness.dark ? const Color(0xffec4899) : const Color(0xffdb2777); + + /// The second measure of a chart (editors, shares). + static Color accent(Brightness b) => + b == Brightness.dark ? const Color(0xffa78bfa) : const Color(0xff7c3aed); + + /// The main measure of a chart (active users, accounts). + static Color ink(ShadColorScheme c) => c.foreground; +} + +/// One series of an analytics chart. +@immutable +class AnalyticsSeries { + const AnalyticsSeries({ + required this.id, + required this.label, + required this.color, + required this.values, + this.dashed = false, + this.area = false, + }); + + final String id; + final String label; + final Color color; + + /// One value per point (day or bar), oldest first. + final List values; + + /// Drawn dashed (line charts): a second cue beside the color. + final bool dashed; + + /// Filled below the line (line charts; the main measure). + final bool area; +} + +TextStyle _axisStyle(ShadThemeData theme) => theme.textTheme.muted.copyWith( + fontSize: 11, + height: 1.2, + fontFeatures: const [FontFeature.tabularFigures()], +); + +/// The value ticks of a chart whose largest value is [max]: 0 and four +/// round steps (integers: at least 1 apart). +List _ticks(double max) { + if (max <= 0) return const [0, 1, 2, 3, 4]; + final raw = max / 4; + final mag = math.pow(10, (math.log(raw) / math.ln10).floor()).toDouble(); + var step = mag; + for (final f in const [1.0, 2.0, 2.5, 5.0, 10.0]) { + step = f * mag; + if (step >= raw) break; + } + if (step < 1) step = 1; + return [for (var i = 0; i <= 4; i++) step * i]; +} + +/// The plot area of a chart of [size] whose value labels are [labelWidth] +/// wide. +Rect _plot(Size size, double labelWidth) => + Rect.fromLTRB(labelWidth + 10, 8, size.width - 6, size.height - 22); + +double _labelWidth( + List ticks, + String Function(num) format, + TextStyle s, +) { + var w = 0.0; + for (final t in ticks) { + final tp = TextPainter( + text: TextSpan(text: format(t), style: s), + textDirection: TextDirection.ltr, + )..layout(); + w = math.max(w, tp.width); + } + return w; +} + +/// The indices of the date labels under a plot [width] wide with [n] +/// points: evenly spaced, anchored at the last point (today). +List _dateTicks(int n, double width, {double every = 76}) { + if (n <= 0) return const []; + final most = (width / every).floor().clamp(2, 8); + final step = math.max(1, ((n - 1) / (most - 1)).ceil()); + return [for (var i = n - 1; i >= 0; i -= step) i].reversed.toList(); +} + +void _paintText( + Canvas canvas, + String text, + TextStyle style, + Offset at, { + Alignment align = Alignment.topLeft, + double? minX, + double? maxX, +}) { + final tp = TextPainter( + text: TextSpan(text: text, style: style), + textDirection: TextDirection.ltr, + )..layout(); + var x = at.dx - tp.width * (align.x + 1) / 2; + final y = at.dy - tp.height * (align.y + 1) / 2; + if (minX != null) x = math.max(minX, x); + if (maxX != null) x = math.min(maxX - tp.width, x); + tp.paint(canvas, Offset(x, y)); +} + +void _paintGrid( + Canvas canvas, + Rect plot, + List ticks, + String Function(num) format, + ShadThemeData theme, +) { + final c = theme.colorScheme; + final grid = Paint() + ..color = c.border.withValues(alpha: 0.7) + ..strokeWidth = 1; + final top = ticks.last; + final style = _axisStyle(theme); + for (final t in ticks) { + final y = (plot.bottom - (t / top) * plot.height).roundToDouble() + 0.5; + if (t > 0) { + canvas.drawLine(Offset(plot.left, y), Offset(plot.right, y), grid); + } + _paintText( + canvas, + format(t), + style, + Offset(plot.left - 8, y), + align: Alignment.centerRight, + ); + } + canvas.drawLine( + Offset(plot.left, plot.bottom + 0.5), + Offset(plot.right, plot.bottom + 0.5), + Paint() + ..color = c.border + ..strokeWidth = 1, + ); +} + +// ------------------------------------------------------------- legend + +/// The legend of a chart with two or more series: a swatch (a line for +/// line charts) and the name; a click hides or shows the series. +class AnalyticsLegend extends StatelessWidget { + const AnalyticsLegend({ + super.key, + required this.series, + required this.hidden, + required this.onToggle, + this.lines = false, + }); + + final List series; + final Set hidden; + final ValueChanged onToggle; + final bool lines; + + @override + Widget build(BuildContext context) { + final theme = ShadTheme.of(context); + return Wrap( + spacing: 14, + runSpacing: 4, + children: [ + for (final s in series) + Semantics( + button: true, + toggled: !hidden.contains(s.id), + child: MouseRegion( + cursor: SystemMouseCursors.click, + child: GestureDetector( + key: ValueKey('analytics.legend.${s.id}'), + behavior: HitTestBehavior.opaque, + onTap: () => onToggle(s.id), + child: Opacity( + opacity: hidden.contains(s.id) ? 0.4 : 1, + child: Padding( + padding: const EdgeInsets.symmetric(vertical: 2), + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + _Swatch(color: s.color, line: lines, dashed: s.dashed), + const SizedBox(width: 6), + Text(s.label, style: theme.textTheme.muted), + ], + ), + ), + ), + ), + ), + ), + ], + ); + } +} + +class _Swatch extends StatelessWidget { + const _Swatch({required this.color, this.line = false, this.dashed = false}); + + final Color color; + final bool line; + final bool dashed; + + @override + Widget build(BuildContext context) { + if (!line) { + return Container( + width: 10, + height: 10, + decoration: BoxDecoration( + color: color, + borderRadius: BorderRadius.circular(3), + ), + ); + } + return SizedBox( + width: 14, + height: 10, + child: CustomPaint( + painter: _LineSwatchPainter(color: color, dashed: dashed), + ), + ); + } +} + +class _LineSwatchPainter extends CustomPainter { + _LineSwatchPainter({required this.color, required this.dashed}); + + final Color color; + final bool dashed; + + @override + void paint(Canvas canvas, Size size) { + final p = Paint() + ..color = color + ..strokeWidth = 2 + ..strokeCap = StrokeCap.round; + final y = size.height / 2; + if (dashed) { + canvas.drawLine(Offset(1, y), Offset(5, y), p); + canvas.drawLine(Offset(9, y), Offset(13, y), p); + } else { + canvas.drawLine(Offset(1, y), Offset(size.width - 1, y), p); + } + } + + @override + bool shouldRepaint(_LineSwatchPainter old) => + old.color != color || old.dashed != dashed; +} + +// ------------------------------------------------------------ tooltip + +/// The hover card of a chart: a title (the day or the bar's days) and the +/// series' values with their swatches. +class AnalyticsTooltip extends StatelessWidget { + const AnalyticsTooltip({ + super.key, + required this.title, + required this.rows, + this.lines = false, + }); + + final String title; + final List<(AnalyticsSeries, String)> rows; + final bool lines; + + @override + Widget build(BuildContext context) { + final theme = ShadTheme.of(context); + final c = theme.colorScheme; + final value = theme.textTheme.small.copyWith( + fontFeatures: const [FontFeature.tabularFigures()], + ); + return IgnorePointer( + child: Container( + key: const ValueKey('analytics.tooltip'), + padding: const EdgeInsets.fromLTRB(10, 8, 10, 8), + decoration: BoxDecoration( + color: c.popover, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: c.border), + boxShadow: [ + BoxShadow( + color: const Color(0xff000000).withValues(alpha: 0.12), + blurRadius: 12, + offset: const Offset(0, 4), + ), + ], + ), + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(title, style: theme.textTheme.small), + const SizedBox(height: 6), + Table( + defaultColumnWidth: const IntrinsicColumnWidth(), + defaultVerticalAlignment: TableCellVerticalAlignment.middle, + children: [ + for (final (s, v) in rows) + TableRow( + children: [ + Padding( + padding: const EdgeInsets.only(right: 6), + child: _Swatch( + color: s.color, + line: lines, + dashed: s.dashed, + ), + ), + Padding( + padding: const EdgeInsets.only(right: 16, bottom: 2), + child: Text(s.label, style: theme.textTheme.muted), + ), + Padding( + padding: const EdgeInsets.only(bottom: 2), + child: Text( + v, + style: value, + textAlign: TextAlign.right, + ), + ), + ], + ), + ], + ), + ], + ), + ), + ); + } +} + +/// The hover handling shared by the charts: mouse hover, and taps and +/// drags on touch screens, report the x position; leaving clears it. +class _HoverArea extends StatelessWidget { + const _HoverArea({required this.onX, required this.child}); + + final ValueChanged onX; + final Widget child; + + @override + Widget build(BuildContext context) => MouseRegion( + onHover: (e) => onX(e.localPosition.dx), + onExit: (_) => onX(null), + child: GestureDetector( + behavior: HitTestBehavior.opaque, + onTapDown: (d) => onX(d.localPosition.dx), + onHorizontalDragUpdate: (d) => onX(d.localPosition.dx), + onHorizontalDragEnd: (_) => onX(null), + dragStartBehavior: DragStartBehavior.down, + child: child, + ), + ); +} + +/// Places the tooltip beside the hovered x: right of it in the left half, +/// left of it in the right half. +Widget _placeTooltip(double x, double width, Widget tooltip) => Positioned( + top: 0, + left: x <= width / 2 ? x + 14 : null, + right: x > width / 2 ? width - x + 14 : null, + child: tooltip, +); + +// --------------------------------------------------------- line chart + +/// A line chart over days (specs/19 §3.2): 2 px lines, the first [area] +/// series filled, recessive gridlines, a crosshair with dots and a tooltip +/// on hover, and a legend for two or more series (click hides a series). +class AnalyticsLineChart extends StatefulWidget { + const AnalyticsLineChart({ + super.key, + required this.days, + required this.series, + required this.format, + required this.dayLabel, + required this.dayTitle, + this.height = 200, + this.semanticLabel, + }); + + final List days; + final List series; + final String Function(num v) format; + + /// Short date of the axis ("Oct 3"). + final String Function(DateTime d) dayLabel; + + /// Date of the tooltip ("Mon, Oct 3"). + final String Function(DateTime d) dayTitle; + final double height; + final String? semanticLabel; + + @override + State createState() => _AnalyticsLineChartState(); +} + +class _AnalyticsLineChartState extends State { + int? _hover; + final Set _hidden = {}; + + List get _shown => [ + for (final s in widget.series) + if (!_hidden.contains(s.id)) s, + ]; + + void _toggle(String id) => setState(() { + if (!_hidden.remove(id)) _hidden.add(id); + }); + + @override + Widget build(BuildContext context) { + final theme = ShadTheme.of(context); + final shown = _shown; + final n = widget.days.length; + var max = 0.0; + for (final s in shown) { + for (final v in s.values) { + max = math.max(max, v); + } + } + final ticks = _ticks(max); + final labelWidth = _labelWidth(ticks, widget.format, _axisStyle(theme)); + return Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + if (widget.series.length > 1) ...[ + AnalyticsLegend( + series: widget.series, + hidden: _hidden, + onToggle: _toggle, + lines: true, + ), + const SizedBox(height: 10), + ], + Semantics( + label: widget.semanticLabel, + image: true, + child: SizedBox( + height: widget.height, + child: LayoutBuilder( + builder: (context, box) { + final size = Size(box.maxWidth, widget.height); + final plot = _plot(size, labelWidth); + double xOf(int i) => n <= 1 + ? plot.center.dx + : plot.left + plot.width * i / (n - 1); + final hover = _hover; + return _HoverArea( + onX: (x) { + int? i; + if (x != null && n > 0) { + i = n <= 1 + ? 0 + : ((x - plot.left) / plot.width * (n - 1)) + .round() + .clamp(0, n - 1); + } + if (i != _hover) setState(() => _hover = i); + }, + child: Stack( + clipBehavior: Clip.none, + children: [ + Positioned.fill( + child: CustomPaint( + painter: _LinePainter( + theme: theme, + days: widget.days, + series: shown, + ticks: ticks, + labelWidth: labelWidth, + format: widget.format, + dayLabel: widget.dayLabel, + hover: hover, + ), + ), + ), + if (hover != null && shown.isNotEmpty) + _placeTooltip( + xOf(hover), + size.width, + AnalyticsTooltip( + title: widget.dayTitle(widget.days[hover]), + lines: true, + rows: [ + for (final s in shown) + (s, widget.format(s.values[hover])), + ], + ), + ), + ], + ), + ); + }, + ), + ), + ), + ], + ); + } +} + +class _LinePainter extends CustomPainter { + _LinePainter({ + required this.theme, + required this.days, + required this.series, + required this.ticks, + required this.labelWidth, + required this.format, + required this.dayLabel, + required this.hover, + }); + + final ShadThemeData theme; + final List days; + final List series; + final List ticks; + final double labelWidth; + final String Function(num) format; + final String Function(DateTime) dayLabel; + final int? hover; + + @override + void paint(Canvas canvas, Size size) { + final plot = _plot(size, labelWidth); + if (plot.width <= 0 || plot.height <= 0) return; + final c = theme.colorScheme; + final n = days.length; + final top = ticks.last; + double x(int i) => + n <= 1 ? plot.center.dx : plot.left + plot.width * i / (n - 1); + double y(double v) => plot.bottom - (v / top) * plot.height; + + _paintGrid(canvas, plot, ticks, format, theme); + final style = _axisStyle(theme); + for (final i in _dateTicks(n, plot.width)) { + _paintText( + canvas, + dayLabel(days[i]), + style, + Offset(x(i), plot.bottom + 6), + align: Alignment.topCenter, + minX: 0, + maxX: size.width, + ); + } + if (hover != null) { + final hx = x(hover!).roundToDouble() + 0.5; + canvas.drawLine( + Offset(hx, plot.top), + Offset(hx, plot.bottom), + Paint() + ..color = c.mutedForeground.withValues(alpha: 0.5) + ..strokeWidth = 1, + ); + } + for (final s in series.reversed) { + if (n == 0) continue; + final path = Path()..moveTo(x(0), y(s.values[0])); + for (var i = 1; i < n; i++) { + path.lineTo(x(i), y(s.values[i])); + } + if (s.area) { + final fill = Path.from(path) + ..lineTo(x(n - 1), plot.bottom) + ..lineTo(x(0), plot.bottom) + ..close(); + canvas.drawPath( + fill, + Paint() + ..shader = LinearGradient( + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + colors: [ + s.color.withValues(alpha: 0.16), + s.color.withValues(alpha: 0.01), + ], + ).createShader(plot), + ); + } + final stroke = Paint() + ..color = s.color + ..style = PaintingStyle.stroke + ..strokeWidth = 2 + ..strokeJoin = StrokeJoin.round + ..strokeCap = StrokeCap.round; + canvas.drawPath(s.dashed ? _dash(path) : path, stroke); + if (n == 1) canvas.drawCircle(Offset(x(0), y(s.values[0])), 3, stroke); + } + if (hover != null) { + for (final s in series) { + final p = Offset(x(hover!), y(s.values[hover!])); + canvas + ..drawCircle(p, 6, Paint()..color = c.card) + ..drawCircle(p, 4, Paint()..color = s.color); + } + } + } + + /// [path] cut into 6 px dashes with 4 px gaps. + static Path _dash(Path path) { + final out = Path(); + for (final m in path.computeMetrics()) { + var d = 0.0; + while (d < m.length) { + out.addPath(m.extractPath(d, math.min(d + 6, m.length)), Offset.zero); + d += 10; + } + } + return out; + } + + @override + bool shouldRepaint(_LinePainter old) => + old.theme != theme || + old.days != days || + old.series != series || + old.hover != hover || + old.labelWidth != labelWidth; +} + +// ---------------------------------------------------------- bar chart + +/// Stacked columns over days or weeks (specs/19 §3.2): one bar per +/// [starts] entry covering [bucketDays] days, a 2 px gap between stacked +/// segments, rounded tops, a highlight band and a tooltip with the total +/// on hover, and a legend for two or more series. +class AnalyticsBarChart extends StatefulWidget { + const AnalyticsBarChart({ + super.key, + required this.starts, + required this.bucketDays, + required this.series, + required this.format, + required this.dayLabel, + required this.bucketTitle, + required this.totalLabel, + this.height = 200, + this.semanticLabel, + }); + + /// The first day of each bar, oldest first. + final List starts; + final int bucketDays; + final List series; + final String Function(num v) format; + final String Function(DateTime d) dayLabel; + + /// The tooltip title of the bar [i] ("Mon, Oct 3" or "Oct 3 – 9"). + final String Function(int i) bucketTitle; + + /// "Total" (shown in the tooltip of stacked bars). + final String totalLabel; + final double height; + final String? semanticLabel; + + @override + State createState() => _AnalyticsBarChartState(); +} + +class _AnalyticsBarChartState extends State { + int? _hover; + final Set _hidden = {}; + + @override + Widget build(BuildContext context) { + final theme = ShadTheme.of(context); + final shown = [ + for (final s in widget.series) + if (!_hidden.contains(s.id)) s, + ]; + final n = widget.starts.length; + final totals = [ + for (var i = 0; i < n; i++) + shown.fold(0, (sum, s) => sum + s.values[i]), + ]; + final ticks = _ticks(totals.fold(0, math.max)); + final labelWidth = _labelWidth(ticks, widget.format, _axisStyle(theme)); + return Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + if (widget.series.length > 1) ...[ + AnalyticsLegend( + series: widget.series, + hidden: _hidden, + onToggle: (id) => setState(() { + if (!_hidden.remove(id)) _hidden.add(id); + }), + ), + const SizedBox(height: 10), + ], + Semantics( + label: widget.semanticLabel, + image: true, + child: SizedBox( + height: widget.height, + child: LayoutBuilder( + builder: (context, box) { + final size = Size(box.maxWidth, widget.height); + final plot = _plot(size, labelWidth); + final slot = n == 0 ? 0.0 : plot.width / n; + final hover = _hover; + return _HoverArea( + onX: (x) { + int? i; + if (x != null && n > 0 && slot > 0) { + i = ((x - plot.left) / slot).floor().clamp(0, n - 1); + } + if (i != _hover) setState(() => _hover = i); + }, + child: Stack( + clipBehavior: Clip.none, + children: [ + Positioned.fill( + child: CustomPaint( + painter: _BarPainter( + theme: theme, + starts: widget.starts, + series: shown, + ticks: ticks, + labelWidth: labelWidth, + format: widget.format, + dayLabel: widget.dayLabel, + hover: hover, + ), + ), + ), + if (hover != null && shown.isNotEmpty) + _placeTooltip( + plot.left + slot * (hover + 0.5), + size.width, + AnalyticsTooltip( + title: widget.bucketTitle(hover), + rows: [ + for (final s in shown.reversed) + (s, widget.format(s.values[hover])), + if (shown.length > 1) + ( + AnalyticsSeries( + id: 'total', + label: widget.totalLabel, + color: const Color(0x00000000), + values: const [], + ), + widget.format(totals[hover]), + ), + ], + ), + ), + ], + ), + ); + }, + ), + ), + ), + ], + ); + } +} + +class _BarPainter extends CustomPainter { + _BarPainter({ + required this.theme, + required this.starts, + required this.series, + required this.ticks, + required this.labelWidth, + required this.format, + required this.dayLabel, + required this.hover, + }); + + final ShadThemeData theme; + final List starts; + final List series; + final List ticks; + final double labelWidth; + final String Function(num) format; + final String Function(DateTime) dayLabel; + final int? hover; + + @override + void paint(Canvas canvas, Size size) { + final plot = _plot(size, labelWidth); + if (plot.width <= 0 || plot.height <= 0) return; + final c = theme.colorScheme; + final n = starts.length; + if (n == 0) return; + final slot = plot.width / n; + final barWidth = math.min(28.0, math.max(1.0, slot * 0.72)); + final top = ticks.last; + + if (hover != null) { + canvas.drawRRect( + RRect.fromRectAndRadius( + Rect.fromLTWH(plot.left + slot * hover!, plot.top, slot, plot.height), + const Radius.circular(4), + ), + Paint()..color = c.muted.withValues(alpha: 0.8), + ); + } + _paintGrid(canvas, plot, ticks, format, theme); + final style = _axisStyle(theme); + for (final i in _dateTicks(n, plot.width)) { + _paintText( + canvas, + dayLabel(starts[i]), + style, + Offset(plot.left + slot * (i + 0.5), plot.bottom + 6), + align: Alignment.topCenter, + minX: 0, + maxX: size.width, + ); + } + // A 2 px gap between stacked segments (only when bars are wide enough + // to show it). + final gap = barWidth >= 6 ? 2.0 : 0.0; + final radius = math.min(4.0, barWidth / 2); + for (var i = 0; i < n; i++) { + final left = plot.left + slot * i + (slot - barWidth) / 2; + var base = plot.bottom; + final segments = [ + for (final s in series) + if (s.values[i] > 0) s, + ]; + for (var k = 0; k < segments.length; k++) { + final s = segments[k]; + final h = s.values[i] / top * plot.height; + final isTop = k == segments.length - 1; + var rectTop = base - h; + final rectBottom = k == 0 ? base : base - gap; + if (rectBottom - rectTop < 1) rectTop = rectBottom - 1; + final rect = Rect.fromLTRB(left, rectTop, left + barWidth, rectBottom); + canvas.drawRRect( + RRect.fromRectAndCorners( + rect, + topLeft: isTop ? Radius.circular(radius) : Radius.zero, + topRight: isTop ? Radius.circular(radius) : Radius.zero, + ), + Paint()..color = s.color, + ); + base -= h; + } + } + } + + @override + bool shouldRepaint(_BarPainter old) => + old.theme != theme || + old.starts != starts || + old.series != series || + old.hover != hover || + old.labelWidth != labelWidth; +} + +// ------------------------------------------------------------ others + +/// A ranked list of horizontal bars (AI by feature or model): label, bar +/// relative to the largest value, and the value as text. +class AnalyticsRankBars extends StatelessWidget { + const AnalyticsRankBars({ + super.key, + required this.rows, + required this.color, + this.keyPrefix = 'analytics.rank', + }); + + /// Label, value and its text, largest first. + final List<(String, double, String)> rows; + final Color color; + final String keyPrefix; + + @override + Widget build(BuildContext context) { + final theme = ShadTheme.of(context); + final c = theme.colorScheme; + final max = rows.fold(0, (m, r) => math.max(m, r.$2)); + return Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + for (final (label, value, text) in rows) + Padding( + key: ValueKey('$keyPrefix.$label'), + padding: const EdgeInsets.only(bottom: 8), + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Row( + children: [ + Expanded( + child: Text( + label, + style: theme.textTheme.small.copyWith( + fontWeight: FontWeight.w400, + ), + overflow: TextOverflow.ellipsis, + ), + ), + const SizedBox(width: 8), + Text( + text, + style: theme.textTheme.muted.copyWith( + fontFeatures: const [FontFeature.tabularFigures()], + ), + ), + ], + ), + const SizedBox(height: 4), + LayoutBuilder( + builder: (context, box) => Stack( + children: [ + Container( + height: 6, + decoration: BoxDecoration( + color: c.muted, + borderRadius: BorderRadius.circular(3), + ), + ), + Container( + height: 6, + width: max <= 0 + ? 0 + : math.max(3, box.maxWidth * value / max), + decoration: BoxDecoration( + color: color, + borderRadius: BorderRadius.circular(3), + ), + ), + ], + ), + ), + ], + ), + ), + ], + ); + } +} + +/// A small trend line under a KPI (no axes): 2 px, the last point marked. +class AnalyticsSparkline extends StatelessWidget { + const AnalyticsSparkline({ + super.key, + required this.values, + required this.color, + this.height = 28, + }); + + final List values; + final Color color; + final double height; + + @override + Widget build(BuildContext context) => ExcludeSemantics( + child: SizedBox( + height: height, + child: CustomPaint( + painter: _SparkPainter( + values, + color, + ShadTheme.of(context).colorScheme, + ), + ), + ), + ); +} + +class _SparkPainter extends CustomPainter { + _SparkPainter(this.values, this.color, this.c); + + final List values; + final Color color; + final ShadColorScheme c; + + @override + void paint(Canvas canvas, Size size) { + if (values.length < 2) return; + final max = values.fold(0, math.max); + final top = max <= 0 ? 1.0 : max; + final n = values.length; + Offset at(int i) => Offset( + 2 + (size.width - 4) * i / (n - 1), + size.height - 3 - (values[i] / top) * (size.height - 6), + ); + final path = Path()..moveTo(at(0).dx, at(0).dy); + for (var i = 1; i < n; i++) { + path.lineTo(at(i).dx, at(i).dy); + } + canvas.drawPath( + path, + Paint() + ..color = color + ..style = PaintingStyle.stroke + ..strokeWidth = 2 + ..strokeJoin = StrokeJoin.round + ..strokeCap = StrokeCap.round, + ); + canvas + ..drawCircle(at(n - 1), 4, Paint()..color = c.card) + ..drawCircle(at(n - 1), 2.5, Paint()..color = color); + } + + @override + bool shouldRepaint(_SparkPainter old) => + old.values != values || old.color != color || old.c != c; +} diff --git a/wonky_drive/lib/features/analytics/analytics_controller.dart b/wonky_drive/lib/features/analytics/analytics_controller.dart new file mode 100644 index 00000000..07964122 --- /dev/null +++ b/wonky_drive/lib/features/analytics/analytics_controller.dart @@ -0,0 +1,151 @@ +import 'dart:async'; + +import 'package:flutter/foundation.dart'; +import 'package:wonky_app/wonky_app.dart'; +import 'package:wonky_client/wonky_client.dart'; + +import 'analytics_api.dart'; + +/// The periods of the Analytics page (specs/19 §3.1), in days. +const analyticsPeriods = [7, 30, 90, 365]; + +/// The default period. +const analyticsDefaultDays = 30; + +/// `/analytics?days=…&admins=1` of a period ([analyticsPeriods]) and the +/// *Include admins* switch. +String analyticsPath({int days = analyticsDefaultDays, bool admins = false}) { + final q = [ + if (days != analyticsDefaultDays) 'days=$days', + if (admins) 'admins=1', + ]; + return q.isEmpty ? '/analytics' : '/analytics?${q.join('&')}'; +} + +/// The period of `?days=` ([analyticsDefaultDays] when absent or unknown). +int parseAnalyticsDays(String? v) { + final d = int.tryParse(v ?? ''); + return analyticsPeriods.contains(d) ? d! : analyticsDefaultDays; +} + +/// State of the Analytics page (specs/19 §3): the overview of the period. +/// Responses of an older period are dropped. +class AnalyticsController extends ChangeNotifier { + AnalyticsController({ + required this.services, + this.days = analyticsDefaultDays, + this.includeAdmins = false, + }); + + final ShellServices services; + + AnalyticsApi get api => AnalyticsHost.of(services).api; + + int days; + bool includeAdmins; + + AnalyticsOverview? overview; + Object? error; + bool loading = false; + + /// Bumped on every request; a response of an older one is dropped. + int _overviewToken = 0; + + bool _disposed = false; + + /// Reloads the overview. + Future reload() => loadOverview(); + + Future loadOverview() async { + final token = ++_overviewToken; + loading = true; + error = null; + _notify(); + try { + final o = await api.overview(days, includeAdmins: includeAdmins); + if (token != _overviewToken) return; + overview = o; + } catch (e) { + if (token != _overviewToken) return; + error = e; + } finally { + if (token == _overviewToken) { + loading = false; + _notify(); + } + } + } + + /// Applies the route's period and switch (`?days=`, `?admins=`). + void setPeriod(int days, {required bool includeAdmins}) { + if (days == this.days && includeAdmins == this.includeAdmins) return; + this.days = days; + this.includeAdmins = includeAdmins; + unawaited(reload()); + } + + void _notify() { + if (!_disposed) notifyListeners(); + } + + @override + void dispose() { + _disposed = true; + super.dispose(); + } +} + +/// Per-shell collaborators of the Analytics page: the server API (replaced +/// in tests). +class AnalyticsHost { + AnalyticsHost._(this.services); + + static final Expando _hosts = Expando('AnalyticsHost'); + + /// The host of [services] (created on first use). + static AnalyticsHost of(ShellServices services) => + _hosts[services] ??= AnalyticsHost._(services); + + final ShellServices services; + + AnalyticsApi? _api; + + /// Server access ([ServerAnalyticsApi] unless replaced). + AnalyticsApi get api => _api ??= ServerAnalyticsApi(services); + set api(AnalyticsApi v) => _api = v; +} + +/// Sums [values] (one per day) into buckets of [size] days, oldest first; +/// the first bucket is the shorter one when the days don't divide evenly, +/// so the last bucket always ends today. +List bucketSums(List values, int size) { + if (size <= 1) return [for (final v in values) v.toDouble()]; + final out = []; + var end = values.length; + while (end > 0) { + final start = end - size < 0 ? 0 : end - size; + var sum = 0.0; + for (var i = start; i < end; i++) { + sum += values[i]; + } + out.add(sum); + end = start; + } + return out.reversed.toList(); +} + +/// The first day of each bucket of [bucketSums] over [days]. +List bucketStarts(List days, int size) { + if (size <= 1) return days; + final out = []; + var end = days.length; + while (end > 0) { + final start = end - size < 0 ? 0 : end - size; + out.add(days[start]); + end = start; + } + return out.reversed.toList(); +} + +/// Days per bar of the bar charts: daily up to 90 days, weekly beyond. +int bucketSizeOf(int days) => days > 90 ? 7 : 1; diff --git a/wonky_drive/lib/features/analytics/analytics_screen.dart b/wonky_drive/lib/features/analytics/analytics_screen.dart new file mode 100644 index 00000000..5aee280a --- /dev/null +++ b/wonky_drive/lib/features/analytics/analytics_screen.dart @@ -0,0 +1,822 @@ +import 'dart:async'; + +import 'package:flutter/widgets.dart'; +import 'package:shad/shad.dart'; +import 'package:wonky_app/wonky_app.dart'; +import 'package:wonky_client/wonky_client.dart'; +import 'package:wonky_core/wonky_core.dart' show InvocationSource, KeyScope; +import 'package:wonky_ui/wonky_ui.dart'; + +import '../../l10n/drive_l10n.dart'; +import 'analytics_charts.dart'; +import 'analytics_controller.dart'; +import 'analytics_sections.dart'; + +/// The Analytics page `/analytics` (specs/19 §3) in the home frame (top +/// bar, left menu with *Analytics* highlighted), for admins: headline +/// numbers, active users, apps, accounts, content, collaboration, AI, MCP, +/// and sign-up cohorts. [days] and [includeAdmins] come from +/// `?days=` and `?admins=` (`drive.analytics.show`). +class AnalyticsScreen extends StatefulWidget { + const AnalyticsScreen({ + super.key, + required this.services, + this.days = analyticsDefaultDays, + this.includeAdmins = false, + }); + + final ShellServices services; + final int days; + final bool includeAdmins; + + @override + State createState() => _AnalyticsScreenState(); +} + +/// Which rolling count the *Active users* chart shows. +enum _ActiveView { daily, weekly, monthly } + +class _AnalyticsScreenState extends State { + late final AnalyticsController c = AnalyticsController( + services: widget.services, + days: widget.days, + includeAdmins: widget.includeAdmins, + ); + final _scroll = ScrollController(); + final _pageFocus = FocusNode(debugLabel: 'analytics.page'); + final _searchFocus = FocusNode(debugLabel: 'analytics.search'); + final _sidebarFocus = FocusNode( + debugLabel: 'analytics.sidebar', + skipTraversal: true, + ); + final _topFocus = FocusNode(debugLabel: 'analytics.top', skipTraversal: true); + bool _sidebarOpen = true; + _ActiveView _activeView = _ActiveView.daily; + + ShellServices get s => widget.services; + + @override + void initState() { + super.initState(); + unawaited(c.reload()); + s.focusRegions + ..clear() + ..addAll([_topFocus, _sidebarFocus, _pageFocus]); + s.driveSearchFocus = _searchFocus; + s.currentItem.value = null; + s.currentFolder.value = null; + } + + @override + void didUpdateWidget(AnalyticsScreen old) { + super.didUpdateWidget(old); + c.setPeriod(widget.days, includeAdmins: widget.includeAdmins); + } + + @override + void dispose() { + s.focusRegions.removeWhere( + (f) => f == _topFocus || f == _sidebarFocus || f == _pageFocus, + ); + if (s.driveSearchFocus == _searchFocus) s.driveSearchFocus = null; + c.dispose(); + _scroll.dispose(); + _pageFocus.dispose(); + _searchFocus.dispose(); + _sidebarFocus.dispose(); + _topFocus.dispose(); + super.dispose(); + } + + void _show({int? days, bool? admins}) => unawaited( + s.dispatcher.invoke( + 'drive.analytics.show', + args: { + 'days': days ?? c.days, + 'includeAdmins': admins ?? c.includeAdmins, + }, + source: InvocationSource.ui, + context: context, + ), + ); + + /// Below `md` the left menu is a drawer (Drive 04 §2). + Future _openDrawer() => showShadSheet( + context: context, + side: ShadSheetSide.left, + barrierLabel: WonkyAppLocalizations.of(context).actionClose, + builder: (sheetContext) => ShadSheet( + key: const ValueKey('home.drawer'), + closeIcon: ShadIconButton.ghost( + key: const ValueKey('home.drawer.close'), + width: 32, + height: 32, + iconSize: 16, + semanticLabel: WonkyAppLocalizations.of(sheetContext).actionClose, + icon: const Icon(LucideIcons.x), + onPressed: () => Navigator.of(sheetContext).maybePop(), + ), + scrollable: false, + padding: EdgeInsets.zero, + constraints: const BoxConstraints(maxWidth: HomeSidebar.width + 8), + child: SizedBox( + height: MediaQuery.sizeOf(sheetContext).height, + child: Padding( + padding: const EdgeInsets.only(top: 40), + child: HomeSidebar( + services: s, + location: const DriveLocation.home(), + activeDestination: HomeNavDestination.analytics, + onNavigate: () => Navigator.of(sheetContext).pop(), + ), + ), + ), + ), + ); + + @override + Widget build(BuildContext context) { + final theme = ShadTheme.of(context); + final width = MediaQuery.sizeOf(context).width; + final narrow = width < 768; + final sidebarVisible = _sidebarOpen && !narrow; + return ColoredBox( + color: theme.colorScheme.background, + child: KeymapScope( + scope: KeyScope.drive, + keymap: s.keymap, + child: Column( + children: [ + Focus( + focusNode: _topFocus, + child: WonkyTopBar( + services: s, + searchFocus: _searchFocus, + onToggleSidebar: narrow + ? _openDrawer + : () => setState(() => _sidebarOpen = !_sidebarOpen), + contentStart: sidebarVisible ? HomeSidebar.width + 20 : null, + ), + ), + Expanded( + child: Row( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + if (sidebarVisible) + Focus( + focusNode: _sidebarFocus, + child: HomeSidebar( + services: s, + location: const DriveLocation.home(), + activeDestination: HomeNavDestination.analytics, + ), + ), + Expanded( + child: Container( + key: const ValueKey('analytics.page'), + margin: EdgeInsets.only( + right: narrow ? 0 : 12, + bottom: narrow ? 0 : 12, + ), + decoration: BoxDecoration( + color: theme.colorScheme.card, + borderRadius: narrow ? null : BorderRadius.circular(16), + border: narrow + ? null + : Border.all(color: theme.colorScheme.border), + ), + clipBehavior: Clip.antiAlias, + child: Focus( + focusNode: _pageFocus, + child: ListenableBuilder( + listenable: c, + builder: (context, _) => _content(context), + ), + ), + ), + ), + ], + ), + ), + ], + ), + ), + ); + } + + Widget _content(BuildContext context) { + final l = driveL10n(context); + final la = WonkyAppLocalizations.of(context); + return LayoutBuilder( + builder: (context, box) { + final pad = box.maxWidth < 480 ? 12.0 : 24.0; + final o = c.overview; + final error = c.error; + final List body; + if (o == null && error != null) { + final forbidden = + error is WonkyException && error.code == WonkyErrorCode.forbidden; + final offline = isOfflineError(error); + body = [ + WonkyEmptyState( + key: ValueKey( + forbidden ? 'analytics.forbidden' : 'analytics.error', + ), + illustration: forbidden + ? EmptyIllustration.noAccess + : offline + ? EmptyIllustration.offline + : EmptyIllustration.error, + title: forbidden + ? l.analyticsForbiddenTitle + : offline + ? l.storageOfflineTitle + : l.analyticsErrorTitle, + description: forbidden + ? l.analyticsForbiddenBody + : offline + ? l.storageOfflineBody + : errorMessage(error), + size: 96, + actions: [ + if (!forbidden) + ShadButton.outline( + key: const ValueKey('analytics.retry'), + onPressed: () => unawaited(c.reload()), + child: Text(la.actionRetry), + ), + ], + ), + ]; + } else if (o == null) { + body = [ + SizedBox( + height: 220, + child: ClipRect( + child: OverflowBox( + alignment: Alignment.topCenter, + maxHeight: double.infinity, + child: LoadingShimmer.driveList(rows: 4), + ), + ), + ), + ]; + } else { + body = _sections(context, o); + } + return WonkyScrollArea( + controller: _scroll, + child: ListView( + controller: _scroll, + padding: EdgeInsets.fromLTRB(pad, 20, pad, 32), + children: [_header(context), const SizedBox(height: 18), ...body], + ), + ); + }, + ); + } + + Widget _header(BuildContext context) { + final l = driveL10n(context); + final f = AnalyticsFormat(context); + final theme = ShadTheme.of(context); + final o = c.overview; + final note = o == null + ? null + : [ + l.analyticsUpdated(f.time(o.generatedAt)), + if (o.trackingSince case final t?) + if (!t.isBefore(o.series.first.day)) + l.analyticsTrackingSince(f.date(t)), + if (o.trackingSince == null) l.analyticsNoActivityYet, + ].join(' · '); + return Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Wrap( + alignment: WrapAlignment.spaceBetween, + crossAxisAlignment: WrapCrossAlignment.center, + spacing: 16, + runSpacing: 10, + children: [ + Semantics( + header: true, + child: Text(l.analyticsTitle, style: theme.textTheme.h3), + ), + Wrap( + crossAxisAlignment: WrapCrossAlignment.center, + spacing: 14, + runSpacing: 8, + children: [ + // Phones choose the period from a select (the tabs need + // about 460 px). + if (MediaQuery.sizeOf(context).width < 600) + SizedBox( + width: 140, + child: ShadSelect( + key: ValueKey( + 'analytics.period.select.${c.days}', + ), + initialValue: c.days, + minWidth: 140, + options: [ + for (final d in analyticsPeriods) + ShadOption( + key: ValueKey('analytics.period.option.$d'), + value: d, + child: Text(l.analyticsPeriodDays(d)), + ), + ], + selectedOptionBuilder: (context, d) => + Text(l.analyticsPeriodDays(d)), + onChanged: (d) { + if (d != null) _show(days: d); + }, + ), + ) + else + ShadTabs( + key: const ValueKey('analytics.period'), + value: c.days, + onChanged: (d) => _show(days: d), + tabs: [ + for (final d in analyticsPeriods) + ShadTab( + key: ValueKey('analytics.period.$d'), + value: d, + child: Text(l.analyticsPeriodDays(d)), + ), + ], + ), + ShadSwitch( + key: const ValueKey('analytics.includeAdmins'), + value: c.includeAdmins, + onChanged: (v) => _show(admins: v), + label: Text(l.analyticsIncludeAdmins), + ), + ShadIconButton.ghost( + key: const ValueKey('analytics.refresh'), + width: 32, + height: 32, + iconSize: 16, + semanticLabel: l.analyticsRefresh, + icon: c.loading + ? const SizedBox.square( + dimension: 14, + child: ShadProgress(), + ) + : const Icon(LucideIcons.refreshCw), + onPressed: c.loading ? null : () => unawaited(c.reload()), + ), + ], + ), + ], + ), + const SizedBox(height: 4), + Text( + note ?? l.analyticsSubtitle, + key: const ValueKey('analytics.note'), + style: theme.textTheme.muted, + ), + ], + ); + } + + List _sections(BuildContext context, AnalyticsOverview o) { + final l = driveL10n(context); + final f = AnalyticsFormat(context); + final theme = ShadTheme.of(context); + final cs = theme.colorScheme; + final b = theme.brightness; + final ink = AnalyticsColors.ink(cs); + final accent = AnalyticsColors.accent(b); + final days = [for (final d in o.series) d.day]; + final dayLabels = [for (final d in days) f.dayTitle(d)]; + final last = o.series.last; + final created = o.series.fold( + 0, + (s, d) => s + d.documents + d.spreadsheets + d.presentations + d.files, + ); + final semantic = l.analyticsChartLabel; + + Widget line(String id, List series, {double h = 200}) => + AnalyticsLineChart( + key: ValueKey('analytics.chart.$id'), + days: days, + series: series, + format: f.compact, + dayLabel: f.day, + dayTitle: f.dayTitle, + height: h, + semanticLabel: semantic( + [for (final s in series) s.label].join(', '), + f.day(days.first), + f.day(days.last), + ), + ); + + AnalyticsTableData Function() table(List series) => + () => seriesTable(l.analyticsColDay, dayLabels, series, f.count); + + Widget bars( + String id, + List<(String, String, Color, num Function(AnalyticsDay))> measures, { + double h = 180, + }) { + final bk = bucketed(o, f, measures); + return AnalyticsBarChart( + key: ValueKey('analytics.chart.$id'), + starts: bk.starts, + bucketDays: bk.size, + series: bk.series, + format: f.compact, + dayLabel: f.day, + bucketTitle: bk.title, + totalLabel: l.analyticsTotal, + height: h, + semanticLabel: semantic( + [for (final s in bk.series) s.label].join(', '), + f.day(days.first), + f.day(days.last), + ), + ); + } + + AnalyticsTableData Function() barTable( + List<(String, String, Color, num Function(AnalyticsDay))> measures, + ) => () { + final bk = bucketed(o, f, measures); + return seriesTable( + bk.size == 1 ? l.analyticsColDay : l.analyticsColWeek, + bk.labels, + bk.series, + f.count, + ); + }; + + // ---- Active users ---- + final activeSeries = switch (_activeView) { + _ActiveView.daily => [ + AnalyticsSeries( + id: 'active', + label: l.analyticsSeriesActive, + color: ink, + area: true, + values: [for (final d in o.series) d.active.toDouble()], + ), + AnalyticsSeries( + id: 'editors', + label: l.analyticsSeriesEditors, + color: accent, + values: [for (final d in o.series) d.editors.toDouble()], + ), + ], + _ActiveView.weekly => [ + AnalyticsSeries( + id: 'weekly', + label: l.analyticsSeriesWeekly, + color: ink, + area: true, + values: [for (final d in o.series) d.weekly.toDouble()], + ), + ], + _ActiveView.monthly => [ + AnalyticsSeries( + id: 'monthly', + label: l.analyticsSeriesMonthly, + color: ink, + area: true, + values: [for (final d in o.series) d.monthly.toDouble()], + ), + ], + }; + final appSeries = [ + AnalyticsSeries( + id: 'drive', + label: 'Drive', + color: AnalyticsColors.drive(b), + values: [for (final d in o.series) d.drive.toDouble()], + ), + AnalyticsSeries( + id: 'write', + label: 'Write', + color: AnalyticsColors.write, + values: [for (final d in o.series) d.write.toDouble()], + ), + AnalyticsSeries( + id: 'sheets', + label: 'Sheets', + color: AnalyticsColors.sheets, + values: [for (final d in o.series) d.sheets.toDouble()], + ), + AnalyticsSeries( + id: 'slides', + label: 'Slides', + color: AnalyticsColors.slides, + values: [for (final d in o.series) d.slides.toDouble()], + ), + AnalyticsSeries( + id: 'mcp', + label: l.analyticsSeriesMcp, + color: AnalyticsColors.mcp, + dashed: true, + values: [for (final d in o.series) d.mcp.toDouble()], + ), + ]; + final collabSeries = [ + AnalyticsSeries( + id: 'comments', + label: l.analyticsSeriesComments, + color: ink, + values: [for (final d in o.series) d.comments.toDouble()], + ), + AnalyticsSeries( + id: 'shares', + label: l.analyticsSeriesShares, + color: accent, + values: [for (final d in o.series) d.shares.toDouble()], + ), + ]; + final kinds = analyticsKinds(context, cs); + final contentMeasures = [ + for (final (id, label, color) in kinds) + ( + id, + label, + color, + switch (id) { + 'document' => (AnalyticsDay d) => d.documents, + 'spreadsheet' => (AnalyticsDay d) => d.spreadsheets, + 'presentation' => (AnalyticsDay d) => d.presentations, + _ => (AnalyticsDay d) => d.files, + }, + ), + ]; + final signupMeasures = [ + ('signups', l.analyticsSeriesSignups, ink, (AnalyticsDay d) => d.signups), + ]; + final aiMeasures = [ + ( + 'aiRequests', + l.analyticsSeriesAiRequests, + ink, + (AnalyticsDay d) => d.aiRequests, + ), + ]; + final mcpMeasures = [ + ( + 'mcpCalls', + l.analyticsSeriesMcpCalls, + AnalyticsColors.mcp, + (AnalyticsDay d) => d.mcpCalls, + ), + ]; + final aiTokens = o.series.fold(0, (s, d) => s + d.aiTokens); + final aiRequests = o.series.fold(0, (s, d) => s + d.aiRequests); + final mcpCalls = o.series.fold(0, (s, d) => s + d.mcpCalls); + const gap = SizedBox(height: 12); + + return [ + AnalyticsGrid( + wide: 3, + medium: 2, + narrow: 2, + children: [ + AnalyticsKpi( + id: 'accounts', + label: l.analyticsKpiAccounts, + value: f.count(o.accounts), + note: l.analyticsKpiNew(f.count(o.newAccounts), o.days), + trend: [for (final d in o.series) d.accounts.toDouble()], + ), + AnalyticsKpi( + id: 'today', + label: l.analyticsKpiToday, + value: f.count(o.activeToday), + note: l.analyticsKpiEditorsToday(f.count(last.editors)), + trend: [for (final d in o.series) d.active.toDouble()], + ), + AnalyticsKpi( + id: 'weekly', + label: l.analyticsKpiWeekly, + value: f.count(o.weekly), + note: l.analyticsKpiWeeklyNote, + trend: [for (final d in o.series) d.weekly.toDouble()], + ), + AnalyticsKpi( + id: 'monthly', + label: l.analyticsKpiMonthly, + value: f.count(o.monthly), + note: l.analyticsKpiMonthlyNote, + trend: [for (final d in o.series) d.monthly.toDouble()], + ), + AnalyticsKpi( + id: 'stickiness', + label: l.analyticsKpiStickiness, + value: f.percent(o.stickiness), + note: l.analyticsKpiStickinessNote, + ), + AnalyticsKpi( + id: 'created', + label: l.analyticsKpiCreated, + value: f.count(created), + note: l.analyticsKpiInPeriod(o.days), + ), + ], + ), + const SizedBox(height: 20), + AnalyticsCard( + id: 'active', + title: l.analyticsActiveTitle, + subtitle: l.analyticsActiveSubtitle, + actions: [ + ShadTabs<_ActiveView>( + key: const ValueKey('analytics.active.view'), + // Scrolls instead of overflowing on phones. + scrollable: true, + value: _activeView, + onChanged: (v) => setState(() => _activeView = v), + tabs: [ + for (final v in _ActiveView.values) + ShadTab( + key: ValueKey('analytics.active.view.${v.name}'), + value: v, + child: Text(switch (v) { + _ActiveView.daily => l.analyticsViewDaily, + _ActiveView.weekly => l.analyticsViewWeekly, + _ActiveView.monthly => l.analyticsViewMonthly, + }), + ), + ], + ), + ], + chart: line('active.${_activeView.name}', activeSeries, h: 240), + table: table(activeSeries), + ), + gap, + AnalyticsCard( + id: 'apps', + title: l.analyticsAppsTitle, + subtitle: l.analyticsAppsSubtitle, + chart: line('apps', appSeries), + table: table(appSeries), + ), + gap, + AnalyticsGrid( + wide: 2, + medium: 1, + children: [ + AnalyticsCard( + id: 'signups', + title: l.analyticsSignupsTitle, + subtitle: l.analyticsSignupsSubtitle( + f.count(o.newAccounts), + f.count(o.accounts), + ), + chart: bars('signups', signupMeasures), + table: barTable(signupMeasures), + ), + AnalyticsCard( + id: 'mix', + title: l.analyticsContentNowTitle, + chart: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + AnalyticsContentNow(overview: o), + const SizedBox(height: 22), + Text(l.analyticsSignInTitle, style: theme.textTheme.small), + const SizedBox(height: 10), + AnalyticsSignInMethods(overview: o), + ], + ), + ), + ], + ), + gap, + AnalyticsCard( + id: 'content', + title: l.analyticsContentTitle, + subtitle: l.analyticsContentSubtitle, + chart: bars('content', contentMeasures, h: 200), + table: barTable(contentMeasures), + ), + gap, + AnalyticsCard( + id: 'collaboration', + title: l.analyticsCollabTitle, + chart: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + AnalyticsStatRow( + stats: [ + ('shared', l.analyticsStatShared, f.count(o.sharedItems)), + ( + 'coEdited', + l.analyticsStatCoEdited(o.days), + f.count(o.coEditedItems), + ), + ( + 'commenters', + l.analyticsStatCommenters(o.days), + f.count(o.commenters), + ), + ], + ), + const SizedBox(height: 16), + line('collaboration', collabSeries, h: 180), + ], + ), + table: table(collabSeries), + ), + gap, + AnalyticsCard( + id: 'ai', + title: l.analyticsAiTitle, + subtitle: l.analyticsAiSubtitle( + f.count(aiRequests), + f.compact(aiTokens), + o.aiRetentionDays, + ), + chart: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + bars('ai', aiMeasures, h: 160), + const SizedBox(height: 18), + AnalyticsGrid( + wide: 2, + medium: 2, + gap: 24, + children: [ + _rank( + context, + 'feature', + l.analyticsAiByFeature, + o.aiFeatures, + f, + ), + _rank(context, 'model', l.analyticsAiByModel, o.aiModels, f), + ], + ), + ], + ), + table: barTable(aiMeasures), + ), + gap, + AnalyticsCard( + id: 'mcp', + title: l.analyticsMcpTitle, + subtitle: l.analyticsMcpSubtitle(f.count(mcpCalls)), + chart: bars('mcp', mcpMeasures, h: 160), + table: barTable(mcpMeasures), + ), + gap, + AnalyticsCard( + id: 'retention', + title: l.analyticsRetentionTitle, + subtitle: l.analyticsRetentionSubtitle, + chart: AnalyticsCohortGrid(cohorts: o.cohorts), + ), + ]; + } + + Widget _rank( + BuildContext context, + String id, + String title, + List counts, + AnalyticsFormat f, + ) { + final l = driveL10n(context); + final theme = ShadTheme.of(context); + return Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Text(title, style: theme.textTheme.small), + const SizedBox(height: 10), + if (counts.isEmpty) + Text(l.analyticsNoAiUse, style: theme.textTheme.muted) + else + AnalyticsRankBars( + keyPrefix: 'analytics.ai.$id', + color: AnalyticsColors.ink(theme.colorScheme), + rows: [ + for (final c in counts) + ( + c.key, + c.count.toDouble(), + l.analyticsAiRow(f.count(c.count), f.compact(c.amount)), + ), + ], + ), + ], + ); + } +} + +/// `/analytics?days=…&admins=1` → [AnalyticsScreen] (registered by +/// `DriveAppConfig`). +Widget analyticsRoutePage(ShellServices services, Uri uri) => AnalyticsScreen( + services: services, + days: parseAnalyticsDays(uri.queryParameters['days']), + includeAdmins: uri.queryParameters['admins'] == '1', +); diff --git a/wonky_drive/lib/features/analytics/analytics_sections.dart b/wonky_drive/lib/features/analytics/analytics_sections.dart new file mode 100644 index 00000000..6903a304 --- /dev/null +++ b/wonky_drive/lib/features/analytics/analytics_sections.dart @@ -0,0 +1,648 @@ +import 'dart:math' as math; + +import 'package:flutter/widgets.dart'; +import 'package:shad/shad.dart'; +import 'package:wonky_app/wonky_app.dart'; +import 'package:wonky_client/wonky_client.dart'; +import 'package:wonky_ui/wonky_ui.dart'; + +import '../../l10n/drive_l10n.dart'; +import 'analytics_charts.dart'; +import 'analytics_controller.dart'; + +/// Number and date formats of the Analytics page in the app's locale. +/// Days are UTC days (the server's), so dates are formatted as given. +class AnalyticsFormat { + AnalyticsFormat(BuildContext context) : locale = _locale(context); + + final String locale; + + static String _locale(BuildContext context) { + final l = Localizations.localeOf(context).toString(); + return DateFormat.localeExists(l) && NumberFormat.localeExists(l) + ? l + : 'en'; + } + + late final NumberFormat _int = NumberFormat.decimalPattern(locale); + late final NumberFormat _compact = NumberFormat.compact(locale: locale); + late final NumberFormat _percent = NumberFormat.percentPattern(locale); + + String count(num v) => _int.format(v.round()); + + /// Below 10,000 in full, above compact ("12K"). + String compact(num v) => + v.abs() < 10000 ? _int.format(v.round()) : _compact.format(v); + + String percent(double v) => _percent.format(v); + + /// "Oct 3". + String day(DateTime d) => DateFormat.MMMd(locale).format(d); + + /// "Mon, Oct 3". + String dayTitle(DateTime d) => DateFormat.MMMEd(locale).format(d); + + /// "Oct 3, 2026". + String date(DateTime d) => DateFormat.yMMMd(locale).format(d); + + /// "Oct 3 – Oct 9". + String range(DateTime from, DateTime to) => '${day(from)} – ${day(to)}'; + + /// "14:05" in the device's time zone. + String time(DateTime t) => DateFormat.Hm(locale).format(t.toLocal()); +} + +/// A section card of the Analytics page: title, optional subtitle and +/// [actions], and the [chart] — or, after *Show as table*, [table]. +class AnalyticsCard extends StatefulWidget { + const AnalyticsCard({ + super.key, + required this.id, + required this.title, + required this.chart, + this.subtitle, + this.actions = const [], + this.table, + }); + + final String id; + final String title; + final String? subtitle; + final List actions; + final Widget chart; + + /// The same data as a table (null: no table view). + final AnalyticsTableData Function()? table; + + @override + State createState() => _AnalyticsCardState(); +} + +class _AnalyticsCardState extends State { + bool _table = false; + + @override + Widget build(BuildContext context) { + final l = driveL10n(context); + final theme = ShadTheme.of(context); + final c = theme.colorScheme; + final table = widget.table; + return Container( + key: ValueKey('analytics.card.${widget.id}'), + padding: const EdgeInsets.fromLTRB(16, 14, 16, 16), + decoration: BoxDecoration( + color: c.background, + borderRadius: BorderRadius.circular(12), + border: Border.all(color: c.border), + ), + child: LayoutBuilder( + builder: (context, box) { + // Narrow cards put the actions (tabs) under the title. + final stacked = box.maxWidth < 520 && widget.actions.isNotEmpty; + final tableButton = table == null + ? null + : ShadIconButton.ghost( + key: ValueKey('analytics.card.${widget.id}.table'), + width: 32, + height: 32, + iconSize: 16, + semanticLabel: _table + ? l.analyticsShowChart + : l.analyticsShowTable, + icon: Icon( + _table ? LucideIcons.chartLine : LucideIcons.table2, + ), + onPressed: () => setState(() => _table = !_table), + ); + return Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Semantics( + header: true, + child: Text( + widget.title, + style: theme.textTheme.large, + ), + ), + if (widget.subtitle case final s?) ...[ + const SizedBox(height: 2), + Text(s, style: theme.textTheme.muted), + ], + ], + ), + ), + if (!stacked) ...widget.actions, + ?tableButton, + ], + ), + if (stacked) ...[ + const SizedBox(height: 10), + Align( + alignment: Alignment.centerLeft, + child: Wrap(spacing: 8, children: widget.actions), + ), + ], + const SizedBox(height: 14), + if (_table && table != null) + AnalyticsTable(data: table()) + else + widget.chart, + ], + ); + }, + ), + ); + } +} + +/// Rows of a chart's table view, newest first. +class AnalyticsTableData { + const AnalyticsTableData({required this.columns, required this.rows}); + + final List columns; + final List> rows; +} + +/// The table view of a chart: a header and the rows, scrolling inside a +/// fixed height. +class AnalyticsTable extends StatelessWidget { + const AnalyticsTable({super.key, required this.data}); + + final AnalyticsTableData data; + + @override + Widget build(BuildContext context) { + final theme = ShadTheme.of(context); + final c = theme.colorScheme; + final number = theme.textTheme.small.copyWith( + fontWeight: FontWeight.w400, + fontFeatures: const [FontFeature.tabularFigures()], + ); + Widget cell(String text, {bool header = false, bool first = false}) => + Padding( + padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 6), + child: Text( + text, + textAlign: first ? TextAlign.left : TextAlign.right, + style: header ? theme.textTheme.muted : number, + ), + ); + return SizedBox( + height: 240, + child: SingleChildScrollView( + child: SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: ConstrainedBox( + constraints: const BoxConstraints(minWidth: 320), + child: Table( + defaultColumnWidth: const IntrinsicColumnWidth(), + border: TableBorder( + horizontalInside: BorderSide(color: c.border), + ), + children: [ + TableRow( + children: [ + for (var i = 0; i < data.columns.length; i++) + cell(data.columns[i], header: true, first: i == 0), + ], + ), + for (final r in data.rows) + TableRow( + children: [ + for (var i = 0; i < r.length; i++) + cell(r[i], first: i == 0), + ], + ), + ], + ), + ), + ), + ), + ); + } +} + +/// [series] over [days] as table rows, newest first. +AnalyticsTableData seriesTable( + String dayColumn, + List dayLabels, + List series, + String Function(num) format, +) => AnalyticsTableData( + columns: [dayColumn, for (final s in series) s.label], + rows: [ + for (var i = dayLabels.length - 1; i >= 0; i--) + [dayLabels[i], for (final s in series) format(s.values[i])], + ], +); + +/// A headline number (specs/19 §3.1): label, value, a note, and an +/// optional sparkline of the period. +class AnalyticsKpi extends StatelessWidget { + const AnalyticsKpi({ + super.key, + required this.id, + required this.label, + required this.value, + this.note, + this.trend, + }); + + final String id; + final String label; + final String value; + final String? note; + final List? trend; + + @override + Widget build(BuildContext context) { + final theme = ShadTheme.of(context); + final c = theme.colorScheme; + return Container( + key: ValueKey('analytics.kpi.$id'), + padding: const EdgeInsets.fromLTRB(14, 12, 14, 12), + decoration: BoxDecoration( + color: c.background, + borderRadius: BorderRadius.circular(12), + border: Border.all(color: c.border), + ), + child: Semantics( + container: true, + label: [label, value, ?note].join(', '), + excludeSemantics: true, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(label, style: theme.textTheme.muted), + const SizedBox(height: 4), + Text( + value, + key: ValueKey('analytics.kpi.$id.value'), + style: theme.textTheme.h3.copyWith( + fontFeatures: const [FontFeature.tabularFigures()], + ), + ), + const SizedBox(height: 2), + Text( + note ?? '', + style: theme.textTheme.muted.copyWith(fontSize: 12), + maxLines: 1, + overflow: TextOverflow.ellipsis, + ), + if (trend case final t?) ...[ + const SizedBox(height: 6), + AnalyticsSparkline(values: t, color: AnalyticsColors.ink(c)), + ], + ], + ), + ), + ); + } +} + +/// Lays [children] out in equal columns: [wide] columns from 720 px, +/// [medium] from 460 px, otherwise [narrow]. +class AnalyticsGrid extends StatelessWidget { + const AnalyticsGrid({ + super.key, + required this.children, + this.wide = 3, + this.medium = 2, + this.narrow = 1, + this.gap = 12, + }); + + final List children; + final int wide; + final int medium; + final int narrow; + final double gap; + + @override + Widget build(BuildContext context) => LayoutBuilder( + builder: (context, box) { + final columns = box.maxWidth >= 720 + ? wide + : box.maxWidth >= 460 + ? medium + : narrow; + final width = (box.maxWidth - gap * (columns - 1)) / columns; + return Wrap( + spacing: gap, + runSpacing: gap, + children: [for (final c in children) SizedBox(width: width, child: c)], + ); + }, + ); +} + +/// The weekly sign-up cohorts (specs/19 §3.5): one row per cohort, a cell +/// per week since sign-up with the share still active, shaded with the +/// ink by that share; weeks before tracking started are blank. +class AnalyticsCohortGrid extends StatelessWidget { + const AnalyticsCohortGrid({super.key, required this.cohorts}); + + final List cohorts; + + @override + Widget build(BuildContext context) { + final l = driveL10n(context); + final f = AnalyticsFormat(context); + final theme = ShadTheme.of(context); + final c = theme.colorScheme; + final weeks = cohorts.fold(0, (m, k) => math.max(m, k.active.length)); + final small = theme.textTheme.muted.copyWith(fontSize: 12); + final number = theme.textTheme.small.copyWith( + fontSize: 12, + fontWeight: FontWeight.w500, + fontFeatures: const [FontFeature.tabularFigures()], + ); + Widget head(String text, {TextAlign align = TextAlign.center}) => Padding( + padding: const EdgeInsets.fromLTRB(4, 0, 4, 6), + child: Text(text, style: small, textAlign: align), + ); + return SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: Table( + defaultColumnWidth: const FixedColumnWidth(48), + columnWidths: const { + 0: IntrinsicColumnWidth(), + 1: IntrinsicColumnWidth(), + }, + defaultVerticalAlignment: TableCellVerticalAlignment.middle, + children: [ + TableRow( + children: [ + head(l.analyticsCohortWeek, align: TextAlign.left), + head(l.analyticsCohortSize, align: TextAlign.right), + for (var k = 0; k < weeks; k++) head(l.analyticsCohortWeekN(k)), + ], + ), + for (final cohort in cohorts.reversed) + TableRow( + key: ValueKey( + 'analytics.cohort.${cohort.week.toIso8601String()}', + ), + children: [ + Padding( + padding: const EdgeInsets.only(right: 12), + child: Text(f.day(cohort.week), style: theme.textTheme.small), + ), + Padding( + padding: const EdgeInsets.only(right: 8), + child: Text( + f.count(cohort.size), + style: number, + textAlign: TextAlign.right, + ), + ), + for (var k = 0; k < weeks; k++) + _cell(context, cohort, k, f, number, c), + ], + ), + ], + ), + ); + } + + Widget _cell( + BuildContext context, + AnalyticsCohort cohort, + int k, + AnalyticsFormat f, + TextStyle number, + ShadColorScheme c, + ) { + final l = driveL10n(context); + final active = k < cohort.active.length ? cohort.active[k] : null; + if (active == null || cohort.size == 0) { + return const SizedBox(height: 30); + } + final share = active / cohort.size; + final alpha = 0.06 + 0.8 * share; + final label = l.analyticsCohortCell( + f.day(cohort.week), + k, + active, + f.percent(share), + ); + return Padding( + padding: const EdgeInsets.all(2), + child: ShadTooltip( + builder: (_) => Text(label), + child: Semantics( + label: label, + excludeSemantics: true, + child: Container( + height: 26, + alignment: Alignment.center, + decoration: BoxDecoration( + color: c.foreground.withValues(alpha: alpha), + borderRadius: BorderRadius.circular(4), + ), + child: Text( + f.percent(share), + style: number.copyWith( + fontSize: 11, + color: alpha > 0.5 ? c.background : c.foreground, + ), + ), + ), + ), + ), + ); + } +} + +/// A row of three small numbers (collaboration). +class AnalyticsStatRow extends StatelessWidget { + const AnalyticsStatRow({super.key, required this.stats}); + + /// Id, label and value. + final List<(String, String, String)> stats; + + @override + Widget build(BuildContext context) { + final theme = ShadTheme.of(context); + return Wrap( + spacing: 28, + runSpacing: 8, + children: [ + for (final (id, label, value) in stats) + Column( + key: ValueKey('analytics.stat.$id'), + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + value, + style: theme.textTheme.h4.copyWith( + fontFeatures: const [FontFeature.tabularFigures()], + ), + ), + Text(label, style: theme.textTheme.muted), + ], + ), + ], + ); + } +} + +/// The kinds of items in the content charts, with their colors (the kind +/// colors of the drive icons; files are Drive's). +List<(String, String, Color)> analyticsKinds( + BuildContext context, + ShadColorScheme c, +) { + final la = WonkyAppLocalizations.of(context); + final b = ShadTheme.of(context).brightness; + return [ + ('document', la.settingsStorageDocuments, AnalyticsColors.write), + ('spreadsheet', la.settingsStorageSpreadsheets, AnalyticsColors.sheets), + ('presentation', la.settingsStoragePresentations, AnalyticsColors.slides), + ('file', la.settingsStorageFiles, AnalyticsColors.drive(b)), + ]; +} + +/// Items now by kind (count and bytes) and total storage, as a stacked bar +/// with legend. +class AnalyticsContentNow extends StatelessWidget { + const AnalyticsContentNow({super.key, required this.overview}); + + final AnalyticsOverview overview; + + @override + Widget build(BuildContext context) { + final l = driveL10n(context); + final f = AnalyticsFormat(context); + final theme = ShadTheme.of(context); + final c = theme.colorScheme; + final totals = {for (final t in overview.itemTotals) t.key: t}; + final kinds = analyticsKinds(context, c); + final all = kinds.fold(0, (s, k) => s + (totals[k.$1]?.count ?? 0)); + final segments = [ + for (final (id, label, color) in kinds) + WonkyStackedBarSegment( + id: id, + label: label, + value: (totals[id]?.count ?? 0).toDouble(), + valueLabel: f.count(totals[id]?.count ?? 0), + color: color, + ), + ]; + return Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Text( + l.analyticsItemsTotal( + f.count(all), + storageBytes(overview.storageBytes), + ), + style: theme.textTheme.muted, + ), + const SizedBox(height: 10), + WonkyStackedBar( + key: const ValueKey('analytics.content.bar'), + keyPrefix: 'analytics.content.legend', + total: math.max(1, all).toDouble(), + segments: segments, + semanticLabel: [ + l.analyticsContentNowTitle, + for (final s in segments) s.legendText, + ].join(', '), + ), + ], + ); + } +} + +/// Accounts by sign-in method as a stacked bar with legend. +class AnalyticsSignInMethods extends StatelessWidget { + const AnalyticsSignInMethods({super.key, required this.overview}); + + final AnalyticsOverview overview; + + @override + Widget build(BuildContext context) { + final l = driveL10n(context); + final f = AnalyticsFormat(context); + final theme = ShadTheme.of(context); + final c = theme.colorScheme; + final methods = {for (final m in overview.signInMethods) m.key: m.count}; + final segments = [ + WonkyStackedBarSegment( + id: 'email', + label: l.analyticsSignInEmail, + value: (methods['email'] ?? 0).toDouble(), + valueLabel: f.count(methods['email'] ?? 0), + color: AnalyticsColors.ink(c), + ), + WonkyStackedBarSegment( + id: 'google', + label: l.analyticsSignInGoogle, + value: (methods['google'] ?? 0).toDouble(), + valueLabel: f.count(methods['google'] ?? 0), + color: AnalyticsColors.accent(theme.brightness), + ), + ]; + final total = segments.fold(0, (s, x) => s + x.value); + return WonkyStackedBar( + key: const ValueKey('analytics.signIn.bar'), + keyPrefix: 'analytics.signIn.legend', + total: math.max(1, total), + segments: segments, + semanticLabel: [ + l.analyticsSignInTitle, + for (final s in segments) s.legendText, + ].join(', '), + ); + } +} + +/// The bar chart of one daily measure, bucketed by [AnalyticsController]'s +/// rule (daily up to 90 days, weekly beyond), with its table view data. +({ + List starts, + int size, + List series, + String Function(int) title, + List labels, +}) +bucketed( + AnalyticsOverview o, + AnalyticsFormat f, + List<(String, String, Color, num Function(AnalyticsDay))> measures, +) { + final days = [for (final d in o.series) d.day]; + final size = bucketSizeOf(o.days); + final starts = bucketStarts(days, size); + String title(int i) { + if (size == 1) return f.dayTitle(starts[i]); + final end = i + 1 < starts.length + ? starts[i + 1].subtract(const Duration(days: 1)) + : days.last; + return f.range(starts[i], end); + } + + return ( + starts: starts, + size: size, + series: [ + for (final (id, label, color, pick) in measures) + AnalyticsSeries( + id: id, + label: label, + color: color, + values: bucketSums([for (final d in o.series) pick(d)], size), + ), + ], + title: title, + labels: [for (var i = 0; i < starts.length; i++) title(i)], + ); +} diff --git a/wonky_drive/lib/l10n/drive_en.arb b/wonky_drive/lib/l10n/drive_en.arb index 2e1e5394..24057d9c 100644 --- a/wonky_drive/lib/l10n/drive_en.arb +++ b/wonky_drive/lib/l10n/drive_en.arb @@ -1195,5 +1195,418 @@ "type": "String" } } + }, + "cmdAnalyticsShow": "Show analytics", + "@cmdAnalyticsShow": { + "description": "Command: opens the usage analytics page (admins, specs/19)." + }, + "categoryAnalytics": "Analytics", + "@categoryAnalytics": { + "description": "Command palette category of the analytics commands." + }, + "analyticsTitle": "Analytics", + "@analyticsTitle": { + "description": "Title of the usage analytics page (specs/19 §3)." + }, + "analyticsSubtitle": "Usage of Wonky Work by UTC day.", + "@analyticsSubtitle": { + "description": "Note under the analytics title while it loads." + }, + "analyticsUpdated": "Updated {time}", + "@analyticsUpdated": { + "description": "When the shown numbers were computed.", + "placeholders": { + "time": { + "type": "String" + } + } + }, + "analyticsTrackingSince": "Activity recorded since {date}", + "@analyticsTrackingSince": { + "description": "Shown when activity tracking started inside the period (earlier days have no activity data).", + "placeholders": { + "date": { + "type": "String" + } + } + }, + "analyticsNoActivityYet": "No activity recorded yet", + "@analyticsNoActivityYet": { + "description": "Shown before any activity was recorded." + }, + "analyticsPeriodDays": "{days} days", + "@analyticsPeriodDays": { + "description": "A period tab of the analytics page.", + "placeholders": { + "days": { + "type": "int" + } + } + }, + "analyticsIncludeAdmins": "Include admins", + "@analyticsIncludeAdmins": { + "description": "Switch: count admins (Wonky Work team) in every number." + }, + "analyticsRefresh": "Refresh", + "@analyticsRefresh": { + "description": "Reloads the analytics." + }, + "analyticsForbiddenTitle": "Analytics are for admins", + "@analyticsForbiddenTitle": { + "description": "Page state when a non-admin opens /analytics." + }, + "analyticsForbiddenBody": "Ask a Wonky Work admin if you need these numbers.", + "@analyticsForbiddenBody": { + "description": "Body of the admins-only state." + }, + "analyticsErrorTitle": "The analytics could not be loaded", + "@analyticsErrorTitle": { + "description": "Error state of the analytics page." + }, + "analyticsShowTable": "Show as table", + "@analyticsShowTable": { + "description": "Toggles a chart card to its table view." + }, + "analyticsShowChart": "Show as chart", + "@analyticsShowChart": { + "description": "Toggles a chart card back to its chart." + }, + "analyticsChartLabel": "Chart of {series} from {from} to {to}", + "@analyticsChartLabel": { + "description": "Screen reader label of a chart.", + "placeholders": { + "series": { + "type": "String" + }, + "from": { + "type": "String" + }, + "to": { + "type": "String" + } + } + }, + "analyticsColDay": "Day", + "@analyticsColDay": { + "description": "Table view: the day column." + }, + "analyticsColWeek": "Week", + "@analyticsColWeek": { + "description": "Table view: the week column (weekly bars)." + }, + "analyticsTotal": "Total", + "@analyticsTotal": { + "description": "Tooltip row: the total of stacked bars." + }, + "analyticsKpiAccounts": "Accounts", + "@analyticsKpiAccounts": { + "description": "Headline number: all accounts." + }, + "analyticsKpiNew": "+{count} in {days} days", + "@analyticsKpiNew": { + "description": "Under the accounts number: accounts created in the period.", + "placeholders": { + "count": { + "type": "String" + }, + "days": { + "type": "int" + } + } + }, + "analyticsKpiToday": "Active today", + "@analyticsKpiToday": { + "description": "Headline number: distinct active users today (UTC)." + }, + "analyticsKpiEditorsToday": "{count} created or edited", + "@analyticsKpiEditorsToday": { + "description": "Under active today: how many of them created or edited something.", + "placeholders": { + "count": { + "type": "String" + } + } + }, + "analyticsKpiWeekly": "Weekly active", + "@analyticsKpiWeekly": { + "description": "Headline number: distinct active users in the last 7 days." + }, + "analyticsKpiWeeklyNote": "Last 7 days", + "@analyticsKpiWeeklyNote": { + "description": "Note under the weekly number." + }, + "analyticsKpiMonthly": "Monthly active", + "@analyticsKpiMonthly": { + "description": "Headline number: distinct active users in the last 30 days (MAU)." + }, + "analyticsKpiMonthlyNote": "Last 30 days", + "@analyticsKpiMonthlyNote": { + "description": "Note under the monthly number." + }, + "analyticsKpiStickiness": "Stickiness", + "@analyticsKpiStickiness": { + "description": "Headline number: average daily active users over monthly active users." + }, + "analyticsKpiStickinessNote": "Daily ÷ monthly active", + "@analyticsKpiStickinessNote": { + "description": "Note under stickiness." + }, + "analyticsKpiCreated": "Items created", + "@analyticsKpiCreated": { + "description": "Headline number: documents, spreadsheets, presentations and files created in the period." + }, + "analyticsKpiInPeriod": "In {days} days", + "@analyticsKpiInPeriod": { + "description": "Note: the number covers the period.", + "placeholders": { + "days": { + "type": "int" + } + } + }, + "analyticsActiveTitle": "Active users", + "@analyticsActiveTitle": { + "description": "Card title." + }, + "analyticsActiveSubtitle": "People who used any app or MCP", + "@analyticsActiveSubtitle": { + "description": "Card subtitle of active users." + }, + "analyticsViewDaily": "Daily", + "@analyticsViewDaily": { + "description": "Tab: daily active users." + }, + "analyticsViewWeekly": "Weekly", + "@analyticsViewWeekly": { + "description": "Tab: users active in the 7 days ending each day." + }, + "analyticsViewMonthly": "Monthly", + "@analyticsViewMonthly": { + "description": "Tab: users active in the 30 days ending each day." + }, + "analyticsSeriesActive": "Active", + "@analyticsSeriesActive": { + "description": "Series: daily active users." + }, + "analyticsSeriesEditors": "Created or edited", + "@analyticsSeriesEditors": { + "description": "Series: users who created or edited something that day." + }, + "analyticsSeriesWeekly": "Weekly active", + "@analyticsSeriesWeekly": { + "description": "Series: 7-day active users." + }, + "analyticsSeriesMonthly": "Monthly active", + "@analyticsSeriesMonthly": { + "description": "Series: 30-day active users." + }, + "analyticsAppsTitle": "Active users by app", + "@analyticsAppsTitle": { + "description": "Card title." + }, + "analyticsAppsSubtitle": "A person using two apps counts in both", + "@analyticsAppsSubtitle": { + "description": "Card subtitle." + }, + "analyticsSeriesMcp": "MCP clients", + "@analyticsSeriesMcp": { + "description": "Series: users active through an MCP client." + }, + "analyticsSignupsTitle": "Sign-ups", + "@analyticsSignupsTitle": { + "description": "Card title." + }, + "analyticsSignupsSubtitle": "{count} new · {total} accounts", + "@analyticsSignupsSubtitle": { + "description": "Card subtitle: new accounts in the period and all accounts.", + "placeholders": { + "count": { + "type": "String" + }, + "total": { + "type": "String" + } + } + }, + "analyticsSeriesSignups": "Sign-ups", + "@analyticsSeriesSignups": { + "description": "Series: accounts created." + }, + "analyticsContentNowTitle": "Content now", + "@analyticsContentNowTitle": { + "description": "Card title: items that exist now by kind." + }, + "analyticsItemsTotal": "{count} items · {size} stored", + "@analyticsItemsTotal": { + "description": "Line in the content card: items now and the storage they use.", + "placeholders": { + "count": { + "type": "String" + }, + "size": { + "type": "String" + } + } + }, + "analyticsSignInTitle": "Sign-in methods", + "@analyticsSignInTitle": { + "description": "Heading of the sign-in methods bar." + }, + "analyticsSignInEmail": "Email", + "@analyticsSignInEmail": { + "description": "Sign-in method: email and password." + }, + "analyticsSignInGoogle": "Google", + "@analyticsSignInGoogle": { + "description": "Sign-in method: Google." + }, + "analyticsContentTitle": "Content created", + "@analyticsContentTitle": { + "description": "Card title." + }, + "analyticsContentSubtitle": "By people, the assistant and MCP; welcome content left out", + "@analyticsContentSubtitle": { + "description": "Card subtitle." + }, + "analyticsCollabTitle": "Collaboration", + "@analyticsCollabTitle": { + "description": "Card title." + }, + "analyticsStatShared": "Items shared now", + "@analyticsStatShared": { + "description": "Stat: items shared with at least one other person." + }, + "analyticsStatCoEdited": "Co-edited in {days} days", + "@analyticsStatCoEdited": { + "description": "Stat: items edited by two or more people in the period.", + "placeholders": { + "days": { + "type": "int" + } + } + }, + "analyticsStatCommenters": "Commenters in {days} days", + "@analyticsStatCommenters": { + "description": "Stat: people who commented in the period.", + "placeholders": { + "days": { + "type": "int" + } + } + }, + "analyticsSeriesComments": "Comments", + "@analyticsSeriesComments": { + "description": "Series: comments and replies." + }, + "analyticsSeriesShares": "Shares", + "@analyticsSeriesShares": { + "description": "Series: items shared with people." + }, + "analyticsAiTitle": "AI assistant", + "@analyticsAiTitle": { + "description": "Card title." + }, + "analyticsAiSubtitle": "{requests} requests · {tokens} tokens · kept {days} days", + "@analyticsAiSubtitle": { + "description": "Card subtitle: AI usage in the period and how long it is kept.", + "placeholders": { + "requests": { + "type": "String" + }, + "tokens": { + "type": "String" + }, + "days": { + "type": "int" + } + } + }, + "analyticsSeriesAiRequests": "Requests", + "@analyticsSeriesAiRequests": { + "description": "Series: AI model requests." + }, + "analyticsAiByFeature": "By feature", + "@analyticsAiByFeature": { + "description": "Heading of AI usage by feature." + }, + "analyticsAiByModel": "By model", + "@analyticsAiByModel": { + "description": "Heading of AI usage by model." + }, + "analyticsAiRow": "{requests} · {tokens} tokens", + "@analyticsAiRow": { + "description": "Value of an AI usage row.", + "placeholders": { + "requests": { + "type": "String" + }, + "tokens": { + "type": "String" + } + } + }, + "analyticsNoAiUse": "No AI use in this period", + "@analyticsNoAiUse": { + "description": "Empty AI usage list." + }, + "analyticsMcpTitle": "MCP tool calls", + "@analyticsMcpTitle": { + "description": "Card title." + }, + "analyticsMcpSubtitle": "{count} calls by people's access tokens (admins included)", + "@analyticsMcpSubtitle": { + "description": "Card subtitle.", + "placeholders": { + "count": { + "type": "String" + } + } + }, + "analyticsSeriesMcpCalls": "Tool calls", + "@analyticsSeriesMcpCalls": { + "description": "Series: MCP tool calls." + }, + "analyticsRetentionTitle": "Retention", + "@analyticsRetentionTitle": { + "description": "Card title: weekly sign-up cohorts." + }, + "analyticsRetentionSubtitle": "Share of each week's sign-ups active in the weeks after", + "@analyticsRetentionSubtitle": { + "description": "Card subtitle." + }, + "analyticsCohortWeek": "Signed up", + "@analyticsCohortWeek": { + "description": "Cohort table column: the sign-up week." + }, + "analyticsCohortSize": "Accounts", + "@analyticsCohortSize": { + "description": "Cohort table column: accounts in the cohort." + }, + "analyticsCohortWeekN": "W{week}", + "@analyticsCohortWeekN": { + "description": "Cohort table column: week N after sign-up.", + "placeholders": { + "week": { + "type": "int" + } + } + }, + "analyticsCohortCell": "Week of {cohort}: {active} active in week {week} ({share})", + "@analyticsCohortCell": { + "description": "Tooltip of a cohort cell.", + "placeholders": { + "cohort": { + "type": "String" + }, + "week": { + "type": "int" + }, + "active": { + "type": "int" + }, + "share": { + "type": "String" + } + } } } diff --git a/wonky_drive/lib/l10n/drive_en_XA.arb b/wonky_drive/lib/l10n/drive_en_XA.arb index 4d75e6b0..720e1f97 100644 --- a/wonky_drive/lib/l10n/drive_en_XA.arb +++ b/wonky_drive/lib/l10n/drive_en_XA.arb @@ -222,5 +222,80 @@ "cmdViewToggleFoldersOnTop": "[Ƒöļðéŕš öñ ţöþ one t]", "categoryView": "[Ṽîéŵ on]", "uploadStatusConverted": "[{kind, select, document{Çöñṽéŕţéð ţö å ðöçûɱéñţ} spreadsheet{Çöñṽéŕţéð ţö å šþŕéåðšĥééţ} other{Çöñṽéŕţéð}} one two three four]", - "uploadConvertFailed": "[{name} çöûļðñ'ţ ƀé çöñṽéŕţéð. Îţ ŵåš ķéþţ åš å ƒîļé. one two three]" + "uploadConvertFailed": "[{name} çöûļðñ'ţ ƀé çöñṽéŕţéð. Îţ ŵåš ķéþţ åš å ƒîļé. one two three]", + "cmdAnalyticsShow": "[Šĥöŵ åñåļýţîçš one t]", + "categoryAnalytics": "[Åñåļýţîçš one]", + "analyticsTitle": "[Åñåļýţîçš one]", + "analyticsSubtitle": "[Ûšåĝé öƒ Ŵöñķý Ŵöŕķ ƀý ÛŢÇ ðåý. one two t]", + "analyticsUpdated": "[Ûþðåţéð {time} one]", + "analyticsTrackingSince": "[Åçţîṽîţý ŕéçöŕðéð šîñçé {date} one two]", + "analyticsNoActivityYet": "[Ñö åçţîṽîţý ŕéçöŕðéð ýéţ one two]", + "analyticsPeriodDays": "[{days} ðåýš on]", + "analyticsIncludeAdmins": "[Îñçļûðé åðɱîñš one t]", + "analyticsRefresh": "[Ŕéƒŕéšĥ one]", + "analyticsForbiddenTitle": "[Åñåļýţîçš åŕé ƒöŕ åðɱîñš one two]", + "analyticsForbiddenBody": "[Åšķ å Ŵöñķý Ŵöŕķ åðɱîñ îƒ ýöû ñééð ţĥéšé ñûɱƀéŕš. one two three]", + "analyticsErrorTitle": "[Ţĥé åñåļýţîçš çöûļð ñöţ ƀé ļöåðéð one two th]", + "analyticsShowTable": "[Šĥöŵ åš ţåƀļé one]", + "analyticsShowChart": "[Šĥöŵ åš çĥåŕţ one]", + "analyticsChartLabel": "[Çĥåŕţ öƒ {series} ƒŕöɱ {from} ţö {to} one t]", + "analyticsColDay": "[Ðåý on]", + "analyticsColWeek": "[Ŵééķ on]", + "analyticsTotal": "[Ţöţåļ on]", + "analyticsKpiAccounts": "[Åççöûñţš one]", + "analyticsKpiNew": "[+{count} îñ {days} ðåýš one]", + "analyticsKpiToday": "[Åçţîṽé ţöðåý one]", + "analyticsKpiEditorsToday": "[{count} çŕéåţéð öŕ éðîţéð one tw]", + "analyticsKpiWeekly": "[Ŵééķļý åçţîṽé one t]", + "analyticsKpiWeeklyNote": "[Ļåšţ 7 ðåýš one]", + "analyticsKpiMonthly": "[Ṁöñţĥļý åçţîṽé one t]", + "analyticsKpiMonthlyNote": "[Ļåšţ 30 ðåýš one]", + "analyticsKpiStickiness": "[Šţîçķîñéšš one]", + "analyticsKpiStickinessNote": "[Ðåîļý ÷ ɱöñţĥļý åçţîṽé one two]", + "analyticsKpiCreated": "[Îţéɱš çŕéåţéð one t]", + "analyticsKpiInPeriod": "[Îñ {days} ðåýš one]", + "analyticsActiveTitle": "[Åçţîṽé ûšéŕš one]", + "analyticsActiveSubtitle": "[Þéöþļé ŵĥö ûšéð åñý åþþ öŕ ṀÇÞ one two t]", + "analyticsViewDaily": "[Ðåîļý on]", + "analyticsViewWeekly": "[Ŵééķļý one]", + "analyticsViewMonthly": "[Ṁöñţĥļý one]", + "analyticsSeriesActive": "[Åçţîṽé one]", + "analyticsSeriesEditors": "[Çŕéåţéð öŕ éðîţéð one tw]", + "analyticsSeriesWeekly": "[Ŵééķļý åçţîṽé one t]", + "analyticsSeriesMonthly": "[Ṁöñţĥļý åçţîṽé one t]", + "analyticsAppsTitle": "[Åçţîṽé ûšéŕš ƀý åþþ one tw]", + "analyticsAppsSubtitle": "[Å þéŕšöñ ûšîñĝ ţŵö åþþš çöûñţš îñ ƀöţĥ one two thr]", + "analyticsSeriesMcp": "[ṀÇÞ çļîéñţš one]", + "analyticsSignupsTitle": "[Šîĝñ-ûþš one]", + "analyticsSignupsSubtitle": "[{count} ñéŵ · {total} åççöûñţš one t]", + "analyticsSeriesSignups": "[Šîĝñ-ûþš one]", + "analyticsContentNowTitle": "[Çöñţéñţ ñöŵ one]", + "analyticsItemsTotal": "[{count} îţéɱš · {size} šţöŕéð one t]", + "analyticsSignInTitle": "[Šîĝñ-îñ ɱéţĥöðš one t]", + "analyticsSignInEmail": "[Éɱåîļ on]", + "analyticsSignInGoogle": "[Ĝööĝļé one]", + "analyticsContentTitle": "[Çöñţéñţ çŕéåţéð one t]", + "analyticsContentSubtitle": "[Ɓý þéöþļé, ţĥé åššîšţåñţ åñð ṀÇÞ; ŵéļçöɱé çöñţéñţ ļéƒţ öûţ one two three four]", + "analyticsCollabTitle": "[Çöļļåƀöŕåţîöñ one t]", + "analyticsStatShared": "[Îţéɱš šĥåŕéð ñöŵ one t]", + "analyticsStatCoEdited": "[Çö-éðîţéð îñ {days} ðåýš one tw]", + "analyticsStatCommenters": "[Çöɱɱéñţéŕš îñ {days} ðåýš one tw]", + "analyticsSeriesComments": "[Çöɱɱéñţš one]", + "analyticsSeriesShares": "[Šĥåŕéš one]", + "analyticsAiTitle": "[ÅÎ åššîšţåñţ one]", + "analyticsAiSubtitle": "[{requests} ŕéǫûéšţš · {tokens} ţöķéñš · ķéþţ {days} ðåýš one two t]", + "analyticsSeriesAiRequests": "[Ŕéǫûéšţš one]", + "analyticsAiByFeature": "[Ɓý ƒéåţûŕé one]", + "analyticsAiByModel": "[Ɓý ɱöðéļ one]", + "analyticsAiRow": "[{requests} · {tokens} ţöķéñš one]", + "analyticsNoAiUse": "[Ñö ÅÎ ûšé îñ ţĥîš þéŕîöð one two]", + "analyticsMcpTitle": "[ṀÇÞ ţööļ çåļļš one t]", + "analyticsMcpSubtitle": "[{count} çåļļš ƀý þéöþļé'š åççéšš ţöķéñš (åðɱîñš îñçļûðéð) one two three fo]", + "analyticsSeriesMcpCalls": "[Ţööļ çåļļš one]", + "analyticsRetentionTitle": "[Ŕéţéñţîöñ one]", + "analyticsRetentionSubtitle": "[Šĥåŕé öƒ éåçĥ ŵééķ'š šîĝñ-ûþš åçţîṽé îñ ţĥé ŵééķš åƒţéŕ one two three fou]", + "analyticsCohortWeek": "[Šîĝñéð ûþ one]", + "analyticsCohortSize": "[Åççöûñţš one]", + "analyticsCohortWeekN": "[Ŵ{week} o]", + "analyticsCohortCell": "[Ŵééķ öƒ {cohort}: {active} åçţîṽé îñ ŵééķ {week} ({share}) one two]" } diff --git a/wonky_drive/lib/l10n/gen/drive_localizations.dart b/wonky_drive/lib/l10n/gen/drive_localizations.dart index 65d032b2..788f4e78 100644 --- a/wonky_drive/lib/l10n/gen/drive_localizations.dart +++ b/wonky_drive/lib/l10n/gen/drive_localizations.dart @@ -1428,6 +1428,456 @@ abstract class DriveLocalizations { /// In en, this message translates to: /// **'{name} couldn\'t be converted. It was kept as a file.'** String uploadConvertFailed(String name); + + /// Command: opens the usage analytics page (admins, specs/19). + /// + /// In en, this message translates to: + /// **'Show analytics'** + String get cmdAnalyticsShow; + + /// Command palette category of the analytics commands. + /// + /// In en, this message translates to: + /// **'Analytics'** + String get categoryAnalytics; + + /// Title of the usage analytics page (specs/19 §3). + /// + /// In en, this message translates to: + /// **'Analytics'** + String get analyticsTitle; + + /// Note under the analytics title while it loads. + /// + /// In en, this message translates to: + /// **'Usage of Wonky Work by UTC day.'** + String get analyticsSubtitle; + + /// When the shown numbers were computed. + /// + /// In en, this message translates to: + /// **'Updated {time}'** + String analyticsUpdated(String time); + + /// Shown when activity tracking started inside the period (earlier days have no activity data). + /// + /// In en, this message translates to: + /// **'Activity recorded since {date}'** + String analyticsTrackingSince(String date); + + /// Shown before any activity was recorded. + /// + /// In en, this message translates to: + /// **'No activity recorded yet'** + String get analyticsNoActivityYet; + + /// A period tab of the analytics page. + /// + /// In en, this message translates to: + /// **'{days} days'** + String analyticsPeriodDays(int days); + + /// Switch: count admins (Wonky Work team) in every number. + /// + /// In en, this message translates to: + /// **'Include admins'** + String get analyticsIncludeAdmins; + + /// Reloads the analytics. + /// + /// In en, this message translates to: + /// **'Refresh'** + String get analyticsRefresh; + + /// Page state when a non-admin opens /analytics. + /// + /// In en, this message translates to: + /// **'Analytics are for admins'** + String get analyticsForbiddenTitle; + + /// Body of the admins-only state. + /// + /// In en, this message translates to: + /// **'Ask a Wonky Work admin if you need these numbers.'** + String get analyticsForbiddenBody; + + /// Error state of the analytics page. + /// + /// In en, this message translates to: + /// **'The analytics could not be loaded'** + String get analyticsErrorTitle; + + /// Toggles a chart card to its table view. + /// + /// In en, this message translates to: + /// **'Show as table'** + String get analyticsShowTable; + + /// Toggles a chart card back to its chart. + /// + /// In en, this message translates to: + /// **'Show as chart'** + String get analyticsShowChart; + + /// Screen reader label of a chart. + /// + /// In en, this message translates to: + /// **'Chart of {series} from {from} to {to}'** + String analyticsChartLabel(String series, String from, String to); + + /// Table view: the day column. + /// + /// In en, this message translates to: + /// **'Day'** + String get analyticsColDay; + + /// Table view: the week column (weekly bars). + /// + /// In en, this message translates to: + /// **'Week'** + String get analyticsColWeek; + + /// Tooltip row: the total of stacked bars. + /// + /// In en, this message translates to: + /// **'Total'** + String get analyticsTotal; + + /// Headline number: all accounts. + /// + /// In en, this message translates to: + /// **'Accounts'** + String get analyticsKpiAccounts; + + /// Under the accounts number: accounts created in the period. + /// + /// In en, this message translates to: + /// **'+{count} in {days} days'** + String analyticsKpiNew(String count, int days); + + /// Headline number: distinct active users today (UTC). + /// + /// In en, this message translates to: + /// **'Active today'** + String get analyticsKpiToday; + + /// Under active today: how many of them created or edited something. + /// + /// In en, this message translates to: + /// **'{count} created or edited'** + String analyticsKpiEditorsToday(String count); + + /// Headline number: distinct active users in the last 7 days. + /// + /// In en, this message translates to: + /// **'Weekly active'** + String get analyticsKpiWeekly; + + /// Note under the weekly number. + /// + /// In en, this message translates to: + /// **'Last 7 days'** + String get analyticsKpiWeeklyNote; + + /// Headline number: distinct active users in the last 30 days (MAU). + /// + /// In en, this message translates to: + /// **'Monthly active'** + String get analyticsKpiMonthly; + + /// Note under the monthly number. + /// + /// In en, this message translates to: + /// **'Last 30 days'** + String get analyticsKpiMonthlyNote; + + /// Headline number: average daily active users over monthly active users. + /// + /// In en, this message translates to: + /// **'Stickiness'** + String get analyticsKpiStickiness; + + /// Note under stickiness. + /// + /// In en, this message translates to: + /// **'Daily ÷ monthly active'** + String get analyticsKpiStickinessNote; + + /// Headline number: documents, spreadsheets, presentations and files created in the period. + /// + /// In en, this message translates to: + /// **'Items created'** + String get analyticsKpiCreated; + + /// Note: the number covers the period. + /// + /// In en, this message translates to: + /// **'In {days} days'** + String analyticsKpiInPeriod(int days); + + /// Card title. + /// + /// In en, this message translates to: + /// **'Active users'** + String get analyticsActiveTitle; + + /// Card subtitle of active users. + /// + /// In en, this message translates to: + /// **'People who used any app or MCP'** + String get analyticsActiveSubtitle; + + /// Tab: daily active users. + /// + /// In en, this message translates to: + /// **'Daily'** + String get analyticsViewDaily; + + /// Tab: users active in the 7 days ending each day. + /// + /// In en, this message translates to: + /// **'Weekly'** + String get analyticsViewWeekly; + + /// Tab: users active in the 30 days ending each day. + /// + /// In en, this message translates to: + /// **'Monthly'** + String get analyticsViewMonthly; + + /// Series: daily active users. + /// + /// In en, this message translates to: + /// **'Active'** + String get analyticsSeriesActive; + + /// Series: users who created or edited something that day. + /// + /// In en, this message translates to: + /// **'Created or edited'** + String get analyticsSeriesEditors; + + /// Series: 7-day active users. + /// + /// In en, this message translates to: + /// **'Weekly active'** + String get analyticsSeriesWeekly; + + /// Series: 30-day active users. + /// + /// In en, this message translates to: + /// **'Monthly active'** + String get analyticsSeriesMonthly; + + /// Card title. + /// + /// In en, this message translates to: + /// **'Active users by app'** + String get analyticsAppsTitle; + + /// Card subtitle. + /// + /// In en, this message translates to: + /// **'A person using two apps counts in both'** + String get analyticsAppsSubtitle; + + /// Series: users active through an MCP client. + /// + /// In en, this message translates to: + /// **'MCP clients'** + String get analyticsSeriesMcp; + + /// Card title. + /// + /// In en, this message translates to: + /// **'Sign-ups'** + String get analyticsSignupsTitle; + + /// Card subtitle: new accounts in the period and all accounts. + /// + /// In en, this message translates to: + /// **'{count} new · {total} accounts'** + String analyticsSignupsSubtitle(String count, String total); + + /// Series: accounts created. + /// + /// In en, this message translates to: + /// **'Sign-ups'** + String get analyticsSeriesSignups; + + /// Card title: items that exist now by kind. + /// + /// In en, this message translates to: + /// **'Content now'** + String get analyticsContentNowTitle; + + /// Line in the content card: items now and the storage they use. + /// + /// In en, this message translates to: + /// **'{count} items · {size} stored'** + String analyticsItemsTotal(String count, String size); + + /// Heading of the sign-in methods bar. + /// + /// In en, this message translates to: + /// **'Sign-in methods'** + String get analyticsSignInTitle; + + /// Sign-in method: email and password. + /// + /// In en, this message translates to: + /// **'Email'** + String get analyticsSignInEmail; + + /// Sign-in method: Google. + /// + /// In en, this message translates to: + /// **'Google'** + String get analyticsSignInGoogle; + + /// Card title. + /// + /// In en, this message translates to: + /// **'Content created'** + String get analyticsContentTitle; + + /// Card subtitle. + /// + /// In en, this message translates to: + /// **'By people, the assistant and MCP; welcome content left out'** + String get analyticsContentSubtitle; + + /// Card title. + /// + /// In en, this message translates to: + /// **'Collaboration'** + String get analyticsCollabTitle; + + /// Stat: items shared with at least one other person. + /// + /// In en, this message translates to: + /// **'Items shared now'** + String get analyticsStatShared; + + /// Stat: items edited by two or more people in the period. + /// + /// In en, this message translates to: + /// **'Co-edited in {days} days'** + String analyticsStatCoEdited(int days); + + /// Stat: people who commented in the period. + /// + /// In en, this message translates to: + /// **'Commenters in {days} days'** + String analyticsStatCommenters(int days); + + /// Series: comments and replies. + /// + /// In en, this message translates to: + /// **'Comments'** + String get analyticsSeriesComments; + + /// Series: items shared with people. + /// + /// In en, this message translates to: + /// **'Shares'** + String get analyticsSeriesShares; + + /// Card title. + /// + /// In en, this message translates to: + /// **'AI assistant'** + String get analyticsAiTitle; + + /// Card subtitle: AI usage in the period and how long it is kept. + /// + /// In en, this message translates to: + /// **'{requests} requests · {tokens} tokens · kept {days} days'** + String analyticsAiSubtitle(String requests, String tokens, int days); + + /// Series: AI model requests. + /// + /// In en, this message translates to: + /// **'Requests'** + String get analyticsSeriesAiRequests; + + /// Heading of AI usage by feature. + /// + /// In en, this message translates to: + /// **'By feature'** + String get analyticsAiByFeature; + + /// Heading of AI usage by model. + /// + /// In en, this message translates to: + /// **'By model'** + String get analyticsAiByModel; + + /// Value of an AI usage row. + /// + /// In en, this message translates to: + /// **'{requests} · {tokens} tokens'** + String analyticsAiRow(String requests, String tokens); + + /// Empty AI usage list. + /// + /// In en, this message translates to: + /// **'No AI use in this period'** + String get analyticsNoAiUse; + + /// Card title. + /// + /// In en, this message translates to: + /// **'MCP tool calls'** + String get analyticsMcpTitle; + + /// Card subtitle. + /// + /// In en, this message translates to: + /// **'{count} calls by people\'s access tokens (admins included)'** + String analyticsMcpSubtitle(String count); + + /// Series: MCP tool calls. + /// + /// In en, this message translates to: + /// **'Tool calls'** + String get analyticsSeriesMcpCalls; + + /// Card title: weekly sign-up cohorts. + /// + /// In en, this message translates to: + /// **'Retention'** + String get analyticsRetentionTitle; + + /// Card subtitle. + /// + /// In en, this message translates to: + /// **'Share of each week\'s sign-ups active in the weeks after'** + String get analyticsRetentionSubtitle; + + /// Cohort table column: the sign-up week. + /// + /// In en, this message translates to: + /// **'Signed up'** + String get analyticsCohortWeek; + + /// Cohort table column: accounts in the cohort. + /// + /// In en, this message translates to: + /// **'Accounts'** + String get analyticsCohortSize; + + /// Cohort table column: week N after sign-up. + /// + /// In en, this message translates to: + /// **'W{week}'** + String analyticsCohortWeekN(int week); + + /// Tooltip of a cohort cell. + /// + /// In en, this message translates to: + /// **'Week of {cohort}: {active} active in week {week} ({share})'** + String analyticsCohortCell(String cohort, int week, int active, String share); } class _DriveLocalizationsDelegate diff --git a/wonky_drive/lib/l10n/gen/drive_localizations_en.dart b/wonky_drive/lib/l10n/gen/drive_localizations_en.dart index 78a473ec..285ac3f8 100644 --- a/wonky_drive/lib/l10n/gen/drive_localizations_en.dart +++ b/wonky_drive/lib/l10n/gen/drive_localizations_en.dart @@ -894,6 +894,271 @@ class DriveLocalizationsEn extends DriveLocalizations { String uploadConvertFailed(String name) { return '$name couldn\'t be converted. It was kept as a file.'; } + + @override + String get cmdAnalyticsShow => 'Show analytics'; + + @override + String get categoryAnalytics => 'Analytics'; + + @override + String get analyticsTitle => 'Analytics'; + + @override + String get analyticsSubtitle => 'Usage of Wonky Work by UTC day.'; + + @override + String analyticsUpdated(String time) { + return 'Updated $time'; + } + + @override + String analyticsTrackingSince(String date) { + return 'Activity recorded since $date'; + } + + @override + String get analyticsNoActivityYet => 'No activity recorded yet'; + + @override + String analyticsPeriodDays(int days) { + return '$days days'; + } + + @override + String get analyticsIncludeAdmins => 'Include admins'; + + @override + String get analyticsRefresh => 'Refresh'; + + @override + String get analyticsForbiddenTitle => 'Analytics are for admins'; + + @override + String get analyticsForbiddenBody => + 'Ask a Wonky Work admin if you need these numbers.'; + + @override + String get analyticsErrorTitle => 'The analytics could not be loaded'; + + @override + String get analyticsShowTable => 'Show as table'; + + @override + String get analyticsShowChart => 'Show as chart'; + + @override + String analyticsChartLabel(String series, String from, String to) { + return 'Chart of $series from $from to $to'; + } + + @override + String get analyticsColDay => 'Day'; + + @override + String get analyticsColWeek => 'Week'; + + @override + String get analyticsTotal => 'Total'; + + @override + String get analyticsKpiAccounts => 'Accounts'; + + @override + String analyticsKpiNew(String count, int days) { + return '+$count in $days days'; + } + + @override + String get analyticsKpiToday => 'Active today'; + + @override + String analyticsKpiEditorsToday(String count) { + return '$count created or edited'; + } + + @override + String get analyticsKpiWeekly => 'Weekly active'; + + @override + String get analyticsKpiWeeklyNote => 'Last 7 days'; + + @override + String get analyticsKpiMonthly => 'Monthly active'; + + @override + String get analyticsKpiMonthlyNote => 'Last 30 days'; + + @override + String get analyticsKpiStickiness => 'Stickiness'; + + @override + String get analyticsKpiStickinessNote => 'Daily ÷ monthly active'; + + @override + String get analyticsKpiCreated => 'Items created'; + + @override + String analyticsKpiInPeriod(int days) { + return 'In $days days'; + } + + @override + String get analyticsActiveTitle => 'Active users'; + + @override + String get analyticsActiveSubtitle => 'People who used any app or MCP'; + + @override + String get analyticsViewDaily => 'Daily'; + + @override + String get analyticsViewWeekly => 'Weekly'; + + @override + String get analyticsViewMonthly => 'Monthly'; + + @override + String get analyticsSeriesActive => 'Active'; + + @override + String get analyticsSeriesEditors => 'Created or edited'; + + @override + String get analyticsSeriesWeekly => 'Weekly active'; + + @override + String get analyticsSeriesMonthly => 'Monthly active'; + + @override + String get analyticsAppsTitle => 'Active users by app'; + + @override + String get analyticsAppsSubtitle => 'A person using two apps counts in both'; + + @override + String get analyticsSeriesMcp => 'MCP clients'; + + @override + String get analyticsSignupsTitle => 'Sign-ups'; + + @override + String analyticsSignupsSubtitle(String count, String total) { + return '$count new · $total accounts'; + } + + @override + String get analyticsSeriesSignups => 'Sign-ups'; + + @override + String get analyticsContentNowTitle => 'Content now'; + + @override + String analyticsItemsTotal(String count, String size) { + return '$count items · $size stored'; + } + + @override + String get analyticsSignInTitle => 'Sign-in methods'; + + @override + String get analyticsSignInEmail => 'Email'; + + @override + String get analyticsSignInGoogle => 'Google'; + + @override + String get analyticsContentTitle => 'Content created'; + + @override + String get analyticsContentSubtitle => + 'By people, the assistant and MCP; welcome content left out'; + + @override + String get analyticsCollabTitle => 'Collaboration'; + + @override + String get analyticsStatShared => 'Items shared now'; + + @override + String analyticsStatCoEdited(int days) { + return 'Co-edited in $days days'; + } + + @override + String analyticsStatCommenters(int days) { + return 'Commenters in $days days'; + } + + @override + String get analyticsSeriesComments => 'Comments'; + + @override + String get analyticsSeriesShares => 'Shares'; + + @override + String get analyticsAiTitle => 'AI assistant'; + + @override + String analyticsAiSubtitle(String requests, String tokens, int days) { + return '$requests requests · $tokens tokens · kept $days days'; + } + + @override + String get analyticsSeriesAiRequests => 'Requests'; + + @override + String get analyticsAiByFeature => 'By feature'; + + @override + String get analyticsAiByModel => 'By model'; + + @override + String analyticsAiRow(String requests, String tokens) { + return '$requests · $tokens tokens'; + } + + @override + String get analyticsNoAiUse => 'No AI use in this period'; + + @override + String get analyticsMcpTitle => 'MCP tool calls'; + + @override + String analyticsMcpSubtitle(String count) { + return '$count calls by people\'s access tokens (admins included)'; + } + + @override + String get analyticsSeriesMcpCalls => 'Tool calls'; + + @override + String get analyticsRetentionTitle => 'Retention'; + + @override + String get analyticsRetentionSubtitle => + 'Share of each week\'s sign-ups active in the weeks after'; + + @override + String get analyticsCohortWeek => 'Signed up'; + + @override + String get analyticsCohortSize => 'Accounts'; + + @override + String analyticsCohortWeekN(int week) { + return 'W$week'; + } + + @override + String analyticsCohortCell( + String cohort, + int week, + int active, + String share, + ) { + return 'Week of $cohort: $active active in week $week ($share)'; + } } /// The translations for English (`en_XA`). @@ -1795,4 +2060,272 @@ class DriveLocalizationsEnXa extends DriveLocalizationsEn { String uploadConvertFailed(String name) { return '[$name çöûļðñ\'ţ ƀé çöñṽéŕţéð. Îţ ŵåš ķéþţ åš å ƒîļé. one two three]'; } + + @override + String get cmdAnalyticsShow => '[Šĥöŵ åñåļýţîçš one t]'; + + @override + String get categoryAnalytics => '[Åñåļýţîçš one]'; + + @override + String get analyticsTitle => '[Åñåļýţîçš one]'; + + @override + String get analyticsSubtitle => '[Ûšåĝé öƒ Ŵöñķý Ŵöŕķ ƀý ÛŢÇ ðåý. one two t]'; + + @override + String analyticsUpdated(String time) { + return '[Ûþðåţéð $time one]'; + } + + @override + String analyticsTrackingSince(String date) { + return '[Åçţîṽîţý ŕéçöŕðéð šîñçé $date one two]'; + } + + @override + String get analyticsNoActivityYet => '[Ñö åçţîṽîţý ŕéçöŕðéð ýéţ one two]'; + + @override + String analyticsPeriodDays(int days) { + return '[$days ðåýš on]'; + } + + @override + String get analyticsIncludeAdmins => '[Îñçļûðé åðɱîñš one t]'; + + @override + String get analyticsRefresh => '[Ŕéƒŕéšĥ one]'; + + @override + String get analyticsForbiddenTitle => '[Åñåļýţîçš åŕé ƒöŕ åðɱîñš one two]'; + + @override + String get analyticsForbiddenBody => + '[Åšķ å Ŵöñķý Ŵöŕķ åðɱîñ îƒ ýöû ñééð ţĥéšé ñûɱƀéŕš. one two three]'; + + @override + String get analyticsErrorTitle => + '[Ţĥé åñåļýţîçš çöûļð ñöţ ƀé ļöåðéð one two th]'; + + @override + String get analyticsShowTable => '[Šĥöŵ åš ţåƀļé one]'; + + @override + String get analyticsShowChart => '[Šĥöŵ åš çĥåŕţ one]'; + + @override + String analyticsChartLabel(String series, String from, String to) { + return '[Çĥåŕţ öƒ $series ƒŕöɱ $from ţö $to one t]'; + } + + @override + String get analyticsColDay => '[Ðåý on]'; + + @override + String get analyticsColWeek => '[Ŵééķ on]'; + + @override + String get analyticsTotal => '[Ţöţåļ on]'; + + @override + String get analyticsKpiAccounts => '[Åççöûñţš one]'; + + @override + String analyticsKpiNew(String count, int days) { + return '[+$count îñ $days ðåýš one]'; + } + + @override + String get analyticsKpiToday => '[Åçţîṽé ţöðåý one]'; + + @override + String analyticsKpiEditorsToday(String count) { + return '[$count çŕéåţéð öŕ éðîţéð one tw]'; + } + + @override + String get analyticsKpiWeekly => '[Ŵééķļý åçţîṽé one t]'; + + @override + String get analyticsKpiWeeklyNote => '[Ļåšţ 7 ðåýš one]'; + + @override + String get analyticsKpiMonthly => '[Ṁöñţĥļý åçţîṽé one t]'; + + @override + String get analyticsKpiMonthlyNote => '[Ļåšţ 30 ðåýš one]'; + + @override + String get analyticsKpiStickiness => '[Šţîçķîñéšš one]'; + + @override + String get analyticsKpiStickinessNote => '[Ðåîļý ÷ ɱöñţĥļý åçţîṽé one two]'; + + @override + String get analyticsKpiCreated => '[Îţéɱš çŕéåţéð one t]'; + + @override + String analyticsKpiInPeriod(int days) { + return '[Îñ $days ðåýš one]'; + } + + @override + String get analyticsActiveTitle => '[Åçţîṽé ûšéŕš one]'; + + @override + String get analyticsActiveSubtitle => + '[Þéöþļé ŵĥö ûšéð åñý åþþ öŕ ṀÇÞ one two t]'; + + @override + String get analyticsViewDaily => '[Ðåîļý on]'; + + @override + String get analyticsViewWeekly => '[Ŵééķļý one]'; + + @override + String get analyticsViewMonthly => '[Ṁöñţĥļý one]'; + + @override + String get analyticsSeriesActive => '[Åçţîṽé one]'; + + @override + String get analyticsSeriesEditors => '[Çŕéåţéð öŕ éðîţéð one tw]'; + + @override + String get analyticsSeriesWeekly => '[Ŵééķļý åçţîṽé one t]'; + + @override + String get analyticsSeriesMonthly => '[Ṁöñţĥļý åçţîṽé one t]'; + + @override + String get analyticsAppsTitle => '[Åçţîṽé ûšéŕš ƀý åþþ one tw]'; + + @override + String get analyticsAppsSubtitle => + '[Å þéŕšöñ ûšîñĝ ţŵö åþþš çöûñţš îñ ƀöţĥ one two thr]'; + + @override + String get analyticsSeriesMcp => '[ṀÇÞ çļîéñţš one]'; + + @override + String get analyticsSignupsTitle => '[Šîĝñ-ûþš one]'; + + @override + String analyticsSignupsSubtitle(String count, String total) { + return '[$count ñéŵ · $total åççöûñţš one t]'; + } + + @override + String get analyticsSeriesSignups => '[Šîĝñ-ûþš one]'; + + @override + String get analyticsContentNowTitle => '[Çöñţéñţ ñöŵ one]'; + + @override + String analyticsItemsTotal(String count, String size) { + return '[$count îţéɱš · $size šţöŕéð one t]'; + } + + @override + String get analyticsSignInTitle => '[Šîĝñ-îñ ɱéţĥöðš one t]'; + + @override + String get analyticsSignInEmail => '[Éɱåîļ on]'; + + @override + String get analyticsSignInGoogle => '[Ĝööĝļé one]'; + + @override + String get analyticsContentTitle => '[Çöñţéñţ çŕéåţéð one t]'; + + @override + String get analyticsContentSubtitle => + '[Ɓý þéöþļé, ţĥé åššîšţåñţ åñð ṀÇÞ; ŵéļçöɱé çöñţéñţ ļéƒţ öûţ one two three four]'; + + @override + String get analyticsCollabTitle => '[Çöļļåƀöŕåţîöñ one t]'; + + @override + String get analyticsStatShared => '[Îţéɱš šĥåŕéð ñöŵ one t]'; + + @override + String analyticsStatCoEdited(int days) { + return '[Çö-éðîţéð îñ $days ðåýš one tw]'; + } + + @override + String analyticsStatCommenters(int days) { + return '[Çöɱɱéñţéŕš îñ $days ðåýš one tw]'; + } + + @override + String get analyticsSeriesComments => '[Çöɱɱéñţš one]'; + + @override + String get analyticsSeriesShares => '[Šĥåŕéš one]'; + + @override + String get analyticsAiTitle => '[ÅÎ åššîšţåñţ one]'; + + @override + String analyticsAiSubtitle(String requests, String tokens, int days) { + return '[$requests ŕéǫûéšţš · $tokens ţöķéñš · ķéþţ $days ðåýš one two t]'; + } + + @override + String get analyticsSeriesAiRequests => '[Ŕéǫûéšţš one]'; + + @override + String get analyticsAiByFeature => '[Ɓý ƒéåţûŕé one]'; + + @override + String get analyticsAiByModel => '[Ɓý ɱöðéļ one]'; + + @override + String analyticsAiRow(String requests, String tokens) { + return '[$requests · $tokens ţöķéñš one]'; + } + + @override + String get analyticsNoAiUse => '[Ñö ÅÎ ûšé îñ ţĥîš þéŕîöð one two]'; + + @override + String get analyticsMcpTitle => '[ṀÇÞ ţööļ çåļļš one t]'; + + @override + String analyticsMcpSubtitle(String count) { + return '[$count çåļļš ƀý þéöþļé\'š åççéšš ţöķéñš (åðɱîñš îñçļûðéð) one two three fo]'; + } + + @override + String get analyticsSeriesMcpCalls => '[Ţööļ çåļļš one]'; + + @override + String get analyticsRetentionTitle => '[Ŕéţéñţîöñ one]'; + + @override + String get analyticsRetentionSubtitle => + '[Šĥåŕé öƒ éåçĥ ŵééķ\'š šîĝñ-ûþš åçţîṽé îñ ţĥé ŵééķš åƒţéŕ one two three fou]'; + + @override + String get analyticsCohortWeek => '[Šîĝñéð ûþ one]'; + + @override + String get analyticsCohortSize => '[Åççöûñţš one]'; + + @override + String analyticsCohortWeekN(int week) { + return '[Ŵ$week o]'; + } + + @override + String analyticsCohortCell( + String cohort, + int week, + int active, + String share, + ) { + return '[Ŵééķ öƒ $cohort: $active åçţîṽé îñ ŵééķ $week ($share) one two]'; + } } diff --git a/wonky_drive/test/features/analytics/analytics_controller_test.dart b/wonky_drive/test/features/analytics/analytics_controller_test.dart new file mode 100644 index 00000000..4df2db32 --- /dev/null +++ b/wonky_drive/test/features/analytics/analytics_controller_test.dart @@ -0,0 +1,50 @@ +import 'package:flutter_test/flutter_test.dart'; +import 'package:wonky_drive/features/analytics/analytics_controller.dart'; + +/// The pure helpers of the Analytics page (specs/19 §3): routes and the +/// bucketing of the bar charts. +void main() { + group('Given the analytics route', () { + for (final (days, admins, path) in [ + (30, false, '/analytics'), + (90, false, '/analytics?days=90'), + (30, true, '/analytics?admins=1'), + (7, true, '/analytics?days=7&admins=1'), + ]) { + test('when building $days days, admins $admins then it is $path', () { + expect(analyticsPath(days: days, admins: admins), path); + }); + } + + for (final (raw, days) in [ + (null, 30), + ('365', 365), + ('14', 30), + ('x', 30), + ]) { + test('when parsing "$raw" then the period is $days days', () { + expect(parseAnalyticsDays(raw), days); + }); + } + }); + + group('Given 10 daily values', () { + final values = [for (var i = 1; i <= 10; i++) i]; + final days = [for (var i = 0; i < 10; i++) DateTime.utc(2026, 10, 11 + i)]; + + test('when bucketing by 1 then nothing changes', () { + expect(bucketSums(values, 1), [for (final v in values) v.toDouble()]); + }); + + test('when bucketing by 7 then the last bucket ends today and the ' + 'first is the short one', () { + expect(bucketSums(values, 7), [1 + 2 + 3.0, 4 + 5 + 6 + 7 + 8 + 9 + 10]); + expect(bucketStarts(days, 7), [days[0], days[3]]); + }); + }); + + test('when choosing bar sizes then up to 90 days are daily and 365 ' + 'weekly', () { + expect([for (final d in analyticsPeriods) bucketSizeOf(d)], [1, 1, 1, 7]); + }); +} diff --git a/wonky_drive/test/features/analytics/analytics_screen_test.dart b/wonky_drive/test/features/analytics/analytics_screen_test.dart new file mode 100644 index 00000000..95b8e8a9 --- /dev/null +++ b/wonky_drive/test/features/analytics/analytics_screen_test.dart @@ -0,0 +1,200 @@ +import 'package:flutter/gestures.dart'; +import 'package:flutter/widgets.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:wonky_client/wonky_client.dart'; +import 'package:wonky_drive/l10n/drive_l10n.dart'; + +import '../../support/analytics_fakes.dart'; + +final l = driveL10nEnglish; + +/// The Analytics page (specs/19 §3): admins only, the period and the +/// *Include admins* switch through `drive.analytics.show`, charts with +/// hover tooltips and table views, light/dark, 360 px and the +/// pseudo-locale. +void main() { + Finder key(String k) => find.byKey(ValueKey(k)); + + /// Scrolls the page (not the left menu or a table) until [f] shows. + Future scrollTo(WidgetTester tester, Finder f, [double by = 200]) => + tester.scrollUntilVisible( + f, + by, + scrollable: find + .descendant( + of: key('analytics.page'), + matching: find.byType(Scrollable), + ) + .first, + ); + + group('Given an admin', () { + late AnalyticsTestbed t; + + setUp(() => t = AnalyticsTestbed()); + tearDown(() => t.dispose()); + + testWidgets('when the Drive home opens then the left menu has ' + 'Analytics', (tester) async { + await t.pump(tester, location: '/'); + + expect(key('drive.nav.analytics'), findsOneWidget); + }); + + testWidgets('when Analytics opens then it shows the headline numbers ' + 'and the charts', (tester) async { + await t.pump(tester, location: '/analytics'); + + expect(t.analytics.overviewRequests, [(30, false)]); + expect(find.text(l.analyticsTitle), findsWidgets); + final o = fakeOverview(30); + expect( + find.descendant( + of: key('analytics.kpi.today.value'), + matching: find.text('${o.activeToday}'), + matchRoot: true, + ), + findsOneWidget, + ); + for (final id in [ + 'active', + 'apps', + 'signups', + 'content', + 'collaboration', + 'ai', + 'mcp', + 'retention', + ]) { + await scrollTo(tester, key('analytics.card.$id'), 200); + expect(key('analytics.card.$id'), findsOneWidget, reason: id); + } + }); + + testWidgets('when choosing 90 days then the route and the request ' + 'follow', (tester) async { + await t.pump(tester, location: '/analytics'); + + await tester.tap(key('analytics.period.90')); + await tester.pumpAndSettle(); + + expect(t.location, '/analytics?days=90'); + expect(t.analytics.overviewRequests.last, (90, false)); + }); + + testWidgets('when turning on Include admins then admins are ' + 'counted', (tester) async { + await t.pump(tester, location: '/analytics'); + + await tester.tap(key('analytics.includeAdmins')); + await tester.pumpAndSettle(); + + expect(t.location, '/analytics?admins=1'); + expect(t.analytics.overviewRequests.last, (30, true)); + }); + + testWidgets('when hovering the active users chart then a tooltip shows ' + 'the day and the values', (tester) async { + await t.pump(tester, location: '/analytics'); + final chart = key('analytics.chart.active.daily'); + final box = tester.getRect(chart); + + final mouse = await tester.createGesture(kind: PointerDeviceKind.mouse); + await mouse.addPointer(location: box.bottomRight - const Offset(8, 60)); + await mouse.moveTo(box.bottomRight - const Offset(7, 60)); + await tester.pump(); + + expect(key('analytics.tooltip'), findsOneWidget); + final today = fakeOverview(30).series.last; + expect( + find.descendant( + of: key('analytics.tooltip'), + matching: find.text('${today.active}'), + ), + findsOneWidget, + ); + await mouse.removePointer(); + }); + + testWidgets('when showing a chart as a table then the newest day comes ' + 'first', (tester) async { + await t.pump(tester, location: '/analytics'); + + await tester.tap(key('analytics.card.active.table')); + await tester.pumpAndSettle(); + + expect(find.text(l.analyticsColDay), findsOneWidget); + expect(find.text('Tue, Oct 20'), findsOneWidget); + }); + + testWidgets('when switching to Monthly then the chart shows monthly ' + 'active users', (tester) async { + await t.pump(tester, location: '/analytics'); + + await tester.tap(key('analytics.active.view.monthly')); + await tester.pumpAndSettle(); + + expect(key('analytics.chart.active.monthly'), findsOneWidget); + }); + + for (final (name, brightness, size) in [ + ('dark', Brightness.dark, const Size(1280, 900)), + ('360 px', Brightness.light, const Size(360, 800)), + ]) { + testWidgets('when shown $name then it lays out without ' + 'errors', (tester) async { + await t.pump( + tester, + location: '/analytics?days=365', + brightness: brightness, + size: size, + ); + + expect(key('analytics.card.active'), findsOneWidget); + await scrollTo(tester, key('analytics.card.retention'), 300); + expect(tester.takeException(), isNull); + }); + } + + testWidgets('when shown in the pseudo-locale then it lays out without ' + 'errors', (tester) async { + await t.pump( + tester, + location: '/analytics', + locale: const Locale('en', 'XA'), + ); + + expect(key('analytics.card.active'), findsOneWidget); + expect(tester.takeException(), isNull); + }); + }); + + group('Given a person who is not an admin', () { + late AnalyticsTestbed t; + + setUp(() { + t = AnalyticsTestbed(admin: false); + t.analytics.failWith = WonkyException( + code: WonkyErrorCode.forbidden, + message: 'Usage analytics are for admins.', + ); + }); + tearDown(() => t.dispose()); + + testWidgets('when the Drive home opens then the left menu has no ' + 'Analytics', (tester) async { + await t.pump(tester, location: '/'); + + expect(key('drive.nav.analytics'), findsNothing); + expect(key('drive.nav.storage'), findsOneWidget); + }); + + testWidgets('when /analytics is opened then it says analytics are for ' + 'admins', (tester) async { + await t.pump(tester, location: '/analytics'); + + expect(key('analytics.forbidden'), findsOneWidget); + expect(find.text(l.analyticsForbiddenTitle), findsOneWidget); + }); + }); +} diff --git a/wonky_drive/test/support/analytics_fakes.dart b/wonky_drive/test/support/analytics_fakes.dart new file mode 100644 index 00000000..374d7f25 --- /dev/null +++ b/wonky_drive/test/support/analytics_fakes.dart @@ -0,0 +1,121 @@ +import 'package:wonky_app/testing.dart'; +import 'package:wonky_client/wonky_client.dart'; +import 'package:wonky_drive/features/analytics/analytics_api.dart'; +import 'package:wonky_drive/features/analytics/analytics_controller.dart'; + +import 'storage_fakes.dart'; + +/// The last day of the fake analytics (UTC). +final analyticsToday = DateTime.utc(2026, 10, 20); + +/// A deterministic overview of [days] days: activity that grows towards +/// today, every measure non-zero somewhere. +AnalyticsOverview fakeOverview(int days, {bool includeAdmins = false}) { + final series = [ + for (var i = 0; i < days; i++) + () { + final day = analyticsToday.subtract(Duration(days: days - 1 - i)); + final base = 10 + i % 7 + i ~/ 3; + return AnalyticsDay( + day: day, + active: base, + editors: base ~/ 2, + weekly: base * 3, + monthly: base * 6, + drive: base ~/ 2, + write: base ~/ 3, + sheets: base ~/ 4, + slides: base ~/ 5, + mcp: i % 3, + signups: i % 4, + accounts: 100 + i, + documents: i % 5, + spreadsheets: i % 3, + presentations: i % 2, + files: i % 4, + folders: 0, + comments: i % 6, + shares: i % 3, + aiRequests: 2 * (i % 5), + aiTokens: 1500 * (i % 5), + mcpCalls: 7 * (i % 3), + ); + }(), + ]; + return AnalyticsOverview( + days: days, + includeAdmins: includeAdmins, + generatedAt: analyticsToday.add(const Duration(hours: 9)), + trackingSince: analyticsToday.subtract(const Duration(days: 400)), + accounts: 100 + days - 1, + newAccounts: days, + activeToday: series.last.active, + weekly: series.last.weekly, + monthly: series.last.monthly, + stickiness: 0.27, + series: series, + itemTotals: [ + AnalyticsCount(key: 'document', count: 420, amount: 12 * mb), + AnalyticsCount(key: 'spreadsheet', count: 180, amount: 30 * mb), + AnalyticsCount(key: 'presentation', count: 40, amount: 8 * mb), + AnalyticsCount(key: 'file', count: 95, amount: 200 * mb), + ], + storageBytes: 250 * mb, + signInMethods: [ + AnalyticsCount(key: 'email', count: 70), + AnalyticsCount(key: 'google', count: 52), + ], + aiFeatures: [ + AnalyticsCount(key: 'chat', count: 120, amount: 400000), + AnalyticsCount(key: 'proofread', count: 30, amount: 90000), + ], + aiModels: [ + AnalyticsCount(key: 'gemini-3.1-pro', count: 100, amount: 380000), + AnalyticsCount(key: 'gemini-3.8-flash', count: 50, amount: 110000), + ], + aiRetentionDays: 90, + sharedItems: 64, + coEditedItems: 12, + commenters: 9, + cohorts: [ + for (var w = 0; w < 12; w++) + AnalyticsCohort( + week: analyticsToday.subtract(Duration(days: 7 * (11 - w) + 1)), + size: 10 + w, + active: [for (var k = 0; k < 12 - w; k++) (10 + w) * (12 - k) ~/ 13], + ), + ], + ); +} + +/// [AnalyticsApi] over [fakeOverview]; records the requests and fails with +/// [failWith]. +class FakeAnalyticsApi implements AnalyticsApi { + final List<(int, bool)> overviewRequests = []; + Object? failWith; + + @override + Future overview( + int days, { + required bool includeAdmins, + }) async { + overviewRequests.add((days, includeAdmins)); + final e = failWith; + if (e != null) throw e; + return fakeOverview(days, includeAdmins: includeAdmins); + } +} + +/// The Storage testbed (Drive frame, router, harness) with a +/// [FakeAnalyticsApi] and a board whose caller is an admin or not. +class AnalyticsTestbed extends StorageTestbed { + AnalyticsTestbed({bool admin = true}) + : this._(FakeBoardRepository(isAdmin: admin)); + + AnalyticsTestbed._(this.board) : super(board: board) { + AnalyticsHost.of(services).api = analytics; + } + + final FakeBoardRepository board; + final FakeAnalyticsApi analytics = FakeAnalyticsApi(); +} diff --git a/wonky_drive/test/support/storage_fakes.dart b/wonky_drive/test/support/storage_fakes.dart index 21920119..a4f85190 100644 --- a/wonky_drive/test/support/storage_fakes.dart +++ b/wonky_drive/test/support/storage_fakes.dart @@ -73,9 +73,16 @@ class FakeStorageApi implements StorageApi { /// a router with the Storage page (`/storage`), the home and the preview /// route stubs. class StorageTestbed { - StorageTestbed({int usedBytes = 20 * mb, int trashBytes = 0}) - : storage = FakeStorage.used(usedBytes, trashBytes: trashBytes) { - h = CommandTestHarness(config: const DriveAppConfig(), storage: storage); + StorageTestbed({ + int usedBytes = 20 * mb, + int trashBytes = 0, + BoardRepository? board, + }) : storage = FakeStorage.used(usedBytes, trashBytes: trashBytes) { + h = CommandTestHarness( + config: const DriveAppConfig(), + storage: storage, + board: board, + ); api = FakeStorageApi(h.drive); StorageHost.of(h.services) ..api = api diff --git a/wonky_server/lib/src/generated/endpoints.dart b/wonky_server/lib/src/generated/endpoints.dart index ebd3c519..a8d54b1c 100644 --- a/wonky_server/lib/src/generated/endpoints.dart +++ b/wonky_server/lib/src/generated/endpoints.dart @@ -24,6 +24,8 @@ import 'package:wonky_server/src/generated/platform/ai/models/assistant_context_ as _ixc2f7d5; import 'package:wonky_server/src/generated/platform/ai/models/inline_ai_request.dart' as _i4c3y8bm; +import 'package:wonky_server/src/generated/platform/analytics/models/usage_app.dart' + as _idlxfxe3; import 'package:wonky_server/src/generated/platform/board/models/board_area.dart' as _i2y7swbd; import 'package:wonky_server/src/generated/platform/board/models/board_flag_reason.dart' @@ -110,6 +112,7 @@ import '../auth/email_idp_endpoint.dart' as _iuc1hd5t; import '../auth/jwt_refresh_endpoint.dart' as _inwq3ztq; import '../platform/activity/activity_endpoint.dart' as _id6etezj; import '../platform/ai/assistant_endpoint.dart' as _i8k7ge8b; +import '../platform/analytics/analytics_endpoint.dart' as _ihmj012r; import '../platform/board/board_endpoint.dart' as _itoz815u; import '../platform/comments/comment_endpoint.dart' as _iuwjzuw0; import '../platform/drive/drive_endpoint.dart' as _ijanxtjh; @@ -175,6 +178,12 @@ class Endpoints extends _is.EndpointDispatch { 'assistant', null, ), + 'analytics': _ihmj012r.AnalyticsEndpoint() + ..initialize( + server, + 'analytics', + null, + ), 'board': _itoz815u.BoardEndpoint() ..initialize( server, @@ -984,6 +993,56 @@ class Endpoints extends _is.EndpointDispatch { ), }, ); + connectors['analytics'] = _is.EndpointConnector( + name: 'analytics', + endpoint: endpoints['analytics']!, + methodConnectors: { + 'ping': _is.MethodConnector( + name: 'ping', + params: { + 'app': _is.ParameterDescription( + name: 'app', + type: _is.getType<_idlxfxe3.UsageApp>(), + nullable: false, + ), + }, + call: + ( + _is.Session session, + Map params, + ) async => + (endpoints['analytics'] as _ihmj012r.AnalyticsEndpoint).ping( + session, + params['app'], + ), + ), + 'overview': _is.MethodConnector( + name: 'overview', + params: { + 'days': _is.ParameterDescription( + name: 'days', + type: _is.getType(), + nullable: false, + ), + 'includeAdmins': _is.ParameterDescription( + name: 'includeAdmins', + type: _is.getType(), + nullable: false, + ), + }, + call: + ( + _is.Session session, + Map params, + ) async => (endpoints['analytics'] as _ihmj012r.AnalyticsEndpoint) + .overview( + session, + params['days'], + params['includeAdmins'], + ), + ), + }, + ); connectors['board'] = _is.EndpointConnector( name: 'board', endpoint: endpoints['board']!, diff --git a/wonky_server/lib/src/generated/future_calls.dart b/wonky_server/lib/src/generated/future_calls.dart index ddbca080..e4c2f7fa 100644 --- a/wonky_server/lib/src/generated/future_calls.dart +++ b/wonky_server/lib/src/generated/future_calls.dart @@ -678,8 +678,8 @@ class MaintenanceExpireGrantsFutureCall extends _is.FutureCall /// Daily: trash purge, (v2) expired uploads and folder kind masks, /// version thinning, op-log and change-log pruning, active-set eviction, -/// server change records, deleted themes, the diff cache, old AI usage -/// and old notifications. +/// server change records, deleted themes, the diff cache, old AI usage, +/// old usage analytics and old notifications. class MaintenanceDailyFutureCall extends _is.FutureCall implements _is.InvokableFutureCall { @override diff --git a/wonky_server/lib/src/generated/platform/analytics/models/analytics_cohort.dart b/wonky_server/lib/src/generated/platform/analytics/models/analytics_cohort.dart new file mode 100644 index 00000000..76e353ec --- /dev/null +++ b/wonky_server/lib/src/generated/platform/analytics/models/analytics_cohort.dart @@ -0,0 +1,112 @@ +/* AUTOMATICALLY GENERATED CODE DO NOT MODIFY */ +/* To generate run: "serverpod generate" */ + +// ignore_for_file: implementation_imports +// ignore_for_file: library_private_types_in_public_api +// ignore_for_file: non_constant_identifier_names +// ignore_for_file: public_member_api_docs +// ignore_for_file: type_literal_in_constant_pattern +// ignore_for_file: use_super_parameters +// ignore_for_file: invalid_use_of_internal_member + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'package:serverpod/serverpod.dart' as _is; +import 'package:wonky_server/src/generated/protocol.dart' as _il4umwa0; + +/// A weekly sign-up cohort (specs/19 §3.5): accounts created in the week +/// starting [week] (Monday, UTC) and how many of them were active N weeks +/// later. +abstract class AnalyticsCohort + implements _is.SerializableModel, _is.ProtocolSerialization { + AnalyticsCohort._({ + required this.week, + required this.size, + required this.active, + }); + + factory AnalyticsCohort({ + required DateTime week, + required int size, + required List active, + }) = _AnalyticsCohortImpl; + + factory AnalyticsCohort.fromJson(Map jsonSerialization) { + return AnalyticsCohort( + week: _is.DateTimeJsonExtension.fromJson(jsonSerialization['week']), + size: jsonSerialization['size'] as int, + active: _il4umwa0.Protocol().deserialize>( + jsonSerialization['active'], + ), + ); + } + + DateTime week; + + int size; + + /// Index N: active users of the cohort in week N after sign-up (0 = the + /// sign-up week). Null where the week is in the future or ended before + /// activity was recorded. + List active; + + /// Returns a shallow copy of this [AnalyticsCohort] + /// with some or all fields replaced by the given arguments. + @_is.useResult + AnalyticsCohort copyWith({ + DateTime? week, + int? size, + List? active, + }); + @override + Map toJson() { + return { + '__className__': 'AnalyticsCohort', + 'week': week.toJson(), + 'size': size, + 'active': active.toJson(), + }; + } + + @override + Map toJsonForProtocol() { + return { + '__className__': 'AnalyticsCohort', + 'week': week.toJson(), + 'size': size, + 'active': active.toJson(), + }; + } + + @override + String toString() { + return _is.SerializationManager.encode(this); + } +} + +class _AnalyticsCohortImpl extends AnalyticsCohort { + _AnalyticsCohortImpl({ + required DateTime week, + required int size, + required List active, + }) : super._( + week: week, + size: size, + active: active, + ); + + /// Returns a shallow copy of this [AnalyticsCohort] + /// with some or all fields replaced by the given arguments. + @_is.useResult + @override + AnalyticsCohort copyWith({ + DateTime? week, + int? size, + List? active, + }) { + return AnalyticsCohort( + week: week ?? this.week, + size: size ?? this.size, + active: active ?? this.active.map((e0) => e0).toList(), + ); + } +} diff --git a/wonky_server/lib/src/generated/platform/analytics/models/analytics_count.dart b/wonky_server/lib/src/generated/platform/analytics/models/analytics_count.dart new file mode 100644 index 00000000..5ecbf4de --- /dev/null +++ b/wonky_server/lib/src/generated/platform/analytics/models/analytics_count.dart @@ -0,0 +1,107 @@ +/* AUTOMATICALLY GENERATED CODE DO NOT MODIFY */ +/* To generate run: "serverpod generate" */ + +// ignore_for_file: implementation_imports +// ignore_for_file: library_private_types_in_public_api +// ignore_for_file: non_constant_identifier_names +// ignore_for_file: public_member_api_docs +// ignore_for_file: type_literal_in_constant_pattern +// ignore_for_file: use_super_parameters +// ignore_for_file: invalid_use_of_internal_member + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'package:serverpod/serverpod.dart' as _is; + +/// A labeled count of the usage analytics (specs/19 §3): items by kind, +/// sign-in methods, AI requests by feature or model. +abstract class AnalyticsCount + implements _is.SerializableModel, _is.ProtocolSerialization { + AnalyticsCount._({ + required this.key, + required this.count, + int? amount, + }) : amount = amount ?? 0; + + factory AnalyticsCount({ + required String key, + required int count, + int? amount, + }) = _AnalyticsCountImpl; + + factory AnalyticsCount.fromJson(Map jsonSerialization) { + return AnalyticsCount( + key: jsonSerialization['key'] as String, + count: jsonSerialization['count'] as int, + amount: jsonSerialization['amount'] as int?, + ); + } + + String key; + + int count; + + /// A second measure where one applies (bytes of items, AI tokens); 0 + /// otherwise. + int amount; + + /// Returns a shallow copy of this [AnalyticsCount] + /// with some or all fields replaced by the given arguments. + @_is.useResult + AnalyticsCount copyWith({ + String? key, + int? count, + int? amount, + }); + @override + Map toJson() { + return { + '__className__': 'AnalyticsCount', + 'key': key, + 'count': count, + 'amount': amount, + }; + } + + @override + Map toJsonForProtocol() { + return { + '__className__': 'AnalyticsCount', + 'key': key, + 'count': count, + 'amount': amount, + }; + } + + @override + String toString() { + return _is.SerializationManager.encode(this); + } +} + +class _AnalyticsCountImpl extends AnalyticsCount { + _AnalyticsCountImpl({ + required String key, + required int count, + int? amount, + }) : super._( + key: key, + count: count, + amount: amount, + ); + + /// Returns a shallow copy of this [AnalyticsCount] + /// with some or all fields replaced by the given arguments. + @_is.useResult + @override + AnalyticsCount copyWith({ + String? key, + int? count, + int? amount, + }) { + return AnalyticsCount( + key: key ?? this.key, + count: count ?? this.count, + amount: amount ?? this.amount, + ); + } +} diff --git a/wonky_server/lib/src/generated/platform/analytics/models/analytics_day.dart b/wonky_server/lib/src/generated/platform/analytics/models/analytics_day.dart new file mode 100644 index 00000000..62ac1ef0 --- /dev/null +++ b/wonky_server/lib/src/generated/platform/analytics/models/analytics_day.dart @@ -0,0 +1,340 @@ +/* AUTOMATICALLY GENERATED CODE DO NOT MODIFY */ +/* To generate run: "serverpod generate" */ + +// ignore_for_file: implementation_imports +// ignore_for_file: library_private_types_in_public_api +// ignore_for_file: non_constant_identifier_names +// ignore_for_file: public_member_api_docs +// ignore_for_file: type_literal_in_constant_pattern +// ignore_for_file: use_super_parameters +// ignore_for_file: invalid_use_of_internal_member + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'package:serverpod/serverpod.dart' as _is; + +/// One UTC day of the usage analytics (specs/19 §3). Users are counted +/// once per day; the rolling counts are distinct users in the 7 and 30 +/// days ending with [day]. +abstract class AnalyticsDay + implements _is.SerializableModel, _is.ProtocolSerialization { + AnalyticsDay._({ + required this.day, + required this.active, + required this.editors, + required this.weekly, + required this.monthly, + required this.drive, + required this.write, + required this.sheets, + required this.slides, + required this.mcp, + required this.signups, + required this.accounts, + required this.documents, + required this.spreadsheets, + required this.presentations, + required this.files, + required this.folders, + required this.comments, + required this.shares, + required this.aiRequests, + required this.aiTokens, + required this.mcpCalls, + }); + + factory AnalyticsDay({ + required DateTime day, + required int active, + required int editors, + required int weekly, + required int monthly, + required int drive, + required int write, + required int sheets, + required int slides, + required int mcp, + required int signups, + required int accounts, + required int documents, + required int spreadsheets, + required int presentations, + required int files, + required int folders, + required int comments, + required int shares, + required int aiRequests, + required int aiTokens, + required int mcpCalls, + }) = _AnalyticsDayImpl; + + factory AnalyticsDay.fromJson(Map jsonSerialization) { + return AnalyticsDay( + day: _is.DateTimeJsonExtension.fromJson(jsonSerialization['day']), + active: jsonSerialization['active'] as int, + editors: jsonSerialization['editors'] as int, + weekly: jsonSerialization['weekly'] as int, + monthly: jsonSerialization['monthly'] as int, + drive: jsonSerialization['drive'] as int, + write: jsonSerialization['write'] as int, + sheets: jsonSerialization['sheets'] as int, + slides: jsonSerialization['slides'] as int, + mcp: jsonSerialization['mcp'] as int, + signups: jsonSerialization['signups'] as int, + accounts: jsonSerialization['accounts'] as int, + documents: jsonSerialization['documents'] as int, + spreadsheets: jsonSerialization['spreadsheets'] as int, + presentations: jsonSerialization['presentations'] as int, + files: jsonSerialization['files'] as int, + folders: jsonSerialization['folders'] as int, + comments: jsonSerialization['comments'] as int, + shares: jsonSerialization['shares'] as int, + aiRequests: jsonSerialization['aiRequests'] as int, + aiTokens: jsonSerialization['aiTokens'] as int, + mcpCalls: jsonSerialization['mcpCalls'] as int, + ); + } + + DateTime day; + + /// Users active in any app or through MCP. + int active; + + /// Users who created or edited something. + int editors; + + int weekly; + + int monthly; + + int drive; + + int write; + + int sheets; + + int slides; + + int mcp; + + /// Accounts created that day, and all accounts at its end. + int signups; + + int accounts; + + /// Items created that day by kind (templates of the gallery left out). + int documents; + + int spreadsheets; + + int presentations; + + int files; + + int folders; + + /// Comments and replies by people (not system events). + int comments; + + /// Direct grants to people (not inherited from a folder). + int shares; + + int aiRequests; + + int aiTokens; + + int mcpCalls; + + /// Returns a shallow copy of this [AnalyticsDay] + /// with some or all fields replaced by the given arguments. + @_is.useResult + AnalyticsDay copyWith({ + DateTime? day, + int? active, + int? editors, + int? weekly, + int? monthly, + int? drive, + int? write, + int? sheets, + int? slides, + int? mcp, + int? signups, + int? accounts, + int? documents, + int? spreadsheets, + int? presentations, + int? files, + int? folders, + int? comments, + int? shares, + int? aiRequests, + int? aiTokens, + int? mcpCalls, + }); + @override + Map toJson() { + return { + '__className__': 'AnalyticsDay', + 'day': day.toJson(), + 'active': active, + 'editors': editors, + 'weekly': weekly, + 'monthly': monthly, + 'drive': drive, + 'write': write, + 'sheets': sheets, + 'slides': slides, + 'mcp': mcp, + 'signups': signups, + 'accounts': accounts, + 'documents': documents, + 'spreadsheets': spreadsheets, + 'presentations': presentations, + 'files': files, + 'folders': folders, + 'comments': comments, + 'shares': shares, + 'aiRequests': aiRequests, + 'aiTokens': aiTokens, + 'mcpCalls': mcpCalls, + }; + } + + @override + Map toJsonForProtocol() { + return { + '__className__': 'AnalyticsDay', + 'day': day.toJson(), + 'active': active, + 'editors': editors, + 'weekly': weekly, + 'monthly': monthly, + 'drive': drive, + 'write': write, + 'sheets': sheets, + 'slides': slides, + 'mcp': mcp, + 'signups': signups, + 'accounts': accounts, + 'documents': documents, + 'spreadsheets': spreadsheets, + 'presentations': presentations, + 'files': files, + 'folders': folders, + 'comments': comments, + 'shares': shares, + 'aiRequests': aiRequests, + 'aiTokens': aiTokens, + 'mcpCalls': mcpCalls, + }; + } + + @override + String toString() { + return _is.SerializationManager.encode(this); + } +} + +class _AnalyticsDayImpl extends AnalyticsDay { + _AnalyticsDayImpl({ + required DateTime day, + required int active, + required int editors, + required int weekly, + required int monthly, + required int drive, + required int write, + required int sheets, + required int slides, + required int mcp, + required int signups, + required int accounts, + required int documents, + required int spreadsheets, + required int presentations, + required int files, + required int folders, + required int comments, + required int shares, + required int aiRequests, + required int aiTokens, + required int mcpCalls, + }) : super._( + day: day, + active: active, + editors: editors, + weekly: weekly, + monthly: monthly, + drive: drive, + write: write, + sheets: sheets, + slides: slides, + mcp: mcp, + signups: signups, + accounts: accounts, + documents: documents, + spreadsheets: spreadsheets, + presentations: presentations, + files: files, + folders: folders, + comments: comments, + shares: shares, + aiRequests: aiRequests, + aiTokens: aiTokens, + mcpCalls: mcpCalls, + ); + + /// Returns a shallow copy of this [AnalyticsDay] + /// with some or all fields replaced by the given arguments. + @_is.useResult + @override + AnalyticsDay copyWith({ + DateTime? day, + int? active, + int? editors, + int? weekly, + int? monthly, + int? drive, + int? write, + int? sheets, + int? slides, + int? mcp, + int? signups, + int? accounts, + int? documents, + int? spreadsheets, + int? presentations, + int? files, + int? folders, + int? comments, + int? shares, + int? aiRequests, + int? aiTokens, + int? mcpCalls, + }) { + return AnalyticsDay( + day: day ?? this.day, + active: active ?? this.active, + editors: editors ?? this.editors, + weekly: weekly ?? this.weekly, + monthly: monthly ?? this.monthly, + drive: drive ?? this.drive, + write: write ?? this.write, + sheets: sheets ?? this.sheets, + slides: slides ?? this.slides, + mcp: mcp ?? this.mcp, + signups: signups ?? this.signups, + accounts: accounts ?? this.accounts, + documents: documents ?? this.documents, + spreadsheets: spreadsheets ?? this.spreadsheets, + presentations: presentations ?? this.presentations, + files: files ?? this.files, + folders: folders ?? this.folders, + comments: comments ?? this.comments, + shares: shares ?? this.shares, + aiRequests: aiRequests ?? this.aiRequests, + aiTokens: aiTokens ?? this.aiTokens, + mcpCalls: mcpCalls ?? this.mcpCalls, + ); + } +} diff --git a/wonky_server/lib/src/generated/platform/analytics/models/analytics_overview.dart b/wonky_server/lib/src/generated/platform/analytics/models/analytics_overview.dart new file mode 100644 index 00000000..93a0a2ef --- /dev/null +++ b/wonky_server/lib/src/generated/platform/analytics/models/analytics_overview.dart @@ -0,0 +1,376 @@ +/* AUTOMATICALLY GENERATED CODE DO NOT MODIFY */ +/* To generate run: "serverpod generate" */ + +// ignore_for_file: implementation_imports +// ignore_for_file: library_private_types_in_public_api +// ignore_for_file: non_constant_identifier_names +// ignore_for_file: public_member_api_docs +// ignore_for_file: type_literal_in_constant_pattern +// ignore_for_file: use_super_parameters +// ignore_for_file: invalid_use_of_internal_member + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'package:serverpod/serverpod.dart' as _is; +import 'package:wonky_server/src/generated/protocol.dart' as _il4umwa0; +import '../../../platform/analytics/models/analytics_cohort.dart' as _i3uny1ae; +import '../../../platform/analytics/models/analytics_count.dart' as _iucqk5df; +import '../../../platform/analytics/models/analytics_day.dart' as _ii75e3xb; + +/// The usage analytics dashboard of Wonky Drive (specs/19 §3), for admins. +abstract class AnalyticsOverview + implements _is.SerializableModel, _is.ProtocolSerialization { + AnalyticsOverview._({ + required this.days, + required this.includeAdmins, + required this.generatedAt, + this.trackingSince, + required this.accounts, + required this.newAccounts, + required this.activeToday, + required this.weekly, + required this.monthly, + required this.stickiness, + required this.series, + required this.itemTotals, + required this.storageBytes, + required this.signInMethods, + required this.aiFeatures, + required this.aiModels, + required this.aiRetentionDays, + required this.sharedItems, + required this.coEditedItems, + required this.commenters, + required this.cohorts, + }); + + factory AnalyticsOverview({ + required int days, + required bool includeAdmins, + required DateTime generatedAt, + DateTime? trackingSince, + required int accounts, + required int newAccounts, + required int activeToday, + required int weekly, + required int monthly, + required double stickiness, + required List<_ii75e3xb.AnalyticsDay> series, + required List<_iucqk5df.AnalyticsCount> itemTotals, + required int storageBytes, + required List<_iucqk5df.AnalyticsCount> signInMethods, + required List<_iucqk5df.AnalyticsCount> aiFeatures, + required List<_iucqk5df.AnalyticsCount> aiModels, + required int aiRetentionDays, + required int sharedItems, + required int coEditedItems, + required int commenters, + required List<_i3uny1ae.AnalyticsCohort> cohorts, + }) = _AnalyticsOverviewImpl; + + factory AnalyticsOverview.fromJson(Map jsonSerialization) { + return AnalyticsOverview( + days: jsonSerialization['days'] as int, + includeAdmins: _is.BoolJsonExtension.fromJson( + jsonSerialization['includeAdmins'], + ), + generatedAt: _is.DateTimeJsonExtension.fromJson( + jsonSerialization['generatedAt'], + ), + trackingSince: jsonSerialization['trackingSince'] == null + ? null + : _is.DateTimeJsonExtension.fromJson( + jsonSerialization['trackingSince'], + ), + accounts: jsonSerialization['accounts'] as int, + newAccounts: jsonSerialization['newAccounts'] as int, + activeToday: jsonSerialization['activeToday'] as int, + weekly: jsonSerialization['weekly'] as int, + monthly: jsonSerialization['monthly'] as int, + stickiness: (jsonSerialization['stickiness'] as num).toDouble(), + series: _il4umwa0.Protocol().deserialize>( + jsonSerialization['series'], + ), + itemTotals: _il4umwa0.Protocol() + .deserialize>( + jsonSerialization['itemTotals'], + ), + storageBytes: jsonSerialization['storageBytes'] as int, + signInMethods: _il4umwa0.Protocol() + .deserialize>( + jsonSerialization['signInMethods'], + ), + aiFeatures: _il4umwa0.Protocol() + .deserialize>( + jsonSerialization['aiFeatures'], + ), + aiModels: _il4umwa0.Protocol() + .deserialize>( + jsonSerialization['aiModels'], + ), + aiRetentionDays: jsonSerialization['aiRetentionDays'] as int, + sharedItems: jsonSerialization['sharedItems'] as int, + coEditedItems: jsonSerialization['coEditedItems'] as int, + commenters: jsonSerialization['commenters'] as int, + cohorts: _il4umwa0.Protocol() + .deserialize>( + jsonSerialization['cohorts'], + ), + ); + } + + /// Period length in days; [series] has one entry per day, oldest first, + /// ending today (UTC). + int days; + + bool includeAdmins; + + DateTime generatedAt; + + /// The first day with recorded activity (null: none yet). + DateTime? trackingSince; + + /// All accounts now, and those created in the period. + int accounts; + + int newAccounts; + + /// Distinct active users today, in the last 7 and the last 30 days. + int activeToday; + + int weekly; + + int monthly; + + /// The average daily active users of the last 30 days over [monthly] + /// (0–1). + double stickiness; + + List<_ii75e3xb.AnalyticsDay> series; + + /// Items now (not trashed) by kind: count and bytes. + List<_iucqk5df.AnalyticsCount> itemTotals; + + int storageBytes; + + /// Accounts by sign-in method (`email`, `google`, …); an account with + /// two methods counts for both. + List<_iucqk5df.AnalyticsCount> signInMethods; + + /// AI requests and tokens in the period by feature and by model. + List<_iucqk5df.AnalyticsCount> aiFeatures; + + List<_iucqk5df.AnalyticsCount> aiModels; + + /// How many days of AI usage the server keeps. + int aiRetentionDays; + + /// Items now shared with at least one other person. + int sharedItems; + + /// Items edited by two or more people in the period. + int coEditedItems; + + /// People who commented in the period. + int commenters; + + List<_i3uny1ae.AnalyticsCohort> cohorts; + + /// Returns a shallow copy of this [AnalyticsOverview] + /// with some or all fields replaced by the given arguments. + @_is.useResult + AnalyticsOverview copyWith({ + int? days, + bool? includeAdmins, + DateTime? generatedAt, + DateTime? trackingSince = const _is.$UndefinedDateTime(), + int? accounts, + int? newAccounts, + int? activeToday, + int? weekly, + int? monthly, + double? stickiness, + List<_ii75e3xb.AnalyticsDay>? series, + List<_iucqk5df.AnalyticsCount>? itemTotals, + int? storageBytes, + List<_iucqk5df.AnalyticsCount>? signInMethods, + List<_iucqk5df.AnalyticsCount>? aiFeatures, + List<_iucqk5df.AnalyticsCount>? aiModels, + int? aiRetentionDays, + int? sharedItems, + int? coEditedItems, + int? commenters, + List<_i3uny1ae.AnalyticsCohort>? cohorts, + }); + @override + Map toJson() { + return { + '__className__': 'AnalyticsOverview', + 'days': days, + 'includeAdmins': includeAdmins, + 'generatedAt': generatedAt.toJson(), + if (trackingSince != null) 'trackingSince': trackingSince?.toJson(), + 'accounts': accounts, + 'newAccounts': newAccounts, + 'activeToday': activeToday, + 'weekly': weekly, + 'monthly': monthly, + 'stickiness': stickiness, + 'series': series.toJson(valueToJson: (v) => v.toJson()), + 'itemTotals': itemTotals.toJson(valueToJson: (v) => v.toJson()), + 'storageBytes': storageBytes, + 'signInMethods': signInMethods.toJson(valueToJson: (v) => v.toJson()), + 'aiFeatures': aiFeatures.toJson(valueToJson: (v) => v.toJson()), + 'aiModels': aiModels.toJson(valueToJson: (v) => v.toJson()), + 'aiRetentionDays': aiRetentionDays, + 'sharedItems': sharedItems, + 'coEditedItems': coEditedItems, + 'commenters': commenters, + 'cohorts': cohorts.toJson(valueToJson: (v) => v.toJson()), + }; + } + + @override + Map toJsonForProtocol() { + return { + '__className__': 'AnalyticsOverview', + 'days': days, + 'includeAdmins': includeAdmins, + 'generatedAt': generatedAt.toJson(), + if (trackingSince != null) 'trackingSince': trackingSince?.toJson(), + 'accounts': accounts, + 'newAccounts': newAccounts, + 'activeToday': activeToday, + 'weekly': weekly, + 'monthly': monthly, + 'stickiness': stickiness, + 'series': series.toJson(valueToJson: (v) => v.toJsonForProtocol()), + 'itemTotals': itemTotals.toJson( + valueToJson: (v) => v.toJsonForProtocol(), + ), + 'storageBytes': storageBytes, + 'signInMethods': signInMethods.toJson( + valueToJson: (v) => v.toJsonForProtocol(), + ), + 'aiFeatures': aiFeatures.toJson( + valueToJson: (v) => v.toJsonForProtocol(), + ), + 'aiModels': aiModels.toJson(valueToJson: (v) => v.toJsonForProtocol()), + 'aiRetentionDays': aiRetentionDays, + 'sharedItems': sharedItems, + 'coEditedItems': coEditedItems, + 'commenters': commenters, + 'cohorts': cohorts.toJson(valueToJson: (v) => v.toJsonForProtocol()), + }; + } + + @override + String toString() { + return _is.SerializationManager.encode(this); + } +} + +class _AnalyticsOverviewImpl extends AnalyticsOverview { + _AnalyticsOverviewImpl({ + required int days, + required bool includeAdmins, + required DateTime generatedAt, + DateTime? trackingSince, + required int accounts, + required int newAccounts, + required int activeToday, + required int weekly, + required int monthly, + required double stickiness, + required List<_ii75e3xb.AnalyticsDay> series, + required List<_iucqk5df.AnalyticsCount> itemTotals, + required int storageBytes, + required List<_iucqk5df.AnalyticsCount> signInMethods, + required List<_iucqk5df.AnalyticsCount> aiFeatures, + required List<_iucqk5df.AnalyticsCount> aiModels, + required int aiRetentionDays, + required int sharedItems, + required int coEditedItems, + required int commenters, + required List<_i3uny1ae.AnalyticsCohort> cohorts, + }) : super._( + days: days, + includeAdmins: includeAdmins, + generatedAt: generatedAt, + trackingSince: trackingSince, + accounts: accounts, + newAccounts: newAccounts, + activeToday: activeToday, + weekly: weekly, + monthly: monthly, + stickiness: stickiness, + series: series, + itemTotals: itemTotals, + storageBytes: storageBytes, + signInMethods: signInMethods, + aiFeatures: aiFeatures, + aiModels: aiModels, + aiRetentionDays: aiRetentionDays, + sharedItems: sharedItems, + coEditedItems: coEditedItems, + commenters: commenters, + cohorts: cohorts, + ); + + /// Returns a shallow copy of this [AnalyticsOverview] + /// with some or all fields replaced by the given arguments. + @_is.useResult + @override + AnalyticsOverview copyWith({ + int? days, + bool? includeAdmins, + DateTime? generatedAt, + DateTime? trackingSince = const _is.$UndefinedDateTime(), + int? accounts, + int? newAccounts, + int? activeToday, + int? weekly, + int? monthly, + double? stickiness, + List<_ii75e3xb.AnalyticsDay>? series, + List<_iucqk5df.AnalyticsCount>? itemTotals, + int? storageBytes, + List<_iucqk5df.AnalyticsCount>? signInMethods, + List<_iucqk5df.AnalyticsCount>? aiFeatures, + List<_iucqk5df.AnalyticsCount>? aiModels, + int? aiRetentionDays, + int? sharedItems, + int? coEditedItems, + int? commenters, + List<_i3uny1ae.AnalyticsCohort>? cohorts, + }) { + return AnalyticsOverview( + days: days ?? this.days, + includeAdmins: includeAdmins ?? this.includeAdmins, + generatedAt: generatedAt ?? this.generatedAt, + trackingSince: trackingSince is _is.UndefinedSentinel + ? this.trackingSince + : trackingSince, + accounts: accounts ?? this.accounts, + newAccounts: newAccounts ?? this.newAccounts, + activeToday: activeToday ?? this.activeToday, + weekly: weekly ?? this.weekly, + monthly: monthly ?? this.monthly, + stickiness: stickiness ?? this.stickiness, + series: series ?? this.series.map((e0) => e0.copyWith()).toList(), + itemTotals: + itemTotals ?? this.itemTotals.map((e0) => e0.copyWith()).toList(), + storageBytes: storageBytes ?? this.storageBytes, + signInMethods: + signInMethods ?? + this.signInMethods.map((e0) => e0.copyWith()).toList(), + aiFeatures: + aiFeatures ?? this.aiFeatures.map((e0) => e0.copyWith()).toList(), + aiModels: aiModels ?? this.aiModels.map((e0) => e0.copyWith()).toList(), + aiRetentionDays: aiRetentionDays ?? this.aiRetentionDays, + sharedItems: sharedItems ?? this.sharedItems, + coEditedItems: coEditedItems ?? this.coEditedItems, + commenters: commenters ?? this.commenters, + cohorts: cohorts ?? this.cohorts.map((e0) => e0.copyWith()).toList(), + ); + } +} diff --git a/wonky_server/lib/src/generated/platform/analytics/models/usage_app.dart b/wonky_server/lib/src/generated/platform/analytics/models/usage_app.dart new file mode 100644 index 00000000..161586e6 --- /dev/null +++ b/wonky_server/lib/src/generated/platform/analytics/models/usage_app.dart @@ -0,0 +1,46 @@ +/* AUTOMATICALLY GENERATED CODE DO NOT MODIFY */ +/* To generate run: "serverpod generate" */ + +// ignore_for_file: implementation_imports +// ignore_for_file: library_private_types_in_public_api +// ignore_for_file: non_constant_identifier_names +// ignore_for_file: public_member_api_docs +// ignore_for_file: type_literal_in_constant_pattern +// ignore_for_file: use_super_parameters +// ignore_for_file: invalid_use_of_internal_member + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'package:serverpod/serverpod.dart' as _is; + +/// Where a user was active (usage analytics, specs/19 §2): one of the +/// apps, or an MCP client with a personal access token. +enum UsageApp implements _is.SerializableModel { + drive, + write, + sheets, + slides, + mcp; + + static UsageApp fromJson(String name) { + switch (name) { + case 'drive': + return UsageApp.drive; + case 'write': + return UsageApp.write; + case 'sheets': + return UsageApp.sheets; + case 'slides': + return UsageApp.slides; + case 'mcp': + return UsageApp.mcp; + default: + throw ArgumentError('Value "$name" cannot be converted to "UsageApp"'); + } + } + + @override + String toJson() => name; + + @override + String toString() => name; +} diff --git a/wonky_server/lib/src/generated/platform/analytics/models/usage_counter_day.dart b/wonky_server/lib/src/generated/platform/analytics/models/usage_counter_day.dart new file mode 100644 index 00000000..75e4e226 --- /dev/null +++ b/wonky_server/lib/src/generated/platform/analytics/models/usage_counter_day.dart @@ -0,0 +1,689 @@ +/* AUTOMATICALLY GENERATED CODE DO NOT MODIFY */ +/* To generate run: "serverpod generate" */ + +// ignore_for_file: implementation_imports +// ignore_for_file: library_private_types_in_public_api +// ignore_for_file: non_constant_identifier_names +// ignore_for_file: public_member_api_docs +// ignore_for_file: type_literal_in_constant_pattern +// ignore_for_file: use_super_parameters +// ignore_for_file: invalid_use_of_internal_member + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:async' as _ida; +import 'package:serverpod/serverpod.dart' as _is; + +/// A daily counter of the usage analytics (specs/19 §2), e.g. `mcp.calls`. +abstract class UsageCounterDay + implements _is.TableRow, _is.ProtocolSerialization { + UsageCounterDay._({ + this.id, + required this.day, + required this.name, + int? value, + }) : value = value ?? 0; + + factory UsageCounterDay({ + int? id, + required DateTime day, + required String name, + int? value, + }) = _UsageCounterDayImpl; + + factory UsageCounterDay.fromJson(Map jsonSerialization) { + return UsageCounterDay( + id: jsonSerialization['id'] as int?, + day: _is.DateTimeJsonExtension.fromJson(jsonSerialization['day']), + name: jsonSerialization['name'] as String, + value: jsonSerialization['value'] as int?, + ); + } + + static final t = UsageCounterDayTable(); + + static const db = UsageCounterDayRepository._(); + + @override + int? id; + + /// UTC midnight of the day. + DateTime day; + + String name; + + int value; + + @override + _is.Table get table => t; + + /// Returns a shallow copy of this [UsageCounterDay] + /// with some or all fields replaced by the given arguments. + @_is.useResult + UsageCounterDay copyWith({ + int? id, + DateTime? day, + String? name, + int? value, + }); + @override + Map toJson() { + return { + '__className__': 'UsageCounterDay', + if (id != null) 'id': id, + 'day': day.toJson(), + 'name': name, + 'value': value, + }; + } + + @override + Map toJsonForProtocol() { + return {}; + } + + static UsageCounterDayInclude include() { + return UsageCounterDayInclude._(); + } + + static UsageCounterDayIncludeList includeList({ + _is.WhereExpressionBuilder? where, + int? limit, + int? offset, + _is.OrderByBuilder? orderBy, + _is.OrderByListBuilder? orderByList, + UsageCounterDayInclude? include, + }) { + return UsageCounterDayIncludeList._( + where: where, + limit: limit, + offset: offset, + orderBy: orderBy?.call(UsageCounterDay.t), + orderByList: orderByList?.call(UsageCounterDay.t), + include: include, + ); + } + + @override + String toString() { + return _is.SerializationManager.encode(this); + } +} + +class _Undefined {} + +class _UsageCounterDayImpl extends UsageCounterDay { + _UsageCounterDayImpl({ + int? id, + required DateTime day, + required String name, + int? value, + }) : super._( + id: id, + day: day, + name: name, + value: value, + ); + + /// Returns a shallow copy of this [UsageCounterDay] + /// with some or all fields replaced by the given arguments. + @_is.useResult + @override + UsageCounterDay copyWith({ + Object? id = _Undefined, + DateTime? day, + String? name, + int? value, + }) { + return UsageCounterDay( + id: id is int? ? id : this.id, + day: day ?? this.day, + name: name ?? this.name, + value: value ?? this.value, + ); + } +} + +class UsageCounterDayUpdateTable extends _is.UpdateTable { + UsageCounterDayUpdateTable(super.table); + + _is.ColumnValue day(DateTime value) => _is.ColumnValue( + table.day, + value, + ); + + _is.ColumnValue name(String value) => _is.ColumnValue( + table.name, + value, + ); + + _is.ColumnValue value(int value) => _is.ColumnValue( + table.value, + value, + ); +} + +class UsageCounterDayTable extends _is.Table { + UsageCounterDayTable({super.tableRelation}) + : super(tableName: 'usage_counter_day') { + updateTable = UsageCounterDayUpdateTable(this); + day = _is.ColumnDateTime( + 'day', + this, + ); + name = _is.ColumnString( + 'name', + this, + ); + value = _is.ColumnInt( + 'value', + this, + hasDefault: true, + ); + } + + late final UsageCounterDayUpdateTable updateTable; + + /// UTC midnight of the day. + late final _is.ColumnDateTime day; + + late final _is.ColumnString name; + + late final _is.ColumnInt value; + + @override + List<_is.Column> get columns => [ + id, + day, + name, + value, + ]; +} + +class UsageCounterDayInclude extends _is.IncludeObject { + UsageCounterDayInclude._(); + + @override + Map get includes => {}; + + @override + _is.Table get table => UsageCounterDay.t; +} + +class UsageCounterDayIncludeList extends _is.IncludeList { + UsageCounterDayIncludeList._({ + _is.WhereExpressionBuilder? where, + super.limit, + super.offset, + super.orderBy, + super.orderByList, + super.include, + }) { + super.where = where?.call(UsageCounterDay.t); + } + + @override + Map get includes => include?.includes ?? {}; + + @override + _is.Table get table => UsageCounterDay.t; +} + +class UsageCounterDayRepository { + const UsageCounterDayRepository._(); + + /// Returns a list of [UsageCounterDay]s matching the given query parameters. + /// + /// Use [where] to specify which items to include in the return value. + /// If none is specified, all items will be returned. + /// + /// To specify the order of the items use [orderBy] or [orderByList] + /// when sorting by multiple columns. + /// + /// The maximum number of items can be set by [limit]. If no limit is set, + /// all items matching the query will be returned. + /// + /// [offset] defines how many items to skip, after which [limit] (or all) + /// items are read from the database. + /// + /// ```dart + /// var persons = await Persons.db.find( + /// session, + /// where: (t) => t.lastName.equals('Jones'), + /// orderBy: (t) => t.firstName, + /// limit: 100, + /// ); + /// ``` + Future> find( + _is.DatabaseSession session, { + _is.WhereExpressionBuilder? where, + int? limit, + int? offset, + _is.OrderByBuilder? orderBy, + _is.OrderByListBuilder? orderByList, + _is.Transaction? transaction, + _is.LockMode? lockMode, + _is.LockBehavior? lockBehavior, + }) async { + return session.db.find( + where: where?.call(UsageCounterDay.t), + orderBy: orderBy?.call(UsageCounterDay.t), + orderByList: orderByList?.call(UsageCounterDay.t), + limit: limit, + offset: offset, + transaction: transaction, + lockMode: lockMode, + lockBehavior: lockBehavior, + ); + } + + /// Emits [UsageCounterDay]s matching the given query parameters every time the + /// source tables are modified. + /// + /// Use [where] to specify which items to include in the return value. + /// If none is specified, all items will be returned. + /// + /// To specify the order of the items use [orderBy] or [orderByList] + /// when sorting by multiple columns. + /// + /// The maximum number of items can be set by [limit]. If no limit is set, + /// all items matching the query will be returned. + /// + /// [offset] defines how many items to skip, after which [limit] (or all) + /// items are read from the database. + /// + /// Use [throttle] to specify the minimum interval between queries. It can + /// also be set to `null`, in which case the stream will only be throttled + /// when its subscription is paused. + /// + /// Source tables are collected from the queried table, [where], [orderBy], + /// [orderByList], and the [include] graph. [alsoTriggerOnTables] is added + /// to that set. Pass [Table] instances such as `UsageCounterDay.t`. + /// + /// Raw [Expression] SQL is not inspected. Tables referenced only in raw + /// SQL must be passed via [alsoTriggerOnTables]. + /// + /// The stream always reads committed state and never joins an ambient + /// [Transaction]. Emissions for a write fire after that write commits. + /// + /// Currently only supported on SQLite. Calling this method on PostgreSQL + /// throws an [UnsupportedError]. + /// + /// ```dart + /// var subscription = Persons.db.watch( + /// session, + /// where: (t) => t.lastName.equals('Jones'), + /// orderBy: (t) => t.firstName, + /// limit: 100, + /// ).listen((persons) { + /// // Handle the latest matching rows. + /// }); + /// ``` + _ida.Stream> watch( + _is.DatabaseSession session, { + _is.WhereExpressionBuilder? where, + int? limit, + int? offset, + _is.OrderByBuilder? orderBy, + _is.OrderByListBuilder? orderByList, + Duration? throttle = const Duration(milliseconds: 30), + Iterable<_is.Table>? alsoTriggerOnTables, + }) { + return session.db.watch( + where: where?.call(UsageCounterDay.t), + orderBy: orderBy?.call(UsageCounterDay.t), + orderByList: orderByList?.call(UsageCounterDay.t), + limit: limit, + offset: offset, + throttle: throttle, + alsoTriggerOnTables: alsoTriggerOnTables, + ); + } + + /// Returns the first matching [UsageCounterDay] matching the given query parameters. + /// + /// Use [where] to specify which items to include in the return value. + /// If none is specified, all items will be returned. + /// + /// To specify the order use [orderBy] or [orderByList] + /// when sorting by multiple columns. + /// + /// [offset] defines how many items to skip, after which the next one will be picked. + /// + /// ```dart + /// var youngestPerson = await Persons.db.findFirstRow( + /// session, + /// where: (t) => t.lastName.equals('Jones'), + /// orderBy: (t) => t.age, + /// ); + /// ``` + Future findFirstRow( + _is.DatabaseSession session, { + _is.WhereExpressionBuilder? where, + int? offset, + _is.OrderByBuilder? orderBy, + _is.OrderByListBuilder? orderByList, + _is.Transaction? transaction, + _is.LockMode? lockMode, + _is.LockBehavior? lockBehavior, + }) async { + return session.db.findFirstRow( + where: where?.call(UsageCounterDay.t), + orderBy: orderBy?.call(UsageCounterDay.t), + orderByList: orderByList?.call(UsageCounterDay.t), + offset: offset, + transaction: transaction, + lockMode: lockMode, + lockBehavior: lockBehavior, + ); + } + + /// Finds a single [UsageCounterDay] by its [id] or null if no such row exists. + Future findById( + _is.DatabaseSession session, + int id, { + _is.Transaction? transaction, + _is.LockMode? lockMode, + _is.LockBehavior? lockBehavior, + }) async { + return session.db.findById( + id, + transaction: transaction, + lockMode: lockMode, + lockBehavior: lockBehavior, + ); + } + + /// Inserts all [UsageCounterDay]s in the list and returns the inserted rows. + /// + /// The returned [UsageCounterDay]s will have their `id` fields set. + /// + /// This is an atomic operation, meaning that if one of the rows fails to + /// insert, none of the rows will be inserted. + /// + /// If [ignoreConflicts] is set to `true`, rows that conflict with existing + /// rows are silently skipped, and only the successfully inserted rows are + /// returned. + /// + /// If [noReturn] is set to `true`, the inserted rows are not read back from + /// the database and an empty list is returned. This avoids the overhead of + /// transferring and deserializing the rows when the result is not needed. + Future> insert( + _is.DatabaseSession session, + List rows, { + _is.Transaction? transaction, + bool ignoreConflicts = false, + bool noReturn = false, + }) async { + return session.db.insert( + rows, + transaction: transaction, + ignoreConflicts: ignoreConflicts, + noReturn: noReturn, + ); + } + + /// Inserts a single [UsageCounterDay] and returns the inserted row. + /// + /// The returned [UsageCounterDay] will have its `id` field set. + Future insertRow( + _is.DatabaseSession session, + UsageCounterDay row, { + _is.Transaction? transaction, + }) async { + return session.db.insertRow( + row, + transaction: transaction, + ); + } + + /// Upserts all [UsageCounterDay]s in the list and returns the resulting rows. + /// + /// If a row conflicts on the given [conflictColumns], the existing row is + /// updated with the new values. Otherwise, a new row is inserted. + /// + /// If [updateColumns] is provided, only those columns will be updated on + /// conflict. If null, all non-conflict, non-id columns are updated. + /// + /// If [updateWhere] is provided, the update only applies to rows matching the + /// given expression. Conflicting rows that don't match are skipped and not + /// returned, so the resulting list may be shorter than [rows]. + /// + /// The returned [UsageCounterDay]s will have their `id` fields set. + /// + /// This is an atomic operation, meaning that if one of the rows fails, + /// none of the rows will be affected. + /// + /// If [noReturn] is set to `true`, the resulting rows are not read back from + /// the database and an empty list is returned. This avoids the overhead of + /// transferring and deserializing the rows when the result is not needed. + Future> upsert( + _is.DatabaseSession session, + List rows, { + required _is.ColumnSelections conflictColumns, + _is.ColumnSelections? updateColumns, + _is.WhereExpressionBuilder? updateWhere, + _is.Transaction? transaction, + bool noReturn = false, + }) async { + return session.db.upsert( + rows, + conflictColumns: conflictColumns(UsageCounterDay.t), + updateColumns: updateColumns?.call(UsageCounterDay.t), + updateWhere: updateWhere?.call(UsageCounterDay.t), + transaction: transaction, + noReturn: noReturn, + ); + } + + /// Upserts a single [UsageCounterDay] and returns the resulting row. + /// + /// If the row conflicts on the given [conflictColumns], the existing row is + /// updated. Otherwise, a new row is inserted. + /// + /// If [updateColumns] is provided, only those columns will be updated on + /// conflict. If null, all non-conflict, non-id columns are updated. + /// + /// If [updateWhere] is provided, the update only applies when the existing + /// row matches the expression. Returns `null` if no row was affected — for + /// example when [updateWhere] does not match the conflicting row. + /// + /// The returned [UsageCounterDay] will have its `id` field set. + Future upsertRow( + _is.DatabaseSession session, + UsageCounterDay row, { + required _is.ColumnSelections conflictColumns, + _is.ColumnSelections? updateColumns, + _is.WhereExpressionBuilder? updateWhere, + _is.Transaction? transaction, + }) async { + return session.db.upsertRow( + row, + conflictColumns: conflictColumns(UsageCounterDay.t), + updateColumns: updateColumns?.call(UsageCounterDay.t), + updateWhere: updateWhere?.call(UsageCounterDay.t), + transaction: transaction, + ); + } + + /// Updates all [UsageCounterDay]s in the list and returns the updated rows. If + /// [columns] is provided, only those columns will be updated. Defaults to + /// all columns. + /// This is an atomic operation, meaning that if one of the rows fails to + /// update, none of the rows will be updated. + /// + /// If [noReturn] is set to `true`, the updated rows are not read back from + /// the database and an empty list is returned. This avoids the overhead of + /// transferring and deserializing the rows when the result is not needed. + Future> update( + _is.DatabaseSession session, + List rows, { + _is.ColumnSelections? columns, + _is.Transaction? transaction, + bool noReturn = false, + }) async { + return session.db.update( + rows, + columns: columns?.call(UsageCounterDay.t), + transaction: transaction, + noReturn: noReturn, + ); + } + + /// Updates a single [UsageCounterDay]. The row needs to have its id set. + /// Optionally, a list of [columns] can be provided to only update those + /// columns. Defaults to all columns. + Future updateRow( + _is.DatabaseSession session, + UsageCounterDay row, { + _is.ColumnSelections? columns, + _is.Transaction? transaction, + }) async { + return session.db.updateRow( + row, + columns: columns?.call(UsageCounterDay.t), + transaction: transaction, + ); + } + + /// Updates a single [UsageCounterDay] by its [id] with the specified [columnValues]. + /// Returns the updated row or null if no row with the given id exists. + Future updateById( + _is.DatabaseSession session, + int id, { + required _is.ColumnValueListBuilder + columnValues, + _is.Transaction? transaction, + }) async { + return session.db.updateById( + id, + columnValues: columnValues(UsageCounterDay.t.updateTable), + transaction: transaction, + ); + } + + /// Updates all [UsageCounterDay]s matching the [where] expression with the specified [columnValues]. + /// Returns the list of updated rows. + /// + /// If [noReturn] is set to `true`, the updated rows are not read back from + /// the database and an empty list is returned. This avoids the overhead of + /// transferring and deserializing the rows when the result is not needed. + Future> updateWhere( + _is.DatabaseSession session, { + required _is.ColumnValueListBuilder + columnValues, + required _is.WhereExpressionBuilder where, + int? limit, + int? offset, + _is.OrderByBuilder? orderBy, + _is.OrderByListBuilder? orderByList, + _is.Transaction? transaction, + bool noReturn = false, + }) async { + return session.db.updateWhere( + columnValues: columnValues(UsageCounterDay.t.updateTable), + where: where(UsageCounterDay.t), + limit: limit, + offset: offset, + orderBy: orderBy?.call(UsageCounterDay.t), + orderByList: orderByList?.call(UsageCounterDay.t), + transaction: transaction, + noReturn: noReturn, + ); + } + + /// Deletes all [UsageCounterDay]s in the list and returns the deleted rows. + /// + /// To specify the order of the returned rows use [orderBy] or [orderByList] + /// when sorting by multiple columns. + /// + /// This is an atomic operation, meaning that if one of the rows fail to + /// be deleted, none of the rows will be deleted. + /// + /// If [noReturn] is set to `true`, the deleted rows are not read back from + /// the database and an empty list is returned. This avoids the overhead of + /// transferring and deserializing the rows when the result is not needed. + Future> delete( + _is.DatabaseSession session, + List rows, { + _is.OrderByBuilder? orderBy, + _is.OrderByListBuilder? orderByList, + _is.Transaction? transaction, + bool noReturn = false, + }) async { + return session.db.delete( + rows, + orderBy: orderBy?.call(UsageCounterDay.t), + orderByList: orderByList?.call(UsageCounterDay.t), + transaction: transaction, + noReturn: noReturn, + ); + } + + /// Deletes a single [UsageCounterDay]. + Future deleteRow( + _is.DatabaseSession session, + UsageCounterDay row, { + _is.Transaction? transaction, + }) async { + return session.db.deleteRow( + row, + transaction: transaction, + ); + } + + /// Deletes all rows matching the [where] expression. + /// + /// To specify the order of the returned rows use [orderBy] or [orderByList] + /// when sorting by multiple columns. + /// + /// If [noReturn] is set to `true`, the deleted rows are not read back from + /// the database and an empty list is returned. This avoids the overhead of + /// transferring and deserializing the rows when the result is not needed. + Future> deleteWhere( + _is.DatabaseSession session, { + required _is.WhereExpressionBuilder where, + _is.OrderByBuilder? orderBy, + _is.OrderByListBuilder? orderByList, + _is.Transaction? transaction, + bool noReturn = false, + }) async { + return session.db.deleteWhere( + where: where(UsageCounterDay.t), + orderBy: orderBy?.call(UsageCounterDay.t), + orderByList: orderByList?.call(UsageCounterDay.t), + transaction: transaction, + noReturn: noReturn, + ); + } + + /// Counts the number of rows matching the [where] expression. If omitted, + /// will return the count of all rows in the table. + Future count( + _is.DatabaseSession session, { + _is.WhereExpressionBuilder? where, + int? limit, + _is.Transaction? transaction, + }) async { + return session.db.count( + where: where?.call(UsageCounterDay.t), + limit: limit, + transaction: transaction, + ); + } + + /// Acquires row-level locks on [UsageCounterDay] rows matching the [where] expression. + Future lockRows( + _is.DatabaseSession session, { + required _is.WhereExpressionBuilder where, + required _is.LockMode lockMode, + required _is.Transaction transaction, + _is.LockBehavior lockBehavior = _is.LockBehavior.wait, + }) async { + return session.db.lockRows( + where: where(UsageCounterDay.t), + lockMode: lockMode, + lockBehavior: lockBehavior, + transaction: transaction, + ); + } +} diff --git a/wonky_server/lib/src/generated/platform/analytics/models/usage_day_stats.dart b/wonky_server/lib/src/generated/platform/analytics/models/usage_day_stats.dart new file mode 100644 index 00000000..a77560e2 --- /dev/null +++ b/wonky_server/lib/src/generated/platform/analytics/models/usage_day_stats.dart @@ -0,0 +1,904 @@ +/* AUTOMATICALLY GENERATED CODE DO NOT MODIFY */ +/* To generate run: "serverpod generate" */ + +// ignore_for_file: implementation_imports +// ignore_for_file: library_private_types_in_public_api +// ignore_for_file: non_constant_identifier_names +// ignore_for_file: public_member_api_docs +// ignore_for_file: type_literal_in_constant_pattern +// ignore_for_file: use_super_parameters +// ignore_for_file: invalid_use_of_internal_member + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:async' as _ida; +import 'package:serverpod/serverpod.dart' as _is; + +/// The activity of one finished UTC day (usage analytics, specs/19 §2.1): +/// computed once by the overview, then read. A finished day never changes, +/// because activity is only written for the current day. One row with and +/// one without admins (the admin rule of the time it was computed). Kept +/// after `user_activity_day` is purged. +abstract class UsageDayStats + implements _is.TableRow, _is.ProtocolSerialization { + UsageDayStats._({ + this.id, + required this.day, + required this.includeAdmins, + required this.active, + required this.editors, + required this.drive, + required this.write, + required this.sheets, + required this.slides, + required this.mcp, + required this.weekly, + required this.monthly, + required this.computedAt, + }); + + factory UsageDayStats({ + int? id, + required DateTime day, + required bool includeAdmins, + required int active, + required int editors, + required int drive, + required int write, + required int sheets, + required int slides, + required int mcp, + required int weekly, + required int monthly, + required DateTime computedAt, + }) = _UsageDayStatsImpl; + + factory UsageDayStats.fromJson(Map jsonSerialization) { + return UsageDayStats( + id: jsonSerialization['id'] as int?, + day: _is.DateTimeJsonExtension.fromJson(jsonSerialization['day']), + includeAdmins: _is.BoolJsonExtension.fromJson( + jsonSerialization['includeAdmins'], + ), + active: jsonSerialization['active'] as int, + editors: jsonSerialization['editors'] as int, + drive: jsonSerialization['drive'] as int, + write: jsonSerialization['write'] as int, + sheets: jsonSerialization['sheets'] as int, + slides: jsonSerialization['slides'] as int, + mcp: jsonSerialization['mcp'] as int, + weekly: jsonSerialization['weekly'] as int, + monthly: jsonSerialization['monthly'] as int, + computedAt: _is.DateTimeJsonExtension.fromJson( + jsonSerialization['computedAt'], + ), + ); + } + + static final t = UsageDayStatsTable(); + + static const db = UsageDayStatsRepository._(); + + @override + int? id; + + /// UTC midnight of the day. + DateTime day; + + bool includeAdmins; + + int active; + + int editors; + + int drive; + + int write; + + int sheets; + + int slides; + + int mcp; + + /// Distinct users in the 7 and the 30 days ending with [day]. + int weekly; + + int monthly; + + DateTime computedAt; + + @override + _is.Table get table => t; + + /// Returns a shallow copy of this [UsageDayStats] + /// with some or all fields replaced by the given arguments. + @_is.useResult + UsageDayStats copyWith({ + int? id, + DateTime? day, + bool? includeAdmins, + int? active, + int? editors, + int? drive, + int? write, + int? sheets, + int? slides, + int? mcp, + int? weekly, + int? monthly, + DateTime? computedAt, + }); + @override + Map toJson() { + return { + '__className__': 'UsageDayStats', + if (id != null) 'id': id, + 'day': day.toJson(), + 'includeAdmins': includeAdmins, + 'active': active, + 'editors': editors, + 'drive': drive, + 'write': write, + 'sheets': sheets, + 'slides': slides, + 'mcp': mcp, + 'weekly': weekly, + 'monthly': monthly, + 'computedAt': computedAt.toJson(), + }; + } + + @override + Map toJsonForProtocol() { + return {}; + } + + static UsageDayStatsInclude include() { + return UsageDayStatsInclude._(); + } + + static UsageDayStatsIncludeList includeList({ + _is.WhereExpressionBuilder? where, + int? limit, + int? offset, + _is.OrderByBuilder? orderBy, + _is.OrderByListBuilder? orderByList, + UsageDayStatsInclude? include, + }) { + return UsageDayStatsIncludeList._( + where: where, + limit: limit, + offset: offset, + orderBy: orderBy?.call(UsageDayStats.t), + orderByList: orderByList?.call(UsageDayStats.t), + include: include, + ); + } + + @override + String toString() { + return _is.SerializationManager.encode(this); + } +} + +class _Undefined {} + +class _UsageDayStatsImpl extends UsageDayStats { + _UsageDayStatsImpl({ + int? id, + required DateTime day, + required bool includeAdmins, + required int active, + required int editors, + required int drive, + required int write, + required int sheets, + required int slides, + required int mcp, + required int weekly, + required int monthly, + required DateTime computedAt, + }) : super._( + id: id, + day: day, + includeAdmins: includeAdmins, + active: active, + editors: editors, + drive: drive, + write: write, + sheets: sheets, + slides: slides, + mcp: mcp, + weekly: weekly, + monthly: monthly, + computedAt: computedAt, + ); + + /// Returns a shallow copy of this [UsageDayStats] + /// with some or all fields replaced by the given arguments. + @_is.useResult + @override + UsageDayStats copyWith({ + Object? id = _Undefined, + DateTime? day, + bool? includeAdmins, + int? active, + int? editors, + int? drive, + int? write, + int? sheets, + int? slides, + int? mcp, + int? weekly, + int? monthly, + DateTime? computedAt, + }) { + return UsageDayStats( + id: id is int? ? id : this.id, + day: day ?? this.day, + includeAdmins: includeAdmins ?? this.includeAdmins, + active: active ?? this.active, + editors: editors ?? this.editors, + drive: drive ?? this.drive, + write: write ?? this.write, + sheets: sheets ?? this.sheets, + slides: slides ?? this.slides, + mcp: mcp ?? this.mcp, + weekly: weekly ?? this.weekly, + monthly: monthly ?? this.monthly, + computedAt: computedAt ?? this.computedAt, + ); + } +} + +class UsageDayStatsUpdateTable extends _is.UpdateTable { + UsageDayStatsUpdateTable(super.table); + + _is.ColumnValue day(DateTime value) => _is.ColumnValue( + table.day, + value, + ); + + _is.ColumnValue includeAdmins(bool value) => _is.ColumnValue( + table.includeAdmins, + value, + ); + + _is.ColumnValue active(int value) => _is.ColumnValue( + table.active, + value, + ); + + _is.ColumnValue editors(int value) => _is.ColumnValue( + table.editors, + value, + ); + + _is.ColumnValue drive(int value) => _is.ColumnValue( + table.drive, + value, + ); + + _is.ColumnValue write(int value) => _is.ColumnValue( + table.write, + value, + ); + + _is.ColumnValue sheets(int value) => _is.ColumnValue( + table.sheets, + value, + ); + + _is.ColumnValue slides(int value) => _is.ColumnValue( + table.slides, + value, + ); + + _is.ColumnValue mcp(int value) => _is.ColumnValue( + table.mcp, + value, + ); + + _is.ColumnValue weekly(int value) => _is.ColumnValue( + table.weekly, + value, + ); + + _is.ColumnValue monthly(int value) => _is.ColumnValue( + table.monthly, + value, + ); + + _is.ColumnValue computedAt(DateTime value) => + _is.ColumnValue( + table.computedAt, + value, + ); +} + +class UsageDayStatsTable extends _is.Table { + UsageDayStatsTable({super.tableRelation}) + : super(tableName: 'usage_day_stats') { + updateTable = UsageDayStatsUpdateTable(this); + day = _is.ColumnDateTime( + 'day', + this, + ); + includeAdmins = _is.ColumnBool( + 'includeAdmins', + this, + ); + active = _is.ColumnInt( + 'active', + this, + ); + editors = _is.ColumnInt( + 'editors', + this, + ); + drive = _is.ColumnInt( + 'drive', + this, + ); + write = _is.ColumnInt( + 'write', + this, + ); + sheets = _is.ColumnInt( + 'sheets', + this, + ); + slides = _is.ColumnInt( + 'slides', + this, + ); + mcp = _is.ColumnInt( + 'mcp', + this, + ); + weekly = _is.ColumnInt( + 'weekly', + this, + ); + monthly = _is.ColumnInt( + 'monthly', + this, + ); + computedAt = _is.ColumnDateTime( + 'computedAt', + this, + ); + } + + late final UsageDayStatsUpdateTable updateTable; + + /// UTC midnight of the day. + late final _is.ColumnDateTime day; + + late final _is.ColumnBool includeAdmins; + + late final _is.ColumnInt active; + + late final _is.ColumnInt editors; + + late final _is.ColumnInt drive; + + late final _is.ColumnInt write; + + late final _is.ColumnInt sheets; + + late final _is.ColumnInt slides; + + late final _is.ColumnInt mcp; + + /// Distinct users in the 7 and the 30 days ending with [day]. + late final _is.ColumnInt weekly; + + late final _is.ColumnInt monthly; + + late final _is.ColumnDateTime computedAt; + + @override + List<_is.Column> get columns => [ + id, + day, + includeAdmins, + active, + editors, + drive, + write, + sheets, + slides, + mcp, + weekly, + monthly, + computedAt, + ]; +} + +class UsageDayStatsInclude extends _is.IncludeObject { + UsageDayStatsInclude._(); + + @override + Map get includes => {}; + + @override + _is.Table get table => UsageDayStats.t; +} + +class UsageDayStatsIncludeList extends _is.IncludeList { + UsageDayStatsIncludeList._({ + _is.WhereExpressionBuilder? where, + super.limit, + super.offset, + super.orderBy, + super.orderByList, + super.include, + }) { + super.where = where?.call(UsageDayStats.t); + } + + @override + Map get includes => include?.includes ?? {}; + + @override + _is.Table get table => UsageDayStats.t; +} + +class UsageDayStatsRepository { + const UsageDayStatsRepository._(); + + /// Returns a list of [UsageDayStats]s matching the given query parameters. + /// + /// Use [where] to specify which items to include in the return value. + /// If none is specified, all items will be returned. + /// + /// To specify the order of the items use [orderBy] or [orderByList] + /// when sorting by multiple columns. + /// + /// The maximum number of items can be set by [limit]. If no limit is set, + /// all items matching the query will be returned. + /// + /// [offset] defines how many items to skip, after which [limit] (or all) + /// items are read from the database. + /// + /// ```dart + /// var persons = await Persons.db.find( + /// session, + /// where: (t) => t.lastName.equals('Jones'), + /// orderBy: (t) => t.firstName, + /// limit: 100, + /// ); + /// ``` + Future> find( + _is.DatabaseSession session, { + _is.WhereExpressionBuilder? where, + int? limit, + int? offset, + _is.OrderByBuilder? orderBy, + _is.OrderByListBuilder? orderByList, + _is.Transaction? transaction, + _is.LockMode? lockMode, + _is.LockBehavior? lockBehavior, + }) async { + return session.db.find( + where: where?.call(UsageDayStats.t), + orderBy: orderBy?.call(UsageDayStats.t), + orderByList: orderByList?.call(UsageDayStats.t), + limit: limit, + offset: offset, + transaction: transaction, + lockMode: lockMode, + lockBehavior: lockBehavior, + ); + } + + /// Emits [UsageDayStats]s matching the given query parameters every time the + /// source tables are modified. + /// + /// Use [where] to specify which items to include in the return value. + /// If none is specified, all items will be returned. + /// + /// To specify the order of the items use [orderBy] or [orderByList] + /// when sorting by multiple columns. + /// + /// The maximum number of items can be set by [limit]. If no limit is set, + /// all items matching the query will be returned. + /// + /// [offset] defines how many items to skip, after which [limit] (or all) + /// items are read from the database. + /// + /// Use [throttle] to specify the minimum interval between queries. It can + /// also be set to `null`, in which case the stream will only be throttled + /// when its subscription is paused. + /// + /// Source tables are collected from the queried table, [where], [orderBy], + /// [orderByList], and the [include] graph. [alsoTriggerOnTables] is added + /// to that set. Pass [Table] instances such as `UsageDayStats.t`. + /// + /// Raw [Expression] SQL is not inspected. Tables referenced only in raw + /// SQL must be passed via [alsoTriggerOnTables]. + /// + /// The stream always reads committed state and never joins an ambient + /// [Transaction]. Emissions for a write fire after that write commits. + /// + /// Currently only supported on SQLite. Calling this method on PostgreSQL + /// throws an [UnsupportedError]. + /// + /// ```dart + /// var subscription = Persons.db.watch( + /// session, + /// where: (t) => t.lastName.equals('Jones'), + /// orderBy: (t) => t.firstName, + /// limit: 100, + /// ).listen((persons) { + /// // Handle the latest matching rows. + /// }); + /// ``` + _ida.Stream> watch( + _is.DatabaseSession session, { + _is.WhereExpressionBuilder? where, + int? limit, + int? offset, + _is.OrderByBuilder? orderBy, + _is.OrderByListBuilder? orderByList, + Duration? throttle = const Duration(milliseconds: 30), + Iterable<_is.Table>? alsoTriggerOnTables, + }) { + return session.db.watch( + where: where?.call(UsageDayStats.t), + orderBy: orderBy?.call(UsageDayStats.t), + orderByList: orderByList?.call(UsageDayStats.t), + limit: limit, + offset: offset, + throttle: throttle, + alsoTriggerOnTables: alsoTriggerOnTables, + ); + } + + /// Returns the first matching [UsageDayStats] matching the given query parameters. + /// + /// Use [where] to specify which items to include in the return value. + /// If none is specified, all items will be returned. + /// + /// To specify the order use [orderBy] or [orderByList] + /// when sorting by multiple columns. + /// + /// [offset] defines how many items to skip, after which the next one will be picked. + /// + /// ```dart + /// var youngestPerson = await Persons.db.findFirstRow( + /// session, + /// where: (t) => t.lastName.equals('Jones'), + /// orderBy: (t) => t.age, + /// ); + /// ``` + Future findFirstRow( + _is.DatabaseSession session, { + _is.WhereExpressionBuilder? where, + int? offset, + _is.OrderByBuilder? orderBy, + _is.OrderByListBuilder? orderByList, + _is.Transaction? transaction, + _is.LockMode? lockMode, + _is.LockBehavior? lockBehavior, + }) async { + return session.db.findFirstRow( + where: where?.call(UsageDayStats.t), + orderBy: orderBy?.call(UsageDayStats.t), + orderByList: orderByList?.call(UsageDayStats.t), + offset: offset, + transaction: transaction, + lockMode: lockMode, + lockBehavior: lockBehavior, + ); + } + + /// Finds a single [UsageDayStats] by its [id] or null if no such row exists. + Future findById( + _is.DatabaseSession session, + int id, { + _is.Transaction? transaction, + _is.LockMode? lockMode, + _is.LockBehavior? lockBehavior, + }) async { + return session.db.findById( + id, + transaction: transaction, + lockMode: lockMode, + lockBehavior: lockBehavior, + ); + } + + /// Inserts all [UsageDayStats]s in the list and returns the inserted rows. + /// + /// The returned [UsageDayStats]s will have their `id` fields set. + /// + /// This is an atomic operation, meaning that if one of the rows fails to + /// insert, none of the rows will be inserted. + /// + /// If [ignoreConflicts] is set to `true`, rows that conflict with existing + /// rows are silently skipped, and only the successfully inserted rows are + /// returned. + /// + /// If [noReturn] is set to `true`, the inserted rows are not read back from + /// the database and an empty list is returned. This avoids the overhead of + /// transferring and deserializing the rows when the result is not needed. + Future> insert( + _is.DatabaseSession session, + List rows, { + _is.Transaction? transaction, + bool ignoreConflicts = false, + bool noReturn = false, + }) async { + return session.db.insert( + rows, + transaction: transaction, + ignoreConflicts: ignoreConflicts, + noReturn: noReturn, + ); + } + + /// Inserts a single [UsageDayStats] and returns the inserted row. + /// + /// The returned [UsageDayStats] will have its `id` field set. + Future insertRow( + _is.DatabaseSession session, + UsageDayStats row, { + _is.Transaction? transaction, + }) async { + return session.db.insertRow( + row, + transaction: transaction, + ); + } + + /// Upserts all [UsageDayStats]s in the list and returns the resulting rows. + /// + /// If a row conflicts on the given [conflictColumns], the existing row is + /// updated with the new values. Otherwise, a new row is inserted. + /// + /// If [updateColumns] is provided, only those columns will be updated on + /// conflict. If null, all non-conflict, non-id columns are updated. + /// + /// If [updateWhere] is provided, the update only applies to rows matching the + /// given expression. Conflicting rows that don't match are skipped and not + /// returned, so the resulting list may be shorter than [rows]. + /// + /// The returned [UsageDayStats]s will have their `id` fields set. + /// + /// This is an atomic operation, meaning that if one of the rows fails, + /// none of the rows will be affected. + /// + /// If [noReturn] is set to `true`, the resulting rows are not read back from + /// the database and an empty list is returned. This avoids the overhead of + /// transferring and deserializing the rows when the result is not needed. + Future> upsert( + _is.DatabaseSession session, + List rows, { + required _is.ColumnSelections conflictColumns, + _is.ColumnSelections? updateColumns, + _is.WhereExpressionBuilder? updateWhere, + _is.Transaction? transaction, + bool noReturn = false, + }) async { + return session.db.upsert( + rows, + conflictColumns: conflictColumns(UsageDayStats.t), + updateColumns: updateColumns?.call(UsageDayStats.t), + updateWhere: updateWhere?.call(UsageDayStats.t), + transaction: transaction, + noReturn: noReturn, + ); + } + + /// Upserts a single [UsageDayStats] and returns the resulting row. + /// + /// If the row conflicts on the given [conflictColumns], the existing row is + /// updated. Otherwise, a new row is inserted. + /// + /// If [updateColumns] is provided, only those columns will be updated on + /// conflict. If null, all non-conflict, non-id columns are updated. + /// + /// If [updateWhere] is provided, the update only applies when the existing + /// row matches the expression. Returns `null` if no row was affected — for + /// example when [updateWhere] does not match the conflicting row. + /// + /// The returned [UsageDayStats] will have its `id` field set. + Future upsertRow( + _is.DatabaseSession session, + UsageDayStats row, { + required _is.ColumnSelections conflictColumns, + _is.ColumnSelections? updateColumns, + _is.WhereExpressionBuilder? updateWhere, + _is.Transaction? transaction, + }) async { + return session.db.upsertRow( + row, + conflictColumns: conflictColumns(UsageDayStats.t), + updateColumns: updateColumns?.call(UsageDayStats.t), + updateWhere: updateWhere?.call(UsageDayStats.t), + transaction: transaction, + ); + } + + /// Updates all [UsageDayStats]s in the list and returns the updated rows. If + /// [columns] is provided, only those columns will be updated. Defaults to + /// all columns. + /// This is an atomic operation, meaning that if one of the rows fails to + /// update, none of the rows will be updated. + /// + /// If [noReturn] is set to `true`, the updated rows are not read back from + /// the database and an empty list is returned. This avoids the overhead of + /// transferring and deserializing the rows when the result is not needed. + Future> update( + _is.DatabaseSession session, + List rows, { + _is.ColumnSelections? columns, + _is.Transaction? transaction, + bool noReturn = false, + }) async { + return session.db.update( + rows, + columns: columns?.call(UsageDayStats.t), + transaction: transaction, + noReturn: noReturn, + ); + } + + /// Updates a single [UsageDayStats]. The row needs to have its id set. + /// Optionally, a list of [columns] can be provided to only update those + /// columns. Defaults to all columns. + Future updateRow( + _is.DatabaseSession session, + UsageDayStats row, { + _is.ColumnSelections? columns, + _is.Transaction? transaction, + }) async { + return session.db.updateRow( + row, + columns: columns?.call(UsageDayStats.t), + transaction: transaction, + ); + } + + /// Updates a single [UsageDayStats] by its [id] with the specified [columnValues]. + /// Returns the updated row or null if no row with the given id exists. + Future updateById( + _is.DatabaseSession session, + int id, { + required _is.ColumnValueListBuilder columnValues, + _is.Transaction? transaction, + }) async { + return session.db.updateById( + id, + columnValues: columnValues(UsageDayStats.t.updateTable), + transaction: transaction, + ); + } + + /// Updates all [UsageDayStats]s matching the [where] expression with the specified [columnValues]. + /// Returns the list of updated rows. + /// + /// If [noReturn] is set to `true`, the updated rows are not read back from + /// the database and an empty list is returned. This avoids the overhead of + /// transferring and deserializing the rows when the result is not needed. + Future> updateWhere( + _is.DatabaseSession session, { + required _is.ColumnValueListBuilder columnValues, + required _is.WhereExpressionBuilder where, + int? limit, + int? offset, + _is.OrderByBuilder? orderBy, + _is.OrderByListBuilder? orderByList, + _is.Transaction? transaction, + bool noReturn = false, + }) async { + return session.db.updateWhere( + columnValues: columnValues(UsageDayStats.t.updateTable), + where: where(UsageDayStats.t), + limit: limit, + offset: offset, + orderBy: orderBy?.call(UsageDayStats.t), + orderByList: orderByList?.call(UsageDayStats.t), + transaction: transaction, + noReturn: noReturn, + ); + } + + /// Deletes all [UsageDayStats]s in the list and returns the deleted rows. + /// + /// To specify the order of the returned rows use [orderBy] or [orderByList] + /// when sorting by multiple columns. + /// + /// This is an atomic operation, meaning that if one of the rows fail to + /// be deleted, none of the rows will be deleted. + /// + /// If [noReturn] is set to `true`, the deleted rows are not read back from + /// the database and an empty list is returned. This avoids the overhead of + /// transferring and deserializing the rows when the result is not needed. + Future> delete( + _is.DatabaseSession session, + List rows, { + _is.OrderByBuilder? orderBy, + _is.OrderByListBuilder? orderByList, + _is.Transaction? transaction, + bool noReturn = false, + }) async { + return session.db.delete( + rows, + orderBy: orderBy?.call(UsageDayStats.t), + orderByList: orderByList?.call(UsageDayStats.t), + transaction: transaction, + noReturn: noReturn, + ); + } + + /// Deletes a single [UsageDayStats]. + Future deleteRow( + _is.DatabaseSession session, + UsageDayStats row, { + _is.Transaction? transaction, + }) async { + return session.db.deleteRow( + row, + transaction: transaction, + ); + } + + /// Deletes all rows matching the [where] expression. + /// + /// To specify the order of the returned rows use [orderBy] or [orderByList] + /// when sorting by multiple columns. + /// + /// If [noReturn] is set to `true`, the deleted rows are not read back from + /// the database and an empty list is returned. This avoids the overhead of + /// transferring and deserializing the rows when the result is not needed. + Future> deleteWhere( + _is.DatabaseSession session, { + required _is.WhereExpressionBuilder where, + _is.OrderByBuilder? orderBy, + _is.OrderByListBuilder? orderByList, + _is.Transaction? transaction, + bool noReturn = false, + }) async { + return session.db.deleteWhere( + where: where(UsageDayStats.t), + orderBy: orderBy?.call(UsageDayStats.t), + orderByList: orderByList?.call(UsageDayStats.t), + transaction: transaction, + noReturn: noReturn, + ); + } + + /// Counts the number of rows matching the [where] expression. If omitted, + /// will return the count of all rows in the table. + Future count( + _is.DatabaseSession session, { + _is.WhereExpressionBuilder? where, + int? limit, + _is.Transaction? transaction, + }) async { + return session.db.count( + where: where?.call(UsageDayStats.t), + limit: limit, + transaction: transaction, + ); + } + + /// Acquires row-level locks on [UsageDayStats] rows matching the [where] expression. + Future lockRows( + _is.DatabaseSession session, { + required _is.WhereExpressionBuilder where, + required _is.LockMode lockMode, + required _is.Transaction transaction, + _is.LockBehavior lockBehavior = _is.LockBehavior.wait, + }) async { + return session.db.lockRows( + where: where(UsageDayStats.t), + lockMode: lockMode, + lockBehavior: lockBehavior, + transaction: transaction, + ); + } +} diff --git a/wonky_server/lib/src/generated/platform/analytics/models/user_activity_day.dart b/wonky_server/lib/src/generated/platform/analytics/models/user_activity_day.dart new file mode 100644 index 00000000..8ac69088 --- /dev/null +++ b/wonky_server/lib/src/generated/platform/analytics/models/user_activity_day.dart @@ -0,0 +1,726 @@ +/* AUTOMATICALLY GENERATED CODE DO NOT MODIFY */ +/* To generate run: "serverpod generate" */ + +// ignore_for_file: implementation_imports +// ignore_for_file: library_private_types_in_public_api +// ignore_for_file: non_constant_identifier_names +// ignore_for_file: public_member_api_docs +// ignore_for_file: type_literal_in_constant_pattern +// ignore_for_file: use_super_parameters +// ignore_for_file: invalid_use_of_internal_member + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:async' as _ida; +import 'package:serverpod/serverpod.dart' as _is; +import '../../../platform/analytics/models/usage_app.dart' as _iwb3843v; + +/// A user was active in [app] on a UTC day (usage analytics, specs/19 §2). +/// One row per user, day and app; written at most once per instance and +/// key (`UsageTracker`), kept 400 days (`analytics.purgeActivity`). +/// +/// [userId] has no foreign key on purpose: rows are written beside +/// transactions that may lock the profile, and the counts of past days stay +/// put when an account is deleted (its rows keep only the bare id). +abstract class UserActivityDay + implements _is.TableRow, _is.ProtocolSerialization { + UserActivityDay._({ + this.id, + required this.userId, + required this.day, + required this.app, + bool? edited, + }) : edited = edited ?? false; + + factory UserActivityDay({ + int? id, + required int userId, + required DateTime day, + required _iwb3843v.UsageApp app, + bool? edited, + }) = _UserActivityDayImpl; + + factory UserActivityDay.fromJson(Map jsonSerialization) { + return UserActivityDay( + id: jsonSerialization['id'] as int?, + userId: jsonSerialization['userId'] as int, + day: _is.DateTimeJsonExtension.fromJson(jsonSerialization['day']), + app: _iwb3843v.UsageApp.fromJson((jsonSerialization['app'] as String)), + edited: jsonSerialization['edited'] == null + ? null + : _is.BoolJsonExtension.fromJson(jsonSerialization['edited']), + ); + } + + static final t = UserActivityDayTable(); + + static const db = UserActivityDayRepository._(); + + @override + int? id; + + int userId; + + /// UTC midnight of the day. + DateTime day; + + _iwb3843v.UsageApp app; + + /// Whether the user also created or edited something that day. + bool edited; + + @override + _is.Table get table => t; + + /// Returns a shallow copy of this [UserActivityDay] + /// with some or all fields replaced by the given arguments. + @_is.useResult + UserActivityDay copyWith({ + int? id, + int? userId, + DateTime? day, + _iwb3843v.UsageApp? app, + bool? edited, + }); + @override + Map toJson() { + return { + '__className__': 'UserActivityDay', + if (id != null) 'id': id, + 'userId': userId, + 'day': day.toJson(), + 'app': app.toJson(), + 'edited': edited, + }; + } + + @override + Map toJsonForProtocol() { + return {}; + } + + static UserActivityDayInclude include() { + return UserActivityDayInclude._(); + } + + static UserActivityDayIncludeList includeList({ + _is.WhereExpressionBuilder? where, + int? limit, + int? offset, + _is.OrderByBuilder? orderBy, + _is.OrderByListBuilder? orderByList, + UserActivityDayInclude? include, + }) { + return UserActivityDayIncludeList._( + where: where, + limit: limit, + offset: offset, + orderBy: orderBy?.call(UserActivityDay.t), + orderByList: orderByList?.call(UserActivityDay.t), + include: include, + ); + } + + @override + String toString() { + return _is.SerializationManager.encode(this); + } +} + +class _Undefined {} + +class _UserActivityDayImpl extends UserActivityDay { + _UserActivityDayImpl({ + int? id, + required int userId, + required DateTime day, + required _iwb3843v.UsageApp app, + bool? edited, + }) : super._( + id: id, + userId: userId, + day: day, + app: app, + edited: edited, + ); + + /// Returns a shallow copy of this [UserActivityDay] + /// with some or all fields replaced by the given arguments. + @_is.useResult + @override + UserActivityDay copyWith({ + Object? id = _Undefined, + int? userId, + DateTime? day, + _iwb3843v.UsageApp? app, + bool? edited, + }) { + return UserActivityDay( + id: id is int? ? id : this.id, + userId: userId ?? this.userId, + day: day ?? this.day, + app: app ?? this.app, + edited: edited ?? this.edited, + ); + } +} + +class UserActivityDayUpdateTable extends _is.UpdateTable { + UserActivityDayUpdateTable(super.table); + + _is.ColumnValue userId(int value) => _is.ColumnValue( + table.userId, + value, + ); + + _is.ColumnValue day(DateTime value) => _is.ColumnValue( + table.day, + value, + ); + + _is.ColumnValue<_iwb3843v.UsageApp, _iwb3843v.UsageApp> app( + _iwb3843v.UsageApp value, + ) => _is.ColumnValue( + table.app, + value, + ); + + _is.ColumnValue edited(bool value) => _is.ColumnValue( + table.edited, + value, + ); +} + +class UserActivityDayTable extends _is.Table { + UserActivityDayTable({super.tableRelation}) + : super(tableName: 'user_activity_day') { + updateTable = UserActivityDayUpdateTable(this); + userId = _is.ColumnInt( + 'userId', + this, + ); + day = _is.ColumnDateTime( + 'day', + this, + ); + app = _is.ColumnEnum( + 'app', + this, + _is.EnumSerialization.byName, + ); + edited = _is.ColumnBool( + 'edited', + this, + hasDefault: true, + ); + } + + late final UserActivityDayUpdateTable updateTable; + + late final _is.ColumnInt userId; + + /// UTC midnight of the day. + late final _is.ColumnDateTime day; + + late final _is.ColumnEnum<_iwb3843v.UsageApp> app; + + /// Whether the user also created or edited something that day. + late final _is.ColumnBool edited; + + @override + List<_is.Column> get columns => [ + id, + userId, + day, + app, + edited, + ]; +} + +class UserActivityDayInclude extends _is.IncludeObject { + UserActivityDayInclude._(); + + @override + Map get includes => {}; + + @override + _is.Table get table => UserActivityDay.t; +} + +class UserActivityDayIncludeList extends _is.IncludeList { + UserActivityDayIncludeList._({ + _is.WhereExpressionBuilder? where, + super.limit, + super.offset, + super.orderBy, + super.orderByList, + super.include, + }) { + super.where = where?.call(UserActivityDay.t); + } + + @override + Map get includes => include?.includes ?? {}; + + @override + _is.Table get table => UserActivityDay.t; +} + +class UserActivityDayRepository { + const UserActivityDayRepository._(); + + /// Returns a list of [UserActivityDay]s matching the given query parameters. + /// + /// Use [where] to specify which items to include in the return value. + /// If none is specified, all items will be returned. + /// + /// To specify the order of the items use [orderBy] or [orderByList] + /// when sorting by multiple columns. + /// + /// The maximum number of items can be set by [limit]. If no limit is set, + /// all items matching the query will be returned. + /// + /// [offset] defines how many items to skip, after which [limit] (or all) + /// items are read from the database. + /// + /// ```dart + /// var persons = await Persons.db.find( + /// session, + /// where: (t) => t.lastName.equals('Jones'), + /// orderBy: (t) => t.firstName, + /// limit: 100, + /// ); + /// ``` + Future> find( + _is.DatabaseSession session, { + _is.WhereExpressionBuilder? where, + int? limit, + int? offset, + _is.OrderByBuilder? orderBy, + _is.OrderByListBuilder? orderByList, + _is.Transaction? transaction, + _is.LockMode? lockMode, + _is.LockBehavior? lockBehavior, + }) async { + return session.db.find( + where: where?.call(UserActivityDay.t), + orderBy: orderBy?.call(UserActivityDay.t), + orderByList: orderByList?.call(UserActivityDay.t), + limit: limit, + offset: offset, + transaction: transaction, + lockMode: lockMode, + lockBehavior: lockBehavior, + ); + } + + /// Emits [UserActivityDay]s matching the given query parameters every time the + /// source tables are modified. + /// + /// Use [where] to specify which items to include in the return value. + /// If none is specified, all items will be returned. + /// + /// To specify the order of the items use [orderBy] or [orderByList] + /// when sorting by multiple columns. + /// + /// The maximum number of items can be set by [limit]. If no limit is set, + /// all items matching the query will be returned. + /// + /// [offset] defines how many items to skip, after which [limit] (or all) + /// items are read from the database. + /// + /// Use [throttle] to specify the minimum interval between queries. It can + /// also be set to `null`, in which case the stream will only be throttled + /// when its subscription is paused. + /// + /// Source tables are collected from the queried table, [where], [orderBy], + /// [orderByList], and the [include] graph. [alsoTriggerOnTables] is added + /// to that set. Pass [Table] instances such as `UserActivityDay.t`. + /// + /// Raw [Expression] SQL is not inspected. Tables referenced only in raw + /// SQL must be passed via [alsoTriggerOnTables]. + /// + /// The stream always reads committed state and never joins an ambient + /// [Transaction]. Emissions for a write fire after that write commits. + /// + /// Currently only supported on SQLite. Calling this method on PostgreSQL + /// throws an [UnsupportedError]. + /// + /// ```dart + /// var subscription = Persons.db.watch( + /// session, + /// where: (t) => t.lastName.equals('Jones'), + /// orderBy: (t) => t.firstName, + /// limit: 100, + /// ).listen((persons) { + /// // Handle the latest matching rows. + /// }); + /// ``` + _ida.Stream> watch( + _is.DatabaseSession session, { + _is.WhereExpressionBuilder? where, + int? limit, + int? offset, + _is.OrderByBuilder? orderBy, + _is.OrderByListBuilder? orderByList, + Duration? throttle = const Duration(milliseconds: 30), + Iterable<_is.Table>? alsoTriggerOnTables, + }) { + return session.db.watch( + where: where?.call(UserActivityDay.t), + orderBy: orderBy?.call(UserActivityDay.t), + orderByList: orderByList?.call(UserActivityDay.t), + limit: limit, + offset: offset, + throttle: throttle, + alsoTriggerOnTables: alsoTriggerOnTables, + ); + } + + /// Returns the first matching [UserActivityDay] matching the given query parameters. + /// + /// Use [where] to specify which items to include in the return value. + /// If none is specified, all items will be returned. + /// + /// To specify the order use [orderBy] or [orderByList] + /// when sorting by multiple columns. + /// + /// [offset] defines how many items to skip, after which the next one will be picked. + /// + /// ```dart + /// var youngestPerson = await Persons.db.findFirstRow( + /// session, + /// where: (t) => t.lastName.equals('Jones'), + /// orderBy: (t) => t.age, + /// ); + /// ``` + Future findFirstRow( + _is.DatabaseSession session, { + _is.WhereExpressionBuilder? where, + int? offset, + _is.OrderByBuilder? orderBy, + _is.OrderByListBuilder? orderByList, + _is.Transaction? transaction, + _is.LockMode? lockMode, + _is.LockBehavior? lockBehavior, + }) async { + return session.db.findFirstRow( + where: where?.call(UserActivityDay.t), + orderBy: orderBy?.call(UserActivityDay.t), + orderByList: orderByList?.call(UserActivityDay.t), + offset: offset, + transaction: transaction, + lockMode: lockMode, + lockBehavior: lockBehavior, + ); + } + + /// Finds a single [UserActivityDay] by its [id] or null if no such row exists. + Future findById( + _is.DatabaseSession session, + int id, { + _is.Transaction? transaction, + _is.LockMode? lockMode, + _is.LockBehavior? lockBehavior, + }) async { + return session.db.findById( + id, + transaction: transaction, + lockMode: lockMode, + lockBehavior: lockBehavior, + ); + } + + /// Inserts all [UserActivityDay]s in the list and returns the inserted rows. + /// + /// The returned [UserActivityDay]s will have their `id` fields set. + /// + /// This is an atomic operation, meaning that if one of the rows fails to + /// insert, none of the rows will be inserted. + /// + /// If [ignoreConflicts] is set to `true`, rows that conflict with existing + /// rows are silently skipped, and only the successfully inserted rows are + /// returned. + /// + /// If [noReturn] is set to `true`, the inserted rows are not read back from + /// the database and an empty list is returned. This avoids the overhead of + /// transferring and deserializing the rows when the result is not needed. + Future> insert( + _is.DatabaseSession session, + List rows, { + _is.Transaction? transaction, + bool ignoreConflicts = false, + bool noReturn = false, + }) async { + return session.db.insert( + rows, + transaction: transaction, + ignoreConflicts: ignoreConflicts, + noReturn: noReturn, + ); + } + + /// Inserts a single [UserActivityDay] and returns the inserted row. + /// + /// The returned [UserActivityDay] will have its `id` field set. + Future insertRow( + _is.DatabaseSession session, + UserActivityDay row, { + _is.Transaction? transaction, + }) async { + return session.db.insertRow( + row, + transaction: transaction, + ); + } + + /// Upserts all [UserActivityDay]s in the list and returns the resulting rows. + /// + /// If a row conflicts on the given [conflictColumns], the existing row is + /// updated with the new values. Otherwise, a new row is inserted. + /// + /// If [updateColumns] is provided, only those columns will be updated on + /// conflict. If null, all non-conflict, non-id columns are updated. + /// + /// If [updateWhere] is provided, the update only applies to rows matching the + /// given expression. Conflicting rows that don't match are skipped and not + /// returned, so the resulting list may be shorter than [rows]. + /// + /// The returned [UserActivityDay]s will have their `id` fields set. + /// + /// This is an atomic operation, meaning that if one of the rows fails, + /// none of the rows will be affected. + /// + /// If [noReturn] is set to `true`, the resulting rows are not read back from + /// the database and an empty list is returned. This avoids the overhead of + /// transferring and deserializing the rows when the result is not needed. + Future> upsert( + _is.DatabaseSession session, + List rows, { + required _is.ColumnSelections conflictColumns, + _is.ColumnSelections? updateColumns, + _is.WhereExpressionBuilder? updateWhere, + _is.Transaction? transaction, + bool noReturn = false, + }) async { + return session.db.upsert( + rows, + conflictColumns: conflictColumns(UserActivityDay.t), + updateColumns: updateColumns?.call(UserActivityDay.t), + updateWhere: updateWhere?.call(UserActivityDay.t), + transaction: transaction, + noReturn: noReturn, + ); + } + + /// Upserts a single [UserActivityDay] and returns the resulting row. + /// + /// If the row conflicts on the given [conflictColumns], the existing row is + /// updated. Otherwise, a new row is inserted. + /// + /// If [updateColumns] is provided, only those columns will be updated on + /// conflict. If null, all non-conflict, non-id columns are updated. + /// + /// If [updateWhere] is provided, the update only applies when the existing + /// row matches the expression. Returns `null` if no row was affected — for + /// example when [updateWhere] does not match the conflicting row. + /// + /// The returned [UserActivityDay] will have its `id` field set. + Future upsertRow( + _is.DatabaseSession session, + UserActivityDay row, { + required _is.ColumnSelections conflictColumns, + _is.ColumnSelections? updateColumns, + _is.WhereExpressionBuilder? updateWhere, + _is.Transaction? transaction, + }) async { + return session.db.upsertRow( + row, + conflictColumns: conflictColumns(UserActivityDay.t), + updateColumns: updateColumns?.call(UserActivityDay.t), + updateWhere: updateWhere?.call(UserActivityDay.t), + transaction: transaction, + ); + } + + /// Updates all [UserActivityDay]s in the list and returns the updated rows. If + /// [columns] is provided, only those columns will be updated. Defaults to + /// all columns. + /// This is an atomic operation, meaning that if one of the rows fails to + /// update, none of the rows will be updated. + /// + /// If [noReturn] is set to `true`, the updated rows are not read back from + /// the database and an empty list is returned. This avoids the overhead of + /// transferring and deserializing the rows when the result is not needed. + Future> update( + _is.DatabaseSession session, + List rows, { + _is.ColumnSelections? columns, + _is.Transaction? transaction, + bool noReturn = false, + }) async { + return session.db.update( + rows, + columns: columns?.call(UserActivityDay.t), + transaction: transaction, + noReturn: noReturn, + ); + } + + /// Updates a single [UserActivityDay]. The row needs to have its id set. + /// Optionally, a list of [columns] can be provided to only update those + /// columns. Defaults to all columns. + Future updateRow( + _is.DatabaseSession session, + UserActivityDay row, { + _is.ColumnSelections? columns, + _is.Transaction? transaction, + }) async { + return session.db.updateRow( + row, + columns: columns?.call(UserActivityDay.t), + transaction: transaction, + ); + } + + /// Updates a single [UserActivityDay] by its [id] with the specified [columnValues]. + /// Returns the updated row or null if no row with the given id exists. + Future updateById( + _is.DatabaseSession session, + int id, { + required _is.ColumnValueListBuilder + columnValues, + _is.Transaction? transaction, + }) async { + return session.db.updateById( + id, + columnValues: columnValues(UserActivityDay.t.updateTable), + transaction: transaction, + ); + } + + /// Updates all [UserActivityDay]s matching the [where] expression with the specified [columnValues]. + /// Returns the list of updated rows. + /// + /// If [noReturn] is set to `true`, the updated rows are not read back from + /// the database and an empty list is returned. This avoids the overhead of + /// transferring and deserializing the rows when the result is not needed. + Future> updateWhere( + _is.DatabaseSession session, { + required _is.ColumnValueListBuilder + columnValues, + required _is.WhereExpressionBuilder where, + int? limit, + int? offset, + _is.OrderByBuilder? orderBy, + _is.OrderByListBuilder? orderByList, + _is.Transaction? transaction, + bool noReturn = false, + }) async { + return session.db.updateWhere( + columnValues: columnValues(UserActivityDay.t.updateTable), + where: where(UserActivityDay.t), + limit: limit, + offset: offset, + orderBy: orderBy?.call(UserActivityDay.t), + orderByList: orderByList?.call(UserActivityDay.t), + transaction: transaction, + noReturn: noReturn, + ); + } + + /// Deletes all [UserActivityDay]s in the list and returns the deleted rows. + /// + /// To specify the order of the returned rows use [orderBy] or [orderByList] + /// when sorting by multiple columns. + /// + /// This is an atomic operation, meaning that if one of the rows fail to + /// be deleted, none of the rows will be deleted. + /// + /// If [noReturn] is set to `true`, the deleted rows are not read back from + /// the database and an empty list is returned. This avoids the overhead of + /// transferring and deserializing the rows when the result is not needed. + Future> delete( + _is.DatabaseSession session, + List rows, { + _is.OrderByBuilder? orderBy, + _is.OrderByListBuilder? orderByList, + _is.Transaction? transaction, + bool noReturn = false, + }) async { + return session.db.delete( + rows, + orderBy: orderBy?.call(UserActivityDay.t), + orderByList: orderByList?.call(UserActivityDay.t), + transaction: transaction, + noReturn: noReturn, + ); + } + + /// Deletes a single [UserActivityDay]. + Future deleteRow( + _is.DatabaseSession session, + UserActivityDay row, { + _is.Transaction? transaction, + }) async { + return session.db.deleteRow( + row, + transaction: transaction, + ); + } + + /// Deletes all rows matching the [where] expression. + /// + /// To specify the order of the returned rows use [orderBy] or [orderByList] + /// when sorting by multiple columns. + /// + /// If [noReturn] is set to `true`, the deleted rows are not read back from + /// the database and an empty list is returned. This avoids the overhead of + /// transferring and deserializing the rows when the result is not needed. + Future> deleteWhere( + _is.DatabaseSession session, { + required _is.WhereExpressionBuilder where, + _is.OrderByBuilder? orderBy, + _is.OrderByListBuilder? orderByList, + _is.Transaction? transaction, + bool noReturn = false, + }) async { + return session.db.deleteWhere( + where: where(UserActivityDay.t), + orderBy: orderBy?.call(UserActivityDay.t), + orderByList: orderByList?.call(UserActivityDay.t), + transaction: transaction, + noReturn: noReturn, + ); + } + + /// Counts the number of rows matching the [where] expression. If omitted, + /// will return the count of all rows in the table. + Future count( + _is.DatabaseSession session, { + _is.WhereExpressionBuilder? where, + int? limit, + _is.Transaction? transaction, + }) async { + return session.db.count( + where: where?.call(UserActivityDay.t), + limit: limit, + transaction: transaction, + ); + } + + /// Acquires row-level locks on [UserActivityDay] rows matching the [where] expression. + Future lockRows( + _is.DatabaseSession session, { + required _is.WhereExpressionBuilder where, + required _is.LockMode lockMode, + required _is.Transaction transaction, + _is.LockBehavior lockBehavior = _is.LockBehavior.wait, + }) async { + return session.db.lockRows( + where: where(UserActivityDay.t), + lockMode: lockMode, + lockBehavior: lockBehavior, + transaction: transaction, + ); + } +} diff --git a/wonky_server/lib/src/generated/protocol.dart b/wonky_server/lib/src/generated/protocol.dart index bc725709..eedf3feb 100644 --- a/wonky_server/lib/src/generated/protocol.dart +++ b/wonky_server/lib/src/generated/protocol.dart @@ -125,6 +125,14 @@ import 'platform/ai/models/inline_ai_event_type.dart' as _i6pcz5z6; import 'platform/ai/models/inline_ai_request.dart' as _i4m43iwr; import 'platform/ai/models/proofread_event.dart' as _ie0jt2ne; import 'platform/ai/models/proofread_issue.dart' as _ivmxemza; +import 'platform/analytics/models/analytics_cohort.dart' as _ixradasp; +import 'platform/analytics/models/analytics_count.dart' as _innm1rwe; +import 'platform/analytics/models/analytics_day.dart' as _is2u4stz; +import 'platform/analytics/models/analytics_overview.dart' as _i61uxw4p; +import 'platform/analytics/models/usage_app.dart' as _id3chnrt; +import 'platform/analytics/models/usage_counter_day.dart' as _iamkojeb; +import 'platform/analytics/models/usage_day_stats.dart' as _ibanfcrx; +import 'platform/analytics/models/user_activity_day.dart' as _ik0bapqg; import 'platform/board/models/board_ai_usage.dart' as _icowsqvh; import 'platform/board/models/board_area.dart' as _i0ag0upm; import 'platform/board/models/board_author.dart' as _ika8r7fc; @@ -481,6 +489,14 @@ export 'platform/ai/models/inline_ai_event_type.dart'; export 'platform/ai/models/inline_ai_request.dart'; export 'platform/ai/models/proofread_event.dart'; export 'platform/ai/models/proofread_issue.dart'; +export 'platform/analytics/models/analytics_cohort.dart'; +export 'platform/analytics/models/analytics_count.dart'; +export 'platform/analytics/models/analytics_day.dart'; +export 'platform/analytics/models/analytics_overview.dart'; +export 'platform/analytics/models/usage_app.dart'; +export 'platform/analytics/models/usage_counter_day.dart'; +export 'platform/analytics/models/usage_day_stats.dart'; +export 'platform/analytics/models/user_activity_day.dart'; export 'platform/board/models/board_ai_usage.dart'; export 'platform/board/models/board_area.dart'; export 'platform/board/models/board_author.dart'; @@ -855,6 +871,14 @@ class Protocol extends _is.DatabaseSerializationManager _is.getType<_i4m43iwr.InlineAiRequest>, _is.getType<_ie0jt2ne.ProofreadEvent>, _is.getType<_ivmxemza.ProofreadIssue>, + _is.getType<_ixradasp.AnalyticsCohort>, + _is.getType<_innm1rwe.AnalyticsCount>, + _is.getType<_is2u4stz.AnalyticsDay>, + _is.getType<_i61uxw4p.AnalyticsOverview>, + _is.getType<_id3chnrt.UsageApp>, + _is.getType<_iamkojeb.UsageCounterDay>, + _is.getType<_ibanfcrx.UsageDayStats>, + _is.getType<_ik0bapqg.UserActivityDay>, _is.getType<_icowsqvh.BoardAiUsage>, _is.getType<_i0ag0upm.BoardArea>, _is.getType<_ika8r7fc.BoardAuthor>, @@ -1262,6 +1286,14 @@ class Protocol extends _is.DatabaseSerializationManager _is.getType<_i4m43iwr.InlineAiRequest?>, _is.getType<_ie0jt2ne.ProofreadEvent?>, _is.getType<_ivmxemza.ProofreadIssue?>, + _is.getType<_ixradasp.AnalyticsCohort?>, + _is.getType<_innm1rwe.AnalyticsCount?>, + _is.getType<_is2u4stz.AnalyticsDay?>, + _is.getType<_i61uxw4p.AnalyticsOverview?>, + _is.getType<_id3chnrt.UsageApp?>, + _is.getType<_iamkojeb.UsageCounterDay?>, + _is.getType<_ibanfcrx.UsageDayStats?>, + _is.getType<_ik0bapqg.UserActivityDay?>, _is.getType<_icowsqvh.BoardAiUsage?>, _is.getType<_i0ag0upm.BoardArea?>, _is.getType<_ika8r7fc.BoardAuthor?>, @@ -1637,6 +1669,10 @@ class Protocol extends _is.DatabaseSerializationManager _is.getType>, _is.getType>, _is.getType?>, + _is.getType>, + _is.getType>, + _is.getType>, + _is.getType>, _is.getType>, _is.getType>, _is.getType>, @@ -1914,6 +1950,23 @@ class Protocol extends _is.DatabaseSerializationManager isUnique: false, isPrimary: false, ), + _isp.IndexDefinition( + indexName: 'activity_type_at_idx', + tableSpace: null, + elements: [ + _isp.IndexElementDefinition( + type: _isp.IndexElementDefinitionType.column, + definition: 'type', + ), + _isp.IndexElementDefinition( + type: _isp.IndexElementDefinitionType.column, + definition: 'at', + ), + ], + type: 'btree', + isUnique: false, + isPrimary: false, + ), ], managed: true, ), @@ -2184,6 +2237,19 @@ class Protocol extends _is.DatabaseSerializationManager isUnique: false, isPrimary: false, ), + _isp.IndexDefinition( + indexName: 'ai_usage_at_idx', + tableSpace: null, + elements: [ + _isp.IndexElementDefinition( + type: _isp.IndexElementDefinitionType.column, + definition: 'at', + ), + ], + type: 'btree', + isUnique: false, + isPrimary: false, + ), ], managed: true, ), @@ -4986,6 +5052,19 @@ class Protocol extends _is.DatabaseSerializationManager isUnique: true, isPrimary: false, ), + _isp.IndexDefinition( + indexName: 'comment_created_idx', + tableSpace: null, + elements: [ + _isp.IndexElementDefinition( + type: _isp.IndexElementDefinitionType.column, + definition: 'createdAt', + ), + ], + type: 'btree', + isUnique: false, + isPrimary: false, + ), ], managed: true, ), @@ -6829,6 +6908,19 @@ class Protocol extends _is.DatabaseSerializationManager isUnique: false, isPrimary: false, ), + _isp.IndexDefinition( + indexName: 'perm_granted_idx', + tableSpace: null, + elements: [ + _isp.IndexElementDefinition( + type: _isp.IndexElementDefinitionType.column, + definition: 'grantedAt', + ), + ], + type: 'btree', + isUnique: false, + isPrimary: false, + ), ], managed: true, ), @@ -14125,6 +14217,247 @@ class Protocol extends _is.DatabaseSerializationManager ], managed: true, ), + _isp.TableDefinition( + name: 'usage_counter_day', + dartName: 'UsageCounterDay', + schema: 'public', + module: 'wonky', + columns: [ + _isp.ColumnDefinition( + name: 'id', + columnType: _isp.ColumnType.bigint, + isNullable: false, + dartType: 'int?', + columnDefault: 'serial', + ), + _isp.ColumnDefinition( + name: 'day', + columnType: _isp.ColumnType.timestampWithoutTimeZone, + isNullable: false, + dartType: 'DateTime', + ), + _isp.ColumnDefinition( + name: 'name', + columnType: _isp.ColumnType.text, + isNullable: false, + dartType: 'String', + ), + _isp.ColumnDefinition( + name: 'value', + columnType: _isp.ColumnType.bigint, + isNullable: false, + dartType: 'int', + columnDefault: '0', + ), + ], + foreignKeys: [], + indexes: [ + _isp.IndexDefinition( + indexName: 'usage_counter_day_idx', + tableSpace: null, + elements: [ + _isp.IndexElementDefinition( + type: _isp.IndexElementDefinitionType.column, + definition: 'day', + ), + _isp.IndexElementDefinition( + type: _isp.IndexElementDefinitionType.column, + definition: 'name', + ), + ], + type: 'btree', + isUnique: true, + isPrimary: false, + ), + ], + managed: true, + ), + _isp.TableDefinition( + name: 'usage_day_stats', + dartName: 'UsageDayStats', + schema: 'public', + module: 'wonky', + columns: [ + _isp.ColumnDefinition( + name: 'id', + columnType: _isp.ColumnType.bigint, + isNullable: false, + dartType: 'int?', + columnDefault: 'serial', + ), + _isp.ColumnDefinition( + name: 'day', + columnType: _isp.ColumnType.timestampWithoutTimeZone, + isNullable: false, + dartType: 'DateTime', + ), + _isp.ColumnDefinition( + name: 'includeAdmins', + columnType: _isp.ColumnType.boolean, + isNullable: false, + dartType: 'bool', + ), + _isp.ColumnDefinition( + name: 'active', + columnType: _isp.ColumnType.bigint, + isNullable: false, + dartType: 'int', + ), + _isp.ColumnDefinition( + name: 'editors', + columnType: _isp.ColumnType.bigint, + isNullable: false, + dartType: 'int', + ), + _isp.ColumnDefinition( + name: 'drive', + columnType: _isp.ColumnType.bigint, + isNullable: false, + dartType: 'int', + ), + _isp.ColumnDefinition( + name: 'write', + columnType: _isp.ColumnType.bigint, + isNullable: false, + dartType: 'int', + ), + _isp.ColumnDefinition( + name: 'sheets', + columnType: _isp.ColumnType.bigint, + isNullable: false, + dartType: 'int', + ), + _isp.ColumnDefinition( + name: 'slides', + columnType: _isp.ColumnType.bigint, + isNullable: false, + dartType: 'int', + ), + _isp.ColumnDefinition( + name: 'mcp', + columnType: _isp.ColumnType.bigint, + isNullable: false, + dartType: 'int', + ), + _isp.ColumnDefinition( + name: 'weekly', + columnType: _isp.ColumnType.bigint, + isNullable: false, + dartType: 'int', + ), + _isp.ColumnDefinition( + name: 'monthly', + columnType: _isp.ColumnType.bigint, + isNullable: false, + dartType: 'int', + ), + _isp.ColumnDefinition( + name: 'computedAt', + columnType: _isp.ColumnType.timestampWithoutTimeZone, + isNullable: false, + dartType: 'DateTime', + ), + ], + foreignKeys: [], + indexes: [ + _isp.IndexDefinition( + indexName: 'usage_day_stats_idx', + tableSpace: null, + elements: [ + _isp.IndexElementDefinition( + type: _isp.IndexElementDefinitionType.column, + definition: 'day', + ), + _isp.IndexElementDefinition( + type: _isp.IndexElementDefinitionType.column, + definition: 'includeAdmins', + ), + ], + type: 'btree', + isUnique: true, + isPrimary: false, + ), + ], + managed: true, + ), + _isp.TableDefinition( + name: 'user_activity_day', + dartName: 'UserActivityDay', + schema: 'public', + module: 'wonky', + columns: [ + _isp.ColumnDefinition( + name: 'id', + columnType: _isp.ColumnType.bigint, + isNullable: false, + dartType: 'int?', + columnDefault: 'serial', + ), + _isp.ColumnDefinition( + name: 'userId', + columnType: _isp.ColumnType.bigint, + isNullable: false, + dartType: 'int', + ), + _isp.ColumnDefinition( + name: 'day', + columnType: _isp.ColumnType.timestampWithoutTimeZone, + isNullable: false, + dartType: 'DateTime', + ), + _isp.ColumnDefinition( + name: 'app', + columnType: _isp.ColumnType.text, + isNullable: false, + dartType: 'protocol:UsageApp', + ), + _isp.ColumnDefinition( + name: 'edited', + columnType: _isp.ColumnType.boolean, + isNullable: false, + dartType: 'bool', + columnDefault: 'false', + ), + ], + foreignKeys: [], + indexes: [ + _isp.IndexDefinition( + indexName: 'user_activity_day_idx', + tableSpace: null, + elements: [ + _isp.IndexElementDefinition( + type: _isp.IndexElementDefinitionType.column, + definition: 'userId', + ), + _isp.IndexElementDefinition( + type: _isp.IndexElementDefinitionType.column, + definition: 'day', + ), + _isp.IndexElementDefinition( + type: _isp.IndexElementDefinitionType.column, + definition: 'app', + ), + ], + type: 'btree', + isUnique: true, + isPrimary: false, + ), + _isp.IndexDefinition( + indexName: 'user_activity_day_day_idx', + tableSpace: null, + elements: [ + _isp.IndexElementDefinition( + type: _isp.IndexElementDefinitionType.column, + definition: 'day', + ), + ], + type: 'btree', + isUnique: false, + isPrimary: false, + ), + ], + managed: true, + ), _isp.TableDefinition( name: 'user_activity_settings', dartName: 'UserActivitySettings', @@ -14438,6 +14771,19 @@ class Protocol extends _is.DatabaseSerializationManager isUnique: true, isPrimary: false, ), + _isp.IndexDefinition( + indexName: 'user_profile_created_idx', + tableSpace: null, + elements: [ + _isp.IndexElementDefinition( + type: _isp.IndexElementDefinitionType.column, + definition: 'createdAt', + ), + ], + type: 'btree', + isUnique: false, + isPrimary: false, + ), ], managed: true, ), @@ -15044,6 +15390,30 @@ class Protocol extends _is.DatabaseSerializationManager if (t == _ivmxemza.ProofreadIssue) { return _ivmxemza.ProofreadIssue.fromJson(data) as T; } + if (t == _ixradasp.AnalyticsCohort) { + return _ixradasp.AnalyticsCohort.fromJson(data) as T; + } + if (t == _innm1rwe.AnalyticsCount) { + return _innm1rwe.AnalyticsCount.fromJson(data) as T; + } + if (t == _is2u4stz.AnalyticsDay) { + return _is2u4stz.AnalyticsDay.fromJson(data) as T; + } + if (t == _i61uxw4p.AnalyticsOverview) { + return _i61uxw4p.AnalyticsOverview.fromJson(data) as T; + } + if (t == _id3chnrt.UsageApp) { + return _id3chnrt.UsageApp.fromJson(data) as T; + } + if (t == _iamkojeb.UsageCounterDay) { + return _iamkojeb.UsageCounterDay.fromJson(data) as T; + } + if (t == _ibanfcrx.UsageDayStats) { + return _ibanfcrx.UsageDayStats.fromJson(data) as T; + } + if (t == _ik0bapqg.UserActivityDay) { + return _ik0bapqg.UserActivityDay.fromJson(data) as T; + } if (t == _icowsqvh.BoardAiUsage) { return _icowsqvh.BoardAiUsage.fromJson(data) as T; } @@ -16328,6 +16698,36 @@ class Protocol extends _is.DatabaseSerializationManager return (data != null ? _ivmxemza.ProofreadIssue.fromJson(data) : null) as T; } + if (t == _is.getType<_ixradasp.AnalyticsCohort?>()) { + return (data != null ? _ixradasp.AnalyticsCohort.fromJson(data) : null) + as T; + } + if (t == _is.getType<_innm1rwe.AnalyticsCount?>()) { + return (data != null ? _innm1rwe.AnalyticsCount.fromJson(data) : null) + as T; + } + if (t == _is.getType<_is2u4stz.AnalyticsDay?>()) { + return (data != null ? _is2u4stz.AnalyticsDay.fromJson(data) : null) as T; + } + if (t == _is.getType<_i61uxw4p.AnalyticsOverview?>()) { + return (data != null ? _i61uxw4p.AnalyticsOverview.fromJson(data) : null) + as T; + } + if (t == _is.getType<_id3chnrt.UsageApp?>()) { + return (data != null ? _id3chnrt.UsageApp.fromJson(data) : null) as T; + } + if (t == _is.getType<_iamkojeb.UsageCounterDay?>()) { + return (data != null ? _iamkojeb.UsageCounterDay.fromJson(data) : null) + as T; + } + if (t == _is.getType<_ibanfcrx.UsageDayStats?>()) { + return (data != null ? _ibanfcrx.UsageDayStats.fromJson(data) : null) + as T; + } + if (t == _is.getType<_ik0bapqg.UserActivityDay?>()) { + return (data != null ? _ik0bapqg.UserActivityDay.fromJson(data) : null) + as T; + } if (t == _is.getType<_icowsqvh.BoardAiUsage?>()) { return (data != null ? _icowsqvh.BoardAiUsage.fromJson(data) : null) as T; } @@ -17879,6 +18279,27 @@ class Protocol extends _is.DatabaseSerializationManager : null) as T; } + if (t == List) { + return (data as List).map((e) => deserialize(e)).toList() as T; + } + if (t == List<_is2u4stz.AnalyticsDay>) { + return (data as List) + .map((e) => deserialize<_is2u4stz.AnalyticsDay>(e)) + .toList() + as T; + } + if (t == List<_innm1rwe.AnalyticsCount>) { + return (data as List) + .map((e) => deserialize<_innm1rwe.AnalyticsCount>(e)) + .toList() + as T; + } + if (t == List<_ixradasp.AnalyticsCohort>) { + return (data as List) + .map((e) => deserialize<_ixradasp.AnalyticsCohort>(e)) + .toList() + as T; + } if (t == List) { return (data as List).map((e) => deserialize(e)).toList() as T; } @@ -18453,6 +18874,14 @@ class Protocol extends _is.DatabaseSerializationManager _i4m43iwr.InlineAiRequest => 'InlineAiRequest', _ie0jt2ne.ProofreadEvent => 'ProofreadEvent', _ivmxemza.ProofreadIssue => 'ProofreadIssue', + _ixradasp.AnalyticsCohort => 'AnalyticsCohort', + _innm1rwe.AnalyticsCount => 'AnalyticsCount', + _is2u4stz.AnalyticsDay => 'AnalyticsDay', + _i61uxw4p.AnalyticsOverview => 'AnalyticsOverview', + _id3chnrt.UsageApp => 'UsageApp', + _iamkojeb.UsageCounterDay => 'UsageCounterDay', + _ibanfcrx.UsageDayStats => 'UsageDayStats', + _ik0bapqg.UserActivityDay => 'UserActivityDay', _icowsqvh.BoardAiUsage => 'BoardAiUsage', _i0ag0upm.BoardArea => 'BoardArea', _ika8r7fc.BoardAuthor => 'BoardAuthor', @@ -18914,6 +19343,22 @@ class Protocol extends _is.DatabaseSerializationManager return 'ProofreadEvent'; case _ivmxemza.ProofreadIssue(): return 'ProofreadIssue'; + case _ixradasp.AnalyticsCohort(): + return 'AnalyticsCohort'; + case _innm1rwe.AnalyticsCount(): + return 'AnalyticsCount'; + case _is2u4stz.AnalyticsDay(): + return 'AnalyticsDay'; + case _i61uxw4p.AnalyticsOverview(): + return 'AnalyticsOverview'; + case _id3chnrt.UsageApp(): + return 'UsageApp'; + case _iamkojeb.UsageCounterDay(): + return 'UsageCounterDay'; + case _ibanfcrx.UsageDayStats(): + return 'UsageDayStats'; + case _ik0bapqg.UserActivityDay(): + return 'UserActivityDay'; case _icowsqvh.BoardAiUsage(): return 'BoardAiUsage'; case _i0ag0upm.BoardArea(): @@ -19808,6 +20253,30 @@ class Protocol extends _is.DatabaseSerializationManager if (dataClassName == 'ProofreadIssue') { return deserialize<_ivmxemza.ProofreadIssue>(data['data']); } + if (dataClassName == 'AnalyticsCohort') { + return deserialize<_ixradasp.AnalyticsCohort>(data['data']); + } + if (dataClassName == 'AnalyticsCount') { + return deserialize<_innm1rwe.AnalyticsCount>(data['data']); + } + if (dataClassName == 'AnalyticsDay') { + return deserialize<_is2u4stz.AnalyticsDay>(data['data']); + } + if (dataClassName == 'AnalyticsOverview') { + return deserialize<_i61uxw4p.AnalyticsOverview>(data['data']); + } + if (dataClassName == 'UsageApp') { + return deserialize<_id3chnrt.UsageApp>(data['data']); + } + if (dataClassName == 'UsageCounterDay') { + return deserialize<_iamkojeb.UsageCounterDay>(data['data']); + } + if (dataClassName == 'UsageDayStats') { + return deserialize<_ibanfcrx.UsageDayStats>(data['data']); + } + if (dataClassName == 'UserActivityDay') { + return deserialize<_ik0bapqg.UserActivityDay>(data['data']); + } if (dataClassName == 'BoardAiUsage') { return deserialize<_icowsqvh.BoardAiUsage>(data['data']); } @@ -20968,6 +21437,12 @@ class Protocol extends _is.DatabaseSerializationManager return _i8cittxq.AssistantMessage.t; case _iaq6rutx.AssistantThread: return _iaq6rutx.AssistantThread.t; + case _iamkojeb.UsageCounterDay: + return _iamkojeb.UsageCounterDay.t; + case _ibanfcrx.UsageDayStats: + return _ibanfcrx.UsageDayStats.t; + case _ik0bapqg.UserActivityDay: + return _ik0bapqg.UserActivityDay.t; case _icowsqvh.BoardAiUsage: return _icowsqvh.BoardAiUsage.t; case _ilo15wk2.BoardBundleSuggestion: diff --git a/wonky_server/lib/src/generated/protocol.yaml b/wonky_server/lib/src/generated/protocol.yaml index 5b1e53be..ceff9658 100644 --- a/wonky_server/lib/src/generated/protocol.yaml +++ b/wonky_server/lib/src/generated/protocol.yaml @@ -29,6 +29,9 @@ assistant: - revertChange: - inline: - proofread: +analytics: + - ping: + - overview: board: - me: - list: diff --git a/wonky_server/lib/src/platform/activity/activity_event.spy.yaml b/wonky_server/lib/src/platform/activity/activity_event.spy.yaml index acb721af..666a1963 100644 --- a/wonky_server/lib/src/platform/activity/activity_event.spy.yaml +++ b/wonky_server/lib/src/platform/activity/activity_event.spy.yaml @@ -13,3 +13,6 @@ fields: indexes: activity_item_idx: fields: itemId, at + ### Creations and edits by time (usage analytics, specs/19 §3). + activity_type_at_idx: + fields: type, at diff --git a/wonky_server/lib/src/platform/activity/activity_service.dart b/wonky_server/lib/src/platform/activity/activity_service.dart index 41e7b453..9e53beab 100644 --- a/wonky_server/lib/src/platform/activity/activity_service.dart +++ b/wonky_server/lib/src/platform/activity/activity_service.dart @@ -3,6 +3,7 @@ import 'dart:convert'; import 'package:serverpod/serverpod.dart'; import 'package:wonky_core/wonky_core.dart' show Role; +import '../analytics/usage_tracker.dart'; import '../common/actor.dart'; import '../common/json.dart'; import '../common/models.dart'; @@ -36,8 +37,23 @@ abstract final class ActivityService { ), transaction: transaction, ); + if (_contributions.contains(type)) { + await UsageTracker.edited( + session, + actor, + itemId, + template: summary['template'], + ); + } } + /// Events that make their actor an editor of the day (specs/19 §2). + static const _contributions = { + ActivityType.created, + ActivityType.uploaded, + ActivityType.restoredVersion, + }; + /// Records an edit, merged with the user's previous edit event on the item /// when it is less than [editWindow] old. Numeric [counters] are summed; /// [sets] (ids, e.g. the slides a deck edit touched) are merged as sorted @@ -93,6 +109,7 @@ abstract final class ActivityService { ), transaction: transaction, ); + await UsageTracker.edited(session, actor, itemId); return; } final summary = decodeObject(recent.summary); @@ -117,6 +134,7 @@ abstract final class ActivityService { columns: (t) => [t.summary], transaction: transaction, ); + await UsageTracker.edited(session, actor, itemId); } /// Max ids kept per set of an edit event ([logEdit]). diff --git a/wonky_server/lib/src/platform/ai/ai_usage_service.dart b/wonky_server/lib/src/platform/ai/ai_usage_service.dart index b976ae46..7ab2c5dd 100644 --- a/wonky_server/lib/src/platform/ai/ai_usage_service.dart +++ b/wonky_server/lib/src/platform/ai/ai_usage_service.dart @@ -110,9 +110,15 @@ abstract final class AiUsageService { ); } - /// Deletes usage older than 90 days (the daily job); returns the count. + /// How many days of usage are kept. + static const retentionDays = 90; + + /// Deletes usage older than [retentionDays] (the daily job); returns the + /// count. static Future purge(Session session, {DateTime? now}) async { - final cutoff = (now ?? nowUtc()).subtract(const Duration(days: 90)); + final cutoff = (now ?? nowUtc()).subtract( + const Duration(days: retentionDays), + ); final deleted = await AiUsage.db.deleteWhere( session, where: (t) => t.at < cutoff, diff --git a/wonky_server/lib/src/platform/ai/models/ai_usage.spy.yaml b/wonky_server/lib/src/platform/ai/models/ai_usage.spy.yaml index 03e7985d..285b550d 100644 --- a/wonky_server/lib/src/platform/ai/models/ai_usage.spy.yaml +++ b/wonky_server/lib/src/platform/ai/models/ai_usage.spy.yaml @@ -14,3 +14,6 @@ fields: indexes: ai_usage_user_at_idx: fields: userId, at + ### Usage by time (usage analytics, specs/19 §3; the daily purge). + ai_usage_at_idx: + fields: at diff --git a/wonky_server/lib/src/platform/analytics/analytics_endpoint.dart b/wonky_server/lib/src/platform/analytics/analytics_endpoint.dart new file mode 100644 index 00000000..7b794613 --- /dev/null +++ b/wonky_server/lib/src/platform/analytics/analytics_endpoint.dart @@ -0,0 +1,34 @@ +import 'package:serverpod/serverpod.dart'; + +import '../common/models.dart'; +import '../users/user_service.dart'; +import 'analytics_service.dart'; +import 'usage_tracker.dart'; + +/// Usage analytics (specs/19): the apps' activity ping, and the admin +/// dashboard of Wonky Drive (overview, admins only). +class AnalyticsEndpoint extends Endpoint { + @override + bool get requireLogin => true; + + /// The caller is using [app] (sent at app start and on resume). + Future ping(Session session, UsageApp app) async { + final actor = await UserService.actorOf(session); + await UsageTracker.active(session, actor.userId, app); + } + + /// The dashboard for the last [days] days (7, 30, 90 or 365); admins are + /// left out of every count unless [includeAdmins]. + Future overview( + Session session, + int days, + bool includeAdmins, + ) async { + await AnalyticsService.requireAdmin(session); + return AnalyticsService.overview( + session, + days: days, + includeAdmins: includeAdmins, + ); + } +} diff --git a/wonky_server/lib/src/platform/analytics/analytics_service.dart b/wonky_server/lib/src/platform/analytics/analytics_service.dart new file mode 100644 index 00000000..78e9d56c --- /dev/null +++ b/wonky_server/lib/src/platform/analytics/analytics_service.dart @@ -0,0 +1,534 @@ +import 'dart:math' as math; + +import 'package:serverpod/serverpod.dart'; + +import '../activity/activity_service.dart'; +import '../ai/ai_usage_service.dart'; +import '../board/board_admins.dart'; +import '../board/board_config.dart'; +import '../common/errors.dart'; +import '../common/models.dart'; +import '../common/time.dart'; +import '../users/user_service.dart'; +import 'usage_tracker.dart'; + +/// The usage analytics of Wonky Drive's admin dashboard (specs/19 §3): +/// accounts, active users, content, collaboration, AI and MCP use, sign-up +/// cohorts. Admins only (the board's admin rule, +/// specs/16 §9.1); aggregates are computed in SQL and cached briefly. +abstract final class AnalyticsService { + /// Periods the dashboard offers. + static const periods = {7, 30, 90, 365}; + + /// Weekly sign-up cohorts shown (the current week included). + static const cohortWeeks = 12; + + /// How long an overview is reused. + static const cacheLifetime = Duration(minutes: 1); + + /// Throws `forbidden` unless the caller is an admin. + static Future requireAdmin(Session session) async { + final actor = await UserService.actorOf(session); + if (!await BoardAdmins.isAdminUser(session, actor.userId)) { + throw Errors.forbidden('Usage analytics are for admins.'); + } + } + + /// SQL that is true for the profile [alias] unless admins are left out + /// and it is an admin; a missing profile (deleted account) counts. + static String _keep(String alias) => + '(@all OR NOT COALESCE($alias.email = ANY(@ae) OR ' + "split_part($alias.email, '@', 2) = ANY(@ad), false))"; + + /// The entries of [all] that [sql] uses (`@name`): the driver rejects + /// unused parameters. + static QueryParameters _params(String sql, Map all) => + QueryParameters.named({ + for (final e in all.entries) + if (RegExp('@${e.key}\\b').hasMatch(sql)) e.key: e.value, + }); + + static Map _adminParams(bool includeAdmins) { + final c = BoardConfig.current; + return { + 'all': includeAdmins, + 'ae': [for (final e in c.adminEmails) e.toLowerCase()], + 'ad': [for (final d in c.adminEmailDomains) d.toLowerCase()], + }; + } + + /// The dashboard for the last [days] days (one of [periods]), ending + /// today (UTC). + static Future overview( + Session session, { + required int days, + required bool includeAdmins, + }) async { + if (!periods.contains(days)) { + throw Errors.invalid('The period must be one of $periods days.'); + } + final key = 'analytics.overview.$days.$includeAdmins'; + final cached = await session.caches.local.get(key); + if (cached != null) return cached; + final result = await _compute(session, days, includeAdmins); + await session.caches.local.put(key, result, lifetime: cacheLifetime); + return result; + } + + /// Drops the cached overviews (tests, and after a config change). + static Future clearCache(Session session) async { + for (final days in periods) { + for (final admins in const [false, true]) { + await session.caches.local.invalidateKey( + 'analytics.overview.$days.$admins', + ); + } + } + } + + static Future _compute( + Session session, + int days, + bool includeAdmins, + ) async { + final now = nowUtc(); + final today = ActivityService.dayOf(now); + final from = today.subtract(Duration(days: days - 1)); + final to = today.add(const Duration(days: 1)); + // Stickiness needs the last 30 days even for a shorter period. + final activityFrom = from.isBefore(today.subtract(const Duration(days: 29))) + ? from + : today.subtract(const Duration(days: 29)); + final p = { + ..._adminParams(includeAdmins), + 'from': from, + 'to': to, + 'welcome': UsageTracker.welcomeTemplates.toList(), + }; + final dayKeys = [ + for (var i = 0; i < days; i++) from.add(Duration(days: i)), + ]; + + Future>> q(String sql) async => + (await session.db.unsafeQuery( + sql, + parameters: _params(sql, p), + )).map((r) => r.toList()).toList(); + + // Active users per day and app, and the rolling 7/30-day counts: + // finished days from the rollup, today live. + final activity = await _activity( + session, + activityFrom, + today, + includeAdmins, + ); + + // Accounts. + final signups = await _perDay( + q, + 'SELECT date_trunc(\'day\', p."createdAt"), count(*) FROM user_profile p ' + 'WHERE p."createdAt" >= @from AND ${_keep('p')} GROUP BY 1', + ); + final before = _int( + (await q( + 'SELECT count(*) FROM user_profile p ' + 'WHERE p."createdAt" < @from AND ${_keep('p')}', + )).first[0], + ); + + // Items created per day and kind (from the activity log: creations and + // uploads by people, the assistant and MCP; not the welcome content). + final created = >{}; + for (final r in await q( + 'SELECT date_trunc(\'day\', e.at), i.kind, count(*) ' + 'FROM activity_event e JOIN drive_item i ON i.id = e."itemId" ' + 'LEFT JOIN user_profile p ON p.id = e."actorId" ' + "WHERE e.type IN ('created', 'uploaded') " + "AND e.\"actorKind\" IN ('user', 'ai', 'mcp') " + 'AND e.at >= @from AND i."templateOf" IS NULL ' + "AND COALESCE(e.summary::jsonb ->> 'template', '') <> ALL(@welcome) " + 'AND ${_keep('p')} GROUP BY 1, 2', + )) { + created.putIfAbsent(_day(r[0]), () => {})['${r[1]}'] = _int(r[2]); + } + + final comments = await _perDay( + q, + 'SELECT date_trunc(\'day\', c."createdAt"), count(*) FROM comment c ' + 'LEFT JOIN user_profile p ON p.id = c."authorId" ' + 'WHERE c."authorId" IS NOT NULL AND c."systemEvent" IS NULL ' + "AND c.\"authorKind\" = 'user' AND c.\"createdAt\" >= @from " + 'AND ${_keep('p')} GROUP BY 1', + ); + final shares = await _perDay( + q, + 'SELECT date_trunc(\'day\', g."grantedAt"), count(*) ' + 'FROM drive_item_permission g ' + 'LEFT JOIN user_profile p ON p.id = g."grantedById" ' + 'WHERE g."inheritedFromId" IS NULL AND g."viaPublicationId" IS NULL ' + "AND g.role <> 'owner' AND g.\"grantedAt\" >= @from " + 'AND (g."userId" IS NULL OR g."userId" <> g."grantedById") ' + 'AND ${_keep('p')} GROUP BY 1', + ); + final ai = {}; + for (final r in await q( + 'SELECT date_trunc(\'day\', u.at), count(*), ' + 'COALESCE(sum(u."inputTokens" + u."outputTokens"), 0)::bigint ' + 'FROM ai_usage u LEFT JOIN user_profile p ON p.id = u."userId" ' + 'WHERE u.at >= @from AND ${_keep('p')} GROUP BY 1', + )) { + ai[_day(r[0])] = (_int(r[1]), _int(r[2])); + } + final mcpCalls = await _perDay( + q, + 'SELECT c.day, c.value FROM usage_counter_day c ' + "WHERE c.day >= @from AND c.name = '${UsageTracker.mcpCalls}'", + ); + + var accounts = before; + final series = []; + for (final d in dayKeys) { + final a = activity[d] ?? _noActivity; + final c = created[d] ?? const {}; + accounts += signups[d] ?? 0; + series.add( + AnalyticsDay( + day: d, + active: a[0], + editors: a[1], + drive: a[2], + write: a[3], + sheets: a[4], + slides: a[5], + mcp: a[6], + weekly: a[7], + monthly: a[8], + signups: signups[d] ?? 0, + accounts: accounts, + documents: c['document'] ?? 0, + spreadsheets: c['spreadsheet'] ?? 0, + presentations: c['presentation'] ?? 0, + files: c['file'] ?? 0, + folders: c['folder'] ?? 0, + comments: comments[d] ?? 0, + shares: shares[d] ?? 0, + aiRequests: ai[d]?.$1 ?? 0, + aiTokens: ai[d]?.$2 ?? 0, + mcpCalls: mcpCalls[d] ?? 0, + ), + ); + } + + final last30 = [ + for (var i = 0; i < 30; i++) + activity[today.subtract(Duration(days: i))]?[0] ?? 0, + ]; + final monthly = series.last.monthly; + final stickiness = monthly == 0 + ? 0.0 + : math.min(1.0, last30.reduce((a, b) => a + b) / 30 / monthly); + + final trackingRow = await q('SELECT min(day) FROM user_activity_day'); + final trackingSince = trackingRow.first[0] == null + ? null + : _day(trackingRow.first[0]); + + return AnalyticsOverview( + days: days, + includeAdmins: includeAdmins, + generatedAt: now, + trackingSince: trackingSince, + accounts: accounts, + newAccounts: accounts - before, + activeToday: series.last.active, + weekly: series.last.weekly, + monthly: monthly, + stickiness: stickiness, + series: series, + itemTotals: await _counts( + q, + 'SELECT i.kind, count(*), ' + 'COALESCE(sum(i."sizeBytes" + i."attachmentBytes"), 0)::bigint ' + 'FROM drive_item i LEFT JOIN user_profile p ON p.id = i."ownerId" ' + 'WHERE i."trashedAt" IS NULL AND i."templateOf" IS NULL ' + 'AND ${_keep('p')} GROUP BY 1 ORDER BY 2 DESC', + ), + storageBytes: _int( + (await q( + 'SELECT COALESCE(sum(s."usedBytes"), 0)::bigint FROM user_storage s ' + 'LEFT JOIN user_profile p ON p.id = s."userId" WHERE ${_keep('p')}', + )).first[0], + ), + signInMethods: await _counts( + q, + "SELECT 'email', count(DISTINCT p.id), 0 FROM user_profile p " + 'JOIN serverpod_auth_idp_email_account e ' + 'ON e."authUserId" = p."authUserId" WHERE ${_keep('p')} ' + "UNION ALL SELECT 'google', count(DISTINCT p.id), 0 FROM user_profile p " + 'JOIN serverpod_auth_idp_google_account g ' + 'ON g."authUserId" = p."authUserId" WHERE ${_keep('p')}', + ), + aiFeatures: await _counts(q, _aiBy('feature')), + aiModels: await _counts(q, _aiBy('model')), + aiRetentionDays: AiUsageService.retentionDays, + sharedItems: _int( + (await q( + 'SELECT count(DISTINCT g."itemId") FROM drive_item_permission g ' + 'JOIN drive_item i ON i.id = g."itemId" ' + 'LEFT JOIN user_profile p ON p.id = i."ownerId" ' + 'WHERE g."inheritedFromId" IS NULL AND g."viaPublicationId" IS NULL ' + "AND g.role <> 'owner' AND i.\"trashedAt\" IS NULL " + 'AND (g."userId" IS NULL OR g."userId" <> i."ownerId") ' + 'AND ${_keep('p')}', + )).first[0], + ), + coEditedItems: _int( + (await q( + 'SELECT count(*) FROM (SELECT e."itemId" FROM activity_event e ' + 'LEFT JOIN user_profile p ON p.id = e."actorId" ' + "WHERE e.type = 'edited' AND e.\"actorId\" IS NOT NULL " + "AND e.\"actorKind\" IN ('user', 'ai', 'mcp') AND e.at >= @from " + 'AND ${_keep('p')} GROUP BY e."itemId" ' + 'HAVING count(DISTINCT e."actorId") >= 2) x', + )).first[0], + ), + commenters: _int( + (await q( + 'SELECT count(DISTINCT c."authorId") FROM comment c ' + 'LEFT JOIN user_profile p ON p.id = c."authorId" ' + 'WHERE c."authorId" IS NOT NULL AND c."systemEvent" IS NULL ' + "AND c.\"authorKind\" = 'user' AND c.\"createdAt\" >= @from " + 'AND ${_keep('p')}', + )).first[0], + ), + cohorts: await _cohorts(session, today, trackingSince, includeAdmins), + ); + } + + static String _aiBy(String column) => + 'SELECT u."$column", count(*), ' + 'COALESCE(sum(u."inputTokens" + u."outputTokens"), 0)::bigint ' + 'FROM ai_usage u LEFT JOIN user_profile p ON p.id = u."userId" ' + 'WHERE u.at >= @from AND ${_keep('p')} GROUP BY 1 ORDER BY 2 DESC ' + 'LIMIT 12'; + + /// Weekly sign-up cohorts of the last [cohortWeeks] weeks (Monday, UTC): + /// size and active users per week since sign-up. + static Future> _cohorts( + Session session, + DateTime today, + DateTime? trackingSince, + bool includeAdmins, + ) async { + final thisWeek = weekOf(today); + final first = thisWeek.subtract( + const Duration(days: 7 * (cohortWeeks - 1)), + ); + final params = {..._adminParams(includeAdmins), 'first': first}; + Future q(String sql) => + session.db.unsafeQuery(sql, parameters: _params(sql, params)); + final sizes = {}; + for (final r in await q( + 'SELECT date_trunc(\'week\', p."createdAt"), count(*) FROM user_profile p ' + 'WHERE p."createdAt" >= @first AND ${_keep('p')} GROUP BY 1', + )) { + sizes[_day(r[0])] = _int(r[1]); + } + final active = <(DateTime, int), int>{}; + for (final r in await q( + 'WITH c AS (SELECT p.id, date_trunc(\'week\', p."createdAt") AS w ' + 'FROM user_profile p WHERE p."createdAt" >= @first AND ${_keep('p')}) ' + "SELECT c.w, floor(extract(epoch FROM date_trunc('week', a.day) - c.w) " + '/ 604800)::int, count(DISTINCT a."userId") FROM c ' + 'JOIN user_activity_day a ON a."userId" = c.id AND a.day >= c.w ' + 'GROUP BY 1, 2', + )) { + active[(_day(r[0]), _int(r[1]))] = _int(r[2]); + } + final tracked = trackingSince == null ? null : weekOf(trackingSince); + return [ + for (var i = 0; i < cohortWeeks; i++) + if (first.add(Duration(days: 7 * i)) case final week) + AnalyticsCohort( + week: week, + size: sizes[week] ?? 0, + active: [ + for (var k = 0; k < cohortWeeks - i; k++) + if (week.add(Duration(days: 7 * k)) case final w) + tracked == null || w.isBefore(tracked) + ? null + : active[(week, k)] ?? 0, + ], + ), + ]; + } + + /// Activity of no one: [_activity]'s columns. + static const _noActivity = [0, 0, 0, 0, 0, 0, 0, 0, 0]; + + /// Activity per day from [from] to [today]: active, editors, drive, + /// write, sheets, slides, mcp, weekly (7 days ending that day) and + /// monthly (30 days). Finished days come from `usage_day_stats` and are + /// computed and stored once when missing (a finished day never changes: + /// activity is only written for the current UTC day); today is live. + static Future>> _activity( + Session session, + DateTime from, + DateTime today, + bool includeAdmins, + ) async { + final out = >{}; + final stored = await UsageDayStats.db.find( + session, + where: (t) => + (t.day >= from) & + (t.day < today) & + t.includeAdmins.equals(includeAdmins), + ); + for (final r in stored) { + out[_day(r.day)] = [ + r.active, + r.editors, + r.drive, + r.write, + r.sheets, + r.slides, + r.mcp, + r.weekly, + r.monthly, + ]; + } + DateTime? firstMissing; + for (var d = from; d.isBefore(today); d = d.add(const Duration(days: 1))) { + if (!out.containsKey(d)) { + firstMissing = d; + break; + } + } + final computeFrom = firstMissing ?? today; + final computed = await _computeActivity( + session, + computeFrom, + today, + includeAdmins, + ); + final now = nowUtc(); + for ( + var d = computeFrom; + !d.isAfter(today); + d = d.add(const Duration(days: 1)) + ) { + final a = computed[d] ?? _noActivity; + if (d.isBefore(today) && !out.containsKey(d)) { + await session.db.unsafeExecute( + 'INSERT INTO usage_day_stats ("day", "includeAdmins", "active", ' + '"editors", "drive", "write", "sheets", "slides", "mcp", "weekly", ' + '"monthly", "computedAt") VALUES (@day, @all, @a0, @a1, @a2, @a3, ' + '@a4, @a5, @a6, @a7, @a8, @now) ' + 'ON CONFLICT ("day", "includeAdmins") DO NOTHING', + parameters: QueryParameters.named({ + 'day': d, + 'all': includeAdmins, + for (var i = 0; i < a.length; i++) 'a$i': a[i], + 'now': now, + }), + ); + } + out[d] = a; + } + return out; + } + + /// [_activity]'s columns computed from `user_activity_day` for the days + /// [from] … [today]. + static Future>> _computeActivity( + Session session, + DateTime from, + DateTime today, + bool includeAdmins, + ) async { + final p = { + ..._adminParams(includeAdmins), + 'from': from, + 'to': today.add(const Duration(days: 1)), + }; + Future q(String sql) => + session.db.unsafeQuery(sql, parameters: _params(sql, p)); + final out = >{}; + for (final r in await q( + 'SELECT a.day, count(DISTINCT a."userId"), ' + 'count(DISTINCT a."userId") FILTER (WHERE a.edited), ' + "count(DISTINCT a.\"userId\") FILTER (WHERE a.app = 'drive'), " + "count(DISTINCT a.\"userId\") FILTER (WHERE a.app = 'write'), " + "count(DISTINCT a.\"userId\") FILTER (WHERE a.app = 'sheets'), " + "count(DISTINCT a.\"userId\") FILTER (WHERE a.app = 'slides'), " + "count(DISTINCT a.\"userId\") FILTER (WHERE a.app = 'mcp') " + 'FROM user_activity_day a LEFT JOIN user_profile p ON p.id = a."userId" ' + 'WHERE a.day >= @from AND a.day < @to AND ${_keep('p')} ' + 'GROUP BY a.day', + )) { + out[_day(r[0])] = [for (final v in r.skip(1)) _int(v), 0, 0]; + } + // Distinct users in the 7 and 30 days ending with each day. + for (final r in await q( + 'SELECT g.d, ' + "count(DISTINCT a.\"userId\") FILTER (WHERE a.day > g.d - interval '7 days'), " + 'count(DISTINCT a."userId") ' + "FROM generate_series(@from::timestamp, @to::timestamp - interval '1 day', " + "interval '1 day') AS g(d) " + "JOIN user_activity_day a ON a.day > g.d - interval '30 days' " + 'AND a.day <= g.d ' + 'LEFT JOIN user_profile p ON p.id = a."userId" ' + 'WHERE ${_keep('p')} GROUP BY g.d', + )) { + final row = out.putIfAbsent(_day(r[0]), () => [..._noActivity]); + row[7] = _int(r[1]); + row[8] = _int(r[2]); + } + return out; + } + + /// The Monday (UTC midnight) of [day]'s week. + static DateTime weekOf(DateTime day) { + final d = ActivityService.dayOf(day); + return d.subtract(Duration(days: d.weekday - DateTime.monday)); + } + + static Future> _perDay( + Future>> Function(String sql) q, + String sql, + ) async => {for (final r in await q(sql)) _day(r[0]): _int(r[1])}; + + static Future> _counts( + Future>> Function(String sql) q, + String sql, + ) async => [ + for (final r in await q(sql)) + AnalyticsCount(key: '${r[0]}', count: _int(r[1]), amount: _int(r[2])), + ]; + + static DateTime _day(Object? v) => ActivityService.dayOf(_utc(v as DateTime)); + + /// Postgres returns `timestamp without time zone` as a local-looking + /// DateTime; reinterpret its fields as UTC. + static DateTime _utc(DateTime d) => d.isUtc + ? d + : DateTime.utc( + d.year, + d.month, + d.day, + d.hour, + d.minute, + d.second, + d.millisecond, + ); + + static int _int(Object? v) => switch (v) { + null => 0, + final int i => i, + final num n => n.toInt(), + final BigInt b => b.toInt(), + _ => int.parse('$v'), + }; +} diff --git a/wonky_server/lib/src/platform/analytics/models/analytics_cohort.spy.yaml b/wonky_server/lib/src/platform/analytics/models/analytics_cohort.spy.yaml new file mode 100644 index 00000000..251f065e --- /dev/null +++ b/wonky_server/lib/src/platform/analytics/models/analytics_cohort.spy.yaml @@ -0,0 +1,11 @@ +### A weekly sign-up cohort (specs/19 §3.5): accounts created in the week +### starting [week] (Monday, UTC) and how many of them were active N weeks +### later. +class: AnalyticsCohort +fields: + week: DateTime + size: int + ### Index N: active users of the cohort in week N after sign-up (0 = the + ### sign-up week). Null where the week is in the future or ended before + ### activity was recorded. + active: List diff --git a/wonky_server/lib/src/platform/analytics/models/analytics_count.spy.yaml b/wonky_server/lib/src/platform/analytics/models/analytics_count.spy.yaml new file mode 100644 index 00000000..fe9c03b0 --- /dev/null +++ b/wonky_server/lib/src/platform/analytics/models/analytics_count.spy.yaml @@ -0,0 +1,9 @@ +### A labeled count of the usage analytics (specs/19 §3): items by kind, +### sign-in methods, AI requests by feature or model. +class: AnalyticsCount +fields: + key: String + count: int + ### A second measure where one applies (bytes of items, AI tokens); 0 + ### otherwise. + amount: int, default=0 diff --git a/wonky_server/lib/src/platform/analytics/models/analytics_day.spy.yaml b/wonky_server/lib/src/platform/analytics/models/analytics_day.spy.yaml new file mode 100644 index 00000000..ac0f6cfe --- /dev/null +++ b/wonky_server/lib/src/platform/analytics/models/analytics_day.spy.yaml @@ -0,0 +1,33 @@ +### One UTC day of the usage analytics (specs/19 §3). Users are counted +### once per day; the rolling counts are distinct users in the 7 and 30 +### days ending with [day]. +class: AnalyticsDay +fields: + day: DateTime + ### Users active in any app or through MCP. + active: int + ### Users who created or edited something. + editors: int + weekly: int + monthly: int + drive: int + write: int + sheets: int + slides: int + mcp: int + ### Accounts created that day, and all accounts at its end. + signups: int + accounts: int + ### Items created that day by kind (templates of the gallery left out). + documents: int + spreadsheets: int + presentations: int + files: int + folders: int + ### Comments and replies by people (not system events). + comments: int + ### Direct grants to people (not inherited from a folder). + shares: int + aiRequests: int + aiTokens: int + mcpCalls: int diff --git a/wonky_server/lib/src/platform/analytics/models/analytics_overview.spy.yaml b/wonky_server/lib/src/platform/analytics/models/analytics_overview.spy.yaml new file mode 100644 index 00000000..e96f8fdd --- /dev/null +++ b/wonky_server/lib/src/platform/analytics/models/analytics_overview.spy.yaml @@ -0,0 +1,39 @@ +### The usage analytics dashboard of Wonky Drive (specs/19 §3), for admins. +class: AnalyticsOverview +fields: + ### Period length in days; [series] has one entry per day, oldest first, + ### ending today (UTC). + days: int + includeAdmins: bool + generatedAt: DateTime + ### The first day with recorded activity (null: none yet). + trackingSince: DateTime? + ### All accounts now, and those created in the period. + accounts: int + newAccounts: int + ### Distinct active users today, in the last 7 and the last 30 days. + activeToday: int + weekly: int + monthly: int + ### The average daily active users of the last 30 days over [monthly] + ### (0–1). + stickiness: double + series: List + ### Items now (not trashed) by kind: count and bytes. + itemTotals: List + storageBytes: int + ### Accounts by sign-in method (`email`, `google`, …); an account with + ### two methods counts for both. + signInMethods: List + ### AI requests and tokens in the period by feature and by model. + aiFeatures: List + aiModels: List + ### How many days of AI usage the server keeps. + aiRetentionDays: int + ### Items now shared with at least one other person. + sharedItems: int + ### Items edited by two or more people in the period. + coEditedItems: int + ### People who commented in the period. + commenters: int + cohorts: List diff --git a/wonky_server/lib/src/platform/analytics/models/usage_app.spy.yaml b/wonky_server/lib/src/platform/analytics/models/usage_app.spy.yaml new file mode 100644 index 00000000..77fe8fcc --- /dev/null +++ b/wonky_server/lib/src/platform/analytics/models/usage_app.spy.yaml @@ -0,0 +1,10 @@ +### Where a user was active (usage analytics, specs/19 §2): one of the +### apps, or an MCP client with a personal access token. +enum: UsageApp +serialized: byName +values: + - drive + - write + - sheets + - slides + - mcp diff --git a/wonky_server/lib/src/platform/analytics/models/usage_counter_day.spy.yaml b/wonky_server/lib/src/platform/analytics/models/usage_counter_day.spy.yaml new file mode 100644 index 00000000..354117f4 --- /dev/null +++ b/wonky_server/lib/src/platform/analytics/models/usage_counter_day.spy.yaml @@ -0,0 +1,13 @@ +### A daily counter of the usage analytics (specs/19 §2), e.g. `mcp.calls`. +class: UsageCounterDay +table: usage_counter_day +serverOnly: true +fields: + ### UTC midnight of the day. + day: DateTime + name: String + value: int, default=0 +indexes: + usage_counter_day_idx: + fields: day, name + unique: true diff --git a/wonky_server/lib/src/platform/analytics/models/usage_day_stats.spy.yaml b/wonky_server/lib/src/platform/analytics/models/usage_day_stats.spy.yaml new file mode 100644 index 00000000..cf5effbf --- /dev/null +++ b/wonky_server/lib/src/platform/analytics/models/usage_day_stats.spy.yaml @@ -0,0 +1,27 @@ +### The activity of one finished UTC day (usage analytics, specs/19 §2.1): +### computed once by the overview, then read. A finished day never changes, +### because activity is only written for the current day. One row with and +### one without admins (the admin rule of the time it was computed). Kept +### after `user_activity_day` is purged. +class: UsageDayStats +table: usage_day_stats +serverOnly: true +fields: + ### UTC midnight of the day. + day: DateTime + includeAdmins: bool + active: int + editors: int + drive: int + write: int + sheets: int + slides: int + mcp: int + ### Distinct users in the 7 and the 30 days ending with [day]. + weekly: int + monthly: int + computedAt: DateTime +indexes: + usage_day_stats_idx: + fields: day, includeAdmins + unique: true diff --git a/wonky_server/lib/src/platform/analytics/models/user_activity_day.spy.yaml b/wonky_server/lib/src/platform/analytics/models/user_activity_day.spy.yaml new file mode 100644 index 00000000..a24857c5 --- /dev/null +++ b/wonky_server/lib/src/platform/analytics/models/user_activity_day.spy.yaml @@ -0,0 +1,23 @@ +### A user was active in [app] on a UTC day (usage analytics, specs/19 §2). +### One row per user, day and app; written at most once per instance and +### key (`UsageTracker`), kept 400 days (`analytics.purgeActivity`). +### +### [userId] has no foreign key on purpose: rows are written beside +### transactions that may lock the profile, and the counts of past days stay +### put when an account is deleted (its rows keep only the bare id). +class: UserActivityDay +table: user_activity_day +serverOnly: true +fields: + userId: int + ### UTC midnight of the day. + day: DateTime + app: UsageApp + ### Whether the user also created or edited something that day. + edited: bool, default=false +indexes: + user_activity_day_idx: + fields: userId, day, app + unique: true + user_activity_day_day_idx: + fields: day diff --git a/wonky_server/lib/src/platform/analytics/usage_tracker.dart b/wonky_server/lib/src/platform/analytics/usage_tracker.dart new file mode 100644 index 00000000..7652179e --- /dev/null +++ b/wonky_server/lib/src/platform/analytics/usage_tracker.dart @@ -0,0 +1,202 @@ +import 'package:serverpod/serverpod.dart'; + +import '../activity/activity_service.dart'; +import '../common/actor.dart'; +import '../common/lru_map.dart'; +import '../common/models.dart'; +import '../common/time.dart'; +import '../drive/templates/builtin_templates.dart'; + +/// Records who was active where, for the usage analytics (specs/19 §2): +/// one `user_activity_day` row per user, UTC day and app, and daily +/// counters (`usage_counter_day`). Ids and counts only, never content. +/// +/// Sources: the apps' ping at start and on resume (`analytics.ping`), +/// opening an item (`DriveUserStates.recordOpen`), creating and editing +/// (`ActivityService`), and MCP tool calls (`McpToolExecutor`). Each +/// instance writes a (user, day, app) key at most once (twice when an edit +/// follows an open), so the hot paths cost a map lookup. Tracking never +/// fails the request that triggers it. +abstract final class UsageTracker { + /// Daily counter of MCP tool calls by people's tokens. + static const mcpCalls = 'mcp.calls'; + + /// (user, day, app) → whether an edit was recorded. + static final _seen = LruMap<(int, int, UsageApp), bool>(50000); + + /// Item id → kind (kinds never change). + static final _kinds = LruMap(20000); + + /// User id → when `lastSeenAt` was last written by this instance. + static final _lastSeen = LruMap(20000); + + /// How often `user_profile.lastSeenAt` is refreshed per user. + static const lastSeenInterval = Duration(minutes: 15); + + /// The app that edits items of [kind]; folders and files are Drive's. + static UsageApp appOf(DriveItemKind kind) => switch (kind) { + DriveItemKind.document => UsageApp.write, + DriveItemKind.spreadsheet => UsageApp.sheets, + DriveItemKind.presentation => UsageApp.slides, + DriveItemKind.folder || DriveItemKind.file => UsageApp.drive, + }; + + /// Records that [userId] was active in [app] (and, with [edited], + /// created or edited something there). + static Future active( + Session session, + int userId, + UsageApp app, { + bool edited = false, + }) async { + final now = nowUtc(); + final day = ActivityService.dayOf(now); + final key = (userId, day.millisecondsSinceEpoch, app); + final prev = _seen.get(key); + final write = prev == null || (edited && !prev); + // Edits may run inside a transaction that locks the profile row; the + // pings, opens and MCP calls keep `lastSeenAt` fresh. + final seen = !edited && _touchLastSeen(userId, now); + if (!write && !seen) return; + try { + if (write) { + await session.db.unsafeExecute( + 'INSERT INTO user_activity_day ("userId", "day", "app", "edited") ' + 'VALUES (@user, @day, @app, @edited) ' + 'ON CONFLICT ("userId", "day", "app") DO UPDATE SET ' + '"edited" = user_activity_day."edited" OR EXCLUDED."edited"', + parameters: QueryParameters.named({ + 'user': userId, + 'day': day, + 'app': app.name, + 'edited': edited, + }), + ); + _seen.put(key, edited || (prev ?? false)); + } + if (seen) { + await session.db.unsafeExecute( + 'UPDATE user_profile SET "lastSeenAt" = @now WHERE id = @user', + parameters: QueryParameters.named({'user': userId, 'now': now}), + ); + } + } on Exception catch (e) { + session.log('Usage tracking failed: $e', level: LogLevel.warning); + } + } + + /// Whether `lastSeenAt` of [userId] is due a write (and marks it). + static bool _touchLastSeen(int userId, DateTime now) { + final last = _lastSeen.get(userId); + if (last != null && now.difference(last) < lastSeenInterval) return false; + _lastSeen.put(userId, now); + return true; + } + + /// [actor] opened [item] (a document stream, a deck, a file preview). + static Future opened(Session session, Actor actor, DriveItem item) { + _kinds.put(item.id!, item.kind); + final app = _appOfActor(actor, item.kind); + if (app == null) return Future.value(); + return active(session, actor.userId, app); + } + + /// The built-in templates of the welcome content every account gets + /// (not counted as created by the user). + static const welcomeTemplates = { + BuiltinTemplates.welcomeDocumentKey, + BuiltinTemplates.welcomeSpreadsheetKey, + }; + + /// [actor] created or edited the item [itemId] ([template]: the template + /// it was created from). Scripts and the system are not people at work + /// and are left out, as is the welcome content; the assistant's edits + /// count for the person who asked. + static Future edited( + Session session, + Actor? actor, + int itemId, { + Object? template, + }) async { + if (actor == null || welcomeTemplates.contains(template)) return; + if (actor.kind == ActorKind.script || actor.kind == ActorKind.system) { + return; + } + var kind = _kinds.get(itemId); + if (kind == null) { + try { + kind = (await DriveItem.db.findById(session, itemId))?.kind; + } on Exception catch (e) { + session.log('Usage tracking failed: $e', level: LogLevel.warning); + } + if (kind == null) return; + _kinds.put(itemId, kind); + } + final app = _appOfActor(actor, kind); + if (app == null) return; + await active(session, actor.userId, app, edited: true); + } + + /// A tool call by an MCP client with [userId]'s token. + static Future mcpCall(Session session, int userId) async { + await active(session, userId, UsageApp.mcp); + await increment(session, mcpCalls); + } + + /// Adds [by] to today's counter [name]. + static Future increment( + Session session, + String name, [ + int by = 1, + ]) async { + try { + await session.db.unsafeExecute( + 'INSERT INTO usage_counter_day ("day", "name", "value") ' + 'VALUES (@day, @name, @by) ' + 'ON CONFLICT ("day", "name") DO UPDATE SET ' + '"value" = usage_counter_day."value" + EXCLUDED."value"', + parameters: QueryParameters.named({ + 'day': ActivityService.dayOf(nowUtc()), + 'name': name, + 'by': by, + }), + ); + } on Exception catch (e) { + session.log('Usage tracking failed: $e', level: LogLevel.warning); + } + } + + static UsageApp? _appOfActor(Actor actor, DriveItemKind kind) => + switch (actor.kind) { + ActorKind.user || ActorKind.ai => appOf(kind), + ActorKind.mcp => UsageApp.mcp, + ActorKind.script || ActorKind.system => null, + }; + + /// Keeps activity rows for 400 days (a year-over-year view of the last + /// 30 days) and counters as long; returns the deleted count. + static Future purge(Session session, {DateTime? now}) async { + final cutoff = ActivityService.dayOf( + now ?? nowUtc(), + ).subtract(const Duration(days: retentionDays)); + final days = await UserActivityDay.db.deleteWhere( + session, + where: (t) => t.day < cutoff, + ); + final counters = await UsageCounterDay.db.deleteWhere( + session, + where: (t) => t.day < cutoff, + ); + return days.length + counters.length; + } + + /// How long activity is kept. + static const retentionDays = 400; + + /// Forgets what this instance wrote (for tests that move the clock). + static void reset() { + _seen.clear(); + _kinds.clear(); + _lastSeen.clear(); + } +} diff --git a/wonky_server/lib/src/platform/board/ai/spec_index.g.dart b/wonky_server/lib/src/platform/board/ai/spec_index.g.dart index 5e708acb..d2fb7b89 100644 --- a/wonky_server/lib/src/platform/board/ai/spec_index.g.dart +++ b/wonky_server/lib/src/platform/board/ai/spec_index.g.dart @@ -34,6 +34,7 @@ const specIndexReadme = '| 16 | Bugs & improvements (specs/16-bugs-and-improvements.md) | Public board for bug reports and improvement ideas: report dialog with annotated screenshots, votes, comments, AI triage and moderation, admins, tasks with contributor prompts, claims, GitHub PR rules (M12, built) |\n' '| 17 | RevLog sync (specs/17-revlog-sync.md) | Server-sequenced op log of Sheets and Slides: decisions, data model, change sets and apply rules, protocol, server (sequencer, hooks, pages, headless cache), client (cache, outbox, bootstrap, conflicts), performance gates, as-built notes (M13) |\n' '| 18 | Publications & submissions (specs/18-publications-and-submissions.md) | Blogs register a publication; contributors write in Wonky Write and *Submit* to the blog\'s review queue (signed webhooks, publication API, moderators with comment access, feedback in the document) (M14, built) |\n' + '| 19 | Usage analytics (specs/19-usage-analytics.md) | First-party analytics for admins in Wonky Drive: daily activity per person and app (ids and counts only), DAU/WAU/MAU, content, collaboration, AI and MCP use, sign-up cohorts, a daily rollup (built) |\n' '## Conventions used in all specs'; /// Headings of the suite specs (`specs/*.md`). @@ -396,6 +397,17 @@ const specIndexSuite = ' ## 11. Security and privacy summary\n' ' ## 12. Work packages\n' ' ## 13. As built (M14)\n' + 'specs/19-usage-analytics.md\n' + ' # 19 · Usage analytics\n' + ' ## 1. Decisions\n' + ' ## 2. Recording (server)\n' + ' ### 2.1 Rollup and indexes\n' + ' ## 3. Dashboard\n' + ' ### 3.1 Page (`/drive/analytics[?days=…&admins=1]`)\n' + ' ### 3.2 Charts\n' + ' ## 4. Privacy\n' + ' ## 5. Tests\n' + ' ## 6. Later\n' 'specs/v2-review.md\n' ' # Wonky Work v2 — review decisions\n' ' ## Summary\n' @@ -499,6 +511,7 @@ const specIndexApps = { ' ## 5. Opening items\n' ' ## 6. File preview screen (`/drive/file/:uuid`)\n' ' ## 7. Storage page (`/drive/storage`)\n' + ' ### 7.1 Analytics page (`/drive/analytics`, admins only)\n' ' ## 8. Drive settings (`/settings/app`)\n' ' ## 9. Commands\n' ' ## 10. Keyboard map\n' diff --git a/wonky_server/lib/src/platform/comments/comment.spy.yaml b/wonky_server/lib/src/platform/comments/comment.spy.yaml index 83227a61..f07c288c 100644 --- a/wonky_server/lib/src/platform/comments/comment.spy.yaml +++ b/wonky_server/lib/src/platform/comments/comment.spy.yaml @@ -26,3 +26,6 @@ indexes: comment_uuid_idx: fields: uuid unique: true + ### Comments by time (usage analytics, specs/19 §3). + comment_created_idx: + fields: createdAt diff --git a/wonky_server/lib/src/platform/drive/drive_user_state.dart b/wonky_server/lib/src/platform/drive/drive_user_state.dart index a0346c4a..2ea8fd7c 100644 --- a/wonky_server/lib/src/platform/drive/drive_user_state.dart +++ b/wonky_server/lib/src/platform/drive/drive_user_state.dart @@ -2,6 +2,7 @@ import 'package:serverpod/serverpod.dart'; import 'package:wonky_core/wonky_core.dart' show Role; import '../activity/activity_service.dart'; +import '../analytics/usage_tracker.dart'; import '../common/actor.dart'; import '../common/errors.dart'; import '../common/models.dart'; @@ -128,6 +129,7 @@ abstract final class DriveUserStates { ); // Activity dashboard view counts (specs/07 §6). await ActivityService.recordView(session, item.id!, actor.userId); + await UsageTracker.opened(session, actor, item); } /// Records that the caller edited [item] (for "Last modified by me"). diff --git a/wonky_server/lib/src/platform/jobs/maintenance_future_call.dart b/wonky_server/lib/src/platform/jobs/maintenance_future_call.dart index a7987306..fc912d38 100644 --- a/wonky_server/lib/src/platform/jobs/maintenance_future_call.dart +++ b/wonky_server/lib/src/platform/jobs/maintenance_future_call.dart @@ -6,6 +6,7 @@ import '../../write/ot/document_service.dart'; import '../../write/themes/theme_service.dart'; import '../../write/versions/write_history_service.dart'; import '../ai/ai_usage_service.dart'; +import '../analytics/usage_tracker.dart'; import '../common/guarded.dart'; import '../drive/drive_file_service.dart'; import '../drive/drive_trash.dart'; @@ -63,8 +64,8 @@ class MaintenanceFutureCall extends FutureCall { /// Daily: trash purge, (v2) expired uploads and folder kind masks, /// version thinning, op-log and change-log pruning, active-set eviction, - /// server change records, deleted themes, the diff cache, old AI usage - /// and old notifications. + /// server change records, deleted themes, the diff cache, old AI usage, + /// old usage analytics and old notifications. Future daily(Session session) async { await _run( session, @@ -111,6 +112,11 @@ class MaintenanceFutureCall extends FutureCall { () => WriteHistoryService.purgeDiffCache(session), ); await _run(session, 'ai.purgeUsage', () => AiUsageService.purge(session)); + await _run( + session, + 'analytics.purgeActivity', + () => UsageTracker.purge(session), + ); await _run( session, 'notifications.purgeOld', diff --git a/wonky_server/lib/src/platform/mcp/tool_executor.dart b/wonky_server/lib/src/platform/mcp/tool_executor.dart index 033d0272..b8779dd3 100644 --- a/wonky_server/lib/src/platform/mcp/tool_executor.dart +++ b/wonky_server/lib/src/platform/mcp/tool_executor.dart @@ -1,7 +1,8 @@ import 'package:serverpod/serverpod.dart'; -import 'package:wonky_core/wonky_core.dart'; +import 'package:wonky_core/wonky_core.dart' hide ActorKind; import 'package:wonky_write_core/wonky_write_core.dart' show AddressException; +import '../analytics/usage_tracker.dart'; import '../common/models.dart'; import '../common/rate_limiter.dart'; import 'tool_support.dart'; @@ -131,6 +132,10 @@ class ToolExecutor { ); } } + // Usage analytics (specs/19 §2): people's tokens, not the assistant. + if (ctx.actor.kind == ActorKind.mcp) { + await UsageTracker.mcpCall(ctx.session, ctx.actor.userId); + } try { final result = await tool.handler(ctx, ToolArgs(arguments)); return ToolOutcome.success(result); diff --git a/wonky_server/lib/src/platform/sharing/drive_item_permission.spy.yaml b/wonky_server/lib/src/platform/sharing/drive_item_permission.spy.yaml index c5075131..7602204b 100644 --- a/wonky_server/lib/src/platform/sharing/drive_item_permission.spy.yaml +++ b/wonky_server/lib/src/platform/sharing/drive_item_permission.spy.yaml @@ -27,3 +27,6 @@ indexes: ### Hourly removal of expired grants (`sharing.expiredGrants`). perm_expires_idx: fields: expiresAt + ### Shares by time (usage analytics, specs/19 §3). + perm_granted_idx: + fields: grantedAt diff --git a/wonky_server/lib/src/platform/users/user_profile.spy.yaml b/wonky_server/lib/src/platform/users/user_profile.spy.yaml index 0f4a7a5d..3ffca190 100644 --- a/wonky_server/lib/src/platform/users/user_profile.spy.yaml +++ b/wonky_server/lib/src/platform/users/user_profile.spy.yaml @@ -26,3 +26,6 @@ indexes: user_profile_email_idx: fields: email unique: true + ### Sign-ups by time (usage analytics, specs/19 §3). + user_profile_created_idx: + fields: createdAt diff --git a/wonky_server/migrations/20261020133251149-usage-analytics/definition.json b/wonky_server/migrations/20261020133251149-usage-analytics/definition.json new file mode 100644 index 00000000..265c61fb --- /dev/null +++ b/wonky_server/migrations/20261020133251149-usage-analytics/definition.json @@ -0,0 +1,19940 @@ +{ + "__className__": "serverpod.DatabaseDefinition", + "schemaVersion": 2, + "moduleName": "wonky", + "tables": [ + { + "__className__": "serverpod.TableDefinition", + "name": "access_request", + "dartName": "AccessRequest", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "requesterId", + "fieldName": "requesterId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "requestedRole", + "fieldName": "requestedRole", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:AccessRole" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "message", + "fieldName": "message", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "handledAt", + "fieldName": "handledAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "handledById", + "fieldName": "handledById", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "outcome", + "fieldName": "outcome", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:AccessRequestOutcome?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "access_request_fk_0", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "access_request_fk_1", + "columns": [ + "requesterId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "access_request_item_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "handledAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "activity_event", + "dartName": "ActivityEvent", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "actorId", + "fieldName": "actorId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "actorKind", + "fieldName": "actorKind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:ActorKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "type", + "fieldName": "type", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:ActivityType" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "summary", + "fieldName": "summary", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "at", + "fieldName": "at", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "activity_event_fk_0", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "activity_item_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "at" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "ai_function_cache", + "dartName": "AiFunctionCache", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "key", + "fieldName": "key", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spreadsheetUuid", + "fieldName": "spreadsheetUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "model", + "fieldName": "model", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "value", + "fieldName": "value", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "error", + "fieldName": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "hits", + "fieldName": "hits", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "ai_function_cache_key_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "key" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "ai_function_cache_sheet_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "spreadsheetUuid" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "ai_preview_record", + "dartName": "AiPreviewRecord", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "previewId", + "fieldName": "previewId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileUuid", + "fieldName": "fileUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "previewJson", + "fieldName": "previewJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "changesJson", + "fieldName": "changesJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "expiresAt", + "fieldName": "expiresAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "ai_preview_id_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "previewId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "ai_preview_expires_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "expiresAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "ai_usage", + "dartName": "AiUsage", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "model", + "fieldName": "model", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "feature", + "fieldName": "feature", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "inputTokens", + "fieldName": "inputTokens", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "outputTokens", + "fieldName": "outputTokens", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "cacheReadTokens", + "fieldName": "cacheReadTokens", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "cacheWriteTokens", + "fieldName": "cacheWriteTokens", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "at", + "fieldName": "at", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "ai_usage_fk_0", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "ai_usage_user_at_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "at" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "ai_user_key", + "dartName": "AiUserKey", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "provider", + "fieldName": "provider", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:AiProvider" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "apiKey", + "fieldName": "apiKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "ai_user_key_fk_0", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "ai_user_key_user_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "ai_user_setting", + "dartName": "AiUserSetting", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "quality", + "fieldName": "quality", + "columnType": 0, + "isNullable": false, + "columnDefault": "'best'", + "dartType": "protocol:AiQuality" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "ai_user_setting_fk_0", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "ai_user_setting_user_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "assistant_message", + "dartName": "AssistantMessage", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "threadId", + "fieldName": "threadId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "role", + "fieldName": "role", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "contentJson", + "fieldName": "contentJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "displayText", + "fieldName": "displayText", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "toolCallsJson", + "fieldName": "toolCallsJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "visible", + "fieldName": "visible", + "columnType": 1, + "isNullable": false, + "columnDefault": "true", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "replay", + "fieldName": "replay", + "columnType": 1, + "isNullable": false, + "columnDefault": "true", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "runId", + "fieldName": "runId", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "stopReason", + "fieldName": "stopReason", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "assistant_message_fk_0", + "columns": [ + "threadId" + ], + "referenceTable": "assistant_thread", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "assistant_message_thread_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "threadId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "assistant_thread", + "dartName": "AssistantThread", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "title", + "fieldName": "title", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "contextRevision", + "fieldName": "contextRevision", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "contextMarkdown", + "fieldName": "contextMarkdown", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "assistant_thread_fk_0", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "assistant_thread_fk_1", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "assistant_thread_user_item_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "updatedAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "banding", + "dartName": "Banding", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetId", + "fieldName": "sheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rangeJson", + "fieldName": "rangeJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "styleJson", + "fieldName": "styleJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "banding_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "banding_fk_1", + "columns": [ + "sheetId" + ], + "referenceTable": "sheet", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "banding_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "basic_filter", + "dartName": "BasicFilter", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetId", + "fieldName": "sheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rangeJson", + "fieldName": "rangeJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "criteriaJson", + "fieldName": "criteriaJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sortJson", + "fieldName": "sortJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "basic_filter_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "basic_filter_fk_1", + "columns": [ + "sheetId" + ], + "referenceTable": "sheet", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "basic_filter_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "board_ai_usage", + "dartName": "BoardAiUsage", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "day", + "fieldName": "day", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "provider", + "fieldName": "provider", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "model", + "fieldName": "model", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "feature", + "fieldName": "feature", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "requests", + "fieldName": "requests", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "inputTokens", + "fieldName": "inputTokens", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "outputTokens", + "fieldName": "outputTokens", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_ai_usage_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "day" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "provider" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "model" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "feature" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "board_bundle_suggestion", + "dartName": "BoardBundleSuggestion", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "title", + "fieldName": "title", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rationale", + "fieldName": "rationale", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "area", + "fieldName": "area", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:BoardArea?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "postIds", + "fieldName": "postIds", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "state", + "fieldName": "state", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "board_comment", + "dartName": "BoardComment", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "uuid", + "fieldName": "uuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "postId", + "fieldName": "postId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "taskId", + "fieldName": "taskId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authorId", + "fieldName": "authorId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "body", + "fieldName": "body", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "systemEvent", + "fieldName": "systemEvent", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "moderation", + "fieldName": "moderation", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:BoardModeration" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "moderationReason", + "fieldName": "moderationReason", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "needsCheck", + "fieldName": "needsCheck", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "editedAt", + "fieldName": "editedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "deletedAt", + "fieldName": "deletedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "removedAt", + "fieldName": "removedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "board_comment_fk_0", + "columns": [ + "postId" + ], + "referenceTable": "board_post", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "board_comment_fk_1", + "columns": [ + "taskId" + ], + "referenceTable": "board_task", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "board_comment_fk_2", + "columns": [ + "authorId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_comment_uuid_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "uuid" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_comment_post_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "postId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_comment_task_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "taskId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "board_flag", + "dartName": "BoardFlag", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "postId", + "fieldName": "postId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "commentId", + "fieldName": "commentId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "reason", + "fieldName": "reason", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:BoardFlagReason" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "note", + "fieldName": "note", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "board_flag_fk_0", + "columns": [ + "postId" + ], + "referenceTable": "board_post", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "board_flag_fk_1", + "columns": [ + "commentId" + ], + "referenceTable": "board_comment", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "board_flag_fk_2", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_flag_post_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "postId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_flag_comment_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "commentId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "board_github_delivery", + "dartName": "BoardGithubDelivery", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "deliveryId", + "fieldName": "deliveryId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "event", + "fieldName": "event", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "receivedAt", + "fieldName": "receivedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "payload", + "fieldName": "payload", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "processedAt", + "fieldName": "processedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "attempts", + "fieldName": "attempts", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_github_delivery_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "deliveryId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "board_moderation_log", + "dartName": "BoardModerationLog", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "adminId", + "fieldName": "adminId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "action", + "fieldName": "action", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "targetKind", + "fieldName": "targetKind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:BoardTargetKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "targetId", + "fieldName": "targetId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "beforeJson", + "fieldName": "beforeJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "afterJson", + "fieldName": "afterJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "reason", + "fieldName": "reason", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_moderation_log_target_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "targetKind" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "targetId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "board_post", + "dartName": "BoardPost", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authorId", + "fieldName": "authorId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kind", + "fieldName": "kind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:BoardPostKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "reportedKind", + "fieldName": "reportedKind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:BoardPostKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "area", + "fieldName": "area", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:BoardArea?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "size", + "fieldName": "size", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:BoardSize?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "aiLabels", + "fieldName": "aiLabels", + "columnType": 1, + "isNullable": false, + "columnDefault": "true", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "title", + "fieldName": "title", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "body", + "fieldName": "body", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "contextJson", + "fieldName": "contextJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "appHint", + "fieldName": "appHint", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "screenshotFileId", + "fieldName": "screenshotFileId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "status", + "fieldName": "status", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:BoardPostStatus" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "moderation", + "fieldName": "moderation", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:BoardModeration" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "moderationReason", + "fieldName": "moderationReason", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "needsCheck", + "fieldName": "needsCheck", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "editedByModerator", + "fieldName": "editedByModerator", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "triageState", + "fieldName": "triageState", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:BoardTriageState" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "triageJson", + "fieldName": "triageJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "triageAttempts", + "fieldName": "triageAttempts", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "suggestedTitle", + "fieldName": "suggestedTitle", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "summary", + "fieldName": "summary", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "duplicateOfId", + "fieldName": "duplicateOfId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "possibleDuplicateOfId", + "fieldName": "possibleDuplicateOfId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "duplicateHintDismissed", + "fieldName": "duplicateHintDismissed", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "declineReason", + "fieldName": "declineReason", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "taskId", + "fieldName": "taskId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "score", + "fieldName": "score", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "voteCount", + "fieldName": "voteCount", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "commentCount", + "fieldName": "commentCount", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "flagCount", + "fieldName": "flagCount", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "editedAt", + "fieldName": "editedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "deletedAt", + "fieldName": "deletedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "removedAt", + "fieldName": "removedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "board_post_fk_0", + "columns": [ + "authorId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "board_post_fk_1", + "columns": [ + "screenshotFileId" + ], + "referenceTable": "stored_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "board_post_fk_2", + "columns": [ + "taskId" + ], + "referenceTable": "board_task", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_post_list_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "moderation" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "kind" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "status" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "score" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_post_author_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "authorId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_post_task_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "taskId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "board_pull_request", + "dartName": "BoardPullRequest", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "prNumber", + "fieldName": "prNumber", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "taskId", + "fieldName": "taskId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authorLogin", + "fieldName": "authorLogin", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "headSha", + "fieldName": "headSha", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "state", + "fieldName": "state", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "gateState", + "fieldName": "gateState", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "gateReason", + "fieldName": "gateReason", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "gateFirstFailedAt", + "fieldName": "gateFirstFailedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "gateCommentId", + "fieldName": "gateCommentId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "reviewCommentId", + "fieldName": "reviewCommentId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastReviewSha", + "fieldName": "lastReviewSha", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastReviewJson", + "fieldName": "lastReviewJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastReviewAt", + "fieldName": "lastReviewAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "reviewDay", + "fieldName": "reviewDay", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "reviewCount", + "fieldName": "reviewCount", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "mergeCommitSha", + "fieldName": "mergeCommitSha", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "reviewPendingSha", + "fieldName": "reviewPendingSha", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "reviewDueAt", + "fieldName": "reviewDueAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "board_pull_request_fk_0", + "columns": [ + "taskId" + ], + "referenceTable": "board_task", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_pull_request_number_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "prNumber" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "board_task", + "dartName": "BoardTask", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "title", + "fieldName": "title", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "area", + "fieldName": "area", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:BoardArea" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "size", + "fieldName": "size", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:BoardSize" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "status", + "fieldName": "status", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:BoardTaskStatus" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "promptBody", + "fieldName": "promptBody", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "promptGeneratedAt", + "fieldName": "promptGeneratedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "promptRequestedAt", + "fieldName": "promptRequestedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "promptNote", + "fieldName": "promptNote", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "promptExcludedCommentIds", + "fieldName": "promptExcludedCommentIds", + "columnType": 8, + "isNullable": true, + "dartType": "List?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "promptEditedById", + "fieldName": "promptEditedById", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "promptEditedAt", + "fieldName": "promptEditedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdById", + "fieldName": "createdById", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "publishedAt", + "fieldName": "publishedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "claimedById", + "fieldName": "claimedById", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "claimedAt", + "fieldName": "claimedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "claimExpiresAt", + "fieldName": "claimExpiresAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "claimWarnedAt", + "fieldName": "claimWarnedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "claimCode", + "fieldName": "claimCode", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "pullRequestUrl", + "fieldName": "pullRequestUrl", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "prNumber", + "fieldName": "prNumber", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "prAuthorLogin", + "fieldName": "prAuthorLogin", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "mergeCommitSha", + "fieldName": "mergeCommitSha", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "doneAt", + "fieldName": "doneAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "shippedDeploySha", + "fieldName": "shippedDeploySha", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "shippedAt", + "fieldName": "shippedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "board_task_fk_0", + "columns": [ + "claimedById" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_task_status_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "status" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_task_claim_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "claimedById" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "board_user_profile", + "dartName": "BoardUserProfile", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "githubLogin", + "fieldName": "githubLogin", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "blockedAt", + "fieldName": "blockedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "blockedUntil", + "fieldName": "blockedUntil", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "blockedReason", + "fieldName": "blockedReason", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "blockedById", + "fieldName": "blockedById", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "board_user_profile_fk_0", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_user_profile_user_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "board_vote", + "dartName": "BoardVote", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "postId", + "fieldName": "postId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "value", + "fieldName": "value", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "board_vote_fk_0", + "columns": [ + "postId" + ], + "referenceTable": "board_post", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "board_vote_fk_1", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_vote_unique_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "postId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_vote_recent_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "postId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "cell", + "dartName": "Cell", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetId", + "fieldName": "sheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rowId", + "fieldName": "rowId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "columnId", + "fieldName": "columnId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "content", + "fieldName": "content", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "note", + "fieldName": "note", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "numberFormat", + "fieldName": "numberFormat", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fontFamily", + "fieldName": "fontFamily", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fontSize", + "fieldName": "fontSize", + "columnType": 3, + "isNullable": true, + "dartType": "double?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "bold", + "fieldName": "bold", + "columnType": 1, + "isNullable": true, + "dartType": "bool?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "italic", + "fieldName": "italic", + "columnType": 1, + "isNullable": true, + "dartType": "bool?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "underline", + "fieldName": "underline", + "columnType": 1, + "isNullable": true, + "dartType": "bool?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "strikethrough", + "fieldName": "strikethrough", + "columnType": 1, + "isNullable": true, + "dartType": "bool?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "textColor", + "fieldName": "textColor", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fillColor", + "fieldName": "fillColor", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "hAlign", + "fieldName": "hAlign", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:HorizontalAlign?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "vAlign", + "fieldName": "vAlign", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:VerticalAlign?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "wrap", + "fieldName": "wrap", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:WrapStrategy?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rotation", + "fieldName": "rotation", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "borderTop", + "fieldName": "borderTop", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "borderRight", + "fieldName": "borderRight", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "borderBottom", + "fieldName": "borderBottom", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "borderLeft", + "fieldName": "borderLeft", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "linkUrl", + "fieldName": "linkUrl", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "cell_fk_0", + "columns": [ + "sheetId" + ], + "referenceTable": "sheet", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "cell_row_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "sheetId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "rowId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "cell_col_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "sheetId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "columnId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "cell_history", + "dartName": "CellHistory", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileUuid", + "fieldName": "fileUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetId", + "fieldName": "sheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rowId", + "fieldName": "rowId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "colId", + "fieldName": "colId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userUuid", + "fieldName": "userUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "actorKind", + "fieldName": "actorKind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:ActorKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "label", + "fieldName": "label", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "at", + "fieldName": "at", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "before", + "fieldName": "before", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "after", + "fieldName": "after", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "cell_history_cell_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileUuid" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "sheetId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "rowId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "colId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "at" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "cell_history_change_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileUuid" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "revision" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "rowId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "colId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "chart_link", + "dartName": "ChartLink", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "elementId", + "fieldName": "elementId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spreadsheetItemUuid", + "fieldName": "spreadsheetItemUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "chartObjectId", + "fieldName": "chartObjectId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetId", + "fieldName": "sheetId", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sourceSpecJson", + "fieldName": "sourceSpecJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "dataSnapshotJson", + "fieldName": "dataSnapshotJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sourceVersion", + "fieldName": "sourceVersion", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedBy", + "fieldName": "updatedBy", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "autoUpdate", + "fieldName": "autoUpdate", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "chart_link_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "chart_link_fk_1", + "columns": [ + "elementId" + ], + "referenceTable": "slide_element", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "chart_link_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "chart_link_element_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "elementId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "code_state", + "dartName": "CodeState", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "elementId", + "fieldName": "elementId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sortKey", + "fieldName": "sortKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "label", + "fieldName": "label", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "code", + "fieldName": "code", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "language", + "fieldName": "language", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "title", + "fieldName": "title", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "highlight", + "fieldName": "highlight", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "annotationsJson", + "fieldName": "annotationsJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "transitionJson", + "fieldName": "transitionJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "code_state_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "code_state_fk_1", + "columns": [ + "elementId" + ], + "referenceTable": "slide_element", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "code_state_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "code_state_element_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "elementId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "sortKey" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "comment", + "dartName": "Comment", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "threadId", + "fieldName": "threadId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "uuid", + "fieldName": "uuid", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authorId", + "fieldName": "authorId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authorKind", + "fieldName": "authorKind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:ActorKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "body", + "fieldName": "body", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "mentions", + "fieldName": "mentions", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "reactions", + "fieldName": "reactions", + "columnType": 0, + "isNullable": false, + "columnDefault": "'{}'", + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "editedAt", + "fieldName": "editedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "deletedAt", + "fieldName": "deletedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "systemEvent", + "fieldName": "systemEvent", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:CommentSystemEvent?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "publicationId", + "fieldName": "publicationId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "comment_fk_0", + "columns": [ + "threadId" + ], + "referenceTable": "comment_thread", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "comment_fk_1", + "columns": [ + "publicationId" + ], + "referenceTable": "publication", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "comment_thread_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "threadId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "comment_uuid_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "uuid" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "comment_thread", + "dartName": "CommentThread", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "uuid", + "fieldName": "uuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "anchorKind", + "fieldName": "anchorKind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:CommentAnchorKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "anchorJson", + "fieldName": "anchorJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "quotedText", + "fieldName": "quotedText", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "status", + "fieldName": "status", + "columnType": 0, + "isNullable": false, + "columnDefault": "'open'", + "dartType": "protocol:CommentStatus" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdById", + "fieldName": "createdById", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "resolvedById", + "fieldName": "resolvedById", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "resolvedAt", + "fieldName": "resolvedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "assigneeId", + "fieldName": "assigneeId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "statusBeforeOrphan", + "fieldName": "statusBeforeOrphan", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:CommentStatus?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "orphanReasonJson", + "fieldName": "orphanReasonJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "suggestionId", + "fieldName": "suggestionId", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "comment_thread_fk_0", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "comment_thread_item_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "status" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "comment_thread_uuid_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "uuid" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "conditional_format_rule", + "dartName": "ConditionalFormatRule", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetId", + "fieldName": "sheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sortKey", + "fieldName": "sortKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rangesJson", + "fieldName": "rangesJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "ruleJson", + "fieldName": "ruleJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "enabled", + "fieldName": "enabled", + "columnType": 1, + "isNullable": false, + "columnDefault": "true", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "conditional_format_rule_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "conditional_format_rule_fk_1", + "columns": [ + "sheetId" + ], + "referenceTable": "sheet", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "conditional_format_rule_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "data_validation_rule", + "dartName": "DataValidationRule", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetId", + "fieldName": "sheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rangesJson", + "fieldName": "rangesJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "criteriaJson", + "fieldName": "criteriaJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "strict", + "fieldName": "strict", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "showDropdown", + "fieldName": "showDropdown", + "columnType": 1, + "isNullable": false, + "columnDefault": "true", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "displayStyle", + "fieldName": "displayStyle", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "helpText", + "fieldName": "helpText", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "data_validation_rule_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "data_validation_rule_fk_1", + "columns": [ + "sheetId" + ], + "referenceTable": "sheet", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "data_validation_rule_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "deck", + "dartName": "Deck", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "title", + "fieldName": "title", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "width", + "fieldName": "width", + "columnType": 3, + "isNullable": false, + "columnDefault": "1920.0", + "dartType": "double" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "height", + "fieldName": "height", + "columnType": 3, + "isNullable": false, + "columnDefault": "1080.0", + "dartType": "double" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sizePreset", + "fieldName": "sizePreset", + "columnType": 0, + "isNullable": false, + "columnDefault": "'widescreen16x9'", + "dartType": "protocol:SlideSizePreset" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "themeId", + "fieldName": "themeId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "appearance", + "fieldName": "appearance", + "columnType": 0, + "isNullable": false, + "columnDefault": "'light'", + "dartType": "protocol:DeckAppearance" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "language", + "fieldName": "language", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "showSlideNumbers", + "fieldName": "showSlideNumbers", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "hideNumberOnTitle", + "fieldName": "hideNumberOnTitle", + "columnType": 1, + "isNullable": false, + "columnDefault": "true", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "firstSlideNumber", + "fieldName": "firstSlideNumber", + "columnType": 6, + "isNullable": false, + "columnDefault": "1", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "footerText", + "fieldName": "footerText", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "defaultsJson", + "fieldName": "defaultsJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "guidesJson", + "fieldName": "guidesJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "presentJson", + "fieldName": "presentJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdBy", + "fieldName": "createdBy", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "deck_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "deck_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "deck_theme", + "dartName": "DeckTheme", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "deckId", + "fieldName": "deckId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sourceKey", + "fieldName": "sourceKey", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "colorsJson", + "fieldName": "colorsJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fontsJson", + "fieldName": "fontsJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "textStylesJson", + "fieldName": "textStylesJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "backgroundJson", + "fieldName": "backgroundJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "shapeStyleJson", + "fieldName": "shapeStyleJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "tableStyleJson", + "fieldName": "tableStyleJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "codeStyleJson", + "fieldName": "codeStyleJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "chartStyleJson", + "fieldName": "chartStyleJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sortKey", + "fieldName": "sortKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "deck_theme_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "deck_theme_fk_1", + "columns": [ + "deckId" + ], + "referenceTable": "deck", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "deck_theme_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "deck_theme_deck_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "deckId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "dimension_group", + "dartName": "DimensionGroup", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetId", + "fieldName": "sheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "dimension", + "fieldName": "dimension", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:Dimension" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "startId", + "fieldName": "startId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "endId", + "fieldName": "endId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "depth", + "fieldName": "depth", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "collapsed", + "fieldName": "collapsed", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "dimension_group_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "dimension_group_fk_1", + "columns": [ + "sheetId" + ], + "referenceTable": "sheet", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "dimension_group_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "document", + "dartName": "Document", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "uuid", + "fieldName": "uuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "headRevision", + "fieldName": "headRevision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "latestSnapshotRevision", + "fieldName": "latestSnapshotRevision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "themeId", + "fieldName": "themeId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "pageSetupJson", + "fieldName": "pageSetupJson", + "columnType": 0, + "isNullable": false, + "columnDefault": "'{}'", + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "language", + "fieldName": "language", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "frontMatter", + "fieldName": "frontMatter", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "charCount", + "fieldName": "charCount", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "wordCount", + "fieldName": "wordCount", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "document_fk_0", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "document_uuid_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "uuid" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "document_item_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "document_import_report", + "dartName": "DocumentImportReport", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "documentId", + "fieldName": "documentId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "warningsJson", + "fieldName": "warningsJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "seenAt", + "fieldName": "seenAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "document_import_report_fk_0", + "columns": [ + "documentId" + ], + "referenceTable": "document", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "document_import_report_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "documentId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "document_meta_change", + "dartName": "DocumentMetaChange", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "documentId", + "fieldName": "documentId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "field", + "fieldName": "field", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "clientOpId", + "fieldName": "clientOpId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "beforeJson", + "fieldName": "beforeJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "afterJson", + "fieldName": "afterJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authorId", + "fieldName": "authorId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "actorKind", + "fieldName": "actorKind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:ActorKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "document_meta_change_fk_0", + "columns": [ + "documentId" + ], + "referenceTable": "document", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "document_meta_change_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "documentId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "document_meta_change_client_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "documentId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "clientOpId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "document_op", + "dartName": "DocumentOp", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "documentId", + "fieldName": "documentId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "clientOpId", + "fieldName": "clientOpId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authorId", + "fieldName": "authorId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "actorKind", + "fieldName": "actorKind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:ActorKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sessionId", + "fieldName": "sessionId", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kind", + "fieldName": "kind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:DocumentOpKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "baseRevision", + "fieldName": "baseRevision", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "deltaJson", + "fieldName": "deltaJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "inverseJson", + "fieldName": "inverseJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "document_op_fk_0", + "columns": [ + "documentId" + ], + "referenceTable": "document", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "document_op_rev_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "documentId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "revision" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "document_op_client_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "documentId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "clientOpId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "document_op_created_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "brin", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "document_snapshot", + "dartName": "DocumentSnapshot", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "documentId", + "fieldName": "documentId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "deltaJson", + "fieldName": "deltaJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "compressed", + "fieldName": "compressed", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "document_snapshot_fk_0", + "columns": [ + "documentId" + ], + "referenceTable": "document", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "document_snapshot_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "documentId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "revision" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "drive_item", + "dartName": "DriveItem", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "uuid", + "fieldName": "uuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kind", + "fieldName": "kind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:DriveItemKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "ownerId", + "fieldName": "ownerId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "parentId", + "fieldName": "parentId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "description", + "fieldName": "description", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "contentRef", + "fieldName": "contentRef", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "thumbnailFileId", + "fieldName": "thumbnailFileId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sizeBytes", + "fieldName": "sizeBytes", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "attachmentBytes", + "fieldName": "attachmentBytes", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kindMask", + "fieldName": "kindMask", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "mimeType", + "fieldName": "mimeType", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileCategory", + "fieldName": "fileCategory", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:FileCategory?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "uploadState", + "fieldName": "uploadState", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:FileUploadState?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileMetaJson", + "fieldName": "fileMetaJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "previewFileId", + "fieldName": "previewFileId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdById", + "fieldName": "createdById", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "modifiedAt", + "fieldName": "modifiedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "modifiedById", + "fieldName": "modifiedById", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "trashedAt", + "fieldName": "trashedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "trashedById", + "fieldName": "trashedById", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "templateOf", + "fieldName": "templateOf", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:TemplateCategory?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "templateKey", + "fieldName": "templateKey", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "editorsCanShare", + "fieldName": "editorsCanShare", + "columnType": 1, + "isNullable": false, + "columnDefault": "true", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "nonEditorsCanExport", + "fieldName": "nonEditorsCanExport", + "columnType": 1, + "isNullable": false, + "columnDefault": "true", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "viewersSeeComments", + "fieldName": "viewersSeeComments", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "searchText", + "fieldName": "searchText", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "drive_item_fk_0", + "columns": [ + "ownerId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 2 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "drive_item_fk_1", + "columns": [ + "parentId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "drive_item_uuid_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "uuid" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "drive_item_parent_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "parentId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "drive_item_owner_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "ownerId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "trashedAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "drive_item_content_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "contentRef" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "drive_item_template_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "templateOf" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "drive_item_upload_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "uploadState" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "drive_item_trashed_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "trashedAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "drive_item_permission", + "dartName": "DriveItemPermission", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "invitedEmail", + "fieldName": "invitedEmail", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "role", + "fieldName": "role", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:AccessRole" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "inheritedFromId", + "fieldName": "inheritedFromId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "grantedById", + "fieldName": "grantedById", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "grantedAt", + "fieldName": "grantedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "expiresAt", + "fieldName": "expiresAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "viaPublicationId", + "fieldName": "viaPublicationId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "drive_item_permission_fk_0", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "drive_item_permission_fk_1", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "drive_item_permission_fk_2", + "columns": [ + "viaPublicationId" + ], + "referenceTable": "publication", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "perm_item_user_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "inheritedFromId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "invitedEmail" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false, + "nullsDistinct": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "perm_user_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "perm_email_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "invitedEmail" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "perm_expires_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "expiresAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "drive_item_user_state", + "dartName": "DriveItemUserState", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "starred", + "fieldName": "starred", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastOpenedAt", + "fieldName": "lastOpenedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastEditedAt", + "fieldName": "lastEditedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "pinnedOffline", + "fieldName": "pinnedOffline", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "shortcutParentId", + "fieldName": "shortcutParentId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "viaLink", + "fieldName": "viaLink", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "drive_item_user_state_fk_0", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "drive_item_user_state_fk_1", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "drive_item_user_state_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "drive_item_user_recent_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "lastOpenedAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "embedded_object", + "dartName": "EmbeddedObject", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetId", + "fieldName": "sheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kind", + "fieldName": "kind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:EmbeddedObjectKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "anchorJson", + "fieldName": "anchorJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "specJson", + "fieldName": "specJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "zIndex", + "fieldName": "zIndex", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "title", + "fieldName": "title", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "altText", + "fieldName": "altText", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "embedded_object_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "embedded_object_fk_1", + "columns": [ + "sheetId" + ], + "referenceTable": "sheet", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "embedded_object_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "feedback_report", + "dartName": "FeedbackReport", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kind", + "fieldName": "kind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:FeedbackKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "message", + "fieldName": "message", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "app", + "fieldName": "app", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "appVersion", + "fieldName": "appVersion", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "platform", + "fieldName": "platform", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "route", + "fieldName": "route", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "stackTrace", + "fieldName": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "contextJson", + "fieldName": "contextJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "feedback_report_created_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "filter_view", + "dartName": "FilterView", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetId", + "fieldName": "sheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rangeJson", + "fieldName": "rangeJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "criteriaJson", + "fieldName": "criteriaJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sortJson", + "fieldName": "sortJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdBy", + "fieldName": "createdBy", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "filter_view_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "filter_view_fk_1", + "columns": [ + "sheetId" + ], + "referenceTable": "sheet", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "filter_view_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "headless_change", + "dartName": "HeadlessChange", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "changeId", + "fieldName": "changeId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kind", + "fieldName": "kind", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "documentId", + "fieldName": "documentId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "inverseJson", + "fieldName": "inverseJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "metaField", + "fieldName": "metaField", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "metaBeforeJson", + "fieldName": "metaBeforeJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "metaAfterJson", + "fieldName": "metaAfterJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "actorKind", + "fieldName": "actorKind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:ActorKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "label", + "fieldName": "label", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "toolName", + "fieldName": "toolName", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revertedAt", + "fieldName": "revertedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "headless_change_fk_0", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "headless_change_id_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "changeId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "headless_change_created_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "item_version", + "dartName": "ItemVersion", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kind", + "fieldName": "kind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:VersionKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdById", + "fieldName": "createdById", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authors", + "fieldName": "authors", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "storageKind", + "fieldName": "storageKind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:VersionStorage" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "snapshotFileId", + "fieldName": "snapshotFileId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sizeBytes", + "fieldName": "sizeBytes", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "item_version_fk_0", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "item_version_item_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "item_version_state", + "dartName": "ItemVersionState", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastEditAt", + "fieldName": "lastEditAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "dirtySince", + "fieldName": "dirtySince", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastVersionAt", + "fieldName": "lastVersionAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "editorsSinceLastVersion", + "fieldName": "editorsSinceLastVersion", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastRevision", + "fieldName": "lastRevision", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "capturingSince", + "fieldName": "capturingSince", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "item_version_state_fk_0", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "item_version_state_item_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "item_version_state_dirty_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "dirtySince" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "item_view_day", + "dartName": "ItemViewDay", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "day", + "fieldName": "day", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "views", + "fieldName": "views", + "columnType": 6, + "isNullable": false, + "columnDefault": "1", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastViewedAt", + "fieldName": "lastViewedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "item_view_day_fk_0", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "item_view_day_fk_1", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "item_view_day_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "day" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "item_view_day_item_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "day" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "macro", + "dartName": "Macro", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "projectId", + "fieldName": "projectId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "functionName", + "fieldName": "functionName", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "shortcutSlot", + "fieldName": "shortcutSlot", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "macro_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "macro_fk_1", + "columns": [ + "projectId" + ], + "referenceTable": "script_project", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "macro_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "merged_range", + "dartName": "MergedRange", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetId", + "fieldName": "sheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rangeJson", + "fieldName": "rangeJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "merged_range_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "merged_range_fk_1", + "columns": [ + "sheetId" + ], + "referenceTable": "sheet", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "merged_range_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "named_range", + "dartName": "NamedRange", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spreadsheetId", + "fieldName": "spreadsheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rangeJson", + "fieldName": "rangeJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "formula", + "fieldName": "formula", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "comment", + "fieldName": "comment", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "metaJson", + "fieldName": "metaJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "named_range_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "named_range_fk_1", + "columns": [ + "spreadsheetId" + ], + "referenceTable": "spreadsheet", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "named_range_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "notification", + "dartName": "UserNotification", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kind", + "fieldName": "kind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:NotificationKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "actorId", + "fieldName": "actorId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "payload", + "fieldName": "payload", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "readAt", + "fieldName": "readAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "emailedAt", + "fieldName": "emailedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "emailPending", + "fieldName": "emailPending", + "columnType": 1, + "isNullable": true, + "columnDefault": "false", + "dartType": "bool?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "notification_fk_0", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "notification_user_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "notification_email_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "emailPending" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "notification_created_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "brin", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "ownership_transfer", + "dartName": "OwnershipTransfer", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fromUserId", + "fieldName": "fromUserId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "toUserId", + "fieldName": "toUserId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "handledAt", + "fieldName": "handledAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "accepted", + "fieldName": "accepted", + "columnType": 1, + "isNullable": true, + "dartType": "bool?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "ownership_transfer_fk_0", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "ownership_transfer_fk_1", + "columns": [ + "toUserId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "ownership_transfer_item_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "handledAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "personal_access_token", + "dartName": "PersonalAccessToken", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "tokenHash", + "fieldName": "tokenHash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "prefix", + "fieldName": "prefix", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "scopes", + "fieldName": "scopes", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "expiresAt", + "fieldName": "expiresAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastUsedAt", + "fieldName": "lastUsedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revokedAt", + "fieldName": "revokedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "personal_access_token_fk_0", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "personal_access_token_user_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "personal_access_token_hash_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "tokenHash" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "pivot_table", + "dartName": "PivotTable", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetId", + "fieldName": "sheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "anchorRowId", + "fieldName": "anchorRowId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "anchorColId", + "fieldName": "anchorColId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sourceRangeJson", + "fieldName": "sourceRangeJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "specJson", + "fieldName": "specJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "pivot_table_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "pivot_table_fk_1", + "columns": [ + "sheetId" + ], + "referenceTable": "sheet", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "pivot_table_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "protected_range", + "dartName": "ProtectedRange", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetId", + "fieldName": "sheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rangeJson", + "fieldName": "rangeJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "exceptRangesJson", + "fieldName": "exceptRangesJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "description", + "fieldName": "description", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "warningOnly", + "fieldName": "warningOnly", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "editorsJson", + "fieldName": "editorsJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdBy", + "fieldName": "createdBy", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "protected_range_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "protected_range_fk_1", + "columns": [ + "sheetId" + ], + "referenceTable": "sheet", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "protected_range_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "publication", + "dartName": "Publication", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "publicId", + "fieldName": "publicId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "ownerId", + "fieldName": "ownerId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "siteUrl", + "fieldName": "siteUrl", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "webhookUrl", + "fieldName": "webhookUrl", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "verifiedHost", + "fieldName": "verifiedHost", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "verifiedAt", + "fieldName": "verifiedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "templateItemId", + "fieldName": "templateItemId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "termsUrl", + "fieldName": "termsUrl", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fields", + "fieldName": "fields", + "columnType": 8, + "isNullable": false, + "dartType": "protocol:PublicationFields" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "signingSecret", + "fieldName": "signingSecret", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "previousSigningSecret", + "fieldName": "previousSigningSecret", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "previousSecretUntil", + "fieldName": "previousSecretUntil", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "apiKeyHash", + "fieldName": "apiKeyHash", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "apiKeyLast4", + "fieldName": "apiKeyLast4", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "enabled", + "fieldName": "enabled", + "columnType": 1, + "isNullable": false, + "columnDefault": "true", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "publication_fk_0", + "columns": [ + "ownerId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "publication_fk_1", + "columns": [ + "templateItemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "publication_public_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "publicId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "publication_owner_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "ownerId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "publication_api_key_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "apiKeyHash" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "publication_block", + "dartName": "PublicationBlock", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "publicationId", + "fieldName": "publicationId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "at", + "fieldName": "at", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "publication_block_fk_0", + "columns": [ + "publicationId" + ], + "referenceTable": "publication", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "publication_block_fk_1", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "publication_block_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "publicationId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "publication_consent", + "dartName": "PublicationConsent", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "publicationId", + "fieldName": "publicationId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "consentKey", + "fieldName": "consentKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "at", + "fieldName": "at", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "publication_consent_fk_0", + "columns": [ + "publicationId" + ], + "referenceTable": "publication", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "publication_consent_fk_1", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "publication_consent_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "publicationId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "publication_delivery", + "dartName": "PublicationDelivery", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "publicationId", + "fieldName": "publicationId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "submissionId", + "fieldName": "submissionId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "webhookId", + "fieldName": "webhookId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "type", + "fieldName": "type", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sequence", + "fieldName": "sequence", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "payload", + "fieldName": "payload", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "attempts", + "fieldName": "attempts", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "nextAttemptAt", + "fieldName": "nextAttemptAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "leaseUntil", + "fieldName": "leaseUntil", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastStatus", + "fieldName": "lastStatus", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastError", + "fieldName": "lastError", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "deliveredAt", + "fieldName": "deliveredAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "failedAt", + "fieldName": "failedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "publication_delivery_fk_0", + "columns": [ + "publicationId" + ], + "referenceTable": "publication", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "publication_delivery_fk_1", + "columns": [ + "submissionId" + ], + "referenceTable": "submission", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "publication_delivery_webhook_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "webhookId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "publication_delivery_due_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "nextAttemptAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "publication_delivery_publication_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "publicationId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "publication_moderator", + "dartName": "PublicationModerator", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "publicationId", + "fieldName": "publicationId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "email", + "fieldName": "email", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "publication_moderator_fk_0", + "columns": [ + "publicationId" + ], + "referenceTable": "publication", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "publication_moderator_fk_1", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "publication_moderator_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "publicationId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "publication_moderator_user_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "rev_file", + "dartName": "RevFile", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileUuid", + "fieldName": "fileUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kind", + "fieldName": "kind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:RevFileKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "headRevision", + "fieldName": "headRevision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "prunedBelow", + "fieldName": "prunedBelow", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "initPending", + "fieldName": "initPending", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "purging", + "fieldName": "purging", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "schemaHash", + "fieldName": "schemaHash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "stats", + "fieldName": "stats", + "columnType": 0, + "isNullable": false, + "columnDefault": "'{}'", + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "contentCount", + "fieldName": "contentCount", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "rev_file_fk_0", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 2 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "rev_file_uuid_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileUuid" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "rev_file_item_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "rev_hook_state", + "dartName": "RevHookState", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "cursorsJson", + "fieldName": "cursorsJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "leaseOwner", + "fieldName": "leaseOwner", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "leaseUntil", + "fieldName": "leaseUntil", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "attempts", + "fieldName": "attempts", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastError", + "fieldName": "lastError", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "nextAttemptAt", + "fieldName": "nextAttemptAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "rev_hook_state_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "rev_hook_state_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "rev_hook_state_due_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "nextAttemptAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "rev_op", + "dartName": "RevOp", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "clientOpId", + "fieldName": "clientOpId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "baseRevision", + "fieldName": "baseRevision", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authorId", + "fieldName": "authorId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authorUuid", + "fieldName": "authorUuid", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sessionId", + "fieldName": "sessionId", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "onBehalfOfSessionId", + "fieldName": "onBehalfOfSessionId", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "actorKind", + "fieldName": "actorKind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:ActorKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "label", + "fieldName": "label", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "groupId", + "fieldName": "groupId", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "groupIndex", + "fieldName": "groupIndex", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "groupLast", + "fieldName": "groupLast", + "columnType": 1, + "isNullable": false, + "columnDefault": "true", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "recordId", + "fieldName": "recordId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "offline", + "fieldName": "offline", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "payload", + "fieldName": "payload", + "columnType": 5, + "isNullable": true, + "dartType": "dart:typed_data:ByteData?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "changeCount", + "fieldName": "changeCount", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "summaryJson", + "fieldName": "summaryJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "detailJson", + "fieldName": "detailJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "outcomeJson", + "fieldName": "outcomeJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "appliedEqualsSubmitted", + "fieldName": "appliedEqualsSubmitted", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "clientCreatedAt", + "fieldName": "clientCreatedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "committedAt", + "fieldName": "committedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "rev_op_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "rev_op_rev_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "revision" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "rev_op_client_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "clientOpId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "rev_op_record_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "recordId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "rev_op_committed_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "committedAt" + } + ], + "type": "brin", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "script_authorization", + "dartName": "ScriptAuthorization", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spreadsheetUuid", + "fieldName": "spreadsheetUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "scopes", + "fieldName": "scopes", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "grantedAt", + "fieldName": "grantedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revokedAt", + "fieldName": "revokedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "script_auth_user_sheet_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "spreadsheetUuid" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "script_build", + "dartName": "ScriptBuild", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "projectId", + "fieldName": "projectId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "status", + "fieldName": "status", + "columnType": 0, + "isNullable": false, + "columnDefault": "'ok'", + "dartType": "protocol:ScriptBuildStatus" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sourceHash", + "fieldName": "sourceHash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "bytecodeFileUuid", + "fieldName": "bytecodeFileUuid", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "diagnosticsJson", + "fieldName": "diagnosticsJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "exportsJson", + "fieldName": "exportsJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "apiVersion", + "fieldName": "apiVersion", + "columnType": 6, + "isNullable": false, + "columnDefault": "1", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "compilerVersion", + "fieldName": "compilerVersion", + "columnType": 0, + "isNullable": false, + "columnDefault": "''", + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "requestedBy", + "fieldName": "requestedBy", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastGoodSourceHash", + "fieldName": "lastGoodSourceHash", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastGoodBytecodeFileUuid", + "fieldName": "lastGoodBytecodeFileUuid", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastGoodExportsJson", + "fieldName": "lastGoodExportsJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastGoodBuiltAt", + "fieldName": "lastGoodBuiltAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "positionsFileUuid", + "fieldName": "positionsFileUuid", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "builtAt", + "fieldName": "builtAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "script_build_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "script_build_fk_1", + "columns": [ + "projectId" + ], + "referenceTable": "script_project", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "script_build_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "script_execution", + "dartName": "ScriptExecution", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "uuid", + "fieldName": "uuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spreadsheetUuid", + "fieldName": "spreadsheetUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "projectId", + "fieldName": "projectId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "functionName", + "fieldName": "functionName", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kind", + "fieldName": "kind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:ScriptExecutionKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "triggerId", + "fieldName": "triggerId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "runAsUserId", + "fieldName": "runAsUserId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "runtime", + "fieldName": "runtime", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:ScriptRuntimeKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "status", + "fieldName": "status", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:ScriptExecutionStatus" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "buildSourceHash", + "fieldName": "buildSourceHash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "startedAt", + "fieldName": "startedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "durationMs", + "fieldName": "durationMs", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "logs", + "fieldName": "logs", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "errorMessage", + "fieldName": "errorMessage", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "errorStackJson", + "fieldName": "errorStackJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "changeId", + "fieldName": "changeId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "cellsRead", + "fieldName": "cellsRead", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "cellsWritten", + "fieldName": "cellsWritten", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fetchCalls", + "fieldName": "fetchCalls", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "callCount", + "fieldName": "callCount", + "columnType": 6, + "isNullable": false, + "columnDefault": "1", + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "script_exec_uuid_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "uuid" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "script_exec_sheet_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "spreadsheetUuid" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "startedAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "script_exec_user_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "startedAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "script_file", + "dartName": "ScriptFile", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "projectId", + "fieldName": "projectId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sortKey", + "fieldName": "sortKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "source", + "fieldName": "source", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "contentHash", + "fieldName": "contentHash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedBy", + "fieldName": "updatedBy", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "script_file_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "script_file_fk_1", + "columns": [ + "projectId" + ], + "referenceTable": "script_project", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "script_file_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "script_job", + "dartName": "ScriptJob", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kind", + "fieldName": "kind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:ScriptExecutionKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spreadsheetUuid", + "fieldName": "spreadsheetUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemUuid", + "fieldName": "itemUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "triggerId", + "fieldName": "triggerId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "runAsUserId", + "fieldName": "runAsUserId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "functionName", + "fieldName": "functionName", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "payloadJson", + "fieldName": "payloadJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "status", + "fieldName": "status", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:ScriptExecutionStatus" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "enqueuedAt", + "fieldName": "enqueuedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "leaseOwner", + "fieldName": "leaseOwner", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "leaseUntil", + "fieldName": "leaseUntil", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "attempts", + "fieldName": "attempts", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "coalesced", + "fieldName": "coalesced", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "resultJson", + "fieldName": "resultJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "finishedAt", + "fieldName": "finishedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "script_job_status_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "status" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "enqueuedAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "script_job_trigger_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "triggerId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "status" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "script_job_user_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "runAsUserId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "status" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "script_project", + "dartName": "ScriptProject", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spreadsheetId", + "fieldName": "spreadsheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "settingsJson", + "fieldName": "settingsJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "script_project_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "script_project_fk_1", + "columns": [ + "spreadsheetId" + ], + "referenceTable": "spreadsheet", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "script_project_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "script_property", + "dartName": "ScriptProperty", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "projectId", + "fieldName": "projectId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "key", + "fieldName": "key", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "value", + "fieldName": "value", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "script_property_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "script_property_fk_1", + "columns": [ + "projectId" + ], + "referenceTable": "script_project", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "script_property_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "script_quota_usage", + "dartName": "ScriptQuotaUsage", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "day", + "fieldName": "day", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "serverRuntimeMs", + "fieldName": "serverRuntimeMs", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "clientRuntimeMs", + "fieldName": "clientRuntimeMs", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "urlFetchCalls", + "fieldName": "urlFetchCalls", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "urlFetchBytes", + "fieldName": "urlFetchBytes", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "triggerRuns", + "fieldName": "triggerRuns", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "script_quota_user_day_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "day" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "script_trigger", + "dartName": "ScriptTrigger", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "projectId", + "fieldName": "projectId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kind", + "fieldName": "kind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:TriggerKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "functionName", + "fieldName": "functionName", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "scheduleJson", + "fieldName": "scheduleJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "runAsUserId", + "fieldName": "runAsUserId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "enabled", + "fieldName": "enabled", + "columnType": 1, + "isNullable": false, + "columnDefault": "true", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "optionsJson", + "fieldName": "optionsJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "script_trigger_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "script_trigger_fk_1", + "columns": [ + "projectId" + ], + "referenceTable": "script_project", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "script_trigger_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "script_trigger_state", + "dartName": "ScriptTriggerState", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "triggerId", + "fieldName": "triggerId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spreadsheetUuid", + "fieldName": "spreadsheetUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "scheduleJson", + "fieldName": "scheduleJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "nextRunAt", + "fieldName": "nextRunAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastRunAt", + "fieldName": "lastRunAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastStatus", + "fieldName": "lastStatus", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:ScriptExecutionStatus?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "consecutiveFailures", + "fieldName": "consecutiveFailures", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "disabledReason", + "fieldName": "disabledReason", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "runningSince", + "fieldName": "runningSince", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastNotifiedAt", + "fieldName": "lastNotifiedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "script_trigger_state_id_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "triggerId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "script_trigger_state_due_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "nextRunAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "script_user_property", + "dartName": "ScriptUserProperty", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileUuid", + "fieldName": "fileUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "key", + "fieldName": "key", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "value", + "fieldName": "value", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "script_user_property_fk_0", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "script_user_property_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileUuid" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "key" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "server_change_record", + "dartName": "ServerChangeRecord", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "changeId", + "fieldName": "changeId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileUuid", + "fieldName": "fileUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "actorKind", + "fieldName": "actorKind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:ActorKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "label", + "fieldName": "label", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "inverseJson", + "fieldName": "inverseJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "inverseFileId", + "fieldName": "inverseFileId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "forwardFileId", + "fieldName": "forwardFileId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "recordId", + "fieldName": "recordId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "cellsAffected", + "fieldName": "cellsAffected", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "expiresAt", + "fieldName": "expiresAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revertedAt", + "fieldName": "revertedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revertChangeId", + "fieldName": "revertChangeId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "server_change_record_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "recordId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "server_change_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileUuid" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "server_change_id_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "changeId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "share_link", + "dartName": "ShareLink", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "token", + "fieldName": "token", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "role", + "fieldName": "role", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:AccessRole?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdById", + "fieldName": "createdById", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "share_link_fk_0", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "share_link_item_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "share_link_token_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "token" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "sheet", + "dartName": "Sheet", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spreadsheetId", + "fieldName": "spreadsheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sortKey", + "fieldName": "sortKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kind", + "fieldName": "kind", + "columnType": 0, + "isNullable": false, + "columnDefault": "'grid'", + "dartType": "protocol:SheetKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "hidden", + "fieldName": "hidden", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "tabColor", + "fieldName": "tabColor", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rightToLeft", + "fieldName": "rightToLeft", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "showGridlines", + "fieldName": "showGridlines", + "columnType": 1, + "isNullable": false, + "columnDefault": "true", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "frozenRows", + "fieldName": "frozenRows", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "frozenColumns", + "fieldName": "frozenColumns", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "defaultRowHeight", + "fieldName": "defaultRowHeight", + "columnType": 3, + "isNullable": false, + "columnDefault": "21.0", + "dartType": "double" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "defaultColumnWidth", + "fieldName": "defaultColumnWidth", + "columnType": 3, + "isNullable": false, + "columnDefault": "100.0", + "dartType": "double" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "formatJson", + "fieldName": "formatJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "printSettingsJson", + "fieldName": "printSettingsJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "sheet_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "sheet_fk_1", + "columns": [ + "spreadsheetId" + ], + "referenceTable": "spreadsheet", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "sheet_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "sheet_order_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "spreadsheetId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "sortKey" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "sheet_column", + "dartName": "SheetColumn", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetId", + "fieldName": "sheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sortKey", + "fieldName": "sortKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "width", + "fieldName": "width", + "columnType": 3, + "isNullable": true, + "dartType": "double?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "hidden", + "fieldName": "hidden", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "formatJson", + "fieldName": "formatJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "sheet_column_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "sheet_column_fk_1", + "columns": [ + "sheetId" + ], + "referenceTable": "sheet", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "sheet_column_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "sheet_column_order_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "sheetId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "sortKey" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "sheet_row", + "dartName": "SheetRow", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetId", + "fieldName": "sheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sortKey", + "fieldName": "sortKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "height", + "fieldName": "height", + "columnType": 3, + "isNullable": true, + "dartType": "double?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "hidden", + "fieldName": "hidden", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "formatJson", + "fieldName": "formatJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "sheet_row_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "sheet_row_fk_1", + "columns": [ + "sheetId" + ], + "referenceTable": "sheet", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "sheet_row_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "sheet_row_order_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "sheetId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "sortKey" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "sheets_import_job", + "dartName": "SheetsImportJob", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "uuid", + "fieldName": "uuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authUserId", + "fieldName": "authUserId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spreadsheetUuid", + "fieldName": "spreadsheetUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "uploadFileId", + "fieldName": "uploadFileId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileName", + "fieldName": "fileName", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "format", + "fieldName": "format", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "optionsJson", + "fieldName": "optionsJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "activeSheetId", + "fieldName": "activeSheetId", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "status", + "fieldName": "status", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:SheetsImportStatus" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "progressDone", + "fieldName": "progressDone", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "progressTotal", + "fieldName": "progressTotal", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "reportJson", + "fieldName": "reportJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetIdsJson", + "fieldName": "sheetIdsJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "changeId", + "fieldName": "changeId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "errorCode", + "fieldName": "errorCode", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "error", + "fieldName": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "cancelRequested", + "fieldName": "cancelRequested", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "leaseOwner", + "fieldName": "leaseOwner", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "leaseUntil", + "fieldName": "leaseUntil", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "sheets_import_job_uuid_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "uuid" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "sheets_import_job_user_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "status" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "sheets_snapshot_index", + "dartName": "SheetsSnapshotIndex", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemVersionId", + "fieldName": "itemVersionId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetsJson", + "fieldName": "sheetsJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "changedRangesJson", + "fieldName": "changedRangesJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authorIds", + "fieldName": "authorIds", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "diffFileId", + "fieldName": "diffFileId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "sheets_snapshot_index_fk_0", + "columns": [ + "itemVersionId" + ], + "referenceTable": "item_version", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "sheets_snapshot_index_version_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemVersionId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "slide", + "dartName": "Slide", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "deckId", + "fieldName": "deckId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sortKey", + "fieldName": "sortKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "groupId", + "fieldName": "groupId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "layoutId", + "fieldName": "layoutId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "backgroundJson", + "fieldName": "backgroundJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "skipped", + "fieldName": "skipped", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "notes", + "fieldName": "notes", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "transitionJson", + "fieldName": "transitionJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "hideMasterElements", + "fieldName": "hideMasterElements", + "columnType": 1, + "isNullable": true, + "dartType": "bool?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "timingsJson", + "fieldName": "timingsJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_fk_1", + "columns": [ + "deckId" + ], + "referenceTable": "deck", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_order_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "deckId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "sortKey" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "slide_build", + "dartName": "SlideBuild", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "slideId", + "fieldName": "slideId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "elementId", + "fieldName": "elementId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kind", + "fieldName": "kind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:BuildKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "effect", + "fieldName": "effect", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sortKey", + "fieldName": "sortKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "trigger", + "fieldName": "trigger", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:BuildTrigger" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "delayMs", + "fieldName": "delayMs", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "durationMs", + "fieldName": "durationMs", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "easing", + "fieldName": "easing", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "optionsJson", + "fieldName": "optionsJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_build_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_build_fk_1", + "columns": [ + "slideId" + ], + "referenceTable": "slide", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_build_fk_2", + "columns": [ + "elementId" + ], + "referenceTable": "slide_element", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_build_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_build_slide_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "slideId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "sortKey" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_build_element_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "elementId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "slide_element", + "dartName": "SlideElement", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "slideId", + "fieldName": "slideId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "layoutId", + "fieldName": "layoutId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "masterId", + "fieldName": "masterId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "parentId", + "fieldName": "parentId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kind", + "fieldName": "kind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:SlideElementKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "x", + "fieldName": "x", + "columnType": 3, + "isNullable": true, + "dartType": "double?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "y", + "fieldName": "y", + "columnType": 3, + "isNullable": true, + "dartType": "double?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "width", + "fieldName": "width", + "columnType": 3, + "isNullable": true, + "dartType": "double?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "height", + "fieldName": "height", + "columnType": 3, + "isNullable": true, + "dartType": "double?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rotation", + "fieldName": "rotation", + "columnType": 3, + "isNullable": true, + "dartType": "double?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "flipH", + "fieldName": "flipH", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "flipV", + "fieldName": "flipV", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "zKey", + "fieldName": "zKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "readingKey", + "fieldName": "readingKey", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "locked", + "fieldName": "locked", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "hidden", + "fieldName": "hidden", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "placeholderType", + "fieldName": "placeholderType", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:PlaceholderType?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "placeholderOf", + "fieldName": "placeholderOf", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "matchKey", + "fieldName": "matchKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "text", + "fieldName": "text", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "textStyleJson", + "fieldName": "textStyleJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fillJson", + "fieldName": "fillJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "strokeJson", + "fieldName": "strokeJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "effectsJson", + "fieldName": "effectsJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "opacity", + "fieldName": "opacity", + "columnType": 3, + "isNullable": true, + "dartType": "double?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "dataJson", + "fieldName": "dataJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "linkJson", + "fieldName": "linkJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "altText", + "fieldName": "altText", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "decorative", + "fieldName": "decorative", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_element_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_element_fk_1", + "columns": [ + "slideId" + ], + "referenceTable": "slide", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_element_fk_2", + "columns": [ + "layoutId" + ], + "referenceTable": "slide_layout", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_element_fk_3", + "columns": [ + "masterId" + ], + "referenceTable": "slide_master", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_element_fk_4", + "columns": [ + "parentId" + ], + "referenceTable": "slide_element", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_element_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_element_slide_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "slideId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "zKey" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_element_layout_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "layoutId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_element_master_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "masterId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_element_parent_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "parentId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "slide_group", + "dartName": "SlideGroup", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "deckId", + "fieldName": "deckId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "title", + "fieldName": "title", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sortKey", + "fieldName": "sortKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "parentId", + "fieldName": "parentId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "color", + "fieldName": "color", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "skipped", + "fieldName": "skipped", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_group_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_group_fk_1", + "columns": [ + "deckId" + ], + "referenceTable": "deck", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_group_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_group_order_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "deckId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "sortKey" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "slide_layout", + "dartName": "SlideLayout", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "masterId", + "fieldName": "masterId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "key", + "fieldName": "key", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sortKey", + "fieldName": "sortKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "backgroundJson", + "fieldName": "backgroundJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "hideMasterElements", + "fieldName": "hideMasterElements", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "hidden", + "fieldName": "hidden", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_layout_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_layout_fk_1", + "columns": [ + "masterId" + ], + "referenceTable": "slide_master", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_layout_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_layout_master_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "masterId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "slide_master", + "dartName": "SlideMaster", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "themeId", + "fieldName": "themeId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sortKey", + "fieldName": "sortKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "backgroundJson", + "fieldName": "backgroundJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_master_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_master_fk_1", + "columns": [ + "themeId" + ], + "referenceTable": "deck_theme", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_master_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_master_theme_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "themeId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "slide_table_axis", + "dartName": "SlideTableAxis", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "elementId", + "fieldName": "elementId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "dimension", + "fieldName": "dimension", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:TableDimension" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sortKey", + "fieldName": "sortKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "size", + "fieldName": "size", + "columnType": 3, + "isNullable": true, + "dartType": "double?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "header", + "fieldName": "header", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_table_axis_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_table_axis_fk_1", + "columns": [ + "elementId" + ], + "referenceTable": "slide_element", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_table_axis_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_table_axis_element_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "elementId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "sortKey" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "slide_table_cell", + "dartName": "SlideTableCell", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "elementId", + "fieldName": "elementId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rowId", + "fieldName": "rowId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "columnId", + "fieldName": "columnId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "text", + "fieldName": "text", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fill", + "fieldName": "fill", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "borderTop", + "fieldName": "borderTop", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "borderRight", + "fieldName": "borderRight", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "borderBottom", + "fieldName": "borderBottom", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "borderLeft", + "fieldName": "borderLeft", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "vAlign", + "fieldName": "vAlign", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "padding", + "fieldName": "padding", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rowSpan", + "fieldName": "rowSpan", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "colSpan", + "fieldName": "colSpan", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_table_cell_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_table_cell_fk_1", + "columns": [ + "elementId" + ], + "referenceTable": "slide_element", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_table_cell_fk_2", + "columns": [ + "rowId" + ], + "referenceTable": "slide_table_axis", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_table_cell_fk_3", + "columns": [ + "columnId" + ], + "referenceTable": "slide_table_axis", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_table_cell_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_table_cell_element_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "elementId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "slides_snapshot_index", + "dartName": "SlidesSnapshotIndex", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemVersionId", + "fieldName": "itemVersionId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "slidesJson", + "fieldName": "slidesJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "changesJson", + "fieldName": "changesJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authorIds", + "fieldName": "authorIds", + "columnType": 8, + "isNullable": false, + "dartType": "List" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slides_snapshot_index_fk_0", + "columns": [ + "itemVersionId" + ], + "referenceTable": "item_version", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slides_snapshot_index_version_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemVersionId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "spreadsheet", + "dartName": "Spreadsheet", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "title", + "fieldName": "title", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "locale", + "fieldName": "locale", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "timeZone", + "fieldName": "timeZone", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "recalcMode", + "fieldName": "recalcMode", + "columnType": 0, + "isNullable": false, + "columnDefault": "'onChange'", + "dartType": "protocol:RecalcMode" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "iterativeCalc", + "fieldName": "iterativeCalc", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "maxIterations", + "fieldName": "maxIterations", + "columnType": 6, + "isNullable": false, + "columnDefault": "50", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "convergenceThreshold", + "fieldName": "convergenceThreshold", + "columnType": 3, + "isNullable": false, + "columnDefault": "0.05", + "dartType": "double" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "defaultFontFamily", + "fieldName": "defaultFontFamily", + "columnType": 0, + "isNullable": false, + "columnDefault": "'Inter'", + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "defaultFontSize", + "fieldName": "defaultFontSize", + "columnType": 3, + "isNullable": false, + "columnDefault": "10.0", + "dartType": "double" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "themeJson", + "fieldName": "themeJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "displayLanguage", + "fieldName": "displayLanguage", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdBy", + "fieldName": "createdBy", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "spreadsheet_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "spreadsheet_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "storage_reservation", + "dartName": "StorageReservation", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileUuid", + "fieldName": "fileUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "bytes", + "fieldName": "bytes", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "expiresAt", + "fieldName": "expiresAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "storage_reservation_fk_0", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "storage_reservation_fk_1", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "storage_reservation_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileUuid" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "storage_reservation_user_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "storage_reservation_expiry_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "expiresAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "stored_file", + "dartName": "StoredFile", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileUuid", + "fieldName": "fileUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "ownerId", + "fieldName": "ownerId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kind", + "fieldName": "kind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:StoredFileKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "storageId", + "fieldName": "storageId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "path", + "fieldName": "path", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileName", + "fieldName": "fileName", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "mimeType", + "fieldName": "mimeType", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sizeBytes", + "fieldName": "sizeBytes", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "status", + "fieldName": "status", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:StoredFileStatus" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "completedAt", + "fieldName": "completedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "expiresAt", + "fieldName": "expiresAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "stored_file_fk_0", + "columns": [ + "ownerId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "stored_file_fk_1", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "stored_file_uuid_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileUuid" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "stored_file_item_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "stored_file_expiry_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "expiresAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "stored_file_owner_kind_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "ownerId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "kind" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "stored_file_status_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "status" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "submission", + "dartName": "Submission", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "uuid", + "fieldName": "uuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "publicationId", + "fieldName": "publicationId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "ref", + "fieldName": "ref", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "status", + "fieldName": "status", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:SubmissionStatus" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "statusBeforeSubmit", + "fieldName": "statusBeforeSubmit", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:SubmissionStatus?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "delivery", + "fieldName": "delivery", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:SubmissionDeliveryState?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "values", + "fieldName": "values", + "columnType": 8, + "isNullable": false, + "dartType": "protocol:SubmissionValues" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "publicUrl", + "fieldName": "publicUrl", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "feedbackThreadId", + "fieldName": "feedbackThreadId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdById", + "fieldName": "createdById", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "disconnectedAt", + "fieldName": "disconnectedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "submission_fk_0", + "columns": [ + "publicationId" + ], + "referenceTable": "publication", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "submission_fk_1", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "submission_uuid_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "uuid" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "submission_item_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "submission_publication_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "publicationId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "status" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "submission_asset", + "dartName": "SubmissionAsset", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "submissionId", + "fieldName": "submissionId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileUuid", + "fieldName": "fileUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "submission_asset_fk_0", + "columns": [ + "submissionId" + ], + "referenceTable": "submission", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "submission_asset_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "submissionId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileUuid" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "submission_asset_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileUuid" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "submission_revision", + "dartName": "SubmissionRevision", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "submissionId", + "fieldName": "submissionId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sequence", + "fieldName": "sequence", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "versionId", + "fieldName": "versionId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "values", + "fieldName": "values", + "columnType": 8, + "isNullable": false, + "dartType": "protocol:SubmissionValues" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "payload", + "fieldName": "payload", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "submittedById", + "fieldName": "submittedById", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "submittedAt", + "fieldName": "submittedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "submission_revision_fk_0", + "columns": [ + "submissionId" + ], + "referenceTable": "submission", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "submission_revision_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "submissionId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "sequence" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "usage_counter_day", + "dartName": "UsageCounterDay", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "day", + "fieldName": "day", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "value", + "fieldName": "value", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "usage_counter_day_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "day" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "name" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "user_activity_day", + "dartName": "UserActivityDay", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "day", + "fieldName": "day", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "app", + "fieldName": "app", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:UsageApp" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "edited", + "fieldName": "edited", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "user_activity_day_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "day" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "app" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "user_activity_day_day_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "day" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "user_activity_settings", + "dartName": "UserActivitySettings", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "showViewHistory", + "fieldName": "showViewHistory", + "columnType": 1, + "isNullable": false, + "columnDefault": "true", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "user_activity_settings_fk_0", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "user_activity_settings_user_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "user_preferences", + "dartName": "UserPreferences", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "appTheme", + "fieldName": "appTheme", + "columnType": 0, + "isNullable": false, + "columnDefault": "'system'", + "dartType": "protocol:AppThemeMode" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "accentColor", + "fieldName": "accentColor", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "density", + "fieldName": "density", + "columnType": 0, + "isNullable": false, + "columnDefault": "'comfortable'", + "dartType": "protocol:UiDensity" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "reduceMotion", + "fieldName": "reduceMotion", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "keymapOverrides", + "fieldName": "keymapOverrides", + "columnType": 0, + "isNullable": false, + "columnDefault": "'{}'", + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "writeDefaults", + "fieldName": "writeDefaults", + "columnType": 0, + "isNullable": false, + "columnDefault": "'{}'", + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetsDefaults", + "fieldName": "sheetsDefaults", + "columnType": 0, + "isNullable": false, + "columnDefault": "'{}'", + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "slidesDefaults", + "fieldName": "slidesDefaults", + "columnType": 0, + "isNullable": false, + "columnDefault": "'{}'", + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "slidesPresenter", + "fieldName": "slidesPresenter", + "columnType": 0, + "isNullable": false, + "columnDefault": "'{}'", + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "driveDefaults", + "fieldName": "driveDefaults", + "columnType": 0, + "isNullable": false, + "columnDefault": "'{}'", + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "notificationSettings", + "fieldName": "notificationSettings", + "columnType": 0, + "isNullable": false, + "columnDefault": "'{}'", + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "aiEnabled", + "fieldName": "aiEnabled", + "columnType": 1, + "isNullable": false, + "columnDefault": "true", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "user_preferences_fk_0", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "user_preferences_user_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "user_profile", + "dartName": "UserProfile", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authUserId", + "fieldName": "authUserId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "displayName", + "fieldName": "displayName", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "email", + "fieldName": "email", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "avatarFileId", + "fieldName": "avatarFileId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "avatarColor", + "fieldName": "avatarColor", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "locale", + "fieldName": "locale", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "timeZone", + "fieldName": "timeZone", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastSeenAt", + "fieldName": "lastSeenAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "welcomeContentAt", + "fieldName": "welcomeContentAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "user_profile_fk_0", + "columns": [ + "authUserId" + ], + "referenceTable": "serverpod_auth_core_user", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "user_profile_auth_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "authUserId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "user_profile_email_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "user_storage", + "dartName": "UserStorage", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "usedBytes", + "fieldName": "usedBytes", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "reservedBytes", + "fieldName": "reservedBytes", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "documentsBytes", + "fieldName": "documentsBytes", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spreadsheetsBytes", + "fieldName": "spreadsheetsBytes", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "presentationsBytes", + "fieldName": "presentationsBytes", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "filesBytes", + "fieldName": "filesBytes", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "trashBytes", + "fieldName": "trashBytes", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "quotaBytesOverride", + "fieldName": "quotaBytesOverride", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "overQuotaSince", + "fieldName": "overQuotaSince", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "reconciledAt", + "fieldName": "reconciledAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "user_storage_fk_0", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "user_storage_user_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "write_diff_cache", + "dartName": "WriteDiffCache", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "documentId", + "fieldName": "documentId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fromRevision", + "fieldName": "fromRevision", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "toRevision", + "fieldName": "toRevision", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "json", + "fieldName": "json", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "write_diff_cache_fk_0", + "columns": [ + "documentId" + ], + "referenceTable": "document", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "write_diff_cache_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "documentId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fromRevision" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "toRevision" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "write_diff_cache_created_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "brin", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "write_theme", + "dartName": "WriteTheme", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "uuid", + "fieldName": "uuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "ownerId", + "fieldName": "ownerId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "isBuiltin", + "fieldName": "isBuiltin", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "builtinKey", + "fieldName": "builtinKey", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "description", + "fieldName": "description", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "schemaVersion", + "fieldName": "schemaVersion", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "version", + "fieldName": "version", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "json", + "fieldName": "json", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "contentHash", + "fieldName": "contentHash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "deletedAt", + "fieldName": "deletedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "write_theme_fk_0", + "columns": [ + "ownerId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "write_theme_uuid_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "uuid" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "write_theme_owner_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "ownerId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "deletedAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "write_theme_builtin_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "builtinKey" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "write_theme_revision", + "dartName": "WriteThemeRevision", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "themeId", + "fieldName": "themeId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "version", + "fieldName": "version", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "json", + "fieldName": "json", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "savedById", + "fieldName": "savedById", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "actorKind", + "fieldName": "actorKind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:ActorKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "write_theme_revision_fk_0", + "columns": [ + "themeId" + ], + "referenceTable": "write_theme", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "write_theme_rev_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "themeId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "version" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_cloud_storage", + "dartName": "CloudStorageEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "storageId", + "fieldName": "storageId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "path", + "fieldName": "path", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "addedTime", + "fieldName": "addedTime", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "expiration", + "fieldName": "expiration", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "byteData", + "fieldName": "byteData", + "columnType": 5, + "isNullable": false, + "dartType": "dart:typed_data:ByteData" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "verified", + "fieldName": "verified", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "contentType", + "fieldName": "contentType", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "cacheControl", + "fieldName": "cacheControl", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "contentDisposition", + "fieldName": "contentDisposition", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "contentEncoding", + "fieldName": "contentEncoding", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "customMetadata", + "fieldName": "customMetadata", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "serverpod_cloud_storage_path_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "storageId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "path" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "serverpod_cloud_storage_expiration", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "expiration" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_cloud_storage_direct_download", + "dartName": "CloudStorageDirectDownloadEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "storageId", + "fieldName": "storageId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "path", + "fieldName": "path", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "expiration", + "fieldName": "expiration", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authKey", + "fieldName": "authKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "downloadFileName", + "fieldName": "downloadFileName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "contentType", + "fieldName": "contentType", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "serverpod_cloud_storage_direct_download_auth_key", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "authKey" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "serverpod_cloud_storage_direct_download_expiration", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "expiration" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_cloud_storage_direct_upload", + "dartName": "CloudStorageDirectUploadEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "storageId", + "fieldName": "storageId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "path", + "fieldName": "path", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "expiration", + "fieldName": "expiration", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authKey", + "fieldName": "authKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "maxFileSize", + "fieldName": "maxFileSize", + "columnType": 6, + "isNullable": false, + "columnDefault": "10485760", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "contentLength", + "fieldName": "contentLength", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "preventOverwrite", + "fieldName": "preventOverwrite", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "contentType", + "fieldName": "contentType", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "cacheControl", + "fieldName": "cacheControl", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "contentDisposition", + "fieldName": "contentDisposition", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "contentEncoding", + "fieldName": "contentEncoding", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "customMetadata", + "fieldName": "customMetadata", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "serverpod_cloud_storage_direct_upload_storage_path", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "storageId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "path" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_future_call", + "dartName": "FutureCallEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "time", + "fieldName": "time", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "serializedObject", + "fieldName": "serializedObject", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "serverId", + "fieldName": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "identifier", + "fieldName": "identifier", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "scheduling", + "fieldName": "scheduling", + "columnType": 8, + "isNullable": true, + "dartType": "protocol:FutureCallScheduling?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "serverpod_future_call_time_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "time" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "serverpod_future_call_serverId_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "serverId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "serverpod_future_call_identifier_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "identifier" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_future_call_claim", + "dartName": "FutureCallClaimEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "futureCallId", + "fieldName": "futureCallId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastHeartbeatTime", + "fieldName": "lastHeartbeatTime", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "serverpod_future_call_claim_fk_0", + "columns": [ + "futureCallId" + ], + "referenceTable": "serverpod_future_call", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "future_call_unique_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "futureCallId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_health_connection_info", + "dartName": "ServerHealthConnectionInfo", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "serverId", + "fieldName": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "timestamp", + "fieldName": "timestamp", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "active", + "fieldName": "active", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "closing", + "fieldName": "closing", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "idle", + "fieldName": "idle", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "granularity", + "fieldName": "granularity", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "serverpod_health_connection_info_timestamp_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "timestamp" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "serverId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "granularity" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_health_metric", + "dartName": "ServerHealthMetric", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "serverId", + "fieldName": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "timestamp", + "fieldName": "timestamp", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "isHealthy", + "fieldName": "isHealthy", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "value", + "fieldName": "value", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "granularity", + "fieldName": "granularity", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "serverpod_health_metric_timestamp_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "timestamp" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "serverId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "name" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "granularity" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_log", + "dartName": "LogEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sessionLogId", + "fieldName": "sessionLogId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "messageId", + "fieldName": "messageId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "reference", + "fieldName": "reference", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "serverId", + "fieldName": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "time", + "fieldName": "time", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "logLevel", + "fieldName": "logLevel", + "columnType": 6, + "isNullable": false, + "dartType": "protocol:LogLevel" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "message", + "fieldName": "message", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "error", + "fieldName": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "stackTrace", + "fieldName": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "order", + "fieldName": "order", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "serverpod_log_fk_0", + "columns": [ + "sessionLogId" + ], + "referenceTable": "serverpod_session_log", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "serverpod_log_sessionLogId_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "sessionLogId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "order" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_message_log", + "dartName": "MessageLogEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sessionLogId", + "fieldName": "sessionLogId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "serverId", + "fieldName": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "messageId", + "fieldName": "messageId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "endpoint", + "fieldName": "endpoint", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "messageName", + "fieldName": "messageName", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "duration", + "fieldName": "duration", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "error", + "fieldName": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "stackTrace", + "fieldName": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "slow", + "fieldName": "slow", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "order", + "fieldName": "order", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "serverpod_message_log_fk_0", + "columns": [ + "sessionLogId" + ], + "referenceTable": "serverpod_session_log", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "serverpod_message_log_sessionLogId_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "sessionLogId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "order" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_method", + "dartName": "MethodInfo", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "endpoint", + "fieldName": "endpoint", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "method", + "fieldName": "method", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "serverpod_method_endpoint_method_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "endpoint" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "method" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_migrations", + "dartName": "DatabaseMigrationVersion", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "module", + "fieldName": "module", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "version", + "fieldName": "version", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "timestamp", + "fieldName": "timestamp", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "serverpod_migrations_ids", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "module" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_query_log", + "dartName": "QueryLogEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "serverId", + "fieldName": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sessionLogId", + "fieldName": "sessionLogId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "messageId", + "fieldName": "messageId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "query", + "fieldName": "query", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "duration", + "fieldName": "duration", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "numRows", + "fieldName": "numRows", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "error", + "fieldName": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "stackTrace", + "fieldName": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "slow", + "fieldName": "slow", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "order", + "fieldName": "order", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "serverpod_query_log_fk_0", + "columns": [ + "sessionLogId" + ], + "referenceTable": "serverpod_session_log", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "serverpod_query_log_sessionLogId_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "sessionLogId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "order" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_readwrite_test", + "dartName": "ReadWriteTestEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "number", + "fieldName": "number", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_runtime_settings", + "dartName": "RuntimeSettings", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "logSettings", + "fieldName": "logSettings", + "columnType": 8, + "isNullable": false, + "dartType": "protocol:LogSettings" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "logSettingsOverrides", + "fieldName": "logSettingsOverrides", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "logServiceCalls", + "fieldName": "logServiceCalls", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "logMalformedCalls", + "fieldName": "logMalformedCalls", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_session_log", + "dartName": "SessionLogEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "serverId", + "fieldName": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "time", + "fieldName": "time", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "module", + "fieldName": "module", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "endpoint", + "fieldName": "endpoint", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "method", + "fieldName": "method", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "duration", + "fieldName": "duration", + "columnType": 3, + "isNullable": true, + "dartType": "double?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "numQueries", + "fieldName": "numQueries", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "slow", + "fieldName": "slow", + "columnType": 1, + "isNullable": true, + "dartType": "bool?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "error", + "fieldName": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "stackTrace", + "fieldName": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authenticatedUserId", + "fieldName": "authenticatedUserId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "isOpen", + "fieldName": "isOpen", + "columnType": 1, + "isNullable": true, + "dartType": "bool?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "touched", + "fieldName": "touched", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "serverpod_session_log_serverid_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "serverId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "serverpod_session_log_time_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "time" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "serverpod_session_log_touched_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "touched" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "serverpod_session_log_isopen_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "isOpen" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_auth_idp_anonymous_account", + "dartName": "AnonymousAccount", + "module": "serverpod_auth_idp", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authUserId", + "fieldName": "authUserId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "serverpod_auth_idp_anonymous_account_fk_0", + "columns": [ + "authUserId" + ], + "referenceTable": "serverpod_auth_core_user", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_auth_idp_apple_account", + "dartName": "AppleAccount", + "module": "serverpod_auth_idp", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userIdentifier", + "fieldName": "userIdentifier", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "refreshToken", + "fieldName": "refreshToken", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "refreshTokenRequestedWithBundleIdentifier", + "fieldName": "refreshTokenRequestedWithBundleIdentifier", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastRefreshedAt", + "fieldName": "lastRefreshedAt", + "columnType": 4, + "isNullable": false, + "columnDefault": "now", + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authUserId", + "fieldName": "authUserId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "email", + "fieldName": "email", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "isEmailVerified", + "fieldName": "isEmailVerified", + "columnType": 1, + "isNullable": true, + "dartType": "bool?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "isPrivateEmail", + "fieldName": "isPrivateEmail", + "columnType": 1, + "isNullable": true, + "dartType": "bool?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "firstName", + "fieldName": "firstName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastName", + "fieldName": "lastName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "serverpod_auth_idp_apple_account_fk_0", + "columns": [ + "authUserId" + ], + "referenceTable": "serverpod_auth_core_user", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "serverpod_auth_apple_account_identifier", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userIdentifier" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_auth_idp_email_account", + "dartName": "EmailAccount", + "module": "serverpod_auth_idp", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authUserId", + "fieldName": "authUserId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "email", + "fieldName": "email", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "passwordHash", + "fieldName": "passwordHash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "serverpod_auth_idp_email_account_fk_0", + "columns": [ + "authUserId" + ], + "referenceTable": "serverpod_auth_core_user", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "serverpod_auth_idp_email_account_email", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_auth_idp_email_account_password_reset_request", + "dartName": "EmailAccountPasswordResetRequest", + "module": "serverpod_auth_idp", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "emailAccountId", + "fieldName": "emailAccountId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "columnDefault": "now", + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "challengeId", + "fieldName": "challengeId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "setPasswordChallengeId", + "fieldName": "setPasswordChallengeId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "serverpod_auth_idp_email_account_password_reset_request_fk_0", + "columns": [ + "emailAccountId" + ], + "referenceTable": "serverpod_auth_idp_email_account", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "serverpod_auth_idp_email_account_password_reset_request_fk_1", + "columns": [ + "challengeId" + ], + "referenceTable": "serverpod_auth_idp_secret_challenge", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "serverpod_auth_idp_email_account_password_reset_request_fk_2", + "columns": [ + "setPasswordChallengeId" + ], + "referenceTable": "serverpod_auth_idp_secret_challenge", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_auth_idp_email_account_request", + "dartName": "EmailAccountRequest", + "module": "serverpod_auth_idp", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "columnDefault": "now", + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "email", + "fieldName": "email", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "challengeId", + "fieldName": "challengeId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createAccountChallengeId", + "fieldName": "createAccountChallengeId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "serverpod_auth_idp_email_account_request_fk_0", + "columns": [ + "challengeId" + ], + "referenceTable": "serverpod_auth_idp_secret_challenge", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "serverpod_auth_idp_email_account_request_fk_1", + "columns": [ + "createAccountChallengeId" + ], + "referenceTable": "serverpod_auth_idp_secret_challenge", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "serverpod_auth_idp_email_account_request_email", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_auth_idp_facebook_account", + "dartName": "FacebookAccount", + "module": "serverpod_auth_idp", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authUserId", + "fieldName": "authUserId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userIdentifier", + "fieldName": "userIdentifier", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "email", + "fieldName": "email", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fullName", + "fieldName": "fullName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "firstName", + "fieldName": "firstName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastName", + "fieldName": "lastName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "serverpod_auth_idp_facebook_account_fk_0", + "columns": [ + "authUserId" + ], + "referenceTable": "serverpod_auth_core_user", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "serverpod_auth_facebook_account_user_identifier", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userIdentifier" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_auth_idp_firebase_account", + "dartName": "FirebaseAccount", + "module": "serverpod_auth_idp", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authUserId", + "fieldName": "authUserId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "created", + "fieldName": "created", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "email", + "fieldName": "email", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "phone", + "fieldName": "phone", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userIdentifier", + "fieldName": "userIdentifier", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "serverpod_auth_idp_firebase_account_fk_0", + "columns": [ + "authUserId" + ], + "referenceTable": "serverpod_auth_core_user", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "serverpod_auth_firebase_account_user_identifier", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userIdentifier" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_auth_idp_github_account", + "dartName": "GitHubAccount", + "module": "serverpod_auth_idp", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authUserId", + "fieldName": "authUserId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userIdentifier", + "fieldName": "userIdentifier", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "email", + "fieldName": "email", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "created", + "fieldName": "created", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "serverpod_auth_idp_github_account_fk_0", + "columns": [ + "authUserId" + ], + "referenceTable": "serverpod_auth_core_user", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "serverpod_auth_github_account_user_identifier", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userIdentifier" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_auth_idp_google_account", + "dartName": "GoogleAccount", + "module": "serverpod_auth_idp", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authUserId", + "fieldName": "authUserId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "created", + "fieldName": "created", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "email", + "fieldName": "email", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userIdentifier", + "fieldName": "userIdentifier", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "serverpod_auth_idp_google_account_fk_0", + "columns": [ + "authUserId" + ], + "referenceTable": "serverpod_auth_core_user", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "serverpod_auth_google_account_user_identifier", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userIdentifier" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_auth_idp_microsoft_account", + "dartName": "MicrosoftAccount", + "module": "serverpod_auth_idp", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authUserId", + "fieldName": "authUserId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userIdentifier", + "fieldName": "userIdentifier", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "email", + "fieldName": "email", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "created", + "fieldName": "created", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "serverpod_auth_idp_microsoft_account_fk_0", + "columns": [ + "authUserId" + ], + "referenceTable": "serverpod_auth_core_user", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "serverpod_auth_microsoft_account_user_identifier", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userIdentifier" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_auth_idp_passkey_account", + "dartName": "PasskeyAccount", + "module": "serverpod_auth_idp", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authUserId", + "fieldName": "authUserId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "keyId", + "fieldName": "keyId", + "columnType": 5, + "isNullable": false, + "dartType": "dart:typed_data:ByteData" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "keyIdBase64", + "fieldName": "keyIdBase64", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "clientDataJSON", + "fieldName": "clientDataJSON", + "columnType": 5, + "isNullable": false, + "dartType": "dart:typed_data:ByteData" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "attestationObject", + "fieldName": "attestationObject", + "columnType": 5, + "isNullable": false, + "dartType": "dart:typed_data:ByteData" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "originalChallenge", + "fieldName": "originalChallenge", + "columnType": 5, + "isNullable": false, + "dartType": "dart:typed_data:ByteData" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "serverpod_auth_idp_passkey_account_fk_0", + "columns": [ + "authUserId" + ], + "referenceTable": "serverpod_auth_core_user", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "serverpod_auth_idp_passkey_account_key_id_base64", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "keyIdBase64" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_auth_idp_passkey_challenge", + "dartName": "PasskeyChallenge", + "module": "serverpod_auth_idp", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "challenge", + "fieldName": "challenge", + "columnType": 5, + "isNullable": false, + "dartType": "dart:typed_data:ByteData" + } + ], + "foreignKeys": [], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_auth_idp_rate_limited_request_attempt", + "dartName": "RateLimitedRequestAttempt", + "module": "serverpod_auth_idp", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "domain", + "fieldName": "domain", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "source", + "fieldName": "source", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "key", + "fieldName": "key", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "ipAddress", + "fieldName": "ipAddress", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "attemptedAt", + "fieldName": "attemptedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "extraData", + "fieldName": "extraData", + "columnType": 8, + "isNullable": true, + "dartType": "Map?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "serverpod_auth_idp_rate_limited_request_attempt_composite", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "domain" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "source" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "key" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "attemptedAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_auth_idp_secret_challenge", + "dartName": "SecretChallenge", + "module": "serverpod_auth_idp", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "challengeCodeHash", + "fieldName": "challengeCodeHash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_auth_core_jwt_refresh_token", + "dartName": "RefreshToken", + "module": "serverpod_auth_core", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authUserId", + "fieldName": "authUserId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "scopeNames", + "fieldName": "scopeNames", + "columnType": 8, + "isNullable": false, + "dartType": "Set" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "extraClaims", + "fieldName": "extraClaims", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "method", + "fieldName": "method", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fixedSecret", + "fieldName": "fixedSecret", + "columnType": 5, + "isNullable": false, + "dartType": "dart:typed_data:ByteData" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rotatingSecretHash", + "fieldName": "rotatingSecretHash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastUpdatedAt", + "fieldName": "lastUpdatedAt", + "columnType": 4, + "isNullable": false, + "columnDefault": "now", + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "columnDefault": "now", + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "serverpod_auth_core_jwt_refresh_token_fk_0", + "columns": [ + "authUserId" + ], + "referenceTable": "serverpod_auth_core_user", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "serverpod_auth_core_jwt_refresh_token_last_updated_at", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "lastUpdatedAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_auth_core_profile", + "dartName": "UserProfile", + "module": "serverpod_auth_core", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authUserId", + "fieldName": "authUserId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userName", + "fieldName": "userName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fullName", + "fieldName": "fullName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "email", + "fieldName": "email", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "columnDefault": "now", + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "imageId", + "fieldName": "imageId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "serverpod_auth_core_profile_fk_0", + "columns": [ + "authUserId" + ], + "referenceTable": "serverpod_auth_core_user", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "serverpod_auth_core_profile_fk_1", + "columns": [ + "imageId" + ], + "referenceTable": "serverpod_auth_core_profile_image", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 3, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "serverpod_auth_profile_user_profile_email_auth_user_id", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "authUserId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_auth_core_profile_image", + "dartName": "UserProfileImage", + "module": "serverpod_auth_core", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userProfileId", + "fieldName": "userProfileId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "columnDefault": "now", + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "storageId", + "fieldName": "storageId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "path", + "fieldName": "path", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "url", + "fieldName": "url", + "columnType": 0, + "isNullable": false, + "dartType": "Uri" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "serverpod_auth_core_profile_image_fk_0", + "columns": [ + "userProfileId" + ], + "referenceTable": "serverpod_auth_core_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_auth_core_session", + "dartName": "ServerSideSession", + "module": "serverpod_auth_core", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authUserId", + "fieldName": "authUserId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "scopeNames", + "fieldName": "scopeNames", + "columnType": 8, + "isNullable": false, + "dartType": "Set" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "columnDefault": "now", + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastUsedAt", + "fieldName": "lastUsedAt", + "columnType": 4, + "isNullable": false, + "columnDefault": "now", + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "expiresAt", + "fieldName": "expiresAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "expireAfterUnusedFor", + "fieldName": "expireAfterUnusedFor", + "columnType": 6, + "isNullable": true, + "dartType": "Duration?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sessionKeyHash", + "fieldName": "sessionKeyHash", + "columnType": 5, + "isNullable": false, + "dartType": "dart:typed_data:ByteData" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sessionKeySalt", + "fieldName": "sessionKeySalt", + "columnType": 5, + "isNullable": false, + "dartType": "dart:typed_data:ByteData" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "method", + "fieldName": "method", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "serverpod_auth_core_session_fk_0", + "columns": [ + "authUserId" + ], + "referenceTable": "serverpod_auth_core_user", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_auth_core_user", + "dartName": "AuthUser", + "module": "serverpod_auth_core", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "scopeNames", + "fieldName": "scopeNames", + "columnType": 8, + "isNullable": false, + "dartType": "Set" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "blocked", + "fieldName": "blocked", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [], + "managed": true + } + ], + "installedModules": [ + { + "__className__": "serverpod.DatabaseMigrationVersionModel", + "module": "wonky", + "version": "20261020133251149-usage-analytics" + }, + { + "__className__": "serverpod.DatabaseMigrationVersion", + "module": "serverpod", + "version": "20260824182259319" + }, + { + "__className__": "serverpod.DatabaseMigrationVersion", + "module": "serverpod_auth_idp", + "version": "20260924105404509" + }, + { + "__className__": "serverpod.DatabaseMigrationVersion", + "module": "serverpod_auth_core", + "version": "20260924105232991" + } + ], + "migrationApiVersion": 1 +} \ No newline at end of file diff --git a/wonky_server/migrations/20261020133251149-usage-analytics/definition.sql b/wonky_server/migrations/20261020133251149-usage-analytics/definition.sql new file mode 100644 index 00000000..a4b74520 --- /dev/null +++ b/wonky_server/migrations/20261020133251149-usage-analytics/definition.sql @@ -0,0 +1,4327 @@ +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; + +-- +-- Class AccessRequest as table access_request +-- +CREATE TABLE "access_request" ( + "id" bigserial PRIMARY KEY, + "itemId" bigint NOT NULL, + "requesterId" bigint NOT NULL, + "requestedRole" text NOT NULL, + "message" text, + "createdAt" timestamp without time zone NOT NULL, + "handledAt" timestamp without time zone, + "handledById" bigint, + "outcome" text +); + +-- Indexes +CREATE INDEX "access_request_item_idx" ON "access_request" USING btree ("itemId", "handledAt"); + +-- +-- Class ActivityEvent as table activity_event +-- +CREATE TABLE "activity_event" ( + "id" bigserial PRIMARY KEY, + "itemId" bigint NOT NULL, + "actorId" bigint, + "actorKind" text NOT NULL, + "type" text NOT NULL, + "summary" text NOT NULL, + "at" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "activity_item_idx" ON "activity_event" USING btree ("itemId", "at"); + +-- +-- Class AiFunctionCache as table ai_function_cache +-- +CREATE TABLE "ai_function_cache" ( + "id" bigserial PRIMARY KEY, + "key" text NOT NULL, + "spreadsheetUuid" uuid NOT NULL, + "model" text NOT NULL, + "value" text NOT NULL, + "error" text, + "createdAt" timestamp without time zone NOT NULL, + "hits" bigint NOT NULL DEFAULT 0 +); + +-- Indexes +CREATE UNIQUE INDEX "ai_function_cache_key_idx" ON "ai_function_cache" USING btree ("key"); +CREATE INDEX "ai_function_cache_sheet_idx" ON "ai_function_cache" USING btree ("spreadsheetUuid"); + +-- +-- Class AiPreviewRecord as table ai_preview_record +-- +CREATE TABLE "ai_preview_record" ( + "id" bigserial PRIMARY KEY, + "previewId" text NOT NULL, + "userId" bigint NOT NULL, + "fileUuid" uuid NOT NULL, + "previewJson" text NOT NULL, + "changesJson" text NOT NULL, + "createdAt" timestamp without time zone NOT NULL, + "expiresAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "ai_preview_id_idx" ON "ai_preview_record" USING btree ("previewId"); +CREATE INDEX "ai_preview_expires_idx" ON "ai_preview_record" USING btree ("expiresAt"); + +-- +-- Class AiUsage as table ai_usage +-- +CREATE TABLE "ai_usage" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "model" text NOT NULL, + "feature" text NOT NULL, + "inputTokens" bigint NOT NULL, + "outputTokens" bigint NOT NULL, + "cacheReadTokens" bigint NOT NULL, + "cacheWriteTokens" bigint NOT NULL, + "at" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "ai_usage_user_at_idx" ON "ai_usage" USING btree ("userId", "at"); + +-- +-- Class AiUserKey as table ai_user_key +-- +CREATE TABLE "ai_user_key" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "provider" text NOT NULL, + "apiKey" text NOT NULL, + "createdAt" timestamp without time zone NOT NULL, + "updatedAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "ai_user_key_user_idx" ON "ai_user_key" USING btree ("userId"); + +-- +-- Class AiUserSetting as table ai_user_setting +-- +CREATE TABLE "ai_user_setting" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "quality" text NOT NULL DEFAULT 'best'::text, + "updatedAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "ai_user_setting_user_idx" ON "ai_user_setting" USING btree ("userId"); + +-- +-- Class AssistantMessage as table assistant_message +-- +CREATE TABLE "assistant_message" ( + "id" bigserial PRIMARY KEY, + "threadId" bigint NOT NULL, + "role" text NOT NULL, + "contentJson" text, + "displayText" text NOT NULL, + "toolCallsJson" text, + "visible" boolean NOT NULL DEFAULT true, + "replay" boolean NOT NULL DEFAULT true, + "runId" text, + "stopReason" text, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "assistant_message_thread_idx" ON "assistant_message" USING btree ("threadId", "id"); + +-- +-- Class AssistantThread as table assistant_thread +-- +CREATE TABLE "assistant_thread" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "itemId" bigint, + "title" text NOT NULL, + "contextRevision" bigint, + "contextMarkdown" text, + "createdAt" timestamp without time zone NOT NULL, + "updatedAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "assistant_thread_user_item_idx" ON "assistant_thread" USING btree ("userId", "itemId", "updatedAt"); + +-- +-- Class Banding as table banding +-- +CREATE TABLE "banding" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "sheetId" uuid NOT NULL, + "rangeJson" text NOT NULL, + "styleJson" text NOT NULL, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "banding_file_idx" ON "banding" USING btree ("fileId", "id"); + +-- +-- Class BasicFilter as table basic_filter +-- +CREATE TABLE "basic_filter" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "sheetId" uuid NOT NULL, + "rangeJson" text NOT NULL, + "criteriaJson" text NOT NULL, + "sortJson" text, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "basic_filter_file_idx" ON "basic_filter" USING btree ("fileId", "id"); + +-- +-- Class BoardAiUsage as table board_ai_usage +-- +CREATE TABLE "board_ai_usage" ( + "id" bigserial PRIMARY KEY, + "day" text NOT NULL, + "provider" text NOT NULL, + "model" text NOT NULL, + "feature" text NOT NULL, + "requests" bigint NOT NULL, + "inputTokens" bigint NOT NULL, + "outputTokens" bigint NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "board_ai_usage_idx" ON "board_ai_usage" USING btree ("day", "provider", "model", "feature"); + +-- +-- Class BoardBundleSuggestion as table board_bundle_suggestion +-- +CREATE TABLE "board_bundle_suggestion" ( + "id" bigserial PRIMARY KEY, + "title" text NOT NULL, + "rationale" text NOT NULL, + "area" text, + "postIds" json NOT NULL, + "state" text NOT NULL, + "createdAt" timestamp without time zone NOT NULL +); + +-- +-- Class BoardComment as table board_comment +-- +CREATE TABLE "board_comment" ( + "id" bigserial PRIMARY KEY, + "uuid" uuid NOT NULL, + "postId" bigint, + "taskId" bigint, + "authorId" bigint, + "body" text NOT NULL, + "systemEvent" text, + "moderation" text NOT NULL, + "moderationReason" text, + "needsCheck" boolean NOT NULL DEFAULT false, + "createdAt" timestamp without time zone NOT NULL, + "editedAt" timestamp without time zone, + "deletedAt" timestamp without time zone, + "removedAt" timestamp without time zone +); + +-- Indexes +CREATE UNIQUE INDEX "board_comment_uuid_idx" ON "board_comment" USING btree ("uuid"); +CREATE INDEX "board_comment_post_idx" ON "board_comment" USING btree ("postId", "createdAt"); +CREATE INDEX "board_comment_task_idx" ON "board_comment" USING btree ("taskId", "createdAt"); + +-- +-- Class BoardFlag as table board_flag +-- +CREATE TABLE "board_flag" ( + "id" bigserial PRIMARY KEY, + "postId" bigint, + "commentId" bigint, + "userId" bigint NOT NULL, + "reason" text NOT NULL, + "note" text, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "board_flag_post_idx" ON "board_flag" USING btree ("postId", "userId"); +CREATE INDEX "board_flag_comment_idx" ON "board_flag" USING btree ("commentId", "userId"); + +-- +-- Class BoardGithubDelivery as table board_github_delivery +-- +CREATE TABLE "board_github_delivery" ( + "id" bigserial PRIMARY KEY, + "deliveryId" text NOT NULL, + "event" text NOT NULL, + "receivedAt" timestamp without time zone NOT NULL, + "payload" text, + "processedAt" timestamp without time zone, + "attempts" bigint NOT NULL DEFAULT 0 +); + +-- Indexes +CREATE UNIQUE INDEX "board_github_delivery_idx" ON "board_github_delivery" USING btree ("deliveryId"); + +-- +-- Class BoardModerationLog as table board_moderation_log +-- +CREATE TABLE "board_moderation_log" ( + "id" bigserial PRIMARY KEY, + "adminId" bigint NOT NULL, + "action" text NOT NULL, + "targetKind" text NOT NULL, + "targetId" bigint NOT NULL, + "beforeJson" text, + "afterJson" text, + "reason" text, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "board_moderation_log_target_idx" ON "board_moderation_log" USING btree ("targetKind", "targetId"); + +-- +-- Class BoardPost as table board_post +-- +CREATE TABLE "board_post" ( + "id" bigserial PRIMARY KEY, + "authorId" bigint, + "kind" text NOT NULL, + "reportedKind" text NOT NULL, + "area" text, + "size" text, + "aiLabels" boolean NOT NULL DEFAULT true, + "title" text NOT NULL, + "body" text NOT NULL, + "contextJson" text, + "appHint" text NOT NULL, + "screenshotFileId" bigint, + "status" text NOT NULL, + "moderation" text NOT NULL, + "moderationReason" text, + "needsCheck" boolean NOT NULL DEFAULT false, + "editedByModerator" boolean NOT NULL DEFAULT false, + "triageState" text NOT NULL, + "triageJson" text, + "triageAttempts" bigint NOT NULL DEFAULT 0, + "suggestedTitle" text, + "summary" text, + "duplicateOfId" bigint, + "possibleDuplicateOfId" bigint, + "duplicateHintDismissed" boolean NOT NULL DEFAULT false, + "declineReason" text, + "taskId" bigint, + "score" bigint NOT NULL DEFAULT 0, + "voteCount" bigint NOT NULL DEFAULT 0, + "commentCount" bigint NOT NULL DEFAULT 0, + "flagCount" bigint NOT NULL DEFAULT 0, + "createdAt" timestamp without time zone NOT NULL, + "editedAt" timestamp without time zone, + "deletedAt" timestamp without time zone, + "removedAt" timestamp without time zone +); + +-- Indexes +CREATE INDEX "board_post_list_idx" ON "board_post" USING btree ("moderation", "kind", "status", "score"); +CREATE INDEX "board_post_author_idx" ON "board_post" USING btree ("authorId"); +CREATE INDEX "board_post_task_idx" ON "board_post" USING btree ("taskId"); + +-- +-- Class BoardPullRequest as table board_pull_request +-- +CREATE TABLE "board_pull_request" ( + "id" bigserial PRIMARY KEY, + "prNumber" bigint NOT NULL, + "taskId" bigint, + "authorLogin" text NOT NULL, + "headSha" text NOT NULL, + "state" text NOT NULL, + "gateState" text NOT NULL, + "gateReason" text, + "gateFirstFailedAt" timestamp without time zone, + "gateCommentId" bigint, + "reviewCommentId" bigint, + "lastReviewSha" text, + "lastReviewJson" text, + "lastReviewAt" timestamp without time zone, + "reviewDay" text, + "reviewCount" bigint NOT NULL DEFAULT 0, + "mergeCommitSha" text, + "reviewPendingSha" text, + "reviewDueAt" timestamp without time zone, + "createdAt" timestamp without time zone NOT NULL, + "updatedAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "board_pull_request_number_idx" ON "board_pull_request" USING btree ("prNumber"); + +-- +-- Class BoardTask as table board_task +-- +CREATE TABLE "board_task" ( + "id" bigserial PRIMARY KEY, + "title" text NOT NULL, + "area" text NOT NULL, + "size" text NOT NULL, + "status" text NOT NULL, + "promptBody" text NOT NULL, + "promptGeneratedAt" timestamp without time zone, + "promptRequestedAt" timestamp without time zone, + "promptNote" text, + "promptExcludedCommentIds" json, + "promptEditedById" bigint, + "promptEditedAt" timestamp without time zone, + "createdById" bigint NOT NULL, + "publishedAt" timestamp without time zone, + "claimedById" bigint, + "claimedAt" timestamp without time zone, + "claimExpiresAt" timestamp without time zone, + "claimWarnedAt" timestamp without time zone, + "claimCode" text, + "pullRequestUrl" text, + "prNumber" bigint, + "prAuthorLogin" text, + "mergeCommitSha" text, + "doneAt" timestamp without time zone, + "shippedDeploySha" text, + "shippedAt" timestamp without time zone, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "board_task_status_idx" ON "board_task" USING btree ("status"); +CREATE INDEX "board_task_claim_idx" ON "board_task" USING btree ("claimedById"); + +-- +-- Class BoardUserProfile as table board_user_profile +-- +CREATE TABLE "board_user_profile" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "githubLogin" text, + "blockedAt" timestamp without time zone, + "blockedUntil" timestamp without time zone, + "blockedReason" text, + "blockedById" bigint +); + +-- Indexes +CREATE UNIQUE INDEX "board_user_profile_user_idx" ON "board_user_profile" USING btree ("userId"); + +-- +-- Class BoardVote as table board_vote +-- +CREATE TABLE "board_vote" ( + "id" bigserial PRIMARY KEY, + "postId" bigint NOT NULL, + "userId" bigint NOT NULL, + "value" bigint NOT NULL, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "board_vote_unique_idx" ON "board_vote" USING btree ("postId", "userId"); +CREATE INDEX "board_vote_recent_idx" ON "board_vote" USING btree ("postId", "createdAt"); + +-- +-- Class Cell as table cell +-- +CREATE TABLE "cell" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "sheetId" uuid NOT NULL, + "rowId" uuid NOT NULL, + "columnId" uuid NOT NULL, + "content" text, + "note" text, + "numberFormat" text, + "fontFamily" text, + "fontSize" double precision, + "bold" boolean, + "italic" boolean, + "underline" boolean, + "strikethrough" boolean, + "textColor" text, + "fillColor" text, + "hAlign" text, + "vAlign" text, + "wrap" text, + "rotation" bigint, + "borderTop" text, + "borderRight" text, + "borderBottom" text, + "borderLeft" text, + "linkUrl" text, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "cell_row_idx" ON "cell" USING btree ("sheetId", "rowId"); +CREATE INDEX "cell_col_idx" ON "cell" USING btree ("sheetId", "columnId"); + +-- +-- Class CellHistory as table cell_history +-- +CREATE TABLE "cell_history" ( + "id" bigserial PRIMARY KEY, + "fileUuid" uuid NOT NULL, + "sheetId" uuid NOT NULL, + "rowId" uuid NOT NULL, + "colId" uuid NOT NULL, + "revision" bigint NOT NULL, + "userUuid" uuid NOT NULL, + "actorKind" text NOT NULL, + "label" text NOT NULL, + "at" timestamp without time zone NOT NULL, + "before" text, + "after" text +); + +-- Indexes +CREATE INDEX "cell_history_cell_idx" ON "cell_history" USING btree ("fileUuid", "sheetId", "rowId", "colId", "at"); +CREATE UNIQUE INDEX "cell_history_change_idx" ON "cell_history" USING btree ("fileUuid", "revision", "rowId", "colId"); + +-- +-- Class ChartLink as table chart_link +-- +CREATE TABLE "chart_link" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "elementId" uuid NOT NULL, + "spreadsheetItemUuid" uuid NOT NULL, + "chartObjectId" uuid NOT NULL, + "sheetId" text, + "sourceSpecJson" text NOT NULL, + "dataSnapshotJson" text NOT NULL, + "sourceVersion" text NOT NULL, + "updatedAt" timestamp without time zone NOT NULL, + "updatedBy" uuid NOT NULL, + "autoUpdate" boolean NOT NULL DEFAULT false, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "chart_link_file_idx" ON "chart_link" USING btree ("fileId", "id"); +CREATE INDEX "chart_link_element_idx" ON "chart_link" USING btree ("elementId"); + +-- +-- Class CodeState as table code_state +-- +CREATE TABLE "code_state" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "elementId" uuid NOT NULL, + "sortKey" text NOT NULL, + "label" text, + "code" text NOT NULL, + "language" text, + "title" text, + "highlight" text, + "annotationsJson" text, + "transitionJson" text, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "code_state_file_idx" ON "code_state" USING btree ("fileId", "id"); +CREATE INDEX "code_state_element_idx" ON "code_state" USING btree ("elementId", "sortKey"); + +-- +-- Class Comment as table comment +-- +CREATE TABLE "comment" ( + "id" bigserial PRIMARY KEY, + "threadId" bigint NOT NULL, + "uuid" uuid, + "authorId" bigint, + "authorKind" text NOT NULL, + "body" text NOT NULL, + "mentions" json NOT NULL, + "reactions" text NOT NULL DEFAULT '{}'::text, + "createdAt" timestamp without time zone NOT NULL, + "editedAt" timestamp without time zone, + "deletedAt" timestamp without time zone, + "systemEvent" text, + "publicationId" bigint +); + +-- Indexes +CREATE INDEX "comment_thread_idx" ON "comment" USING btree ("threadId", "createdAt"); +CREATE UNIQUE INDEX "comment_uuid_idx" ON "comment" USING btree ("uuid"); + +-- +-- Class CommentThread as table comment_thread +-- +CREATE TABLE "comment_thread" ( + "id" bigserial PRIMARY KEY, + "uuid" uuid NOT NULL, + "itemId" bigint NOT NULL, + "anchorKind" text NOT NULL, + "anchorJson" text NOT NULL, + "quotedText" text, + "status" text NOT NULL DEFAULT 'open'::text, + "createdById" bigint NOT NULL, + "createdAt" timestamp without time zone NOT NULL, + "updatedAt" timestamp without time zone, + "resolvedById" bigint, + "resolvedAt" timestamp without time zone, + "assigneeId" bigint, + "statusBeforeOrphan" text, + "orphanReasonJson" text, + "suggestionId" text +); + +-- Indexes +CREATE INDEX "comment_thread_item_idx" ON "comment_thread" USING btree ("itemId", "status"); +CREATE UNIQUE INDEX "comment_thread_uuid_idx" ON "comment_thread" USING btree ("uuid"); + +-- +-- Class ConditionalFormatRule as table conditional_format_rule +-- +CREATE TABLE "conditional_format_rule" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "sheetId" uuid NOT NULL, + "sortKey" text NOT NULL, + "rangesJson" text NOT NULL, + "ruleJson" text NOT NULL, + "enabled" boolean NOT NULL DEFAULT true, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "conditional_format_rule_file_idx" ON "conditional_format_rule" USING btree ("fileId", "id"); + +-- +-- Class DataValidationRule as table data_validation_rule +-- +CREATE TABLE "data_validation_rule" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "sheetId" uuid NOT NULL, + "rangesJson" text NOT NULL, + "criteriaJson" text NOT NULL, + "strict" boolean NOT NULL DEFAULT false, + "showDropdown" boolean NOT NULL DEFAULT true, + "displayStyle" text, + "helpText" text, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "data_validation_rule_file_idx" ON "data_validation_rule" USING btree ("fileId", "id"); + +-- +-- Class Deck as table deck +-- +CREATE TABLE "deck" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "title" text NOT NULL, + "width" double precision NOT NULL DEFAULT 1920.0, + "height" double precision NOT NULL DEFAULT 1080.0, + "sizePreset" text NOT NULL DEFAULT 'widescreen16x9'::text, + "themeId" uuid, + "appearance" text NOT NULL DEFAULT 'light'::text, + "language" text, + "showSlideNumbers" boolean NOT NULL DEFAULT false, + "hideNumberOnTitle" boolean NOT NULL DEFAULT true, + "firstSlideNumber" bigint NOT NULL DEFAULT 1, + "footerText" text, + "defaultsJson" text, + "guidesJson" text, + "presentJson" text, + "createdBy" uuid NOT NULL, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "deck_file_idx" ON "deck" USING btree ("fileId", "id"); + +-- +-- Class DeckTheme as table deck_theme +-- +CREATE TABLE "deck_theme" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "deckId" uuid NOT NULL, + "name" text NOT NULL, + "sourceKey" text, + "colorsJson" text NOT NULL, + "fontsJson" text NOT NULL, + "textStylesJson" text NOT NULL, + "backgroundJson" text NOT NULL, + "shapeStyleJson" text, + "tableStyleJson" text, + "codeStyleJson" text, + "chartStyleJson" text, + "sortKey" text NOT NULL, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "deck_theme_file_idx" ON "deck_theme" USING btree ("fileId", "id"); +CREATE INDEX "deck_theme_deck_idx" ON "deck_theme" USING btree ("deckId"); + +-- +-- Class DimensionGroup as table dimension_group +-- +CREATE TABLE "dimension_group" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "sheetId" uuid NOT NULL, + "dimension" text NOT NULL, + "startId" uuid NOT NULL, + "endId" uuid NOT NULL, + "depth" bigint NOT NULL, + "collapsed" boolean NOT NULL DEFAULT false, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "dimension_group_file_idx" ON "dimension_group" USING btree ("fileId", "id"); + +-- +-- Class Document as table document +-- +CREATE TABLE "document" ( + "id" bigserial PRIMARY KEY, + "uuid" uuid NOT NULL, + "itemId" bigint NOT NULL, + "headRevision" bigint NOT NULL DEFAULT 0, + "latestSnapshotRevision" bigint NOT NULL DEFAULT 0, + "themeId" uuid, + "pageSetupJson" text NOT NULL DEFAULT '{}'::text, + "language" text, + "frontMatter" text, + "charCount" bigint NOT NULL DEFAULT 0, + "wordCount" bigint NOT NULL DEFAULT 0, + "createdAt" timestamp without time zone NOT NULL, + "updatedAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "document_uuid_idx" ON "document" USING btree ("uuid"); +CREATE UNIQUE INDEX "document_item_idx" ON "document" USING btree ("itemId"); + +-- +-- Class DocumentImportReport as table document_import_report +-- +CREATE TABLE "document_import_report" ( + "id" bigserial PRIMARY KEY, + "documentId" bigint NOT NULL, + "userId" bigint NOT NULL, + "warningsJson" text NOT NULL, + "createdAt" timestamp without time zone NOT NULL, + "seenAt" timestamp without time zone +); + +-- Indexes +CREATE INDEX "document_import_report_idx" ON "document_import_report" USING btree ("documentId", "userId"); + +-- +-- Class DocumentMetaChange as table document_meta_change +-- +CREATE TABLE "document_meta_change" ( + "id" bigserial PRIMARY KEY, + "documentId" bigint NOT NULL, + "field" text NOT NULL, + "clientOpId" uuid, + "beforeJson" text NOT NULL, + "afterJson" text NOT NULL, + "authorId" bigint, + "actorKind" text NOT NULL, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "document_meta_change_idx" ON "document_meta_change" USING btree ("documentId", "createdAt"); +CREATE UNIQUE INDEX "document_meta_change_client_idx" ON "document_meta_change" USING btree ("documentId", "clientOpId"); + +-- +-- Class DocumentOp as table document_op +-- +CREATE TABLE "document_op" ( + "id" bigserial PRIMARY KEY, + "documentId" bigint NOT NULL, + "revision" bigint NOT NULL, + "clientOpId" uuid NOT NULL, + "authorId" bigint, + "actorKind" text NOT NULL, + "sessionId" text, + "kind" text NOT NULL, + "baseRevision" bigint NOT NULL, + "deltaJson" text NOT NULL, + "inverseJson" text NOT NULL, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "document_op_rev_idx" ON "document_op" USING btree ("documentId", "revision"); +CREATE UNIQUE INDEX "document_op_client_idx" ON "document_op" USING btree ("documentId", "clientOpId"); +CREATE INDEX "document_op_created_idx" ON "document_op" USING brin ("createdAt"); + +-- +-- Class DocumentSnapshot as table document_snapshot +-- +CREATE TABLE "document_snapshot" ( + "id" bigserial PRIMARY KEY, + "documentId" bigint NOT NULL, + "revision" bigint NOT NULL, + "deltaJson" text NOT NULL, + "compressed" boolean NOT NULL, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "document_snapshot_idx" ON "document_snapshot" USING btree ("documentId", "revision"); + +-- +-- Class DriveItem as table drive_item +-- +CREATE TABLE "drive_item" ( + "id" bigserial PRIMARY KEY, + "uuid" uuid NOT NULL, + "kind" text NOT NULL, + "name" text NOT NULL, + "ownerId" bigint NOT NULL, + "parentId" bigint, + "description" text, + "contentRef" uuid, + "thumbnailFileId" uuid, + "sizeBytes" bigint NOT NULL DEFAULT 0, + "attachmentBytes" bigint NOT NULL DEFAULT 0, + "kindMask" bigint NOT NULL DEFAULT 0, + "mimeType" text, + "fileCategory" text, + "uploadState" text, + "fileMetaJson" text, + "previewFileId" uuid, + "createdAt" timestamp without time zone NOT NULL, + "createdById" bigint NOT NULL, + "modifiedAt" timestamp without time zone NOT NULL, + "modifiedById" bigint, + "trashedAt" timestamp without time zone, + "trashedById" bigint, + "templateOf" text, + "templateKey" text, + "editorsCanShare" boolean NOT NULL DEFAULT true, + "nonEditorsCanExport" boolean NOT NULL DEFAULT true, + "viewersSeeComments" boolean NOT NULL DEFAULT false, + "searchText" text +); + +-- Indexes +CREATE UNIQUE INDEX "drive_item_uuid_idx" ON "drive_item" USING btree ("uuid"); +CREATE INDEX "drive_item_parent_idx" ON "drive_item" USING btree ("parentId"); +CREATE INDEX "drive_item_owner_idx" ON "drive_item" USING btree ("ownerId", "trashedAt"); +CREATE INDEX "drive_item_content_idx" ON "drive_item" USING btree ("contentRef"); +CREATE INDEX "drive_item_template_idx" ON "drive_item" USING btree ("templateOf"); +CREATE INDEX "drive_item_upload_idx" ON "drive_item" USING btree ("uploadState", "createdAt"); +CREATE INDEX "drive_item_trashed_idx" ON "drive_item" USING btree ("trashedAt"); + +-- +-- Class DriveItemPermission as table drive_item_permission +-- +CREATE TABLE "drive_item_permission" ( + "id" bigserial PRIMARY KEY, + "itemId" bigint NOT NULL, + "userId" bigint, + "invitedEmail" text, + "role" text NOT NULL, + "inheritedFromId" bigint, + "grantedById" bigint NOT NULL, + "grantedAt" timestamp without time zone NOT NULL, + "expiresAt" timestamp without time zone, + "viaPublicationId" bigint +); + +-- Indexes +CREATE UNIQUE INDEX "perm_item_user_idx" ON "drive_item_permission" USING btree ("itemId", "userId", "inheritedFromId", "invitedEmail") NULLS NOT DISTINCT; +CREATE INDEX "perm_user_idx" ON "drive_item_permission" USING btree ("userId"); +CREATE INDEX "perm_email_idx" ON "drive_item_permission" USING btree ("invitedEmail"); +CREATE INDEX "perm_expires_idx" ON "drive_item_permission" USING btree ("expiresAt"); + +-- +-- Class DriveItemUserState as table drive_item_user_state +-- +CREATE TABLE "drive_item_user_state" ( + "id" bigserial PRIMARY KEY, + "itemId" bigint NOT NULL, + "userId" bigint NOT NULL, + "starred" boolean NOT NULL DEFAULT false, + "lastOpenedAt" timestamp without time zone, + "lastEditedAt" timestamp without time zone, + "pinnedOffline" boolean NOT NULL DEFAULT false, + "shortcutParentId" bigint, + "viaLink" boolean NOT NULL DEFAULT false +); + +-- Indexes +CREATE UNIQUE INDEX "drive_item_user_state_idx" ON "drive_item_user_state" USING btree ("itemId", "userId"); +CREATE INDEX "drive_item_user_recent_idx" ON "drive_item_user_state" USING btree ("userId", "lastOpenedAt"); + +-- +-- Class EmbeddedObject as table embedded_object +-- +CREATE TABLE "embedded_object" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "sheetId" uuid NOT NULL, + "kind" text NOT NULL, + "anchorJson" text NOT NULL, + "specJson" text NOT NULL, + "zIndex" bigint NOT NULL DEFAULT 0, + "title" text, + "altText" text, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "embedded_object_file_idx" ON "embedded_object" USING btree ("fileId", "id"); + +-- +-- Class FeedbackReport as table feedback_report +-- +CREATE TABLE "feedback_report" ( + "id" bigserial PRIMARY KEY, + "userId" bigint, + "kind" text NOT NULL, + "message" text NOT NULL, + "app" text NOT NULL, + "appVersion" text NOT NULL, + "platform" text NOT NULL, + "route" text, + "stackTrace" text, + "contextJson" text, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "feedback_report_created_idx" ON "feedback_report" USING btree ("createdAt"); + +-- +-- Class FilterView as table filter_view +-- +CREATE TABLE "filter_view" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "sheetId" uuid NOT NULL, + "name" text NOT NULL, + "rangeJson" text NOT NULL, + "criteriaJson" text NOT NULL, + "sortJson" text, + "createdBy" uuid NOT NULL, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "filter_view_file_idx" ON "filter_view" USING btree ("fileId", "id"); + +-- +-- Class HeadlessChange as table headless_change +-- +CREATE TABLE "headless_change" ( + "id" bigserial PRIMARY KEY, + "changeId" uuid NOT NULL, + "kind" text NOT NULL, + "itemId" bigint NOT NULL, + "documentId" bigint, + "revision" bigint, + "inverseJson" text, + "metaField" text, + "metaBeforeJson" text, + "metaAfterJson" text, + "userId" bigint NOT NULL, + "actorKind" text NOT NULL, + "label" text, + "toolName" text NOT NULL, + "createdAt" timestamp without time zone NOT NULL, + "revertedAt" timestamp without time zone +); + +-- Indexes +CREATE UNIQUE INDEX "headless_change_id_idx" ON "headless_change" USING btree ("changeId"); +CREATE INDEX "headless_change_created_idx" ON "headless_change" USING btree ("createdAt"); + +-- +-- Class ItemVersion as table item_version +-- +CREATE TABLE "item_version" ( + "id" bigserial PRIMARY KEY, + "itemId" bigint NOT NULL, + "kind" text NOT NULL, + "name" text, + "createdAt" timestamp without time zone NOT NULL, + "createdById" bigint, + "authors" json NOT NULL, + "storageKind" text NOT NULL, + "revision" bigint, + "snapshotFileId" uuid, + "sizeBytes" bigint NOT NULL DEFAULT 0 +); + +-- Indexes +CREATE INDEX "item_version_item_idx" ON "item_version" USING btree ("itemId", "createdAt"); + +-- +-- Class ItemVersionState as table item_version_state +-- +CREATE TABLE "item_version_state" ( + "id" bigserial PRIMARY KEY, + "itemId" bigint NOT NULL, + "lastEditAt" timestamp without time zone NOT NULL, + "dirtySince" timestamp without time zone, + "lastVersionAt" timestamp without time zone, + "editorsSinceLastVersion" json NOT NULL, + "lastRevision" bigint, + "capturingSince" timestamp without time zone +); + +-- Indexes +CREATE UNIQUE INDEX "item_version_state_item_idx" ON "item_version_state" USING btree ("itemId"); +CREATE INDEX "item_version_state_dirty_idx" ON "item_version_state" USING btree ("dirtySince"); + +-- +-- Class ItemViewDay as table item_view_day +-- +CREATE TABLE "item_view_day" ( + "id" bigserial PRIMARY KEY, + "itemId" bigint NOT NULL, + "userId" bigint NOT NULL, + "day" timestamp without time zone NOT NULL, + "views" bigint NOT NULL DEFAULT 1, + "lastViewedAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "item_view_day_idx" ON "item_view_day" USING btree ("itemId", "userId", "day"); +CREATE INDEX "item_view_day_item_idx" ON "item_view_day" USING btree ("itemId", "day"); + +-- +-- Class Macro as table macro +-- +CREATE TABLE "macro" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "projectId" uuid NOT NULL, + "name" text NOT NULL, + "functionName" text NOT NULL, + "shortcutSlot" bigint, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "macro_file_idx" ON "macro" USING btree ("fileId", "id"); + +-- +-- Class MergedRange as table merged_range +-- +CREATE TABLE "merged_range" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "sheetId" uuid NOT NULL, + "rangeJson" text NOT NULL, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "merged_range_file_idx" ON "merged_range" USING btree ("fileId", "id"); + +-- +-- Class NamedRange as table named_range +-- +CREATE TABLE "named_range" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "spreadsheetId" uuid NOT NULL, + "name" text NOT NULL, + "rangeJson" text, + "formula" text, + "comment" text, + "metaJson" text, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "named_range_file_idx" ON "named_range" USING btree ("fileId", "id"); + +-- +-- Class UserNotification as table notification +-- +CREATE TABLE "notification" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "kind" text NOT NULL, + "itemId" bigint, + "actorId" bigint, + "payload" text NOT NULL, + "createdAt" timestamp without time zone NOT NULL, + "readAt" timestamp without time zone, + "emailedAt" timestamp without time zone, + "emailPending" boolean DEFAULT false +); + +-- Indexes +CREATE INDEX "notification_user_idx" ON "notification" USING btree ("userId", "createdAt"); +CREATE INDEX "notification_email_idx" ON "notification" USING btree ("emailPending", "createdAt"); +CREATE INDEX "notification_created_idx" ON "notification" USING brin ("createdAt"); + +-- +-- Class OwnershipTransfer as table ownership_transfer +-- +CREATE TABLE "ownership_transfer" ( + "id" bigserial PRIMARY KEY, + "itemId" bigint NOT NULL, + "fromUserId" bigint NOT NULL, + "toUserId" bigint NOT NULL, + "createdAt" timestamp without time zone NOT NULL, + "handledAt" timestamp without time zone, + "accepted" boolean +); + +-- Indexes +CREATE INDEX "ownership_transfer_item_idx" ON "ownership_transfer" USING btree ("itemId", "handledAt"); + +-- +-- Class PersonalAccessToken as table personal_access_token +-- +CREATE TABLE "personal_access_token" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "name" text NOT NULL, + "tokenHash" text NOT NULL, + "prefix" text NOT NULL, + "scopes" json NOT NULL, + "expiresAt" timestamp without time zone, + "lastUsedAt" timestamp without time zone, + "createdAt" timestamp without time zone NOT NULL, + "revokedAt" timestamp without time zone +); + +-- Indexes +CREATE INDEX "personal_access_token_user_idx" ON "personal_access_token" USING btree ("userId"); +CREATE UNIQUE INDEX "personal_access_token_hash_idx" ON "personal_access_token" USING btree ("tokenHash"); + +-- +-- Class PivotTable as table pivot_table +-- +CREATE TABLE "pivot_table" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "sheetId" uuid NOT NULL, + "anchorRowId" uuid NOT NULL, + "anchorColId" uuid NOT NULL, + "sourceRangeJson" text NOT NULL, + "specJson" text NOT NULL, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "pivot_table_file_idx" ON "pivot_table" USING btree ("fileId", "id"); + +-- +-- Class ProtectedRange as table protected_range +-- +CREATE TABLE "protected_range" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "sheetId" uuid NOT NULL, + "rangeJson" text, + "exceptRangesJson" text, + "description" text, + "warningOnly" boolean NOT NULL DEFAULT false, + "editorsJson" text NOT NULL, + "createdBy" uuid NOT NULL, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "protected_range_file_idx" ON "protected_range" USING btree ("fileId", "id"); + +-- +-- Class Publication as table publication +-- +CREATE TABLE "publication" ( + "id" bigserial PRIMARY KEY, + "publicId" text NOT NULL, + "ownerId" bigint NOT NULL, + "name" text NOT NULL, + "siteUrl" text NOT NULL, + "webhookUrl" text NOT NULL, + "verifiedHost" text, + "verifiedAt" timestamp without time zone, + "templateItemId" bigint, + "termsUrl" text, + "fields" json NOT NULL, + "signingSecret" text NOT NULL, + "previousSigningSecret" text, + "previousSecretUntil" timestamp without time zone, + "apiKeyHash" text, + "apiKeyLast4" text, + "enabled" boolean NOT NULL DEFAULT true, + "createdAt" timestamp without time zone NOT NULL, + "updatedAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "publication_public_idx" ON "publication" USING btree ("publicId"); +CREATE INDEX "publication_owner_idx" ON "publication" USING btree ("ownerId"); +CREATE INDEX "publication_api_key_idx" ON "publication" USING btree ("apiKeyHash"); + +-- +-- Class PublicationBlock as table publication_block +-- +CREATE TABLE "publication_block" ( + "id" bigserial PRIMARY KEY, + "publicationId" bigint NOT NULL, + "userId" bigint NOT NULL, + "at" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "publication_block_idx" ON "publication_block" USING btree ("publicationId", "userId"); + +-- +-- Class PublicationConsent as table publication_consent +-- +CREATE TABLE "publication_consent" ( + "id" bigserial PRIMARY KEY, + "publicationId" bigint NOT NULL, + "userId" bigint NOT NULL, + "consentKey" text NOT NULL, + "at" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "publication_consent_idx" ON "publication_consent" USING btree ("publicationId", "userId"); + +-- +-- Class PublicationDelivery as table publication_delivery +-- +CREATE TABLE "publication_delivery" ( + "id" bigserial PRIMARY KEY, + "publicationId" bigint NOT NULL, + "submissionId" bigint, + "webhookId" text NOT NULL, + "type" text NOT NULL, + "sequence" bigint, + "payload" text NOT NULL, + "attempts" bigint NOT NULL DEFAULT 0, + "nextAttemptAt" timestamp without time zone, + "leaseUntil" timestamp without time zone, + "lastStatus" bigint, + "lastError" text, + "deliveredAt" timestamp without time zone, + "failedAt" timestamp without time zone, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "publication_delivery_webhook_idx" ON "publication_delivery" USING btree ("webhookId"); +CREATE INDEX "publication_delivery_due_idx" ON "publication_delivery" USING btree ("nextAttemptAt"); +CREATE INDEX "publication_delivery_publication_idx" ON "publication_delivery" USING btree ("publicationId", "createdAt"); + +-- +-- Class PublicationModerator as table publication_moderator +-- +CREATE TABLE "publication_moderator" ( + "id" bigserial PRIMARY KEY, + "publicationId" bigint NOT NULL, + "userId" bigint, + "email" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "publication_moderator_idx" ON "publication_moderator" USING btree ("publicationId", "email"); +CREATE INDEX "publication_moderator_user_idx" ON "publication_moderator" USING btree ("userId"); + +-- +-- Class RevFile as table rev_file +-- +CREATE TABLE "rev_file" ( + "id" bigserial PRIMARY KEY, + "fileUuid" uuid NOT NULL, + "kind" text NOT NULL, + "itemId" bigint NOT NULL, + "headRevision" bigint NOT NULL DEFAULT 0, + "prunedBelow" bigint NOT NULL DEFAULT 0, + "initPending" boolean NOT NULL DEFAULT false, + "purging" boolean NOT NULL DEFAULT false, + "schemaHash" text NOT NULL, + "stats" text NOT NULL DEFAULT '{}'::text, + "contentCount" bigint NOT NULL DEFAULT 0, + "createdAt" timestamp without time zone NOT NULL, + "updatedAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "rev_file_uuid_idx" ON "rev_file" USING btree ("fileUuid"); +CREATE UNIQUE INDEX "rev_file_item_idx" ON "rev_file" USING btree ("itemId"); + +-- +-- Class RevHookState as table rev_hook_state +-- +CREATE TABLE "rev_hook_state" ( + "id" bigserial PRIMARY KEY, + "fileId" bigint NOT NULL, + "cursorsJson" text NOT NULL, + "leaseOwner" text, + "leaseUntil" timestamp without time zone, + "attempts" bigint NOT NULL DEFAULT 0, + "lastError" text, + "nextAttemptAt" timestamp without time zone, + "updatedAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "rev_hook_state_file_idx" ON "rev_hook_state" USING btree ("fileId"); +CREATE INDEX "rev_hook_state_due_idx" ON "rev_hook_state" USING btree ("nextAttemptAt"); + +-- +-- Class RevOp as table rev_op +-- +CREATE TABLE "rev_op" ( + "id" bigserial PRIMARY KEY, + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL, + "clientOpId" uuid NOT NULL, + "baseRevision" bigint NOT NULL, + "authorId" bigint, + "authorUuid" uuid, + "sessionId" text, + "onBehalfOfSessionId" text, + "actorKind" text NOT NULL, + "label" text NOT NULL, + "groupId" text, + "groupIndex" bigint NOT NULL DEFAULT 0, + "groupLast" boolean NOT NULL DEFAULT true, + "recordId" uuid, + "offline" boolean NOT NULL DEFAULT false, + "payload" bytea, + "changeCount" bigint NOT NULL, + "summaryJson" text, + "detailJson" text, + "outcomeJson" text, + "appliedEqualsSubmitted" boolean NOT NULL, + "clientCreatedAt" timestamp without time zone, + "committedAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "rev_op_rev_idx" ON "rev_op" USING btree ("fileId", "revision"); +CREATE UNIQUE INDEX "rev_op_client_idx" ON "rev_op" USING btree ("fileId", "clientOpId"); +CREATE INDEX "rev_op_record_idx" ON "rev_op" USING btree ("recordId"); +CREATE INDEX "rev_op_committed_idx" ON "rev_op" USING brin ("committedAt"); + +-- +-- Class ScriptAuthorization as table script_authorization +-- +CREATE TABLE "script_authorization" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "spreadsheetUuid" uuid NOT NULL, + "scopes" json NOT NULL, + "grantedAt" timestamp without time zone NOT NULL, + "revokedAt" timestamp without time zone +); + +-- Indexes +CREATE UNIQUE INDEX "script_auth_user_sheet_idx" ON "script_authorization" USING btree ("userId", "spreadsheetUuid"); + +-- +-- Class ScriptBuild as table script_build +-- +CREATE TABLE "script_build" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "projectId" uuid NOT NULL, + "status" text NOT NULL DEFAULT 'ok'::text, + "sourceHash" text NOT NULL, + "bytecodeFileUuid" uuid, + "diagnosticsJson" text NOT NULL, + "exportsJson" text NOT NULL, + "apiVersion" bigint NOT NULL DEFAULT 1, + "compilerVersion" text NOT NULL DEFAULT ''::text, + "requestedBy" uuid, + "lastGoodSourceHash" text, + "lastGoodBytecodeFileUuid" uuid, + "lastGoodExportsJson" text, + "lastGoodBuiltAt" timestamp without time zone, + "positionsFileUuid" uuid, + "builtAt" timestamp without time zone NOT NULL, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "script_build_file_idx" ON "script_build" USING btree ("fileId", "id"); + +-- +-- Class ScriptExecution as table script_execution +-- +CREATE TABLE "script_execution" ( + "id" bigserial PRIMARY KEY, + "uuid" uuid NOT NULL, + "spreadsheetUuid" uuid NOT NULL, + "projectId" uuid, + "functionName" text NOT NULL, + "kind" text NOT NULL, + "triggerId" uuid, + "userId" bigint NOT NULL, + "runAsUserId" bigint NOT NULL, + "runtime" text NOT NULL, + "status" text NOT NULL, + "buildSourceHash" text NOT NULL, + "startedAt" timestamp without time zone NOT NULL, + "durationMs" bigint NOT NULL, + "logs" text NOT NULL, + "errorMessage" text, + "errorStackJson" text, + "changeId" uuid, + "cellsRead" bigint NOT NULL, + "cellsWritten" bigint NOT NULL, + "fetchCalls" bigint NOT NULL, + "callCount" bigint NOT NULL DEFAULT 1 +); + +-- Indexes +CREATE UNIQUE INDEX "script_exec_uuid_idx" ON "script_execution" USING btree ("uuid"); +CREATE INDEX "script_exec_sheet_idx" ON "script_execution" USING btree ("spreadsheetUuid", "startedAt"); +CREATE INDEX "script_exec_user_idx" ON "script_execution" USING btree ("userId", "startedAt"); + +-- +-- Class ScriptFile as table script_file +-- +CREATE TABLE "script_file" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "projectId" uuid NOT NULL, + "name" text NOT NULL, + "sortKey" text NOT NULL, + "source" text NOT NULL, + "contentHash" text NOT NULL, + "updatedBy" uuid NOT NULL, + "updatedAt" timestamp without time zone NOT NULL, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "script_file_file_idx" ON "script_file" USING btree ("fileId", "id"); + +-- +-- Class ScriptJob as table script_job +-- +CREATE TABLE "script_job" ( + "id" bigserial PRIMARY KEY, + "kind" text NOT NULL, + "spreadsheetUuid" uuid NOT NULL, + "itemUuid" uuid NOT NULL, + "triggerId" uuid, + "runAsUserId" bigint NOT NULL, + "functionName" text NOT NULL, + "payloadJson" text NOT NULL, + "status" text NOT NULL, + "enqueuedAt" timestamp without time zone NOT NULL, + "leaseOwner" text, + "leaseUntil" timestamp without time zone, + "attempts" bigint NOT NULL DEFAULT 0, + "coalesced" bigint NOT NULL DEFAULT 0, + "resultJson" text, + "finishedAt" timestamp without time zone +); + +-- Indexes +CREATE INDEX "script_job_status_idx" ON "script_job" USING btree ("status", "enqueuedAt"); +CREATE INDEX "script_job_trigger_idx" ON "script_job" USING btree ("triggerId", "status"); +CREATE INDEX "script_job_user_idx" ON "script_job" USING btree ("runAsUserId", "status"); + +-- +-- Class ScriptProject as table script_project +-- +CREATE TABLE "script_project" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "spreadsheetId" uuid NOT NULL, + "name" text NOT NULL, + "settingsJson" text NOT NULL, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "script_project_file_idx" ON "script_project" USING btree ("fileId", "id"); + +-- +-- Class ScriptProperty as table script_property +-- +CREATE TABLE "script_property" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "projectId" uuid NOT NULL, + "key" text NOT NULL, + "value" text NOT NULL, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "script_property_file_idx" ON "script_property" USING btree ("fileId", "id"); + +-- +-- Class ScriptQuotaUsage as table script_quota_usage +-- +CREATE TABLE "script_quota_usage" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "day" timestamp without time zone NOT NULL, + "serverRuntimeMs" bigint NOT NULL DEFAULT 0, + "clientRuntimeMs" bigint NOT NULL DEFAULT 0, + "urlFetchCalls" bigint NOT NULL DEFAULT 0, + "urlFetchBytes" bigint NOT NULL DEFAULT 0, + "triggerRuns" bigint NOT NULL DEFAULT 0 +); + +-- Indexes +CREATE UNIQUE INDEX "script_quota_user_day_idx" ON "script_quota_usage" USING btree ("userId", "day"); + +-- +-- Class ScriptTrigger as table script_trigger +-- +CREATE TABLE "script_trigger" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "projectId" uuid NOT NULL, + "kind" text NOT NULL, + "functionName" text NOT NULL, + "scheduleJson" text, + "runAsUserId" uuid NOT NULL, + "enabled" boolean NOT NULL DEFAULT true, + "optionsJson" text, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "script_trigger_file_idx" ON "script_trigger" USING btree ("fileId", "id"); + +-- +-- Class ScriptTriggerState as table script_trigger_state +-- +CREATE TABLE "script_trigger_state" ( + "id" bigserial PRIMARY KEY, + "triggerId" uuid NOT NULL, + "spreadsheetUuid" uuid NOT NULL, + "scheduleJson" text, + "nextRunAt" timestamp without time zone, + "lastRunAt" timestamp without time zone, + "lastStatus" text, + "consecutiveFailures" bigint NOT NULL DEFAULT 0, + "disabledReason" text, + "runningSince" timestamp without time zone, + "lastNotifiedAt" timestamp without time zone +); + +-- Indexes +CREATE UNIQUE INDEX "script_trigger_state_id_idx" ON "script_trigger_state" USING btree ("triggerId"); +CREATE INDEX "script_trigger_state_due_idx" ON "script_trigger_state" USING btree ("nextRunAt"); + +-- +-- Class ScriptUserProperty as table script_user_property +-- +CREATE TABLE "script_user_property" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "fileUuid" uuid NOT NULL, + "key" text NOT NULL, + "value" text NOT NULL, + "updatedAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "script_user_property_idx" ON "script_user_property" USING btree ("userId", "fileUuid", "key"); + +-- +-- Class ServerChangeRecord as table server_change_record +-- +CREATE TABLE "server_change_record" ( + "id" bigserial PRIMARY KEY, + "changeId" uuid NOT NULL, + "fileUuid" uuid NOT NULL, + "userId" bigint NOT NULL, + "actorKind" text NOT NULL, + "label" text NOT NULL, + "inverseJson" text, + "inverseFileId" uuid, + "forwardFileId" uuid, + "recordId" uuid, + "cellsAffected" bigint NOT NULL, + "createdAt" timestamp without time zone NOT NULL, + "expiresAt" timestamp without time zone NOT NULL, + "revertedAt" timestamp without time zone, + "revertChangeId" uuid +); + +-- Indexes +CREATE INDEX "server_change_record_idx" ON "server_change_record" USING btree ("recordId"); +CREATE INDEX "server_change_file_idx" ON "server_change_record" USING btree ("fileUuid", "createdAt"); +CREATE UNIQUE INDEX "server_change_id_idx" ON "server_change_record" USING btree ("changeId"); + +-- +-- Class ShareLink as table share_link +-- +CREATE TABLE "share_link" ( + "id" bigserial PRIMARY KEY, + "itemId" bigint NOT NULL, + "token" text NOT NULL, + "role" text, + "createdById" bigint NOT NULL, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "share_link_item_idx" ON "share_link" USING btree ("itemId"); +CREATE UNIQUE INDEX "share_link_token_idx" ON "share_link" USING btree ("token"); + +-- +-- Class Sheet as table sheet +-- +CREATE TABLE "sheet" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "spreadsheetId" uuid NOT NULL, + "name" text NOT NULL, + "sortKey" text NOT NULL, + "kind" text NOT NULL DEFAULT 'grid'::text, + "hidden" boolean NOT NULL DEFAULT false, + "tabColor" text, + "rightToLeft" boolean NOT NULL DEFAULT false, + "showGridlines" boolean NOT NULL DEFAULT true, + "frozenRows" bigint NOT NULL DEFAULT 0, + "frozenColumns" bigint NOT NULL DEFAULT 0, + "defaultRowHeight" double precision NOT NULL DEFAULT 21.0, + "defaultColumnWidth" double precision NOT NULL DEFAULT 100.0, + "formatJson" text, + "printSettingsJson" text, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "sheet_file_idx" ON "sheet" USING btree ("fileId", "id"); +CREATE INDEX "sheet_order_idx" ON "sheet" USING btree ("spreadsheetId", "sortKey"); + +-- +-- Class SheetColumn as table sheet_column +-- +CREATE TABLE "sheet_column" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "sheetId" uuid NOT NULL, + "sortKey" text NOT NULL, + "width" double precision, + "hidden" boolean NOT NULL DEFAULT false, + "formatJson" text, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "sheet_column_file_idx" ON "sheet_column" USING btree ("fileId", "id"); +CREATE INDEX "sheet_column_order_idx" ON "sheet_column" USING btree ("sheetId", "sortKey"); + +-- +-- Class SheetRow as table sheet_row +-- +CREATE TABLE "sheet_row" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "sheetId" uuid NOT NULL, + "sortKey" text NOT NULL, + "height" double precision, + "hidden" boolean NOT NULL DEFAULT false, + "formatJson" text, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "sheet_row_file_idx" ON "sheet_row" USING btree ("fileId", "id"); +CREATE INDEX "sheet_row_order_idx" ON "sheet_row" USING btree ("sheetId", "sortKey"); + +-- +-- Class SheetsImportJob as table sheets_import_job +-- +CREATE TABLE "sheets_import_job" ( + "id" bigserial PRIMARY KEY, + "uuid" uuid NOT NULL, + "userId" bigint NOT NULL, + "authUserId" uuid NOT NULL, + "spreadsheetUuid" uuid NOT NULL, + "uploadFileId" uuid NOT NULL, + "fileName" text NOT NULL, + "format" text NOT NULL, + "optionsJson" text NOT NULL, + "activeSheetId" text, + "status" text NOT NULL, + "progressDone" bigint NOT NULL, + "progressTotal" bigint NOT NULL, + "reportJson" text, + "sheetIdsJson" text, + "changeId" uuid, + "errorCode" text, + "error" text, + "cancelRequested" boolean NOT NULL DEFAULT false, + "createdAt" timestamp without time zone NOT NULL, + "updatedAt" timestamp without time zone NOT NULL, + "leaseOwner" text, + "leaseUntil" timestamp without time zone +); + +-- Indexes +CREATE UNIQUE INDEX "sheets_import_job_uuid_idx" ON "sheets_import_job" USING btree ("uuid"); +CREATE INDEX "sheets_import_job_user_idx" ON "sheets_import_job" USING btree ("userId", "status"); + +-- +-- Class SheetsSnapshotIndex as table sheets_snapshot_index +-- +CREATE TABLE "sheets_snapshot_index" ( + "id" bigserial PRIMARY KEY, + "itemVersionId" bigint NOT NULL, + "sheetsJson" text NOT NULL, + "changedRangesJson" text NOT NULL, + "authorIds" json NOT NULL, + "diffFileId" uuid +); + +-- Indexes +CREATE UNIQUE INDEX "sheets_snapshot_index_version_idx" ON "sheets_snapshot_index" USING btree ("itemVersionId"); + +-- +-- Class Slide as table slide +-- +CREATE TABLE "slide" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "deckId" uuid NOT NULL, + "sortKey" text NOT NULL, + "groupId" uuid, + "layoutId" uuid, + "backgroundJson" text, + "skipped" boolean NOT NULL DEFAULT false, + "notes" text, + "transitionJson" text, + "hideMasterElements" boolean, + "timingsJson" text, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "slide_file_idx" ON "slide" USING btree ("fileId", "id"); +CREATE INDEX "slide_order_idx" ON "slide" USING btree ("deckId", "sortKey"); + +-- +-- Class SlideBuild as table slide_build +-- +CREATE TABLE "slide_build" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "slideId" uuid NOT NULL, + "elementId" uuid NOT NULL, + "kind" text NOT NULL, + "effect" text NOT NULL, + "sortKey" text NOT NULL, + "trigger" text NOT NULL, + "delayMs" bigint NOT NULL DEFAULT 0, + "durationMs" bigint NOT NULL, + "easing" text NOT NULL, + "optionsJson" text, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "slide_build_file_idx" ON "slide_build" USING btree ("fileId", "id"); +CREATE INDEX "slide_build_slide_idx" ON "slide_build" USING btree ("slideId", "sortKey"); +CREATE INDEX "slide_build_element_idx" ON "slide_build" USING btree ("elementId"); + +-- +-- Class SlideElement as table slide_element +-- +CREATE TABLE "slide_element" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "slideId" uuid, + "layoutId" uuid, + "masterId" uuid, + "parentId" uuid, + "kind" text NOT NULL, + "name" text, + "x" double precision, + "y" double precision, + "width" double precision, + "height" double precision, + "rotation" double precision, + "flipH" boolean NOT NULL DEFAULT false, + "flipV" boolean NOT NULL DEFAULT false, + "zKey" text NOT NULL, + "readingKey" text, + "locked" boolean NOT NULL DEFAULT false, + "hidden" boolean NOT NULL DEFAULT false, + "placeholderType" text, + "placeholderOf" uuid, + "matchKey" text NOT NULL, + "text" text, + "textStyleJson" text, + "fillJson" text, + "strokeJson" text, + "effectsJson" text, + "opacity" double precision, + "dataJson" text, + "linkJson" text, + "altText" text, + "decorative" boolean NOT NULL DEFAULT false, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "slide_element_file_idx" ON "slide_element" USING btree ("fileId", "id"); +CREATE INDEX "slide_element_slide_idx" ON "slide_element" USING btree ("slideId", "zKey"); +CREATE INDEX "slide_element_layout_idx" ON "slide_element" USING btree ("layoutId"); +CREATE INDEX "slide_element_master_idx" ON "slide_element" USING btree ("masterId"); +CREATE INDEX "slide_element_parent_idx" ON "slide_element" USING btree ("parentId"); + +-- +-- Class SlideGroup as table slide_group +-- +CREATE TABLE "slide_group" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "deckId" uuid NOT NULL, + "title" text NOT NULL, + "sortKey" text NOT NULL, + "parentId" uuid, + "color" text, + "skipped" boolean NOT NULL DEFAULT false, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "slide_group_file_idx" ON "slide_group" USING btree ("fileId", "id"); +CREATE INDEX "slide_group_order_idx" ON "slide_group" USING btree ("deckId", "sortKey"); + +-- +-- Class SlideLayout as table slide_layout +-- +CREATE TABLE "slide_layout" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "masterId" uuid NOT NULL, + "name" text NOT NULL, + "key" text, + "sortKey" text NOT NULL, + "backgroundJson" text, + "hideMasterElements" boolean NOT NULL DEFAULT false, + "hidden" boolean NOT NULL DEFAULT false, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "slide_layout_file_idx" ON "slide_layout" USING btree ("fileId", "id"); +CREATE INDEX "slide_layout_master_idx" ON "slide_layout" USING btree ("masterId"); + +-- +-- Class SlideMaster as table slide_master +-- +CREATE TABLE "slide_master" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "themeId" uuid NOT NULL, + "name" text NOT NULL, + "sortKey" text NOT NULL, + "backgroundJson" text, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "slide_master_file_idx" ON "slide_master" USING btree ("fileId", "id"); +CREATE INDEX "slide_master_theme_idx" ON "slide_master" USING btree ("themeId"); + +-- +-- Class SlideTableAxis as table slide_table_axis +-- +CREATE TABLE "slide_table_axis" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "elementId" uuid NOT NULL, + "dimension" text NOT NULL, + "sortKey" text NOT NULL, + "size" double precision, + "header" boolean NOT NULL DEFAULT false, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "slide_table_axis_file_idx" ON "slide_table_axis" USING btree ("fileId", "id"); +CREATE INDEX "slide_table_axis_element_idx" ON "slide_table_axis" USING btree ("elementId", "sortKey"); + +-- +-- Class SlideTableCell as table slide_table_cell +-- +CREATE TABLE "slide_table_cell" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "elementId" uuid NOT NULL, + "rowId" uuid NOT NULL, + "columnId" uuid NOT NULL, + "text" text, + "fill" text, + "borderTop" text, + "borderRight" text, + "borderBottom" text, + "borderLeft" text, + "vAlign" text, + "padding" text, + "rowSpan" bigint, + "colSpan" bigint, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "slide_table_cell_file_idx" ON "slide_table_cell" USING btree ("fileId", "id"); +CREATE INDEX "slide_table_cell_element_idx" ON "slide_table_cell" USING btree ("elementId"); + +-- +-- Class SlidesSnapshotIndex as table slides_snapshot_index +-- +CREATE TABLE "slides_snapshot_index" ( + "id" bigserial PRIMARY KEY, + "itemVersionId" bigint NOT NULL, + "slidesJson" text NOT NULL, + "changesJson" text NOT NULL, + "authorIds" json NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "slides_snapshot_index_version_idx" ON "slides_snapshot_index" USING btree ("itemVersionId"); + +-- +-- Class Spreadsheet as table spreadsheet +-- +CREATE TABLE "spreadsheet" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "title" text NOT NULL, + "locale" text NOT NULL, + "timeZone" text NOT NULL, + "recalcMode" text NOT NULL DEFAULT 'onChange'::text, + "iterativeCalc" boolean NOT NULL DEFAULT false, + "maxIterations" bigint NOT NULL DEFAULT 50, + "convergenceThreshold" double precision NOT NULL DEFAULT 0.05, + "defaultFontFamily" text NOT NULL DEFAULT 'Inter'::text, + "defaultFontSize" double precision NOT NULL DEFAULT 10.0, + "themeJson" text NOT NULL, + "displayLanguage" text, + "createdBy" uuid NOT NULL, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "spreadsheet_file_idx" ON "spreadsheet" USING btree ("fileId", "id"); + +-- +-- Class StorageReservation as table storage_reservation +-- +CREATE TABLE "storage_reservation" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "fileUuid" uuid NOT NULL, + "itemId" bigint, + "bytes" bigint NOT NULL, + "createdAt" timestamp without time zone NOT NULL, + "expiresAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "storage_reservation_file_idx" ON "storage_reservation" USING btree ("fileUuid"); +CREATE INDEX "storage_reservation_user_idx" ON "storage_reservation" USING btree ("userId"); +CREATE INDEX "storage_reservation_expiry_idx" ON "storage_reservation" USING btree ("expiresAt"); + +-- +-- Class StoredFile as table stored_file +-- +CREATE TABLE "stored_file" ( + "id" bigserial PRIMARY KEY, + "fileUuid" uuid NOT NULL, + "ownerId" bigint, + "itemId" bigint, + "kind" text NOT NULL, + "storageId" text NOT NULL, + "path" text NOT NULL, + "fileName" text NOT NULL, + "mimeType" text NOT NULL, + "sizeBytes" bigint NOT NULL, + "status" text NOT NULL, + "createdAt" timestamp without time zone NOT NULL, + "completedAt" timestamp without time zone, + "expiresAt" timestamp without time zone +); + +-- Indexes +CREATE UNIQUE INDEX "stored_file_uuid_idx" ON "stored_file" USING btree ("fileUuid"); +CREATE INDEX "stored_file_item_idx" ON "stored_file" USING btree ("itemId"); +CREATE INDEX "stored_file_expiry_idx" ON "stored_file" USING btree ("expiresAt"); +CREATE INDEX "stored_file_owner_kind_idx" ON "stored_file" USING btree ("ownerId", "kind", "createdAt"); +CREATE INDEX "stored_file_status_idx" ON "stored_file" USING btree ("status", "createdAt"); + +-- +-- Class Submission as table submission +-- +CREATE TABLE "submission" ( + "id" bigserial PRIMARY KEY, + "uuid" uuid NOT NULL, + "publicationId" bigint NOT NULL, + "itemId" bigint NOT NULL, + "ref" text, + "status" text NOT NULL, + "statusBeforeSubmit" text, + "delivery" text, + "values" json NOT NULL, + "publicUrl" text, + "feedbackThreadId" bigint, + "createdById" bigint NOT NULL, + "createdAt" timestamp without time zone NOT NULL, + "updatedAt" timestamp without time zone NOT NULL, + "disconnectedAt" timestamp without time zone +); + +-- Indexes +CREATE UNIQUE INDEX "submission_uuid_idx" ON "submission" USING btree ("uuid"); +CREATE UNIQUE INDEX "submission_item_idx" ON "submission" USING btree ("itemId"); +CREATE INDEX "submission_publication_idx" ON "submission" USING btree ("publicationId", "status"); + +-- +-- Class SubmissionAsset as table submission_asset +-- +CREATE TABLE "submission_asset" ( + "id" bigserial PRIMARY KEY, + "submissionId" bigint NOT NULL, + "fileUuid" uuid NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "submission_asset_idx" ON "submission_asset" USING btree ("submissionId", "fileUuid"); +CREATE INDEX "submission_asset_file_idx" ON "submission_asset" USING btree ("fileUuid"); + +-- +-- Class SubmissionRevision as table submission_revision +-- +CREATE TABLE "submission_revision" ( + "id" bigserial PRIMARY KEY, + "submissionId" bigint NOT NULL, + "sequence" bigint NOT NULL, + "revision" bigint NOT NULL, + "versionId" bigint, + "values" json NOT NULL, + "payload" text NOT NULL, + "submittedById" bigint NOT NULL, + "submittedAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "submission_revision_idx" ON "submission_revision" USING btree ("submissionId", "sequence"); + +-- +-- Class UsageCounterDay as table usage_counter_day +-- +CREATE TABLE "usage_counter_day" ( + "id" bigserial PRIMARY KEY, + "day" timestamp without time zone NOT NULL, + "name" text NOT NULL, + "value" bigint NOT NULL DEFAULT 0 +); + +-- Indexes +CREATE UNIQUE INDEX "usage_counter_day_idx" ON "usage_counter_day" USING btree ("day", "name"); + +-- +-- Class UserActivityDay as table user_activity_day +-- +CREATE TABLE "user_activity_day" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "day" timestamp without time zone NOT NULL, + "app" text NOT NULL, + "edited" boolean NOT NULL DEFAULT false +); + +-- Indexes +CREATE UNIQUE INDEX "user_activity_day_idx" ON "user_activity_day" USING btree ("userId", "day", "app"); +CREATE INDEX "user_activity_day_day_idx" ON "user_activity_day" USING btree ("day"); + +-- +-- Class UserActivitySettings as table user_activity_settings +-- +CREATE TABLE "user_activity_settings" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "showViewHistory" boolean NOT NULL DEFAULT true, + "updatedAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "user_activity_settings_user_idx" ON "user_activity_settings" USING btree ("userId"); + +-- +-- Class UserPreferences as table user_preferences +-- +CREATE TABLE "user_preferences" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "appTheme" text NOT NULL DEFAULT 'system'::text, + "accentColor" text, + "density" text NOT NULL DEFAULT 'comfortable'::text, + "reduceMotion" boolean NOT NULL DEFAULT false, + "keymapOverrides" text NOT NULL DEFAULT '{}'::text, + "writeDefaults" text NOT NULL DEFAULT '{}'::text, + "sheetsDefaults" text NOT NULL DEFAULT '{}'::text, + "slidesDefaults" text NOT NULL DEFAULT '{}'::text, + "slidesPresenter" text NOT NULL DEFAULT '{}'::text, + "driveDefaults" text NOT NULL DEFAULT '{}'::text, + "notificationSettings" text NOT NULL DEFAULT '{}'::text, + "aiEnabled" boolean NOT NULL DEFAULT true, + "updatedAt" timestamp without time zone +); + +-- Indexes +CREATE UNIQUE INDEX "user_preferences_user_idx" ON "user_preferences" USING btree ("userId"); + +-- +-- Class UserProfile as table user_profile +-- +CREATE TABLE "user_profile" ( + "id" bigserial PRIMARY KEY, + "authUserId" uuid NOT NULL, + "displayName" text NOT NULL, + "email" text NOT NULL, + "avatarFileId" uuid, + "avatarColor" text NOT NULL, + "locale" text, + "timeZone" text, + "createdAt" timestamp without time zone NOT NULL, + "lastSeenAt" timestamp without time zone, + "welcomeContentAt" timestamp without time zone +); + +-- Indexes +CREATE UNIQUE INDEX "user_profile_auth_idx" ON "user_profile" USING btree ("authUserId"); +CREATE UNIQUE INDEX "user_profile_email_idx" ON "user_profile" USING btree ("email"); + +-- +-- Class UserStorage as table user_storage +-- +CREATE TABLE "user_storage" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "usedBytes" bigint NOT NULL DEFAULT 0, + "reservedBytes" bigint NOT NULL DEFAULT 0, + "documentsBytes" bigint NOT NULL DEFAULT 0, + "spreadsheetsBytes" bigint NOT NULL DEFAULT 0, + "presentationsBytes" bigint NOT NULL DEFAULT 0, + "filesBytes" bigint NOT NULL DEFAULT 0, + "trashBytes" bigint NOT NULL DEFAULT 0, + "quotaBytesOverride" bigint, + "overQuotaSince" timestamp without time zone, + "reconciledAt" timestamp without time zone, + "updatedAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "user_storage_user_idx" ON "user_storage" USING btree ("userId"); + +-- +-- Class WriteDiffCache as table write_diff_cache +-- +CREATE TABLE "write_diff_cache" ( + "id" bigserial PRIMARY KEY, + "documentId" bigint NOT NULL, + "fromRevision" bigint NOT NULL, + "toRevision" bigint NOT NULL, + "json" text NOT NULL, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "write_diff_cache_idx" ON "write_diff_cache" USING btree ("documentId", "fromRevision", "toRevision"); +CREATE INDEX "write_diff_cache_created_idx" ON "write_diff_cache" USING brin ("createdAt"); + +-- +-- Class WriteTheme as table write_theme +-- +CREATE TABLE "write_theme" ( + "id" bigserial PRIMARY KEY, + "uuid" uuid NOT NULL, + "ownerId" bigint, + "isBuiltin" boolean NOT NULL, + "builtinKey" text, + "name" text NOT NULL, + "description" text, + "schemaVersion" bigint NOT NULL, + "version" bigint NOT NULL, + "json" text NOT NULL, + "contentHash" text NOT NULL, + "createdAt" timestamp without time zone NOT NULL, + "updatedAt" timestamp without time zone NOT NULL, + "deletedAt" timestamp without time zone +); + +-- Indexes +CREATE UNIQUE INDEX "write_theme_uuid_idx" ON "write_theme" USING btree ("uuid"); +CREATE INDEX "write_theme_owner_idx" ON "write_theme" USING btree ("ownerId", "deletedAt"); +CREATE UNIQUE INDEX "write_theme_builtin_idx" ON "write_theme" USING btree ("builtinKey"); + +-- +-- Class WriteThemeRevision as table write_theme_revision +-- +CREATE TABLE "write_theme_revision" ( + "id" bigserial PRIMARY KEY, + "themeId" bigint NOT NULL, + "version" bigint NOT NULL, + "json" text NOT NULL, + "savedById" bigint, + "actorKind" text NOT NULL, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "write_theme_rev_idx" ON "write_theme_revision" USING btree ("themeId", "version"); + +-- +-- Class CloudStorageEntry as table serverpod_cloud_storage +-- +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"); + +-- +-- Class CloudStorageDirectDownloadEntry as table serverpod_cloud_storage_direct_download +-- +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"); + +-- +-- Class CloudStorageDirectUploadEntry as table serverpod_cloud_storage_direct_upload +-- +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"); + +-- +-- Class FutureCallEntry as table serverpod_future_call +-- +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"); + +-- +-- Class FutureCallClaimEntry as table serverpod_future_call_claim +-- +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"); + +-- +-- Class ServerHealthConnectionInfo as table serverpod_health_connection_info +-- +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"); + +-- +-- Class ServerHealthMetric as table serverpod_health_metric +-- +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"); + +-- +-- Class LogEntry as table serverpod_log +-- +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"); + +-- +-- Class MessageLogEntry as table serverpod_message_log +-- +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"); + +-- +-- Class MethodInfo as table serverpod_method +-- +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"); + +-- +-- Class DatabaseMigrationVersion as table serverpod_migrations +-- +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"); + +-- +-- Class QueryLogEntry as table serverpod_query_log +-- +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"); + +-- +-- Class ReadWriteTestEntry as table serverpod_readwrite_test +-- +CREATE TABLE "serverpod_readwrite_test" ( + "id" bigserial PRIMARY KEY, + "number" bigint NOT NULL +); + +-- +-- Class RuntimeSettings as table serverpod_runtime_settings +-- +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 +); + +-- +-- Class SessionLogEntry as table serverpod_session_log +-- +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"); + +-- +-- Class AnonymousAccount as table serverpod_auth_idp_anonymous_account +-- +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 +); + +-- +-- Class AppleAccount as table serverpod_auth_idp_apple_account +-- +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"); + +-- +-- Class EmailAccount as table serverpod_auth_idp_email_account +-- +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"); + +-- +-- Class EmailAccountPasswordResetRequest as table serverpod_auth_idp_email_account_password_reset_request +-- +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 +); + +-- +-- Class EmailAccountRequest as table serverpod_auth_idp_email_account_request +-- +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"); + +-- +-- Class FacebookAccount as table serverpod_auth_idp_facebook_account +-- +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"); + +-- +-- Class FirebaseAccount as table serverpod_auth_idp_firebase_account +-- +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"); + +-- +-- Class GitHubAccount as table serverpod_auth_idp_github_account +-- +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"); + +-- +-- Class GoogleAccount as table serverpod_auth_idp_google_account +-- +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"); + +-- +-- Class MicrosoftAccount as table serverpod_auth_idp_microsoft_account +-- +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"); + +-- +-- Class PasskeyAccount as table serverpod_auth_idp_passkey_account +-- +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"); + +-- +-- Class PasskeyChallenge as table serverpod_auth_idp_passkey_challenge +-- +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 +); + +-- +-- Class RateLimitedRequestAttempt as table serverpod_auth_idp_rate_limited_request_attempt +-- +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"); + +-- +-- Class SecretChallenge as table serverpod_auth_idp_secret_challenge +-- +CREATE TABLE "serverpod_auth_idp_secret_challenge" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "challengeCodeHash" text NOT NULL +); + +-- +-- Class RefreshToken as table serverpod_auth_core_jwt_refresh_token +-- +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"); + +-- +-- Class UserProfile as table serverpod_auth_core_profile +-- +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"); + +-- +-- Class UserProfileImage as table serverpod_auth_core_profile_image +-- +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 +); + +-- +-- Class ServerSideSession as table serverpod_auth_core_session +-- +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 +); + +-- +-- Class AuthUser as table serverpod_auth_core_user +-- +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 +); + +-- +-- Foreign relations for "access_request" table +-- +ALTER TABLE ONLY "access_request" + ADD CONSTRAINT "access_request_fk_0" + FOREIGN KEY("itemId") + REFERENCES "drive_item"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "access_request" + ADD CONSTRAINT "access_request_fk_1" + FOREIGN KEY("requesterId") + REFERENCES "user_profile"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "activity_event" table +-- +ALTER TABLE ONLY "activity_event" + ADD CONSTRAINT "activity_event_fk_0" + FOREIGN KEY("itemId") + REFERENCES "drive_item"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "ai_usage" table +-- +ALTER TABLE ONLY "ai_usage" + ADD CONSTRAINT "ai_usage_fk_0" + FOREIGN KEY("userId") + REFERENCES "user_profile"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "ai_user_key" table +-- +ALTER TABLE ONLY "ai_user_key" + ADD CONSTRAINT "ai_user_key_fk_0" + FOREIGN KEY("userId") + REFERENCES "user_profile"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "ai_user_setting" table +-- +ALTER TABLE ONLY "ai_user_setting" + ADD CONSTRAINT "ai_user_setting_fk_0" + FOREIGN KEY("userId") + REFERENCES "user_profile"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "assistant_message" table +-- +ALTER TABLE ONLY "assistant_message" + ADD CONSTRAINT "assistant_message_fk_0" + FOREIGN KEY("threadId") + REFERENCES "assistant_thread"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "assistant_thread" table +-- +ALTER TABLE ONLY "assistant_thread" + ADD CONSTRAINT "assistant_thread_fk_0" + FOREIGN KEY("userId") + REFERENCES "user_profile"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "assistant_thread" + ADD CONSTRAINT "assistant_thread_fk_1" + FOREIGN KEY("itemId") + REFERENCES "drive_item"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "banding" table +-- +ALTER TABLE ONLY "banding" + ADD CONSTRAINT "banding_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "banding" + ADD CONSTRAINT "banding_fk_1" + FOREIGN KEY("sheetId") + REFERENCES "sheet"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; + +-- +-- Foreign relations for "basic_filter" table +-- +ALTER TABLE ONLY "basic_filter" + ADD CONSTRAINT "basic_filter_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "basic_filter" + ADD CONSTRAINT "basic_filter_fk_1" + FOREIGN KEY("sheetId") + REFERENCES "sheet"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; + +-- +-- Foreign relations for "board_comment" table +-- +ALTER TABLE ONLY "board_comment" + ADD CONSTRAINT "board_comment_fk_0" + FOREIGN KEY("postId") + REFERENCES "board_post"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "board_comment" + ADD CONSTRAINT "board_comment_fk_1" + FOREIGN KEY("taskId") + REFERENCES "board_task"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "board_comment" + ADD CONSTRAINT "board_comment_fk_2" + FOREIGN KEY("authorId") + REFERENCES "user_profile"("id") + ON DELETE SET NULL + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "board_flag" table +-- +ALTER TABLE ONLY "board_flag" + ADD CONSTRAINT "board_flag_fk_0" + FOREIGN KEY("postId") + REFERENCES "board_post"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "board_flag" + ADD CONSTRAINT "board_flag_fk_1" + FOREIGN KEY("commentId") + REFERENCES "board_comment"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "board_flag" + ADD CONSTRAINT "board_flag_fk_2" + FOREIGN KEY("userId") + REFERENCES "user_profile"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "board_post" table +-- +ALTER TABLE ONLY "board_post" + ADD CONSTRAINT "board_post_fk_0" + FOREIGN KEY("authorId") + REFERENCES "user_profile"("id") + ON DELETE SET NULL + ON UPDATE NO ACTION; +ALTER TABLE ONLY "board_post" + ADD CONSTRAINT "board_post_fk_1" + FOREIGN KEY("screenshotFileId") + REFERENCES "stored_file"("id") + ON DELETE SET NULL + ON UPDATE NO ACTION; +ALTER TABLE ONLY "board_post" + ADD CONSTRAINT "board_post_fk_2" + FOREIGN KEY("taskId") + REFERENCES "board_task"("id") + ON DELETE SET NULL + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "board_pull_request" table +-- +ALTER TABLE ONLY "board_pull_request" + ADD CONSTRAINT "board_pull_request_fk_0" + FOREIGN KEY("taskId") + REFERENCES "board_task"("id") + ON DELETE SET NULL + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "board_task" table +-- +ALTER TABLE ONLY "board_task" + ADD CONSTRAINT "board_task_fk_0" + FOREIGN KEY("claimedById") + REFERENCES "user_profile"("id") + ON DELETE SET NULL + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "board_user_profile" table +-- +ALTER TABLE ONLY "board_user_profile" + ADD CONSTRAINT "board_user_profile_fk_0" + FOREIGN KEY("userId") + REFERENCES "user_profile"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "board_vote" table +-- +ALTER TABLE ONLY "board_vote" + ADD CONSTRAINT "board_vote_fk_0" + FOREIGN KEY("postId") + REFERENCES "board_post"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "board_vote" + ADD CONSTRAINT "board_vote_fk_1" + FOREIGN KEY("userId") + REFERENCES "user_profile"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "cell" table +-- +ALTER TABLE ONLY "cell" + ADD CONSTRAINT "cell_fk_0" + FOREIGN KEY("sheetId") + REFERENCES "sheet"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; + +-- +-- Foreign relations for "chart_link" table +-- +ALTER TABLE ONLY "chart_link" + ADD CONSTRAINT "chart_link_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "chart_link" + ADD CONSTRAINT "chart_link_fk_1" + FOREIGN KEY("elementId") + REFERENCES "slide_element"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; + +-- +-- Foreign relations for "code_state" table +-- +ALTER TABLE ONLY "code_state" + ADD CONSTRAINT "code_state_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "code_state" + ADD CONSTRAINT "code_state_fk_1" + FOREIGN KEY("elementId") + REFERENCES "slide_element"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; + +-- +-- Foreign relations for "comment" table +-- +ALTER TABLE ONLY "comment" + ADD CONSTRAINT "comment_fk_0" + FOREIGN KEY("threadId") + REFERENCES "comment_thread"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "comment" + ADD CONSTRAINT "comment_fk_1" + FOREIGN KEY("publicationId") + REFERENCES "publication"("id") + ON DELETE SET NULL + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "comment_thread" table +-- +ALTER TABLE ONLY "comment_thread" + ADD CONSTRAINT "comment_thread_fk_0" + FOREIGN KEY("itemId") + REFERENCES "drive_item"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "conditional_format_rule" table +-- +ALTER TABLE ONLY "conditional_format_rule" + ADD CONSTRAINT "conditional_format_rule_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "conditional_format_rule" + ADD CONSTRAINT "conditional_format_rule_fk_1" + FOREIGN KEY("sheetId") + REFERENCES "sheet"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; + +-- +-- Foreign relations for "data_validation_rule" table +-- +ALTER TABLE ONLY "data_validation_rule" + ADD CONSTRAINT "data_validation_rule_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "data_validation_rule" + ADD CONSTRAINT "data_validation_rule_fk_1" + FOREIGN KEY("sheetId") + REFERENCES "sheet"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; + +-- +-- Foreign relations for "deck" table +-- +ALTER TABLE ONLY "deck" + ADD CONSTRAINT "deck_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "deck_theme" table +-- +ALTER TABLE ONLY "deck_theme" + ADD CONSTRAINT "deck_theme_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "deck_theme" + ADD CONSTRAINT "deck_theme_fk_1" + FOREIGN KEY("deckId") + REFERENCES "deck"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; + +-- +-- Foreign relations for "dimension_group" table +-- +ALTER TABLE ONLY "dimension_group" + ADD CONSTRAINT "dimension_group_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "dimension_group" + ADD CONSTRAINT "dimension_group_fk_1" + FOREIGN KEY("sheetId") + REFERENCES "sheet"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; + +-- +-- Foreign relations for "document" table +-- +ALTER TABLE ONLY "document" + ADD CONSTRAINT "document_fk_0" + FOREIGN KEY("itemId") + REFERENCES "drive_item"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "document_import_report" table +-- +ALTER TABLE ONLY "document_import_report" + ADD CONSTRAINT "document_import_report_fk_0" + FOREIGN KEY("documentId") + REFERENCES "document"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "document_meta_change" table +-- +ALTER TABLE ONLY "document_meta_change" + ADD CONSTRAINT "document_meta_change_fk_0" + FOREIGN KEY("documentId") + REFERENCES "document"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "document_op" table +-- +ALTER TABLE ONLY "document_op" + ADD CONSTRAINT "document_op_fk_0" + FOREIGN KEY("documentId") + REFERENCES "document"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "document_snapshot" table +-- +ALTER TABLE ONLY "document_snapshot" + ADD CONSTRAINT "document_snapshot_fk_0" + FOREIGN KEY("documentId") + REFERENCES "document"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "drive_item" table +-- +ALTER TABLE ONLY "drive_item" + ADD CONSTRAINT "drive_item_fk_0" + FOREIGN KEY("ownerId") + REFERENCES "user_profile"("id") + ON DELETE RESTRICT + ON UPDATE NO ACTION; +ALTER TABLE ONLY "drive_item" + ADD CONSTRAINT "drive_item_fk_1" + FOREIGN KEY("parentId") + REFERENCES "drive_item"("id") + ON DELETE SET NULL + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "drive_item_permission" table +-- +ALTER TABLE ONLY "drive_item_permission" + ADD CONSTRAINT "drive_item_permission_fk_0" + FOREIGN KEY("itemId") + REFERENCES "drive_item"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "drive_item_permission" + ADD CONSTRAINT "drive_item_permission_fk_1" + FOREIGN KEY("userId") + REFERENCES "user_profile"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "drive_item_permission" + ADD CONSTRAINT "drive_item_permission_fk_2" + FOREIGN KEY("viaPublicationId") + REFERENCES "publication"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "drive_item_user_state" table +-- +ALTER TABLE ONLY "drive_item_user_state" + ADD CONSTRAINT "drive_item_user_state_fk_0" + FOREIGN KEY("itemId") + REFERENCES "drive_item"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "drive_item_user_state" + ADD CONSTRAINT "drive_item_user_state_fk_1" + FOREIGN KEY("userId") + REFERENCES "user_profile"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "embedded_object" table +-- +ALTER TABLE ONLY "embedded_object" + ADD CONSTRAINT "embedded_object_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "embedded_object" + ADD CONSTRAINT "embedded_object_fk_1" + FOREIGN KEY("sheetId") + REFERENCES "sheet"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; + +-- +-- Foreign relations for "filter_view" table +-- +ALTER TABLE ONLY "filter_view" + ADD CONSTRAINT "filter_view_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "filter_view" + ADD CONSTRAINT "filter_view_fk_1" + FOREIGN KEY("sheetId") + REFERENCES "sheet"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; + +-- +-- Foreign relations for "headless_change" table +-- +ALTER TABLE ONLY "headless_change" + ADD CONSTRAINT "headless_change_fk_0" + FOREIGN KEY("itemId") + REFERENCES "drive_item"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "item_version" table +-- +ALTER TABLE ONLY "item_version" + ADD CONSTRAINT "item_version_fk_0" + FOREIGN KEY("itemId") + REFERENCES "drive_item"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "item_version_state" table +-- +ALTER TABLE ONLY "item_version_state" + ADD CONSTRAINT "item_version_state_fk_0" + FOREIGN KEY("itemId") + REFERENCES "drive_item"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "item_view_day" table +-- +ALTER TABLE ONLY "item_view_day" + ADD CONSTRAINT "item_view_day_fk_0" + FOREIGN KEY("itemId") + REFERENCES "drive_item"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "item_view_day" + ADD CONSTRAINT "item_view_day_fk_1" + FOREIGN KEY("userId") + REFERENCES "user_profile"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "macro" table +-- +ALTER TABLE ONLY "macro" + ADD CONSTRAINT "macro_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "macro" + ADD CONSTRAINT "macro_fk_1" + FOREIGN KEY("projectId") + REFERENCES "script_project"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; + +-- +-- Foreign relations for "merged_range" table +-- +ALTER TABLE ONLY "merged_range" + ADD CONSTRAINT "merged_range_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "merged_range" + ADD CONSTRAINT "merged_range_fk_1" + FOREIGN KEY("sheetId") + REFERENCES "sheet"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; + +-- +-- Foreign relations for "named_range" table +-- +ALTER TABLE ONLY "named_range" + ADD CONSTRAINT "named_range_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "named_range" + ADD CONSTRAINT "named_range_fk_1" + FOREIGN KEY("spreadsheetId") + REFERENCES "spreadsheet"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; + +-- +-- Foreign relations for "notification" table +-- +ALTER TABLE ONLY "notification" + ADD CONSTRAINT "notification_fk_0" + FOREIGN KEY("userId") + REFERENCES "user_profile"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "ownership_transfer" table +-- +ALTER TABLE ONLY "ownership_transfer" + ADD CONSTRAINT "ownership_transfer_fk_0" + FOREIGN KEY("itemId") + REFERENCES "drive_item"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "ownership_transfer" + ADD CONSTRAINT "ownership_transfer_fk_1" + FOREIGN KEY("toUserId") + REFERENCES "user_profile"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "personal_access_token" table +-- +ALTER TABLE ONLY "personal_access_token" + ADD CONSTRAINT "personal_access_token_fk_0" + FOREIGN KEY("userId") + REFERENCES "user_profile"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "pivot_table" table +-- +ALTER TABLE ONLY "pivot_table" + ADD CONSTRAINT "pivot_table_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "pivot_table" + ADD CONSTRAINT "pivot_table_fk_1" + FOREIGN KEY("sheetId") + REFERENCES "sheet"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; + +-- +-- Foreign relations for "protected_range" table +-- +ALTER TABLE ONLY "protected_range" + ADD CONSTRAINT "protected_range_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "protected_range" + ADD CONSTRAINT "protected_range_fk_1" + FOREIGN KEY("sheetId") + REFERENCES "sheet"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; + +-- +-- Foreign relations for "publication" table +-- +ALTER TABLE ONLY "publication" + ADD CONSTRAINT "publication_fk_0" + FOREIGN KEY("ownerId") + REFERENCES "user_profile"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "publication" + ADD CONSTRAINT "publication_fk_1" + FOREIGN KEY("templateItemId") + REFERENCES "drive_item"("id") + ON DELETE SET NULL + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "publication_block" table +-- +ALTER TABLE ONLY "publication_block" + ADD CONSTRAINT "publication_block_fk_0" + FOREIGN KEY("publicationId") + REFERENCES "publication"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "publication_block" + ADD CONSTRAINT "publication_block_fk_1" + FOREIGN KEY("userId") + REFERENCES "user_profile"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "publication_consent" table +-- +ALTER TABLE ONLY "publication_consent" + ADD CONSTRAINT "publication_consent_fk_0" + FOREIGN KEY("publicationId") + REFERENCES "publication"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "publication_consent" + ADD CONSTRAINT "publication_consent_fk_1" + FOREIGN KEY("userId") + REFERENCES "user_profile"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "publication_delivery" table +-- +ALTER TABLE ONLY "publication_delivery" + ADD CONSTRAINT "publication_delivery_fk_0" + FOREIGN KEY("publicationId") + REFERENCES "publication"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "publication_delivery" + ADD CONSTRAINT "publication_delivery_fk_1" + FOREIGN KEY("submissionId") + REFERENCES "submission"("id") + ON DELETE SET NULL + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "publication_moderator" table +-- +ALTER TABLE ONLY "publication_moderator" + ADD CONSTRAINT "publication_moderator_fk_0" + FOREIGN KEY("publicationId") + REFERENCES "publication"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "publication_moderator" + ADD CONSTRAINT "publication_moderator_fk_1" + FOREIGN KEY("userId") + REFERENCES "user_profile"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "rev_file" table +-- +ALTER TABLE ONLY "rev_file" + ADD CONSTRAINT "rev_file_fk_0" + FOREIGN KEY("itemId") + REFERENCES "drive_item"("id") + ON DELETE RESTRICT + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "rev_hook_state" table +-- +ALTER TABLE ONLY "rev_hook_state" + ADD CONSTRAINT "rev_hook_state_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "rev_op" table +-- +ALTER TABLE ONLY "rev_op" + ADD CONSTRAINT "rev_op_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "script_build" table +-- +ALTER TABLE ONLY "script_build" + ADD CONSTRAINT "script_build_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "script_build" + ADD CONSTRAINT "script_build_fk_1" + FOREIGN KEY("projectId") + REFERENCES "script_project"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; + +-- +-- Foreign relations for "script_file" table +-- +ALTER TABLE ONLY "script_file" + ADD CONSTRAINT "script_file_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "script_file" + ADD CONSTRAINT "script_file_fk_1" + FOREIGN KEY("projectId") + REFERENCES "script_project"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; + +-- +-- Foreign relations for "script_project" table +-- +ALTER TABLE ONLY "script_project" + ADD CONSTRAINT "script_project_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "script_project" + ADD CONSTRAINT "script_project_fk_1" + FOREIGN KEY("spreadsheetId") + REFERENCES "spreadsheet"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; + +-- +-- Foreign relations for "script_property" table +-- +ALTER TABLE ONLY "script_property" + ADD CONSTRAINT "script_property_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "script_property" + ADD CONSTRAINT "script_property_fk_1" + FOREIGN KEY("projectId") + REFERENCES "script_project"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; + +-- +-- Foreign relations for "script_trigger" table +-- +ALTER TABLE ONLY "script_trigger" + ADD CONSTRAINT "script_trigger_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "script_trigger" + ADD CONSTRAINT "script_trigger_fk_1" + FOREIGN KEY("projectId") + REFERENCES "script_project"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; + +-- +-- Foreign relations for "script_user_property" table +-- +ALTER TABLE ONLY "script_user_property" + ADD CONSTRAINT "script_user_property_fk_0" + FOREIGN KEY("userId") + REFERENCES "user_profile"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "share_link" table +-- +ALTER TABLE ONLY "share_link" + ADD CONSTRAINT "share_link_fk_0" + FOREIGN KEY("itemId") + REFERENCES "drive_item"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "sheet" table +-- +ALTER TABLE ONLY "sheet" + ADD CONSTRAINT "sheet_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "sheet" + ADD CONSTRAINT "sheet_fk_1" + FOREIGN KEY("spreadsheetId") + REFERENCES "spreadsheet"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; + +-- +-- Foreign relations for "sheet_column" table +-- +ALTER TABLE ONLY "sheet_column" + ADD CONSTRAINT "sheet_column_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "sheet_column" + ADD CONSTRAINT "sheet_column_fk_1" + FOREIGN KEY("sheetId") + REFERENCES "sheet"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; + +-- +-- Foreign relations for "sheet_row" table +-- +ALTER TABLE ONLY "sheet_row" + ADD CONSTRAINT "sheet_row_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "sheet_row" + ADD CONSTRAINT "sheet_row_fk_1" + FOREIGN KEY("sheetId") + REFERENCES "sheet"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; + +-- +-- Foreign relations for "sheets_snapshot_index" table +-- +ALTER TABLE ONLY "sheets_snapshot_index" + ADD CONSTRAINT "sheets_snapshot_index_fk_0" + FOREIGN KEY("itemVersionId") + REFERENCES "item_version"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "slide" table +-- +ALTER TABLE ONLY "slide" + ADD CONSTRAINT "slide_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "slide" + ADD CONSTRAINT "slide_fk_1" + FOREIGN KEY("deckId") + REFERENCES "deck"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; + +-- +-- Foreign relations for "slide_build" table +-- +ALTER TABLE ONLY "slide_build" + ADD CONSTRAINT "slide_build_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "slide_build" + ADD CONSTRAINT "slide_build_fk_1" + FOREIGN KEY("slideId") + REFERENCES "slide"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; +ALTER TABLE ONLY "slide_build" + ADD CONSTRAINT "slide_build_fk_2" + FOREIGN KEY("elementId") + REFERENCES "slide_element"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; + +-- +-- Foreign relations for "slide_element" table +-- +ALTER TABLE ONLY "slide_element" + ADD CONSTRAINT "slide_element_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "slide_element" + ADD CONSTRAINT "slide_element_fk_1" + FOREIGN KEY("slideId") + REFERENCES "slide"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; +ALTER TABLE ONLY "slide_element" + ADD CONSTRAINT "slide_element_fk_2" + FOREIGN KEY("layoutId") + REFERENCES "slide_layout"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; +ALTER TABLE ONLY "slide_element" + ADD CONSTRAINT "slide_element_fk_3" + FOREIGN KEY("masterId") + REFERENCES "slide_master"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; +ALTER TABLE ONLY "slide_element" + ADD CONSTRAINT "slide_element_fk_4" + FOREIGN KEY("parentId") + REFERENCES "slide_element"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; + +-- +-- Foreign relations for "slide_group" table +-- +ALTER TABLE ONLY "slide_group" + ADD CONSTRAINT "slide_group_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "slide_group" + ADD CONSTRAINT "slide_group_fk_1" + FOREIGN KEY("deckId") + REFERENCES "deck"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; + +-- +-- Foreign relations for "slide_layout" table +-- +ALTER TABLE ONLY "slide_layout" + ADD CONSTRAINT "slide_layout_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "slide_layout" + ADD CONSTRAINT "slide_layout_fk_1" + FOREIGN KEY("masterId") + REFERENCES "slide_master"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; + +-- +-- Foreign relations for "slide_master" table +-- +ALTER TABLE ONLY "slide_master" + ADD CONSTRAINT "slide_master_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "slide_master" + ADD CONSTRAINT "slide_master_fk_1" + FOREIGN KEY("themeId") + REFERENCES "deck_theme"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; + +-- +-- Foreign relations for "slide_table_axis" table +-- +ALTER TABLE ONLY "slide_table_axis" + ADD CONSTRAINT "slide_table_axis_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "slide_table_axis" + ADD CONSTRAINT "slide_table_axis_fk_1" + FOREIGN KEY("elementId") + REFERENCES "slide_element"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; + +-- +-- Foreign relations for "slide_table_cell" table +-- +ALTER TABLE ONLY "slide_table_cell" + ADD CONSTRAINT "slide_table_cell_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "slide_table_cell" + ADD CONSTRAINT "slide_table_cell_fk_1" + FOREIGN KEY("elementId") + REFERENCES "slide_element"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; +ALTER TABLE ONLY "slide_table_cell" + ADD CONSTRAINT "slide_table_cell_fk_2" + FOREIGN KEY("rowId") + REFERENCES "slide_table_axis"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; +ALTER TABLE ONLY "slide_table_cell" + ADD CONSTRAINT "slide_table_cell_fk_3" + FOREIGN KEY("columnId") + REFERENCES "slide_table_axis"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; + +-- +-- Foreign relations for "slides_snapshot_index" table +-- +ALTER TABLE ONLY "slides_snapshot_index" + ADD CONSTRAINT "slides_snapshot_index_fk_0" + FOREIGN KEY("itemVersionId") + REFERENCES "item_version"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "spreadsheet" table +-- +ALTER TABLE ONLY "spreadsheet" + ADD CONSTRAINT "spreadsheet_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "storage_reservation" table +-- +ALTER TABLE ONLY "storage_reservation" + ADD CONSTRAINT "storage_reservation_fk_0" + FOREIGN KEY("userId") + REFERENCES "user_profile"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "storage_reservation" + ADD CONSTRAINT "storage_reservation_fk_1" + FOREIGN KEY("itemId") + REFERENCES "drive_item"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "stored_file" table +-- +ALTER TABLE ONLY "stored_file" + ADD CONSTRAINT "stored_file_fk_0" + FOREIGN KEY("ownerId") + REFERENCES "user_profile"("id") + ON DELETE SET NULL + ON UPDATE NO ACTION; +ALTER TABLE ONLY "stored_file" + ADD CONSTRAINT "stored_file_fk_1" + FOREIGN KEY("itemId") + REFERENCES "drive_item"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "submission" table +-- +ALTER TABLE ONLY "submission" + ADD CONSTRAINT "submission_fk_0" + FOREIGN KEY("publicationId") + REFERENCES "publication"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "submission" + ADD CONSTRAINT "submission_fk_1" + FOREIGN KEY("itemId") + REFERENCES "drive_item"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "submission_asset" table +-- +ALTER TABLE ONLY "submission_asset" + ADD CONSTRAINT "submission_asset_fk_0" + FOREIGN KEY("submissionId") + REFERENCES "submission"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "submission_revision" table +-- +ALTER TABLE ONLY "submission_revision" + ADD CONSTRAINT "submission_revision_fk_0" + FOREIGN KEY("submissionId") + REFERENCES "submission"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "user_activity_settings" table +-- +ALTER TABLE ONLY "user_activity_settings" + ADD CONSTRAINT "user_activity_settings_fk_0" + FOREIGN KEY("userId") + REFERENCES "user_profile"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "user_preferences" table +-- +ALTER TABLE ONLY "user_preferences" + ADD CONSTRAINT "user_preferences_fk_0" + FOREIGN KEY("userId") + REFERENCES "user_profile"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "user_profile" table +-- +ALTER TABLE ONLY "user_profile" + ADD CONSTRAINT "user_profile_fk_0" + FOREIGN KEY("authUserId") + REFERENCES "serverpod_auth_core_user"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "user_storage" table +-- +ALTER TABLE ONLY "user_storage" + ADD CONSTRAINT "user_storage_fk_0" + FOREIGN KEY("userId") + REFERENCES "user_profile"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "write_diff_cache" table +-- +ALTER TABLE ONLY "write_diff_cache" + ADD CONSTRAINT "write_diff_cache_fk_0" + FOREIGN KEY("documentId") + REFERENCES "document"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "write_theme" table +-- +ALTER TABLE ONLY "write_theme" + ADD CONSTRAINT "write_theme_fk_0" + FOREIGN KEY("ownerId") + REFERENCES "user_profile"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "write_theme_revision" table +-- +ALTER TABLE ONLY "write_theme_revision" + ADD CONSTRAINT "write_theme_revision_fk_0" + FOREIGN KEY("themeId") + REFERENCES "write_theme"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "serverpod_future_call_claim" table +-- +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; + +-- +-- Foreign relations for "serverpod_log" table +-- +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; + +-- +-- Foreign relations for "serverpod_message_log" table +-- +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; + +-- +-- Foreign relations for "serverpod_query_log" table +-- +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; + +-- +-- Foreign relations for "serverpod_auth_idp_anonymous_account" table +-- +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; + +-- +-- Foreign relations for "serverpod_auth_idp_apple_account" table +-- +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; + +-- +-- Foreign relations for "serverpod_auth_idp_email_account" table +-- +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; + +-- +-- Foreign relations for "serverpod_auth_idp_email_account_password_reset_request" table +-- +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; + +-- +-- Foreign relations for "serverpod_auth_idp_email_account_request" table +-- +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; + +-- +-- Foreign relations for "serverpod_auth_idp_facebook_account" table +-- +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; + +-- +-- Foreign relations for "serverpod_auth_idp_firebase_account" table +-- +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; + +-- +-- Foreign relations for "serverpod_auth_idp_github_account" table +-- +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; + +-- +-- Foreign relations for "serverpod_auth_idp_google_account" table +-- +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; + +-- +-- Foreign relations for "serverpod_auth_idp_microsoft_account" table +-- +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; + +-- +-- Foreign relations for "serverpod_auth_idp_passkey_account" table +-- +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; + +-- +-- Foreign relations for "serverpod_auth_core_jwt_refresh_token" table +-- +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; + +-- +-- Foreign relations for "serverpod_auth_core_profile" table +-- +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; + +-- +-- Foreign relations for "serverpod_auth_core_profile_image" table +-- +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; + +-- +-- Foreign relations for "serverpod_auth_core_session" table +-- +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 wonky +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('wonky', '20261020133251149-usage-analytics', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20261020133251149-usage-analytics', "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 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; diff --git a/wonky_server/migrations/20261020133251149-usage-analytics/definition_project.json b/wonky_server/migrations/20261020133251149-usage-analytics/definition_project.json new file mode 100644 index 00000000..31340acb --- /dev/null +++ b/wonky_server/migrations/20261020133251149-usage-analytics/definition_project.json @@ -0,0 +1,16733 @@ +{ + "__className__": "serverpod.DatabaseDefinition", + "schemaVersion": 2, + "moduleName": "wonky", + "tables": [ + { + "__className__": "serverpod.TableDefinition", + "name": "access_request", + "dartName": "AccessRequest", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "requesterId", + "fieldName": "requesterId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "requestedRole", + "fieldName": "requestedRole", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:AccessRole" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "message", + "fieldName": "message", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "handledAt", + "fieldName": "handledAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "handledById", + "fieldName": "handledById", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "outcome", + "fieldName": "outcome", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:AccessRequestOutcome?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "access_request_fk_0", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "access_request_fk_1", + "columns": [ + "requesterId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "access_request_item_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "handledAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "activity_event", + "dartName": "ActivityEvent", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "actorId", + "fieldName": "actorId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "actorKind", + "fieldName": "actorKind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:ActorKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "type", + "fieldName": "type", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:ActivityType" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "summary", + "fieldName": "summary", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "at", + "fieldName": "at", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "activity_event_fk_0", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "activity_item_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "at" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "ai_function_cache", + "dartName": "AiFunctionCache", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "key", + "fieldName": "key", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spreadsheetUuid", + "fieldName": "spreadsheetUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "model", + "fieldName": "model", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "value", + "fieldName": "value", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "error", + "fieldName": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "hits", + "fieldName": "hits", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "ai_function_cache_key_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "key" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "ai_function_cache_sheet_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "spreadsheetUuid" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "ai_preview_record", + "dartName": "AiPreviewRecord", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "previewId", + "fieldName": "previewId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileUuid", + "fieldName": "fileUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "previewJson", + "fieldName": "previewJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "changesJson", + "fieldName": "changesJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "expiresAt", + "fieldName": "expiresAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "ai_preview_id_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "previewId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "ai_preview_expires_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "expiresAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "ai_usage", + "dartName": "AiUsage", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "model", + "fieldName": "model", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "feature", + "fieldName": "feature", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "inputTokens", + "fieldName": "inputTokens", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "outputTokens", + "fieldName": "outputTokens", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "cacheReadTokens", + "fieldName": "cacheReadTokens", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "cacheWriteTokens", + "fieldName": "cacheWriteTokens", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "at", + "fieldName": "at", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "ai_usage_fk_0", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "ai_usage_user_at_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "at" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "ai_user_key", + "dartName": "AiUserKey", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "provider", + "fieldName": "provider", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:AiProvider" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "apiKey", + "fieldName": "apiKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "ai_user_key_fk_0", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "ai_user_key_user_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "ai_user_setting", + "dartName": "AiUserSetting", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "quality", + "fieldName": "quality", + "columnType": 0, + "isNullable": false, + "columnDefault": "'best'", + "dartType": "protocol:AiQuality" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "ai_user_setting_fk_0", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "ai_user_setting_user_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "assistant_message", + "dartName": "AssistantMessage", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "threadId", + "fieldName": "threadId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "role", + "fieldName": "role", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "contentJson", + "fieldName": "contentJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "displayText", + "fieldName": "displayText", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "toolCallsJson", + "fieldName": "toolCallsJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "visible", + "fieldName": "visible", + "columnType": 1, + "isNullable": false, + "columnDefault": "true", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "replay", + "fieldName": "replay", + "columnType": 1, + "isNullable": false, + "columnDefault": "true", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "runId", + "fieldName": "runId", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "stopReason", + "fieldName": "stopReason", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "assistant_message_fk_0", + "columns": [ + "threadId" + ], + "referenceTable": "assistant_thread", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "assistant_message_thread_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "threadId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "assistant_thread", + "dartName": "AssistantThread", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "title", + "fieldName": "title", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "contextRevision", + "fieldName": "contextRevision", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "contextMarkdown", + "fieldName": "contextMarkdown", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "assistant_thread_fk_0", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "assistant_thread_fk_1", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "assistant_thread_user_item_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "updatedAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "banding", + "dartName": "Banding", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetId", + "fieldName": "sheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rangeJson", + "fieldName": "rangeJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "styleJson", + "fieldName": "styleJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "banding_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "banding_fk_1", + "columns": [ + "sheetId" + ], + "referenceTable": "sheet", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "banding_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "basic_filter", + "dartName": "BasicFilter", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetId", + "fieldName": "sheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rangeJson", + "fieldName": "rangeJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "criteriaJson", + "fieldName": "criteriaJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sortJson", + "fieldName": "sortJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "basic_filter_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "basic_filter_fk_1", + "columns": [ + "sheetId" + ], + "referenceTable": "sheet", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "basic_filter_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "board_ai_usage", + "dartName": "BoardAiUsage", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "day", + "fieldName": "day", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "provider", + "fieldName": "provider", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "model", + "fieldName": "model", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "feature", + "fieldName": "feature", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "requests", + "fieldName": "requests", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "inputTokens", + "fieldName": "inputTokens", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "outputTokens", + "fieldName": "outputTokens", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_ai_usage_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "day" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "provider" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "model" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "feature" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "board_bundle_suggestion", + "dartName": "BoardBundleSuggestion", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "title", + "fieldName": "title", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rationale", + "fieldName": "rationale", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "area", + "fieldName": "area", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:BoardArea?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "postIds", + "fieldName": "postIds", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "state", + "fieldName": "state", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "board_comment", + "dartName": "BoardComment", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "uuid", + "fieldName": "uuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "postId", + "fieldName": "postId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "taskId", + "fieldName": "taskId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authorId", + "fieldName": "authorId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "body", + "fieldName": "body", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "systemEvent", + "fieldName": "systemEvent", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "moderation", + "fieldName": "moderation", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:BoardModeration" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "moderationReason", + "fieldName": "moderationReason", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "needsCheck", + "fieldName": "needsCheck", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "editedAt", + "fieldName": "editedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "deletedAt", + "fieldName": "deletedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "removedAt", + "fieldName": "removedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "board_comment_fk_0", + "columns": [ + "postId" + ], + "referenceTable": "board_post", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "board_comment_fk_1", + "columns": [ + "taskId" + ], + "referenceTable": "board_task", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "board_comment_fk_2", + "columns": [ + "authorId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_comment_uuid_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "uuid" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_comment_post_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "postId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_comment_task_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "taskId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "board_flag", + "dartName": "BoardFlag", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "postId", + "fieldName": "postId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "commentId", + "fieldName": "commentId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "reason", + "fieldName": "reason", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:BoardFlagReason" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "note", + "fieldName": "note", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "board_flag_fk_0", + "columns": [ + "postId" + ], + "referenceTable": "board_post", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "board_flag_fk_1", + "columns": [ + "commentId" + ], + "referenceTable": "board_comment", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "board_flag_fk_2", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_flag_post_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "postId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_flag_comment_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "commentId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "board_github_delivery", + "dartName": "BoardGithubDelivery", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "deliveryId", + "fieldName": "deliveryId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "event", + "fieldName": "event", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "receivedAt", + "fieldName": "receivedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "payload", + "fieldName": "payload", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "processedAt", + "fieldName": "processedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "attempts", + "fieldName": "attempts", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_github_delivery_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "deliveryId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "board_moderation_log", + "dartName": "BoardModerationLog", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "adminId", + "fieldName": "adminId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "action", + "fieldName": "action", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "targetKind", + "fieldName": "targetKind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:BoardTargetKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "targetId", + "fieldName": "targetId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "beforeJson", + "fieldName": "beforeJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "afterJson", + "fieldName": "afterJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "reason", + "fieldName": "reason", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_moderation_log_target_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "targetKind" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "targetId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "board_post", + "dartName": "BoardPost", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authorId", + "fieldName": "authorId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kind", + "fieldName": "kind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:BoardPostKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "reportedKind", + "fieldName": "reportedKind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:BoardPostKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "area", + "fieldName": "area", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:BoardArea?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "size", + "fieldName": "size", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:BoardSize?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "aiLabels", + "fieldName": "aiLabels", + "columnType": 1, + "isNullable": false, + "columnDefault": "true", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "title", + "fieldName": "title", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "body", + "fieldName": "body", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "contextJson", + "fieldName": "contextJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "appHint", + "fieldName": "appHint", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "screenshotFileId", + "fieldName": "screenshotFileId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "status", + "fieldName": "status", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:BoardPostStatus" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "moderation", + "fieldName": "moderation", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:BoardModeration" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "moderationReason", + "fieldName": "moderationReason", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "needsCheck", + "fieldName": "needsCheck", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "editedByModerator", + "fieldName": "editedByModerator", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "triageState", + "fieldName": "triageState", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:BoardTriageState" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "triageJson", + "fieldName": "triageJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "triageAttempts", + "fieldName": "triageAttempts", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "suggestedTitle", + "fieldName": "suggestedTitle", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "summary", + "fieldName": "summary", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "duplicateOfId", + "fieldName": "duplicateOfId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "possibleDuplicateOfId", + "fieldName": "possibleDuplicateOfId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "duplicateHintDismissed", + "fieldName": "duplicateHintDismissed", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "declineReason", + "fieldName": "declineReason", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "taskId", + "fieldName": "taskId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "score", + "fieldName": "score", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "voteCount", + "fieldName": "voteCount", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "commentCount", + "fieldName": "commentCount", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "flagCount", + "fieldName": "flagCount", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "editedAt", + "fieldName": "editedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "deletedAt", + "fieldName": "deletedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "removedAt", + "fieldName": "removedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "board_post_fk_0", + "columns": [ + "authorId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "board_post_fk_1", + "columns": [ + "screenshotFileId" + ], + "referenceTable": "stored_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "board_post_fk_2", + "columns": [ + "taskId" + ], + "referenceTable": "board_task", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_post_list_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "moderation" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "kind" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "status" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "score" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_post_author_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "authorId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_post_task_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "taskId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "board_pull_request", + "dartName": "BoardPullRequest", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "prNumber", + "fieldName": "prNumber", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "taskId", + "fieldName": "taskId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authorLogin", + "fieldName": "authorLogin", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "headSha", + "fieldName": "headSha", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "state", + "fieldName": "state", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "gateState", + "fieldName": "gateState", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "gateReason", + "fieldName": "gateReason", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "gateFirstFailedAt", + "fieldName": "gateFirstFailedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "gateCommentId", + "fieldName": "gateCommentId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "reviewCommentId", + "fieldName": "reviewCommentId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastReviewSha", + "fieldName": "lastReviewSha", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastReviewJson", + "fieldName": "lastReviewJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastReviewAt", + "fieldName": "lastReviewAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "reviewDay", + "fieldName": "reviewDay", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "reviewCount", + "fieldName": "reviewCount", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "mergeCommitSha", + "fieldName": "mergeCommitSha", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "reviewPendingSha", + "fieldName": "reviewPendingSha", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "reviewDueAt", + "fieldName": "reviewDueAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "board_pull_request_fk_0", + "columns": [ + "taskId" + ], + "referenceTable": "board_task", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_pull_request_number_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "prNumber" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "board_task", + "dartName": "BoardTask", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "title", + "fieldName": "title", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "area", + "fieldName": "area", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:BoardArea" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "size", + "fieldName": "size", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:BoardSize" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "status", + "fieldName": "status", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:BoardTaskStatus" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "promptBody", + "fieldName": "promptBody", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "promptGeneratedAt", + "fieldName": "promptGeneratedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "promptRequestedAt", + "fieldName": "promptRequestedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "promptNote", + "fieldName": "promptNote", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "promptExcludedCommentIds", + "fieldName": "promptExcludedCommentIds", + "columnType": 8, + "isNullable": true, + "dartType": "List?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "promptEditedById", + "fieldName": "promptEditedById", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "promptEditedAt", + "fieldName": "promptEditedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdById", + "fieldName": "createdById", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "publishedAt", + "fieldName": "publishedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "claimedById", + "fieldName": "claimedById", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "claimedAt", + "fieldName": "claimedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "claimExpiresAt", + "fieldName": "claimExpiresAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "claimWarnedAt", + "fieldName": "claimWarnedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "claimCode", + "fieldName": "claimCode", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "pullRequestUrl", + "fieldName": "pullRequestUrl", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "prNumber", + "fieldName": "prNumber", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "prAuthorLogin", + "fieldName": "prAuthorLogin", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "mergeCommitSha", + "fieldName": "mergeCommitSha", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "doneAt", + "fieldName": "doneAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "shippedDeploySha", + "fieldName": "shippedDeploySha", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "shippedAt", + "fieldName": "shippedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "board_task_fk_0", + "columns": [ + "claimedById" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_task_status_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "status" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_task_claim_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "claimedById" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "board_user_profile", + "dartName": "BoardUserProfile", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "githubLogin", + "fieldName": "githubLogin", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "blockedAt", + "fieldName": "blockedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "blockedUntil", + "fieldName": "blockedUntil", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "blockedReason", + "fieldName": "blockedReason", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "blockedById", + "fieldName": "blockedById", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "board_user_profile_fk_0", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_user_profile_user_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "board_vote", + "dartName": "BoardVote", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "postId", + "fieldName": "postId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "value", + "fieldName": "value", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "board_vote_fk_0", + "columns": [ + "postId" + ], + "referenceTable": "board_post", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "board_vote_fk_1", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_vote_unique_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "postId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_vote_recent_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "postId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "cell", + "dartName": "Cell", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetId", + "fieldName": "sheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rowId", + "fieldName": "rowId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "columnId", + "fieldName": "columnId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "content", + "fieldName": "content", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "note", + "fieldName": "note", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "numberFormat", + "fieldName": "numberFormat", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fontFamily", + "fieldName": "fontFamily", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fontSize", + "fieldName": "fontSize", + "columnType": 3, + "isNullable": true, + "dartType": "double?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "bold", + "fieldName": "bold", + "columnType": 1, + "isNullable": true, + "dartType": "bool?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "italic", + "fieldName": "italic", + "columnType": 1, + "isNullable": true, + "dartType": "bool?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "underline", + "fieldName": "underline", + "columnType": 1, + "isNullable": true, + "dartType": "bool?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "strikethrough", + "fieldName": "strikethrough", + "columnType": 1, + "isNullable": true, + "dartType": "bool?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "textColor", + "fieldName": "textColor", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fillColor", + "fieldName": "fillColor", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "hAlign", + "fieldName": "hAlign", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:HorizontalAlign?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "vAlign", + "fieldName": "vAlign", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:VerticalAlign?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "wrap", + "fieldName": "wrap", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:WrapStrategy?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rotation", + "fieldName": "rotation", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "borderTop", + "fieldName": "borderTop", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "borderRight", + "fieldName": "borderRight", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "borderBottom", + "fieldName": "borderBottom", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "borderLeft", + "fieldName": "borderLeft", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "linkUrl", + "fieldName": "linkUrl", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "cell_fk_0", + "columns": [ + "sheetId" + ], + "referenceTable": "sheet", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "cell_row_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "sheetId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "rowId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "cell_col_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "sheetId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "columnId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "cell_history", + "dartName": "CellHistory", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileUuid", + "fieldName": "fileUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetId", + "fieldName": "sheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rowId", + "fieldName": "rowId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "colId", + "fieldName": "colId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userUuid", + "fieldName": "userUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "actorKind", + "fieldName": "actorKind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:ActorKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "label", + "fieldName": "label", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "at", + "fieldName": "at", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "before", + "fieldName": "before", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "after", + "fieldName": "after", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "cell_history_cell_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileUuid" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "sheetId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "rowId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "colId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "at" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "cell_history_change_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileUuid" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "revision" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "rowId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "colId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "chart_link", + "dartName": "ChartLink", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "elementId", + "fieldName": "elementId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spreadsheetItemUuid", + "fieldName": "spreadsheetItemUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "chartObjectId", + "fieldName": "chartObjectId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetId", + "fieldName": "sheetId", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sourceSpecJson", + "fieldName": "sourceSpecJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "dataSnapshotJson", + "fieldName": "dataSnapshotJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sourceVersion", + "fieldName": "sourceVersion", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedBy", + "fieldName": "updatedBy", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "autoUpdate", + "fieldName": "autoUpdate", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "chart_link_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "chart_link_fk_1", + "columns": [ + "elementId" + ], + "referenceTable": "slide_element", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "chart_link_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "chart_link_element_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "elementId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "code_state", + "dartName": "CodeState", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "elementId", + "fieldName": "elementId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sortKey", + "fieldName": "sortKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "label", + "fieldName": "label", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "code", + "fieldName": "code", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "language", + "fieldName": "language", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "title", + "fieldName": "title", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "highlight", + "fieldName": "highlight", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "annotationsJson", + "fieldName": "annotationsJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "transitionJson", + "fieldName": "transitionJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "code_state_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "code_state_fk_1", + "columns": [ + "elementId" + ], + "referenceTable": "slide_element", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "code_state_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "code_state_element_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "elementId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "sortKey" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "comment", + "dartName": "Comment", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "threadId", + "fieldName": "threadId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "uuid", + "fieldName": "uuid", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authorId", + "fieldName": "authorId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authorKind", + "fieldName": "authorKind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:ActorKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "body", + "fieldName": "body", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "mentions", + "fieldName": "mentions", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "reactions", + "fieldName": "reactions", + "columnType": 0, + "isNullable": false, + "columnDefault": "'{}'", + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "editedAt", + "fieldName": "editedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "deletedAt", + "fieldName": "deletedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "systemEvent", + "fieldName": "systemEvent", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:CommentSystemEvent?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "publicationId", + "fieldName": "publicationId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "comment_fk_0", + "columns": [ + "threadId" + ], + "referenceTable": "comment_thread", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "comment_fk_1", + "columns": [ + "publicationId" + ], + "referenceTable": "publication", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "comment_thread_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "threadId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "comment_uuid_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "uuid" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "comment_thread", + "dartName": "CommentThread", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "uuid", + "fieldName": "uuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "anchorKind", + "fieldName": "anchorKind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:CommentAnchorKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "anchorJson", + "fieldName": "anchorJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "quotedText", + "fieldName": "quotedText", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "status", + "fieldName": "status", + "columnType": 0, + "isNullable": false, + "columnDefault": "'open'", + "dartType": "protocol:CommentStatus" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdById", + "fieldName": "createdById", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "resolvedById", + "fieldName": "resolvedById", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "resolvedAt", + "fieldName": "resolvedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "assigneeId", + "fieldName": "assigneeId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "statusBeforeOrphan", + "fieldName": "statusBeforeOrphan", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:CommentStatus?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "orphanReasonJson", + "fieldName": "orphanReasonJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "suggestionId", + "fieldName": "suggestionId", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "comment_thread_fk_0", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "comment_thread_item_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "status" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "comment_thread_uuid_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "uuid" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "conditional_format_rule", + "dartName": "ConditionalFormatRule", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetId", + "fieldName": "sheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sortKey", + "fieldName": "sortKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rangesJson", + "fieldName": "rangesJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "ruleJson", + "fieldName": "ruleJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "enabled", + "fieldName": "enabled", + "columnType": 1, + "isNullable": false, + "columnDefault": "true", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "conditional_format_rule_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "conditional_format_rule_fk_1", + "columns": [ + "sheetId" + ], + "referenceTable": "sheet", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "conditional_format_rule_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "data_validation_rule", + "dartName": "DataValidationRule", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetId", + "fieldName": "sheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rangesJson", + "fieldName": "rangesJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "criteriaJson", + "fieldName": "criteriaJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "strict", + "fieldName": "strict", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "showDropdown", + "fieldName": "showDropdown", + "columnType": 1, + "isNullable": false, + "columnDefault": "true", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "displayStyle", + "fieldName": "displayStyle", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "helpText", + "fieldName": "helpText", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "data_validation_rule_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "data_validation_rule_fk_1", + "columns": [ + "sheetId" + ], + "referenceTable": "sheet", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "data_validation_rule_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "deck", + "dartName": "Deck", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "title", + "fieldName": "title", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "width", + "fieldName": "width", + "columnType": 3, + "isNullable": false, + "columnDefault": "1920.0", + "dartType": "double" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "height", + "fieldName": "height", + "columnType": 3, + "isNullable": false, + "columnDefault": "1080.0", + "dartType": "double" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sizePreset", + "fieldName": "sizePreset", + "columnType": 0, + "isNullable": false, + "columnDefault": "'widescreen16x9'", + "dartType": "protocol:SlideSizePreset" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "themeId", + "fieldName": "themeId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "appearance", + "fieldName": "appearance", + "columnType": 0, + "isNullable": false, + "columnDefault": "'light'", + "dartType": "protocol:DeckAppearance" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "language", + "fieldName": "language", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "showSlideNumbers", + "fieldName": "showSlideNumbers", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "hideNumberOnTitle", + "fieldName": "hideNumberOnTitle", + "columnType": 1, + "isNullable": false, + "columnDefault": "true", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "firstSlideNumber", + "fieldName": "firstSlideNumber", + "columnType": 6, + "isNullable": false, + "columnDefault": "1", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "footerText", + "fieldName": "footerText", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "defaultsJson", + "fieldName": "defaultsJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "guidesJson", + "fieldName": "guidesJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "presentJson", + "fieldName": "presentJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdBy", + "fieldName": "createdBy", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "deck_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "deck_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "deck_theme", + "dartName": "DeckTheme", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "deckId", + "fieldName": "deckId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sourceKey", + "fieldName": "sourceKey", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "colorsJson", + "fieldName": "colorsJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fontsJson", + "fieldName": "fontsJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "textStylesJson", + "fieldName": "textStylesJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "backgroundJson", + "fieldName": "backgroundJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "shapeStyleJson", + "fieldName": "shapeStyleJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "tableStyleJson", + "fieldName": "tableStyleJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "codeStyleJson", + "fieldName": "codeStyleJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "chartStyleJson", + "fieldName": "chartStyleJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sortKey", + "fieldName": "sortKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "deck_theme_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "deck_theme_fk_1", + "columns": [ + "deckId" + ], + "referenceTable": "deck", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "deck_theme_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "deck_theme_deck_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "deckId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "dimension_group", + "dartName": "DimensionGroup", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetId", + "fieldName": "sheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "dimension", + "fieldName": "dimension", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:Dimension" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "startId", + "fieldName": "startId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "endId", + "fieldName": "endId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "depth", + "fieldName": "depth", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "collapsed", + "fieldName": "collapsed", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "dimension_group_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "dimension_group_fk_1", + "columns": [ + "sheetId" + ], + "referenceTable": "sheet", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "dimension_group_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "document", + "dartName": "Document", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "uuid", + "fieldName": "uuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "headRevision", + "fieldName": "headRevision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "latestSnapshotRevision", + "fieldName": "latestSnapshotRevision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "themeId", + "fieldName": "themeId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "pageSetupJson", + "fieldName": "pageSetupJson", + "columnType": 0, + "isNullable": false, + "columnDefault": "'{}'", + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "language", + "fieldName": "language", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "frontMatter", + "fieldName": "frontMatter", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "charCount", + "fieldName": "charCount", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "wordCount", + "fieldName": "wordCount", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "document_fk_0", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "document_uuid_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "uuid" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "document_item_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "document_import_report", + "dartName": "DocumentImportReport", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "documentId", + "fieldName": "documentId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "warningsJson", + "fieldName": "warningsJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "seenAt", + "fieldName": "seenAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "document_import_report_fk_0", + "columns": [ + "documentId" + ], + "referenceTable": "document", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "document_import_report_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "documentId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "document_meta_change", + "dartName": "DocumentMetaChange", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "documentId", + "fieldName": "documentId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "field", + "fieldName": "field", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "clientOpId", + "fieldName": "clientOpId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "beforeJson", + "fieldName": "beforeJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "afterJson", + "fieldName": "afterJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authorId", + "fieldName": "authorId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "actorKind", + "fieldName": "actorKind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:ActorKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "document_meta_change_fk_0", + "columns": [ + "documentId" + ], + "referenceTable": "document", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "document_meta_change_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "documentId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "document_meta_change_client_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "documentId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "clientOpId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "document_op", + "dartName": "DocumentOp", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "documentId", + "fieldName": "documentId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "clientOpId", + "fieldName": "clientOpId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authorId", + "fieldName": "authorId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "actorKind", + "fieldName": "actorKind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:ActorKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sessionId", + "fieldName": "sessionId", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kind", + "fieldName": "kind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:DocumentOpKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "baseRevision", + "fieldName": "baseRevision", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "deltaJson", + "fieldName": "deltaJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "inverseJson", + "fieldName": "inverseJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "document_op_fk_0", + "columns": [ + "documentId" + ], + "referenceTable": "document", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "document_op_rev_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "documentId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "revision" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "document_op_client_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "documentId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "clientOpId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "document_op_created_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "brin", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "document_snapshot", + "dartName": "DocumentSnapshot", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "documentId", + "fieldName": "documentId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "deltaJson", + "fieldName": "deltaJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "compressed", + "fieldName": "compressed", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "document_snapshot_fk_0", + "columns": [ + "documentId" + ], + "referenceTable": "document", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "document_snapshot_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "documentId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "revision" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "drive_item", + "dartName": "DriveItem", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "uuid", + "fieldName": "uuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kind", + "fieldName": "kind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:DriveItemKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "ownerId", + "fieldName": "ownerId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "parentId", + "fieldName": "parentId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "description", + "fieldName": "description", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "contentRef", + "fieldName": "contentRef", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "thumbnailFileId", + "fieldName": "thumbnailFileId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sizeBytes", + "fieldName": "sizeBytes", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "attachmentBytes", + "fieldName": "attachmentBytes", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kindMask", + "fieldName": "kindMask", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "mimeType", + "fieldName": "mimeType", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileCategory", + "fieldName": "fileCategory", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:FileCategory?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "uploadState", + "fieldName": "uploadState", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:FileUploadState?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileMetaJson", + "fieldName": "fileMetaJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "previewFileId", + "fieldName": "previewFileId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdById", + "fieldName": "createdById", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "modifiedAt", + "fieldName": "modifiedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "modifiedById", + "fieldName": "modifiedById", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "trashedAt", + "fieldName": "trashedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "trashedById", + "fieldName": "trashedById", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "templateOf", + "fieldName": "templateOf", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:TemplateCategory?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "templateKey", + "fieldName": "templateKey", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "editorsCanShare", + "fieldName": "editorsCanShare", + "columnType": 1, + "isNullable": false, + "columnDefault": "true", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "nonEditorsCanExport", + "fieldName": "nonEditorsCanExport", + "columnType": 1, + "isNullable": false, + "columnDefault": "true", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "viewersSeeComments", + "fieldName": "viewersSeeComments", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "searchText", + "fieldName": "searchText", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "drive_item_fk_0", + "columns": [ + "ownerId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 2 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "drive_item_fk_1", + "columns": [ + "parentId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "drive_item_uuid_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "uuid" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "drive_item_parent_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "parentId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "drive_item_owner_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "ownerId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "trashedAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "drive_item_content_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "contentRef" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "drive_item_template_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "templateOf" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "drive_item_upload_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "uploadState" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "drive_item_trashed_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "trashedAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "drive_item_permission", + "dartName": "DriveItemPermission", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "invitedEmail", + "fieldName": "invitedEmail", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "role", + "fieldName": "role", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:AccessRole" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "inheritedFromId", + "fieldName": "inheritedFromId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "grantedById", + "fieldName": "grantedById", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "grantedAt", + "fieldName": "grantedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "expiresAt", + "fieldName": "expiresAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "viaPublicationId", + "fieldName": "viaPublicationId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "drive_item_permission_fk_0", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "drive_item_permission_fk_1", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "drive_item_permission_fk_2", + "columns": [ + "viaPublicationId" + ], + "referenceTable": "publication", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "perm_item_user_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "inheritedFromId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "invitedEmail" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false, + "nullsDistinct": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "perm_user_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "perm_email_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "invitedEmail" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "perm_expires_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "expiresAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "drive_item_user_state", + "dartName": "DriveItemUserState", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "starred", + "fieldName": "starred", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastOpenedAt", + "fieldName": "lastOpenedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastEditedAt", + "fieldName": "lastEditedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "pinnedOffline", + "fieldName": "pinnedOffline", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "shortcutParentId", + "fieldName": "shortcutParentId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "viaLink", + "fieldName": "viaLink", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "drive_item_user_state_fk_0", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "drive_item_user_state_fk_1", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "drive_item_user_state_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "drive_item_user_recent_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "lastOpenedAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "embedded_object", + "dartName": "EmbeddedObject", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetId", + "fieldName": "sheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kind", + "fieldName": "kind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:EmbeddedObjectKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "anchorJson", + "fieldName": "anchorJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "specJson", + "fieldName": "specJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "zIndex", + "fieldName": "zIndex", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "title", + "fieldName": "title", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "altText", + "fieldName": "altText", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "embedded_object_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "embedded_object_fk_1", + "columns": [ + "sheetId" + ], + "referenceTable": "sheet", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "embedded_object_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "feedback_report", + "dartName": "FeedbackReport", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kind", + "fieldName": "kind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:FeedbackKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "message", + "fieldName": "message", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "app", + "fieldName": "app", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "appVersion", + "fieldName": "appVersion", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "platform", + "fieldName": "platform", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "route", + "fieldName": "route", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "stackTrace", + "fieldName": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "contextJson", + "fieldName": "contextJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "feedback_report_created_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "filter_view", + "dartName": "FilterView", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetId", + "fieldName": "sheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rangeJson", + "fieldName": "rangeJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "criteriaJson", + "fieldName": "criteriaJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sortJson", + "fieldName": "sortJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdBy", + "fieldName": "createdBy", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "filter_view_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "filter_view_fk_1", + "columns": [ + "sheetId" + ], + "referenceTable": "sheet", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "filter_view_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "headless_change", + "dartName": "HeadlessChange", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "changeId", + "fieldName": "changeId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kind", + "fieldName": "kind", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "documentId", + "fieldName": "documentId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "inverseJson", + "fieldName": "inverseJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "metaField", + "fieldName": "metaField", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "metaBeforeJson", + "fieldName": "metaBeforeJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "metaAfterJson", + "fieldName": "metaAfterJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "actorKind", + "fieldName": "actorKind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:ActorKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "label", + "fieldName": "label", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "toolName", + "fieldName": "toolName", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revertedAt", + "fieldName": "revertedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "headless_change_fk_0", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "headless_change_id_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "changeId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "headless_change_created_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "item_version", + "dartName": "ItemVersion", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kind", + "fieldName": "kind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:VersionKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdById", + "fieldName": "createdById", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authors", + "fieldName": "authors", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "storageKind", + "fieldName": "storageKind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:VersionStorage" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "snapshotFileId", + "fieldName": "snapshotFileId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sizeBytes", + "fieldName": "sizeBytes", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "item_version_fk_0", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "item_version_item_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "item_version_state", + "dartName": "ItemVersionState", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastEditAt", + "fieldName": "lastEditAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "dirtySince", + "fieldName": "dirtySince", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastVersionAt", + "fieldName": "lastVersionAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "editorsSinceLastVersion", + "fieldName": "editorsSinceLastVersion", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastRevision", + "fieldName": "lastRevision", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "capturingSince", + "fieldName": "capturingSince", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "item_version_state_fk_0", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "item_version_state_item_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "item_version_state_dirty_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "dirtySince" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "item_view_day", + "dartName": "ItemViewDay", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "day", + "fieldName": "day", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "views", + "fieldName": "views", + "columnType": 6, + "isNullable": false, + "columnDefault": "1", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastViewedAt", + "fieldName": "lastViewedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "item_view_day_fk_0", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "item_view_day_fk_1", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "item_view_day_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "day" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "item_view_day_item_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "day" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "macro", + "dartName": "Macro", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "projectId", + "fieldName": "projectId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "functionName", + "fieldName": "functionName", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "shortcutSlot", + "fieldName": "shortcutSlot", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "macro_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "macro_fk_1", + "columns": [ + "projectId" + ], + "referenceTable": "script_project", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "macro_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "merged_range", + "dartName": "MergedRange", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetId", + "fieldName": "sheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rangeJson", + "fieldName": "rangeJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "merged_range_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "merged_range_fk_1", + "columns": [ + "sheetId" + ], + "referenceTable": "sheet", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "merged_range_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "named_range", + "dartName": "NamedRange", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spreadsheetId", + "fieldName": "spreadsheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rangeJson", + "fieldName": "rangeJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "formula", + "fieldName": "formula", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "comment", + "fieldName": "comment", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "metaJson", + "fieldName": "metaJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "named_range_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "named_range_fk_1", + "columns": [ + "spreadsheetId" + ], + "referenceTable": "spreadsheet", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "named_range_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "notification", + "dartName": "UserNotification", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kind", + "fieldName": "kind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:NotificationKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "actorId", + "fieldName": "actorId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "payload", + "fieldName": "payload", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "readAt", + "fieldName": "readAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "emailedAt", + "fieldName": "emailedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "emailPending", + "fieldName": "emailPending", + "columnType": 1, + "isNullable": true, + "columnDefault": "false", + "dartType": "bool?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "notification_fk_0", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "notification_user_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "notification_email_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "emailPending" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "notification_created_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "brin", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "ownership_transfer", + "dartName": "OwnershipTransfer", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fromUserId", + "fieldName": "fromUserId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "toUserId", + "fieldName": "toUserId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "handledAt", + "fieldName": "handledAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "accepted", + "fieldName": "accepted", + "columnType": 1, + "isNullable": true, + "dartType": "bool?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "ownership_transfer_fk_0", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "ownership_transfer_fk_1", + "columns": [ + "toUserId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "ownership_transfer_item_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "handledAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "personal_access_token", + "dartName": "PersonalAccessToken", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "tokenHash", + "fieldName": "tokenHash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "prefix", + "fieldName": "prefix", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "scopes", + "fieldName": "scopes", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "expiresAt", + "fieldName": "expiresAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastUsedAt", + "fieldName": "lastUsedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revokedAt", + "fieldName": "revokedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "personal_access_token_fk_0", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "personal_access_token_user_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "personal_access_token_hash_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "tokenHash" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "pivot_table", + "dartName": "PivotTable", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetId", + "fieldName": "sheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "anchorRowId", + "fieldName": "anchorRowId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "anchorColId", + "fieldName": "anchorColId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sourceRangeJson", + "fieldName": "sourceRangeJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "specJson", + "fieldName": "specJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "pivot_table_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "pivot_table_fk_1", + "columns": [ + "sheetId" + ], + "referenceTable": "sheet", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "pivot_table_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "protected_range", + "dartName": "ProtectedRange", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetId", + "fieldName": "sheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rangeJson", + "fieldName": "rangeJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "exceptRangesJson", + "fieldName": "exceptRangesJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "description", + "fieldName": "description", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "warningOnly", + "fieldName": "warningOnly", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "editorsJson", + "fieldName": "editorsJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdBy", + "fieldName": "createdBy", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "protected_range_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "protected_range_fk_1", + "columns": [ + "sheetId" + ], + "referenceTable": "sheet", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "protected_range_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "publication", + "dartName": "Publication", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "publicId", + "fieldName": "publicId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "ownerId", + "fieldName": "ownerId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "siteUrl", + "fieldName": "siteUrl", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "webhookUrl", + "fieldName": "webhookUrl", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "verifiedHost", + "fieldName": "verifiedHost", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "verifiedAt", + "fieldName": "verifiedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "templateItemId", + "fieldName": "templateItemId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "termsUrl", + "fieldName": "termsUrl", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fields", + "fieldName": "fields", + "columnType": 8, + "isNullable": false, + "dartType": "protocol:PublicationFields" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "signingSecret", + "fieldName": "signingSecret", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "previousSigningSecret", + "fieldName": "previousSigningSecret", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "previousSecretUntil", + "fieldName": "previousSecretUntil", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "apiKeyHash", + "fieldName": "apiKeyHash", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "apiKeyLast4", + "fieldName": "apiKeyLast4", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "enabled", + "fieldName": "enabled", + "columnType": 1, + "isNullable": false, + "columnDefault": "true", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "publication_fk_0", + "columns": [ + "ownerId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "publication_fk_1", + "columns": [ + "templateItemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "publication_public_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "publicId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "publication_owner_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "ownerId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "publication_api_key_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "apiKeyHash" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "publication_block", + "dartName": "PublicationBlock", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "publicationId", + "fieldName": "publicationId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "at", + "fieldName": "at", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "publication_block_fk_0", + "columns": [ + "publicationId" + ], + "referenceTable": "publication", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "publication_block_fk_1", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "publication_block_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "publicationId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "publication_consent", + "dartName": "PublicationConsent", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "publicationId", + "fieldName": "publicationId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "consentKey", + "fieldName": "consentKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "at", + "fieldName": "at", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "publication_consent_fk_0", + "columns": [ + "publicationId" + ], + "referenceTable": "publication", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "publication_consent_fk_1", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "publication_consent_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "publicationId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "publication_delivery", + "dartName": "PublicationDelivery", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "publicationId", + "fieldName": "publicationId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "submissionId", + "fieldName": "submissionId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "webhookId", + "fieldName": "webhookId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "type", + "fieldName": "type", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sequence", + "fieldName": "sequence", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "payload", + "fieldName": "payload", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "attempts", + "fieldName": "attempts", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "nextAttemptAt", + "fieldName": "nextAttemptAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "leaseUntil", + "fieldName": "leaseUntil", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastStatus", + "fieldName": "lastStatus", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastError", + "fieldName": "lastError", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "deliveredAt", + "fieldName": "deliveredAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "failedAt", + "fieldName": "failedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "publication_delivery_fk_0", + "columns": [ + "publicationId" + ], + "referenceTable": "publication", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "publication_delivery_fk_1", + "columns": [ + "submissionId" + ], + "referenceTable": "submission", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "publication_delivery_webhook_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "webhookId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "publication_delivery_due_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "nextAttemptAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "publication_delivery_publication_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "publicationId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "publication_moderator", + "dartName": "PublicationModerator", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "publicationId", + "fieldName": "publicationId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "email", + "fieldName": "email", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "publication_moderator_fk_0", + "columns": [ + "publicationId" + ], + "referenceTable": "publication", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "publication_moderator_fk_1", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "publication_moderator_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "publicationId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "publication_moderator_user_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "rev_file", + "dartName": "RevFile", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileUuid", + "fieldName": "fileUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kind", + "fieldName": "kind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:RevFileKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "headRevision", + "fieldName": "headRevision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "prunedBelow", + "fieldName": "prunedBelow", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "initPending", + "fieldName": "initPending", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "purging", + "fieldName": "purging", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "schemaHash", + "fieldName": "schemaHash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "stats", + "fieldName": "stats", + "columnType": 0, + "isNullable": false, + "columnDefault": "'{}'", + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "contentCount", + "fieldName": "contentCount", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "rev_file_fk_0", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 2 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "rev_file_uuid_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileUuid" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "rev_file_item_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "rev_hook_state", + "dartName": "RevHookState", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "cursorsJson", + "fieldName": "cursorsJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "leaseOwner", + "fieldName": "leaseOwner", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "leaseUntil", + "fieldName": "leaseUntil", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "attempts", + "fieldName": "attempts", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastError", + "fieldName": "lastError", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "nextAttemptAt", + "fieldName": "nextAttemptAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "rev_hook_state_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "rev_hook_state_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "rev_hook_state_due_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "nextAttemptAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "rev_op", + "dartName": "RevOp", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "clientOpId", + "fieldName": "clientOpId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "baseRevision", + "fieldName": "baseRevision", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authorId", + "fieldName": "authorId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authorUuid", + "fieldName": "authorUuid", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sessionId", + "fieldName": "sessionId", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "onBehalfOfSessionId", + "fieldName": "onBehalfOfSessionId", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "actorKind", + "fieldName": "actorKind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:ActorKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "label", + "fieldName": "label", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "groupId", + "fieldName": "groupId", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "groupIndex", + "fieldName": "groupIndex", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "groupLast", + "fieldName": "groupLast", + "columnType": 1, + "isNullable": false, + "columnDefault": "true", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "recordId", + "fieldName": "recordId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "offline", + "fieldName": "offline", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "payload", + "fieldName": "payload", + "columnType": 5, + "isNullable": true, + "dartType": "dart:typed_data:ByteData?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "changeCount", + "fieldName": "changeCount", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "summaryJson", + "fieldName": "summaryJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "detailJson", + "fieldName": "detailJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "outcomeJson", + "fieldName": "outcomeJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "appliedEqualsSubmitted", + "fieldName": "appliedEqualsSubmitted", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "clientCreatedAt", + "fieldName": "clientCreatedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "committedAt", + "fieldName": "committedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "rev_op_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "rev_op_rev_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "revision" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "rev_op_client_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "clientOpId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "rev_op_record_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "recordId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "rev_op_committed_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "committedAt" + } + ], + "type": "brin", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "script_authorization", + "dartName": "ScriptAuthorization", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spreadsheetUuid", + "fieldName": "spreadsheetUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "scopes", + "fieldName": "scopes", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "grantedAt", + "fieldName": "grantedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revokedAt", + "fieldName": "revokedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "script_auth_user_sheet_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "spreadsheetUuid" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "script_build", + "dartName": "ScriptBuild", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "projectId", + "fieldName": "projectId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "status", + "fieldName": "status", + "columnType": 0, + "isNullable": false, + "columnDefault": "'ok'", + "dartType": "protocol:ScriptBuildStatus" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sourceHash", + "fieldName": "sourceHash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "bytecodeFileUuid", + "fieldName": "bytecodeFileUuid", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "diagnosticsJson", + "fieldName": "diagnosticsJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "exportsJson", + "fieldName": "exportsJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "apiVersion", + "fieldName": "apiVersion", + "columnType": 6, + "isNullable": false, + "columnDefault": "1", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "compilerVersion", + "fieldName": "compilerVersion", + "columnType": 0, + "isNullable": false, + "columnDefault": "''", + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "requestedBy", + "fieldName": "requestedBy", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastGoodSourceHash", + "fieldName": "lastGoodSourceHash", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastGoodBytecodeFileUuid", + "fieldName": "lastGoodBytecodeFileUuid", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastGoodExportsJson", + "fieldName": "lastGoodExportsJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastGoodBuiltAt", + "fieldName": "lastGoodBuiltAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "positionsFileUuid", + "fieldName": "positionsFileUuid", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "builtAt", + "fieldName": "builtAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "script_build_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "script_build_fk_1", + "columns": [ + "projectId" + ], + "referenceTable": "script_project", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "script_build_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "script_execution", + "dartName": "ScriptExecution", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "uuid", + "fieldName": "uuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spreadsheetUuid", + "fieldName": "spreadsheetUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "projectId", + "fieldName": "projectId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "functionName", + "fieldName": "functionName", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kind", + "fieldName": "kind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:ScriptExecutionKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "triggerId", + "fieldName": "triggerId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "runAsUserId", + "fieldName": "runAsUserId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "runtime", + "fieldName": "runtime", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:ScriptRuntimeKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "status", + "fieldName": "status", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:ScriptExecutionStatus" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "buildSourceHash", + "fieldName": "buildSourceHash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "startedAt", + "fieldName": "startedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "durationMs", + "fieldName": "durationMs", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "logs", + "fieldName": "logs", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "errorMessage", + "fieldName": "errorMessage", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "errorStackJson", + "fieldName": "errorStackJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "changeId", + "fieldName": "changeId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "cellsRead", + "fieldName": "cellsRead", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "cellsWritten", + "fieldName": "cellsWritten", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fetchCalls", + "fieldName": "fetchCalls", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "callCount", + "fieldName": "callCount", + "columnType": 6, + "isNullable": false, + "columnDefault": "1", + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "script_exec_uuid_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "uuid" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "script_exec_sheet_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "spreadsheetUuid" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "startedAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "script_exec_user_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "startedAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "script_file", + "dartName": "ScriptFile", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "projectId", + "fieldName": "projectId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sortKey", + "fieldName": "sortKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "source", + "fieldName": "source", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "contentHash", + "fieldName": "contentHash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedBy", + "fieldName": "updatedBy", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "script_file_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "script_file_fk_1", + "columns": [ + "projectId" + ], + "referenceTable": "script_project", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "script_file_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "script_job", + "dartName": "ScriptJob", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kind", + "fieldName": "kind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:ScriptExecutionKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spreadsheetUuid", + "fieldName": "spreadsheetUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemUuid", + "fieldName": "itemUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "triggerId", + "fieldName": "triggerId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "runAsUserId", + "fieldName": "runAsUserId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "functionName", + "fieldName": "functionName", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "payloadJson", + "fieldName": "payloadJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "status", + "fieldName": "status", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:ScriptExecutionStatus" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "enqueuedAt", + "fieldName": "enqueuedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "leaseOwner", + "fieldName": "leaseOwner", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "leaseUntil", + "fieldName": "leaseUntil", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "attempts", + "fieldName": "attempts", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "coalesced", + "fieldName": "coalesced", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "resultJson", + "fieldName": "resultJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "finishedAt", + "fieldName": "finishedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "script_job_status_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "status" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "enqueuedAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "script_job_trigger_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "triggerId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "status" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "script_job_user_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "runAsUserId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "status" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "script_project", + "dartName": "ScriptProject", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spreadsheetId", + "fieldName": "spreadsheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "settingsJson", + "fieldName": "settingsJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "script_project_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "script_project_fk_1", + "columns": [ + "spreadsheetId" + ], + "referenceTable": "spreadsheet", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "script_project_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "script_property", + "dartName": "ScriptProperty", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "projectId", + "fieldName": "projectId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "key", + "fieldName": "key", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "value", + "fieldName": "value", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "script_property_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "script_property_fk_1", + "columns": [ + "projectId" + ], + "referenceTable": "script_project", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "script_property_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "script_quota_usage", + "dartName": "ScriptQuotaUsage", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "day", + "fieldName": "day", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "serverRuntimeMs", + "fieldName": "serverRuntimeMs", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "clientRuntimeMs", + "fieldName": "clientRuntimeMs", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "urlFetchCalls", + "fieldName": "urlFetchCalls", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "urlFetchBytes", + "fieldName": "urlFetchBytes", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "triggerRuns", + "fieldName": "triggerRuns", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "script_quota_user_day_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "day" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "script_trigger", + "dartName": "ScriptTrigger", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "projectId", + "fieldName": "projectId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kind", + "fieldName": "kind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:TriggerKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "functionName", + "fieldName": "functionName", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "scheduleJson", + "fieldName": "scheduleJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "runAsUserId", + "fieldName": "runAsUserId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "enabled", + "fieldName": "enabled", + "columnType": 1, + "isNullable": false, + "columnDefault": "true", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "optionsJson", + "fieldName": "optionsJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "script_trigger_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "script_trigger_fk_1", + "columns": [ + "projectId" + ], + "referenceTable": "script_project", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "script_trigger_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "script_trigger_state", + "dartName": "ScriptTriggerState", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "triggerId", + "fieldName": "triggerId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spreadsheetUuid", + "fieldName": "spreadsheetUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "scheduleJson", + "fieldName": "scheduleJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "nextRunAt", + "fieldName": "nextRunAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastRunAt", + "fieldName": "lastRunAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastStatus", + "fieldName": "lastStatus", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:ScriptExecutionStatus?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "consecutiveFailures", + "fieldName": "consecutiveFailures", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "disabledReason", + "fieldName": "disabledReason", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "runningSince", + "fieldName": "runningSince", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastNotifiedAt", + "fieldName": "lastNotifiedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "script_trigger_state_id_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "triggerId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "script_trigger_state_due_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "nextRunAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "script_user_property", + "dartName": "ScriptUserProperty", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileUuid", + "fieldName": "fileUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "key", + "fieldName": "key", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "value", + "fieldName": "value", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "script_user_property_fk_0", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "script_user_property_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileUuid" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "key" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "server_change_record", + "dartName": "ServerChangeRecord", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "changeId", + "fieldName": "changeId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileUuid", + "fieldName": "fileUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "actorKind", + "fieldName": "actorKind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:ActorKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "label", + "fieldName": "label", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "inverseJson", + "fieldName": "inverseJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "inverseFileId", + "fieldName": "inverseFileId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "forwardFileId", + "fieldName": "forwardFileId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "recordId", + "fieldName": "recordId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "cellsAffected", + "fieldName": "cellsAffected", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "expiresAt", + "fieldName": "expiresAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revertedAt", + "fieldName": "revertedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revertChangeId", + "fieldName": "revertChangeId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "server_change_record_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "recordId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "server_change_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileUuid" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "server_change_id_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "changeId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "share_link", + "dartName": "ShareLink", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "token", + "fieldName": "token", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "role", + "fieldName": "role", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:AccessRole?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdById", + "fieldName": "createdById", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "share_link_fk_0", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "share_link_item_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "share_link_token_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "token" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "sheet", + "dartName": "Sheet", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spreadsheetId", + "fieldName": "spreadsheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sortKey", + "fieldName": "sortKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kind", + "fieldName": "kind", + "columnType": 0, + "isNullable": false, + "columnDefault": "'grid'", + "dartType": "protocol:SheetKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "hidden", + "fieldName": "hidden", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "tabColor", + "fieldName": "tabColor", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rightToLeft", + "fieldName": "rightToLeft", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "showGridlines", + "fieldName": "showGridlines", + "columnType": 1, + "isNullable": false, + "columnDefault": "true", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "frozenRows", + "fieldName": "frozenRows", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "frozenColumns", + "fieldName": "frozenColumns", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "defaultRowHeight", + "fieldName": "defaultRowHeight", + "columnType": 3, + "isNullable": false, + "columnDefault": "21.0", + "dartType": "double" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "defaultColumnWidth", + "fieldName": "defaultColumnWidth", + "columnType": 3, + "isNullable": false, + "columnDefault": "100.0", + "dartType": "double" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "formatJson", + "fieldName": "formatJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "printSettingsJson", + "fieldName": "printSettingsJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "sheet_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "sheet_fk_1", + "columns": [ + "spreadsheetId" + ], + "referenceTable": "spreadsheet", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "sheet_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "sheet_order_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "spreadsheetId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "sortKey" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "sheet_column", + "dartName": "SheetColumn", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetId", + "fieldName": "sheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sortKey", + "fieldName": "sortKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "width", + "fieldName": "width", + "columnType": 3, + "isNullable": true, + "dartType": "double?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "hidden", + "fieldName": "hidden", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "formatJson", + "fieldName": "formatJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "sheet_column_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "sheet_column_fk_1", + "columns": [ + "sheetId" + ], + "referenceTable": "sheet", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "sheet_column_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "sheet_column_order_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "sheetId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "sortKey" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "sheet_row", + "dartName": "SheetRow", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetId", + "fieldName": "sheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sortKey", + "fieldName": "sortKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "height", + "fieldName": "height", + "columnType": 3, + "isNullable": true, + "dartType": "double?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "hidden", + "fieldName": "hidden", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "formatJson", + "fieldName": "formatJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "sheet_row_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "sheet_row_fk_1", + "columns": [ + "sheetId" + ], + "referenceTable": "sheet", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "sheet_row_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "sheet_row_order_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "sheetId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "sortKey" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "sheets_import_job", + "dartName": "SheetsImportJob", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "uuid", + "fieldName": "uuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authUserId", + "fieldName": "authUserId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spreadsheetUuid", + "fieldName": "spreadsheetUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "uploadFileId", + "fieldName": "uploadFileId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileName", + "fieldName": "fileName", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "format", + "fieldName": "format", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "optionsJson", + "fieldName": "optionsJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "activeSheetId", + "fieldName": "activeSheetId", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "status", + "fieldName": "status", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:SheetsImportStatus" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "progressDone", + "fieldName": "progressDone", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "progressTotal", + "fieldName": "progressTotal", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "reportJson", + "fieldName": "reportJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetIdsJson", + "fieldName": "sheetIdsJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "changeId", + "fieldName": "changeId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "errorCode", + "fieldName": "errorCode", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "error", + "fieldName": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "cancelRequested", + "fieldName": "cancelRequested", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "leaseOwner", + "fieldName": "leaseOwner", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "leaseUntil", + "fieldName": "leaseUntil", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "sheets_import_job_uuid_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "uuid" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "sheets_import_job_user_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "status" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "sheets_snapshot_index", + "dartName": "SheetsSnapshotIndex", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemVersionId", + "fieldName": "itemVersionId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetsJson", + "fieldName": "sheetsJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "changedRangesJson", + "fieldName": "changedRangesJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authorIds", + "fieldName": "authorIds", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "diffFileId", + "fieldName": "diffFileId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "sheets_snapshot_index_fk_0", + "columns": [ + "itemVersionId" + ], + "referenceTable": "item_version", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "sheets_snapshot_index_version_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemVersionId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "slide", + "dartName": "Slide", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "deckId", + "fieldName": "deckId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sortKey", + "fieldName": "sortKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "groupId", + "fieldName": "groupId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "layoutId", + "fieldName": "layoutId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "backgroundJson", + "fieldName": "backgroundJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "skipped", + "fieldName": "skipped", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "notes", + "fieldName": "notes", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "transitionJson", + "fieldName": "transitionJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "hideMasterElements", + "fieldName": "hideMasterElements", + "columnType": 1, + "isNullable": true, + "dartType": "bool?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "timingsJson", + "fieldName": "timingsJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_fk_1", + "columns": [ + "deckId" + ], + "referenceTable": "deck", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_order_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "deckId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "sortKey" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "slide_build", + "dartName": "SlideBuild", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "slideId", + "fieldName": "slideId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "elementId", + "fieldName": "elementId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kind", + "fieldName": "kind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:BuildKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "effect", + "fieldName": "effect", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sortKey", + "fieldName": "sortKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "trigger", + "fieldName": "trigger", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:BuildTrigger" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "delayMs", + "fieldName": "delayMs", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "durationMs", + "fieldName": "durationMs", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "easing", + "fieldName": "easing", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "optionsJson", + "fieldName": "optionsJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_build_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_build_fk_1", + "columns": [ + "slideId" + ], + "referenceTable": "slide", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_build_fk_2", + "columns": [ + "elementId" + ], + "referenceTable": "slide_element", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_build_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_build_slide_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "slideId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "sortKey" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_build_element_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "elementId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "slide_element", + "dartName": "SlideElement", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "slideId", + "fieldName": "slideId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "layoutId", + "fieldName": "layoutId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "masterId", + "fieldName": "masterId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "parentId", + "fieldName": "parentId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kind", + "fieldName": "kind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:SlideElementKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "x", + "fieldName": "x", + "columnType": 3, + "isNullable": true, + "dartType": "double?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "y", + "fieldName": "y", + "columnType": 3, + "isNullable": true, + "dartType": "double?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "width", + "fieldName": "width", + "columnType": 3, + "isNullable": true, + "dartType": "double?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "height", + "fieldName": "height", + "columnType": 3, + "isNullable": true, + "dartType": "double?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rotation", + "fieldName": "rotation", + "columnType": 3, + "isNullable": true, + "dartType": "double?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "flipH", + "fieldName": "flipH", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "flipV", + "fieldName": "flipV", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "zKey", + "fieldName": "zKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "readingKey", + "fieldName": "readingKey", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "locked", + "fieldName": "locked", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "hidden", + "fieldName": "hidden", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "placeholderType", + "fieldName": "placeholderType", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:PlaceholderType?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "placeholderOf", + "fieldName": "placeholderOf", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "matchKey", + "fieldName": "matchKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "text", + "fieldName": "text", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "textStyleJson", + "fieldName": "textStyleJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fillJson", + "fieldName": "fillJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "strokeJson", + "fieldName": "strokeJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "effectsJson", + "fieldName": "effectsJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "opacity", + "fieldName": "opacity", + "columnType": 3, + "isNullable": true, + "dartType": "double?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "dataJson", + "fieldName": "dataJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "linkJson", + "fieldName": "linkJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "altText", + "fieldName": "altText", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "decorative", + "fieldName": "decorative", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_element_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_element_fk_1", + "columns": [ + "slideId" + ], + "referenceTable": "slide", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_element_fk_2", + "columns": [ + "layoutId" + ], + "referenceTable": "slide_layout", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_element_fk_3", + "columns": [ + "masterId" + ], + "referenceTable": "slide_master", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_element_fk_4", + "columns": [ + "parentId" + ], + "referenceTable": "slide_element", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_element_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_element_slide_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "slideId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "zKey" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_element_layout_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "layoutId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_element_master_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "masterId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_element_parent_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "parentId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "slide_group", + "dartName": "SlideGroup", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "deckId", + "fieldName": "deckId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "title", + "fieldName": "title", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sortKey", + "fieldName": "sortKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "parentId", + "fieldName": "parentId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "color", + "fieldName": "color", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "skipped", + "fieldName": "skipped", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_group_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_group_fk_1", + "columns": [ + "deckId" + ], + "referenceTable": "deck", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_group_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_group_order_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "deckId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "sortKey" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "slide_layout", + "dartName": "SlideLayout", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "masterId", + "fieldName": "masterId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "key", + "fieldName": "key", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sortKey", + "fieldName": "sortKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "backgroundJson", + "fieldName": "backgroundJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "hideMasterElements", + "fieldName": "hideMasterElements", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "hidden", + "fieldName": "hidden", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_layout_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_layout_fk_1", + "columns": [ + "masterId" + ], + "referenceTable": "slide_master", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_layout_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_layout_master_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "masterId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "slide_master", + "dartName": "SlideMaster", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "themeId", + "fieldName": "themeId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sortKey", + "fieldName": "sortKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "backgroundJson", + "fieldName": "backgroundJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_master_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_master_fk_1", + "columns": [ + "themeId" + ], + "referenceTable": "deck_theme", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_master_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_master_theme_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "themeId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "slide_table_axis", + "dartName": "SlideTableAxis", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "elementId", + "fieldName": "elementId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "dimension", + "fieldName": "dimension", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:TableDimension" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sortKey", + "fieldName": "sortKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "size", + "fieldName": "size", + "columnType": 3, + "isNullable": true, + "dartType": "double?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "header", + "fieldName": "header", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_table_axis_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_table_axis_fk_1", + "columns": [ + "elementId" + ], + "referenceTable": "slide_element", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_table_axis_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_table_axis_element_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "elementId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "sortKey" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "slide_table_cell", + "dartName": "SlideTableCell", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "elementId", + "fieldName": "elementId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rowId", + "fieldName": "rowId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "columnId", + "fieldName": "columnId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "text", + "fieldName": "text", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fill", + "fieldName": "fill", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "borderTop", + "fieldName": "borderTop", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "borderRight", + "fieldName": "borderRight", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "borderBottom", + "fieldName": "borderBottom", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "borderLeft", + "fieldName": "borderLeft", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "vAlign", + "fieldName": "vAlign", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "padding", + "fieldName": "padding", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rowSpan", + "fieldName": "rowSpan", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "colSpan", + "fieldName": "colSpan", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_table_cell_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_table_cell_fk_1", + "columns": [ + "elementId" + ], + "referenceTable": "slide_element", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_table_cell_fk_2", + "columns": [ + "rowId" + ], + "referenceTable": "slide_table_axis", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_table_cell_fk_3", + "columns": [ + "columnId" + ], + "referenceTable": "slide_table_axis", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_table_cell_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_table_cell_element_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "elementId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "slides_snapshot_index", + "dartName": "SlidesSnapshotIndex", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemVersionId", + "fieldName": "itemVersionId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "slidesJson", + "fieldName": "slidesJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "changesJson", + "fieldName": "changesJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authorIds", + "fieldName": "authorIds", + "columnType": 8, + "isNullable": false, + "dartType": "List" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slides_snapshot_index_fk_0", + "columns": [ + "itemVersionId" + ], + "referenceTable": "item_version", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slides_snapshot_index_version_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemVersionId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "spreadsheet", + "dartName": "Spreadsheet", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "title", + "fieldName": "title", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "locale", + "fieldName": "locale", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "timeZone", + "fieldName": "timeZone", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "recalcMode", + "fieldName": "recalcMode", + "columnType": 0, + "isNullable": false, + "columnDefault": "'onChange'", + "dartType": "protocol:RecalcMode" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "iterativeCalc", + "fieldName": "iterativeCalc", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "maxIterations", + "fieldName": "maxIterations", + "columnType": 6, + "isNullable": false, + "columnDefault": "50", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "convergenceThreshold", + "fieldName": "convergenceThreshold", + "columnType": 3, + "isNullable": false, + "columnDefault": "0.05", + "dartType": "double" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "defaultFontFamily", + "fieldName": "defaultFontFamily", + "columnType": 0, + "isNullable": false, + "columnDefault": "'Inter'", + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "defaultFontSize", + "fieldName": "defaultFontSize", + "columnType": 3, + "isNullable": false, + "columnDefault": "10.0", + "dartType": "double" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "themeJson", + "fieldName": "themeJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "displayLanguage", + "fieldName": "displayLanguage", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdBy", + "fieldName": "createdBy", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "spreadsheet_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "spreadsheet_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "storage_reservation", + "dartName": "StorageReservation", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileUuid", + "fieldName": "fileUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "bytes", + "fieldName": "bytes", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "expiresAt", + "fieldName": "expiresAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "storage_reservation_fk_0", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "storage_reservation_fk_1", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "storage_reservation_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileUuid" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "storage_reservation_user_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "storage_reservation_expiry_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "expiresAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "stored_file", + "dartName": "StoredFile", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileUuid", + "fieldName": "fileUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "ownerId", + "fieldName": "ownerId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kind", + "fieldName": "kind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:StoredFileKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "storageId", + "fieldName": "storageId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "path", + "fieldName": "path", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileName", + "fieldName": "fileName", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "mimeType", + "fieldName": "mimeType", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sizeBytes", + "fieldName": "sizeBytes", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "status", + "fieldName": "status", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:StoredFileStatus" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "completedAt", + "fieldName": "completedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "expiresAt", + "fieldName": "expiresAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "stored_file_fk_0", + "columns": [ + "ownerId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "stored_file_fk_1", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "stored_file_uuid_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileUuid" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "stored_file_item_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "stored_file_expiry_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "expiresAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "stored_file_owner_kind_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "ownerId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "kind" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "stored_file_status_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "status" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "submission", + "dartName": "Submission", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "uuid", + "fieldName": "uuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "publicationId", + "fieldName": "publicationId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "ref", + "fieldName": "ref", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "status", + "fieldName": "status", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:SubmissionStatus" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "statusBeforeSubmit", + "fieldName": "statusBeforeSubmit", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:SubmissionStatus?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "delivery", + "fieldName": "delivery", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:SubmissionDeliveryState?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "values", + "fieldName": "values", + "columnType": 8, + "isNullable": false, + "dartType": "protocol:SubmissionValues" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "publicUrl", + "fieldName": "publicUrl", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "feedbackThreadId", + "fieldName": "feedbackThreadId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdById", + "fieldName": "createdById", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "disconnectedAt", + "fieldName": "disconnectedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "submission_fk_0", + "columns": [ + "publicationId" + ], + "referenceTable": "publication", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "submission_fk_1", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "submission_uuid_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "uuid" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "submission_item_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "submission_publication_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "publicationId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "status" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "submission_asset", + "dartName": "SubmissionAsset", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "submissionId", + "fieldName": "submissionId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileUuid", + "fieldName": "fileUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "submission_asset_fk_0", + "columns": [ + "submissionId" + ], + "referenceTable": "submission", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "submission_asset_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "submissionId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileUuid" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "submission_asset_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileUuid" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "submission_revision", + "dartName": "SubmissionRevision", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "submissionId", + "fieldName": "submissionId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sequence", + "fieldName": "sequence", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "versionId", + "fieldName": "versionId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "values", + "fieldName": "values", + "columnType": 8, + "isNullable": false, + "dartType": "protocol:SubmissionValues" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "payload", + "fieldName": "payload", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "submittedById", + "fieldName": "submittedById", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "submittedAt", + "fieldName": "submittedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "submission_revision_fk_0", + "columns": [ + "submissionId" + ], + "referenceTable": "submission", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "submission_revision_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "submissionId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "sequence" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "usage_counter_day", + "dartName": "UsageCounterDay", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "day", + "fieldName": "day", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "value", + "fieldName": "value", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "usage_counter_day_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "day" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "name" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "user_activity_day", + "dartName": "UserActivityDay", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "day", + "fieldName": "day", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "app", + "fieldName": "app", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:UsageApp" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "edited", + "fieldName": "edited", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "user_activity_day_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "day" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "app" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "user_activity_day_day_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "day" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "user_activity_settings", + "dartName": "UserActivitySettings", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "showViewHistory", + "fieldName": "showViewHistory", + "columnType": 1, + "isNullable": false, + "columnDefault": "true", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "user_activity_settings_fk_0", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "user_activity_settings_user_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "user_preferences", + "dartName": "UserPreferences", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "appTheme", + "fieldName": "appTheme", + "columnType": 0, + "isNullable": false, + "columnDefault": "'system'", + "dartType": "protocol:AppThemeMode" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "accentColor", + "fieldName": "accentColor", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "density", + "fieldName": "density", + "columnType": 0, + "isNullable": false, + "columnDefault": "'comfortable'", + "dartType": "protocol:UiDensity" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "reduceMotion", + "fieldName": "reduceMotion", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "keymapOverrides", + "fieldName": "keymapOverrides", + "columnType": 0, + "isNullable": false, + "columnDefault": "'{}'", + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "writeDefaults", + "fieldName": "writeDefaults", + "columnType": 0, + "isNullable": false, + "columnDefault": "'{}'", + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetsDefaults", + "fieldName": "sheetsDefaults", + "columnType": 0, + "isNullable": false, + "columnDefault": "'{}'", + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "slidesDefaults", + "fieldName": "slidesDefaults", + "columnType": 0, + "isNullable": false, + "columnDefault": "'{}'", + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "slidesPresenter", + "fieldName": "slidesPresenter", + "columnType": 0, + "isNullable": false, + "columnDefault": "'{}'", + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "driveDefaults", + "fieldName": "driveDefaults", + "columnType": 0, + "isNullable": false, + "columnDefault": "'{}'", + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "notificationSettings", + "fieldName": "notificationSettings", + "columnType": 0, + "isNullable": false, + "columnDefault": "'{}'", + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "aiEnabled", + "fieldName": "aiEnabled", + "columnType": 1, + "isNullable": false, + "columnDefault": "true", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "user_preferences_fk_0", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "user_preferences_user_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "user_profile", + "dartName": "UserProfile", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authUserId", + "fieldName": "authUserId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "displayName", + "fieldName": "displayName", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "email", + "fieldName": "email", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "avatarFileId", + "fieldName": "avatarFileId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "avatarColor", + "fieldName": "avatarColor", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "locale", + "fieldName": "locale", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "timeZone", + "fieldName": "timeZone", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastSeenAt", + "fieldName": "lastSeenAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "welcomeContentAt", + "fieldName": "welcomeContentAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "user_profile_fk_0", + "columns": [ + "authUserId" + ], + "referenceTable": "serverpod_auth_core_user", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "user_profile_auth_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "authUserId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "user_profile_email_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "user_storage", + "dartName": "UserStorage", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "usedBytes", + "fieldName": "usedBytes", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "reservedBytes", + "fieldName": "reservedBytes", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "documentsBytes", + "fieldName": "documentsBytes", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spreadsheetsBytes", + "fieldName": "spreadsheetsBytes", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "presentationsBytes", + "fieldName": "presentationsBytes", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "filesBytes", + "fieldName": "filesBytes", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "trashBytes", + "fieldName": "trashBytes", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "quotaBytesOverride", + "fieldName": "quotaBytesOverride", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "overQuotaSince", + "fieldName": "overQuotaSince", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "reconciledAt", + "fieldName": "reconciledAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "user_storage_fk_0", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "user_storage_user_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "write_diff_cache", + "dartName": "WriteDiffCache", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "documentId", + "fieldName": "documentId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fromRevision", + "fieldName": "fromRevision", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "toRevision", + "fieldName": "toRevision", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "json", + "fieldName": "json", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "write_diff_cache_fk_0", + "columns": [ + "documentId" + ], + "referenceTable": "document", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "write_diff_cache_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "documentId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fromRevision" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "toRevision" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "write_diff_cache_created_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "brin", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "write_theme", + "dartName": "WriteTheme", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "uuid", + "fieldName": "uuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "ownerId", + "fieldName": "ownerId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "isBuiltin", + "fieldName": "isBuiltin", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "builtinKey", + "fieldName": "builtinKey", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "description", + "fieldName": "description", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "schemaVersion", + "fieldName": "schemaVersion", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "version", + "fieldName": "version", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "json", + "fieldName": "json", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "contentHash", + "fieldName": "contentHash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "deletedAt", + "fieldName": "deletedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "write_theme_fk_0", + "columns": [ + "ownerId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "write_theme_uuid_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "uuid" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "write_theme_owner_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "ownerId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "deletedAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "write_theme_builtin_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "builtinKey" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "write_theme_revision", + "dartName": "WriteThemeRevision", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "themeId", + "fieldName": "themeId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "version", + "fieldName": "version", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "json", + "fieldName": "json", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "savedById", + "fieldName": "savedById", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "actorKind", + "fieldName": "actorKind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:ActorKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "write_theme_revision_fk_0", + "columns": [ + "themeId" + ], + "referenceTable": "write_theme", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "write_theme_rev_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "themeId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "version" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + } + ], + "installedModules": [ + { + "__className__": "serverpod.DatabaseMigrationVersion", + "module": "serverpod", + "version": "20260824182259319" + }, + { + "__className__": "serverpod.DatabaseMigrationVersion", + "module": "serverpod_auth_idp", + "version": "20260924105404509" + }, + { + "__className__": "serverpod.DatabaseMigrationVersion", + "module": "serverpod_auth_core", + "version": "20260924105232991" + } + ], + "migrationApiVersion": 1 +} \ No newline at end of file diff --git a/wonky_server/migrations/20261020133251149-usage-analytics/migration.json b/wonky_server/migrations/20261020133251149-usage-analytics/migration.json new file mode 100644 index 00000000..d95ffc42 --- /dev/null +++ b/wonky_server/migrations/20261020133251149-usage-analytics/migration.json @@ -0,0 +1,174 @@ +{ + "__className__": "serverpod.DatabaseMigration", + "actions": [ + { + "__className__": "serverpod.DatabaseMigrationAction", + "type": "createTable", + "createTable": { + "__className__": "serverpod.TableDefinition", + "name": "usage_counter_day", + "dartName": "UsageCounterDay", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "day", + "fieldName": "day", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "value", + "fieldName": "value", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "usage_counter_day_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "day" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "name" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + } + }, + { + "__className__": "serverpod.DatabaseMigrationAction", + "type": "createTable", + "createTable": { + "__className__": "serverpod.TableDefinition", + "name": "user_activity_day", + "dartName": "UserActivityDay", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "day", + "fieldName": "day", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "app", + "fieldName": "app", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:UsageApp" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "edited", + "fieldName": "edited", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "user_activity_day_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "day" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "app" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "user_activity_day_day_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "day" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + } + } + ], + "warnings": [], + "migrationApiVersion": 1 +} \ No newline at end of file diff --git a/wonky_server/migrations/20261020133251149-usage-analytics/migration.sql b/wonky_server/migrations/20261020133251149-usage-analytics/migration.sql new file mode 100644 index 00000000..52f79aad --- /dev/null +++ b/wonky_server/migrations/20261020133251149-usage-analytics/migration.sql @@ -0,0 +1,65 @@ +BEGIN; + +-- +-- ACTION CREATE TABLE +-- +CREATE TABLE "usage_counter_day" ( + "id" bigserial PRIMARY KEY, + "day" timestamp without time zone NOT NULL, + "name" text NOT NULL, + "value" bigint NOT NULL DEFAULT 0 +); + +-- Indexes +CREATE UNIQUE INDEX "usage_counter_day_idx" ON "usage_counter_day" USING btree ("day", "name"); + +-- +-- ACTION CREATE TABLE +-- +CREATE TABLE "user_activity_day" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "day" timestamp without time zone NOT NULL, + "app" text NOT NULL, + "edited" boolean NOT NULL DEFAULT false +); + +-- Indexes +CREATE UNIQUE INDEX "user_activity_day_idx" ON "user_activity_day" USING btree ("userId", "day", "app"); +CREATE INDEX "user_activity_day_day_idx" ON "user_activity_day" USING btree ("day"); + + +-- +-- MIGRATION VERSION FOR wonky +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('wonky', '20261020133251149-usage-analytics', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20261020133251149-usage-analytics', "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 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; diff --git a/wonky_server/migrations/20261020142413171-analytics-indexes/definition.json b/wonky_server/migrations/20261020142413171-analytics-indexes/definition.json new file mode 100644 index 00000000..e5fcfe5b --- /dev/null +++ b/wonky_server/migrations/20261020142413171-analytics-indexes/definition.json @@ -0,0 +1,20152 @@ +{ + "__className__": "serverpod.DatabaseDefinition", + "schemaVersion": 2, + "moduleName": "wonky", + "tables": [ + { + "__className__": "serverpod.TableDefinition", + "name": "access_request", + "dartName": "AccessRequest", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "requesterId", + "fieldName": "requesterId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "requestedRole", + "fieldName": "requestedRole", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:AccessRole" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "message", + "fieldName": "message", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "handledAt", + "fieldName": "handledAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "handledById", + "fieldName": "handledById", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "outcome", + "fieldName": "outcome", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:AccessRequestOutcome?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "access_request_fk_0", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "access_request_fk_1", + "columns": [ + "requesterId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "access_request_item_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "handledAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "activity_event", + "dartName": "ActivityEvent", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "actorId", + "fieldName": "actorId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "actorKind", + "fieldName": "actorKind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:ActorKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "type", + "fieldName": "type", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:ActivityType" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "summary", + "fieldName": "summary", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "at", + "fieldName": "at", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "activity_event_fk_0", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "activity_item_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "at" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "activity_type_at_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "type" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "at" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "ai_function_cache", + "dartName": "AiFunctionCache", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "key", + "fieldName": "key", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spreadsheetUuid", + "fieldName": "spreadsheetUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "model", + "fieldName": "model", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "value", + "fieldName": "value", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "error", + "fieldName": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "hits", + "fieldName": "hits", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "ai_function_cache_key_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "key" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "ai_function_cache_sheet_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "spreadsheetUuid" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "ai_preview_record", + "dartName": "AiPreviewRecord", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "previewId", + "fieldName": "previewId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileUuid", + "fieldName": "fileUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "previewJson", + "fieldName": "previewJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "changesJson", + "fieldName": "changesJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "expiresAt", + "fieldName": "expiresAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "ai_preview_id_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "previewId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "ai_preview_expires_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "expiresAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "ai_usage", + "dartName": "AiUsage", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "model", + "fieldName": "model", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "feature", + "fieldName": "feature", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "inputTokens", + "fieldName": "inputTokens", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "outputTokens", + "fieldName": "outputTokens", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "cacheReadTokens", + "fieldName": "cacheReadTokens", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "cacheWriteTokens", + "fieldName": "cacheWriteTokens", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "at", + "fieldName": "at", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "ai_usage_fk_0", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "ai_usage_user_at_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "at" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "ai_usage_at_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "at" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "ai_user_key", + "dartName": "AiUserKey", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "provider", + "fieldName": "provider", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:AiProvider" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "apiKey", + "fieldName": "apiKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "ai_user_key_fk_0", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "ai_user_key_user_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "ai_user_setting", + "dartName": "AiUserSetting", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "quality", + "fieldName": "quality", + "columnType": 0, + "isNullable": false, + "columnDefault": "'best'", + "dartType": "protocol:AiQuality" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "ai_user_setting_fk_0", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "ai_user_setting_user_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "assistant_message", + "dartName": "AssistantMessage", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "threadId", + "fieldName": "threadId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "role", + "fieldName": "role", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "contentJson", + "fieldName": "contentJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "displayText", + "fieldName": "displayText", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "toolCallsJson", + "fieldName": "toolCallsJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "visible", + "fieldName": "visible", + "columnType": 1, + "isNullable": false, + "columnDefault": "true", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "replay", + "fieldName": "replay", + "columnType": 1, + "isNullable": false, + "columnDefault": "true", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "runId", + "fieldName": "runId", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "stopReason", + "fieldName": "stopReason", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "assistant_message_fk_0", + "columns": [ + "threadId" + ], + "referenceTable": "assistant_thread", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "assistant_message_thread_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "threadId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "assistant_thread", + "dartName": "AssistantThread", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "title", + "fieldName": "title", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "contextRevision", + "fieldName": "contextRevision", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "contextMarkdown", + "fieldName": "contextMarkdown", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "assistant_thread_fk_0", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "assistant_thread_fk_1", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "assistant_thread_user_item_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "updatedAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "banding", + "dartName": "Banding", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetId", + "fieldName": "sheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rangeJson", + "fieldName": "rangeJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "styleJson", + "fieldName": "styleJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "banding_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "banding_fk_1", + "columns": [ + "sheetId" + ], + "referenceTable": "sheet", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "banding_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "basic_filter", + "dartName": "BasicFilter", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetId", + "fieldName": "sheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rangeJson", + "fieldName": "rangeJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "criteriaJson", + "fieldName": "criteriaJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sortJson", + "fieldName": "sortJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "basic_filter_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "basic_filter_fk_1", + "columns": [ + "sheetId" + ], + "referenceTable": "sheet", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "basic_filter_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "board_ai_usage", + "dartName": "BoardAiUsage", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "day", + "fieldName": "day", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "provider", + "fieldName": "provider", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "model", + "fieldName": "model", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "feature", + "fieldName": "feature", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "requests", + "fieldName": "requests", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "inputTokens", + "fieldName": "inputTokens", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "outputTokens", + "fieldName": "outputTokens", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_ai_usage_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "day" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "provider" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "model" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "feature" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "board_bundle_suggestion", + "dartName": "BoardBundleSuggestion", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "title", + "fieldName": "title", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rationale", + "fieldName": "rationale", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "area", + "fieldName": "area", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:BoardArea?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "postIds", + "fieldName": "postIds", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "state", + "fieldName": "state", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "board_comment", + "dartName": "BoardComment", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "uuid", + "fieldName": "uuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "postId", + "fieldName": "postId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "taskId", + "fieldName": "taskId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authorId", + "fieldName": "authorId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "body", + "fieldName": "body", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "systemEvent", + "fieldName": "systemEvent", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "moderation", + "fieldName": "moderation", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:BoardModeration" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "moderationReason", + "fieldName": "moderationReason", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "needsCheck", + "fieldName": "needsCheck", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "editedAt", + "fieldName": "editedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "deletedAt", + "fieldName": "deletedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "removedAt", + "fieldName": "removedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "board_comment_fk_0", + "columns": [ + "postId" + ], + "referenceTable": "board_post", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "board_comment_fk_1", + "columns": [ + "taskId" + ], + "referenceTable": "board_task", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "board_comment_fk_2", + "columns": [ + "authorId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_comment_uuid_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "uuid" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_comment_post_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "postId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_comment_task_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "taskId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "board_flag", + "dartName": "BoardFlag", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "postId", + "fieldName": "postId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "commentId", + "fieldName": "commentId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "reason", + "fieldName": "reason", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:BoardFlagReason" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "note", + "fieldName": "note", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "board_flag_fk_0", + "columns": [ + "postId" + ], + "referenceTable": "board_post", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "board_flag_fk_1", + "columns": [ + "commentId" + ], + "referenceTable": "board_comment", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "board_flag_fk_2", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_flag_post_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "postId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_flag_comment_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "commentId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "board_github_delivery", + "dartName": "BoardGithubDelivery", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "deliveryId", + "fieldName": "deliveryId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "event", + "fieldName": "event", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "receivedAt", + "fieldName": "receivedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "payload", + "fieldName": "payload", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "processedAt", + "fieldName": "processedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "attempts", + "fieldName": "attempts", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_github_delivery_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "deliveryId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "board_moderation_log", + "dartName": "BoardModerationLog", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "adminId", + "fieldName": "adminId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "action", + "fieldName": "action", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "targetKind", + "fieldName": "targetKind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:BoardTargetKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "targetId", + "fieldName": "targetId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "beforeJson", + "fieldName": "beforeJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "afterJson", + "fieldName": "afterJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "reason", + "fieldName": "reason", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_moderation_log_target_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "targetKind" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "targetId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "board_post", + "dartName": "BoardPost", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authorId", + "fieldName": "authorId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kind", + "fieldName": "kind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:BoardPostKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "reportedKind", + "fieldName": "reportedKind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:BoardPostKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "area", + "fieldName": "area", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:BoardArea?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "size", + "fieldName": "size", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:BoardSize?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "aiLabels", + "fieldName": "aiLabels", + "columnType": 1, + "isNullable": false, + "columnDefault": "true", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "title", + "fieldName": "title", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "body", + "fieldName": "body", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "contextJson", + "fieldName": "contextJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "appHint", + "fieldName": "appHint", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "screenshotFileId", + "fieldName": "screenshotFileId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "status", + "fieldName": "status", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:BoardPostStatus" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "moderation", + "fieldName": "moderation", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:BoardModeration" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "moderationReason", + "fieldName": "moderationReason", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "needsCheck", + "fieldName": "needsCheck", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "editedByModerator", + "fieldName": "editedByModerator", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "triageState", + "fieldName": "triageState", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:BoardTriageState" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "triageJson", + "fieldName": "triageJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "triageAttempts", + "fieldName": "triageAttempts", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "suggestedTitle", + "fieldName": "suggestedTitle", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "summary", + "fieldName": "summary", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "duplicateOfId", + "fieldName": "duplicateOfId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "possibleDuplicateOfId", + "fieldName": "possibleDuplicateOfId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "duplicateHintDismissed", + "fieldName": "duplicateHintDismissed", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "declineReason", + "fieldName": "declineReason", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "taskId", + "fieldName": "taskId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "score", + "fieldName": "score", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "voteCount", + "fieldName": "voteCount", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "commentCount", + "fieldName": "commentCount", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "flagCount", + "fieldName": "flagCount", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "editedAt", + "fieldName": "editedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "deletedAt", + "fieldName": "deletedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "removedAt", + "fieldName": "removedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "board_post_fk_0", + "columns": [ + "authorId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "board_post_fk_1", + "columns": [ + "screenshotFileId" + ], + "referenceTable": "stored_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "board_post_fk_2", + "columns": [ + "taskId" + ], + "referenceTable": "board_task", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_post_list_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "moderation" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "kind" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "status" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "score" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_post_author_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "authorId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_post_task_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "taskId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "board_pull_request", + "dartName": "BoardPullRequest", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "prNumber", + "fieldName": "prNumber", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "taskId", + "fieldName": "taskId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authorLogin", + "fieldName": "authorLogin", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "headSha", + "fieldName": "headSha", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "state", + "fieldName": "state", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "gateState", + "fieldName": "gateState", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "gateReason", + "fieldName": "gateReason", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "gateFirstFailedAt", + "fieldName": "gateFirstFailedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "gateCommentId", + "fieldName": "gateCommentId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "reviewCommentId", + "fieldName": "reviewCommentId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastReviewSha", + "fieldName": "lastReviewSha", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastReviewJson", + "fieldName": "lastReviewJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastReviewAt", + "fieldName": "lastReviewAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "reviewDay", + "fieldName": "reviewDay", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "reviewCount", + "fieldName": "reviewCount", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "mergeCommitSha", + "fieldName": "mergeCommitSha", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "reviewPendingSha", + "fieldName": "reviewPendingSha", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "reviewDueAt", + "fieldName": "reviewDueAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "board_pull_request_fk_0", + "columns": [ + "taskId" + ], + "referenceTable": "board_task", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_pull_request_number_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "prNumber" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "board_task", + "dartName": "BoardTask", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "title", + "fieldName": "title", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "area", + "fieldName": "area", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:BoardArea" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "size", + "fieldName": "size", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:BoardSize" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "status", + "fieldName": "status", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:BoardTaskStatus" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "promptBody", + "fieldName": "promptBody", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "promptGeneratedAt", + "fieldName": "promptGeneratedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "promptRequestedAt", + "fieldName": "promptRequestedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "promptNote", + "fieldName": "promptNote", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "promptExcludedCommentIds", + "fieldName": "promptExcludedCommentIds", + "columnType": 8, + "isNullable": true, + "dartType": "List?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "promptEditedById", + "fieldName": "promptEditedById", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "promptEditedAt", + "fieldName": "promptEditedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdById", + "fieldName": "createdById", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "publishedAt", + "fieldName": "publishedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "claimedById", + "fieldName": "claimedById", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "claimedAt", + "fieldName": "claimedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "claimExpiresAt", + "fieldName": "claimExpiresAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "claimWarnedAt", + "fieldName": "claimWarnedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "claimCode", + "fieldName": "claimCode", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "pullRequestUrl", + "fieldName": "pullRequestUrl", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "prNumber", + "fieldName": "prNumber", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "prAuthorLogin", + "fieldName": "prAuthorLogin", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "mergeCommitSha", + "fieldName": "mergeCommitSha", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "doneAt", + "fieldName": "doneAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "shippedDeploySha", + "fieldName": "shippedDeploySha", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "shippedAt", + "fieldName": "shippedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "board_task_fk_0", + "columns": [ + "claimedById" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_task_status_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "status" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_task_claim_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "claimedById" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "board_user_profile", + "dartName": "BoardUserProfile", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "githubLogin", + "fieldName": "githubLogin", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "blockedAt", + "fieldName": "blockedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "blockedUntil", + "fieldName": "blockedUntil", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "blockedReason", + "fieldName": "blockedReason", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "blockedById", + "fieldName": "blockedById", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "board_user_profile_fk_0", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_user_profile_user_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "board_vote", + "dartName": "BoardVote", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "postId", + "fieldName": "postId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "value", + "fieldName": "value", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "board_vote_fk_0", + "columns": [ + "postId" + ], + "referenceTable": "board_post", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "board_vote_fk_1", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_vote_unique_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "postId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_vote_recent_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "postId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "cell", + "dartName": "Cell", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetId", + "fieldName": "sheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rowId", + "fieldName": "rowId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "columnId", + "fieldName": "columnId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "content", + "fieldName": "content", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "note", + "fieldName": "note", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "numberFormat", + "fieldName": "numberFormat", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fontFamily", + "fieldName": "fontFamily", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fontSize", + "fieldName": "fontSize", + "columnType": 3, + "isNullable": true, + "dartType": "double?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "bold", + "fieldName": "bold", + "columnType": 1, + "isNullable": true, + "dartType": "bool?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "italic", + "fieldName": "italic", + "columnType": 1, + "isNullable": true, + "dartType": "bool?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "underline", + "fieldName": "underline", + "columnType": 1, + "isNullable": true, + "dartType": "bool?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "strikethrough", + "fieldName": "strikethrough", + "columnType": 1, + "isNullable": true, + "dartType": "bool?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "textColor", + "fieldName": "textColor", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fillColor", + "fieldName": "fillColor", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "hAlign", + "fieldName": "hAlign", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:HorizontalAlign?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "vAlign", + "fieldName": "vAlign", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:VerticalAlign?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "wrap", + "fieldName": "wrap", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:WrapStrategy?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rotation", + "fieldName": "rotation", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "borderTop", + "fieldName": "borderTop", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "borderRight", + "fieldName": "borderRight", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "borderBottom", + "fieldName": "borderBottom", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "borderLeft", + "fieldName": "borderLeft", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "linkUrl", + "fieldName": "linkUrl", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "cell_fk_0", + "columns": [ + "sheetId" + ], + "referenceTable": "sheet", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "cell_row_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "sheetId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "rowId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "cell_col_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "sheetId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "columnId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "cell_history", + "dartName": "CellHistory", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileUuid", + "fieldName": "fileUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetId", + "fieldName": "sheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rowId", + "fieldName": "rowId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "colId", + "fieldName": "colId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userUuid", + "fieldName": "userUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "actorKind", + "fieldName": "actorKind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:ActorKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "label", + "fieldName": "label", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "at", + "fieldName": "at", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "before", + "fieldName": "before", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "after", + "fieldName": "after", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "cell_history_cell_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileUuid" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "sheetId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "rowId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "colId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "at" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "cell_history_change_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileUuid" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "revision" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "rowId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "colId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "chart_link", + "dartName": "ChartLink", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "elementId", + "fieldName": "elementId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spreadsheetItemUuid", + "fieldName": "spreadsheetItemUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "chartObjectId", + "fieldName": "chartObjectId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetId", + "fieldName": "sheetId", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sourceSpecJson", + "fieldName": "sourceSpecJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "dataSnapshotJson", + "fieldName": "dataSnapshotJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sourceVersion", + "fieldName": "sourceVersion", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedBy", + "fieldName": "updatedBy", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "autoUpdate", + "fieldName": "autoUpdate", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "chart_link_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "chart_link_fk_1", + "columns": [ + "elementId" + ], + "referenceTable": "slide_element", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "chart_link_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "chart_link_element_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "elementId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "code_state", + "dartName": "CodeState", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "elementId", + "fieldName": "elementId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sortKey", + "fieldName": "sortKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "label", + "fieldName": "label", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "code", + "fieldName": "code", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "language", + "fieldName": "language", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "title", + "fieldName": "title", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "highlight", + "fieldName": "highlight", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "annotationsJson", + "fieldName": "annotationsJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "transitionJson", + "fieldName": "transitionJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "code_state_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "code_state_fk_1", + "columns": [ + "elementId" + ], + "referenceTable": "slide_element", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "code_state_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "code_state_element_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "elementId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "sortKey" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "comment", + "dartName": "Comment", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "threadId", + "fieldName": "threadId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "uuid", + "fieldName": "uuid", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authorId", + "fieldName": "authorId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authorKind", + "fieldName": "authorKind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:ActorKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "body", + "fieldName": "body", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "mentions", + "fieldName": "mentions", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "reactions", + "fieldName": "reactions", + "columnType": 0, + "isNullable": false, + "columnDefault": "'{}'", + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "editedAt", + "fieldName": "editedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "deletedAt", + "fieldName": "deletedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "systemEvent", + "fieldName": "systemEvent", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:CommentSystemEvent?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "publicationId", + "fieldName": "publicationId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "comment_fk_0", + "columns": [ + "threadId" + ], + "referenceTable": "comment_thread", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "comment_fk_1", + "columns": [ + "publicationId" + ], + "referenceTable": "publication", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "comment_thread_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "threadId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "comment_uuid_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "uuid" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "comment_created_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "comment_thread", + "dartName": "CommentThread", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "uuid", + "fieldName": "uuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "anchorKind", + "fieldName": "anchorKind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:CommentAnchorKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "anchorJson", + "fieldName": "anchorJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "quotedText", + "fieldName": "quotedText", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "status", + "fieldName": "status", + "columnType": 0, + "isNullable": false, + "columnDefault": "'open'", + "dartType": "protocol:CommentStatus" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdById", + "fieldName": "createdById", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "resolvedById", + "fieldName": "resolvedById", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "resolvedAt", + "fieldName": "resolvedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "assigneeId", + "fieldName": "assigneeId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "statusBeforeOrphan", + "fieldName": "statusBeforeOrphan", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:CommentStatus?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "orphanReasonJson", + "fieldName": "orphanReasonJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "suggestionId", + "fieldName": "suggestionId", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "comment_thread_fk_0", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "comment_thread_item_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "status" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "comment_thread_uuid_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "uuid" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "conditional_format_rule", + "dartName": "ConditionalFormatRule", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetId", + "fieldName": "sheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sortKey", + "fieldName": "sortKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rangesJson", + "fieldName": "rangesJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "ruleJson", + "fieldName": "ruleJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "enabled", + "fieldName": "enabled", + "columnType": 1, + "isNullable": false, + "columnDefault": "true", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "conditional_format_rule_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "conditional_format_rule_fk_1", + "columns": [ + "sheetId" + ], + "referenceTable": "sheet", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "conditional_format_rule_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "data_validation_rule", + "dartName": "DataValidationRule", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetId", + "fieldName": "sheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rangesJson", + "fieldName": "rangesJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "criteriaJson", + "fieldName": "criteriaJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "strict", + "fieldName": "strict", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "showDropdown", + "fieldName": "showDropdown", + "columnType": 1, + "isNullable": false, + "columnDefault": "true", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "displayStyle", + "fieldName": "displayStyle", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "helpText", + "fieldName": "helpText", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "data_validation_rule_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "data_validation_rule_fk_1", + "columns": [ + "sheetId" + ], + "referenceTable": "sheet", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "data_validation_rule_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "deck", + "dartName": "Deck", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "title", + "fieldName": "title", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "width", + "fieldName": "width", + "columnType": 3, + "isNullable": false, + "columnDefault": "1920.0", + "dartType": "double" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "height", + "fieldName": "height", + "columnType": 3, + "isNullable": false, + "columnDefault": "1080.0", + "dartType": "double" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sizePreset", + "fieldName": "sizePreset", + "columnType": 0, + "isNullable": false, + "columnDefault": "'widescreen16x9'", + "dartType": "protocol:SlideSizePreset" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "themeId", + "fieldName": "themeId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "appearance", + "fieldName": "appearance", + "columnType": 0, + "isNullable": false, + "columnDefault": "'light'", + "dartType": "protocol:DeckAppearance" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "language", + "fieldName": "language", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "showSlideNumbers", + "fieldName": "showSlideNumbers", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "hideNumberOnTitle", + "fieldName": "hideNumberOnTitle", + "columnType": 1, + "isNullable": false, + "columnDefault": "true", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "firstSlideNumber", + "fieldName": "firstSlideNumber", + "columnType": 6, + "isNullable": false, + "columnDefault": "1", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "footerText", + "fieldName": "footerText", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "defaultsJson", + "fieldName": "defaultsJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "guidesJson", + "fieldName": "guidesJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "presentJson", + "fieldName": "presentJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdBy", + "fieldName": "createdBy", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "deck_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "deck_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "deck_theme", + "dartName": "DeckTheme", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "deckId", + "fieldName": "deckId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sourceKey", + "fieldName": "sourceKey", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "colorsJson", + "fieldName": "colorsJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fontsJson", + "fieldName": "fontsJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "textStylesJson", + "fieldName": "textStylesJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "backgroundJson", + "fieldName": "backgroundJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "shapeStyleJson", + "fieldName": "shapeStyleJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "tableStyleJson", + "fieldName": "tableStyleJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "codeStyleJson", + "fieldName": "codeStyleJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "chartStyleJson", + "fieldName": "chartStyleJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sortKey", + "fieldName": "sortKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "deck_theme_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "deck_theme_fk_1", + "columns": [ + "deckId" + ], + "referenceTable": "deck", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "deck_theme_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "deck_theme_deck_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "deckId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "dimension_group", + "dartName": "DimensionGroup", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetId", + "fieldName": "sheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "dimension", + "fieldName": "dimension", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:Dimension" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "startId", + "fieldName": "startId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "endId", + "fieldName": "endId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "depth", + "fieldName": "depth", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "collapsed", + "fieldName": "collapsed", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "dimension_group_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "dimension_group_fk_1", + "columns": [ + "sheetId" + ], + "referenceTable": "sheet", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "dimension_group_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "document", + "dartName": "Document", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "uuid", + "fieldName": "uuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "headRevision", + "fieldName": "headRevision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "latestSnapshotRevision", + "fieldName": "latestSnapshotRevision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "themeId", + "fieldName": "themeId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "pageSetupJson", + "fieldName": "pageSetupJson", + "columnType": 0, + "isNullable": false, + "columnDefault": "'{}'", + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "language", + "fieldName": "language", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "frontMatter", + "fieldName": "frontMatter", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "charCount", + "fieldName": "charCount", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "wordCount", + "fieldName": "wordCount", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "document_fk_0", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "document_uuid_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "uuid" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "document_item_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "document_import_report", + "dartName": "DocumentImportReport", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "documentId", + "fieldName": "documentId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "warningsJson", + "fieldName": "warningsJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "seenAt", + "fieldName": "seenAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "document_import_report_fk_0", + "columns": [ + "documentId" + ], + "referenceTable": "document", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "document_import_report_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "documentId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "document_meta_change", + "dartName": "DocumentMetaChange", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "documentId", + "fieldName": "documentId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "field", + "fieldName": "field", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "clientOpId", + "fieldName": "clientOpId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "beforeJson", + "fieldName": "beforeJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "afterJson", + "fieldName": "afterJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authorId", + "fieldName": "authorId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "actorKind", + "fieldName": "actorKind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:ActorKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "document_meta_change_fk_0", + "columns": [ + "documentId" + ], + "referenceTable": "document", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "document_meta_change_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "documentId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "document_meta_change_client_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "documentId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "clientOpId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "document_op", + "dartName": "DocumentOp", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "documentId", + "fieldName": "documentId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "clientOpId", + "fieldName": "clientOpId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authorId", + "fieldName": "authorId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "actorKind", + "fieldName": "actorKind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:ActorKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sessionId", + "fieldName": "sessionId", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kind", + "fieldName": "kind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:DocumentOpKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "baseRevision", + "fieldName": "baseRevision", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "deltaJson", + "fieldName": "deltaJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "inverseJson", + "fieldName": "inverseJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "document_op_fk_0", + "columns": [ + "documentId" + ], + "referenceTable": "document", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "document_op_rev_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "documentId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "revision" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "document_op_client_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "documentId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "clientOpId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "document_op_created_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "brin", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "document_snapshot", + "dartName": "DocumentSnapshot", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "documentId", + "fieldName": "documentId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "deltaJson", + "fieldName": "deltaJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "compressed", + "fieldName": "compressed", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "document_snapshot_fk_0", + "columns": [ + "documentId" + ], + "referenceTable": "document", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "document_snapshot_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "documentId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "revision" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "drive_item", + "dartName": "DriveItem", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "uuid", + "fieldName": "uuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kind", + "fieldName": "kind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:DriveItemKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "ownerId", + "fieldName": "ownerId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "parentId", + "fieldName": "parentId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "description", + "fieldName": "description", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "contentRef", + "fieldName": "contentRef", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "thumbnailFileId", + "fieldName": "thumbnailFileId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sizeBytes", + "fieldName": "sizeBytes", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "attachmentBytes", + "fieldName": "attachmentBytes", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kindMask", + "fieldName": "kindMask", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "mimeType", + "fieldName": "mimeType", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileCategory", + "fieldName": "fileCategory", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:FileCategory?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "uploadState", + "fieldName": "uploadState", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:FileUploadState?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileMetaJson", + "fieldName": "fileMetaJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "previewFileId", + "fieldName": "previewFileId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdById", + "fieldName": "createdById", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "modifiedAt", + "fieldName": "modifiedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "modifiedById", + "fieldName": "modifiedById", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "trashedAt", + "fieldName": "trashedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "trashedById", + "fieldName": "trashedById", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "templateOf", + "fieldName": "templateOf", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:TemplateCategory?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "templateKey", + "fieldName": "templateKey", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "editorsCanShare", + "fieldName": "editorsCanShare", + "columnType": 1, + "isNullable": false, + "columnDefault": "true", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "nonEditorsCanExport", + "fieldName": "nonEditorsCanExport", + "columnType": 1, + "isNullable": false, + "columnDefault": "true", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "viewersSeeComments", + "fieldName": "viewersSeeComments", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "searchText", + "fieldName": "searchText", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "drive_item_fk_0", + "columns": [ + "ownerId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 2 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "drive_item_fk_1", + "columns": [ + "parentId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "drive_item_uuid_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "uuid" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "drive_item_parent_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "parentId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "drive_item_owner_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "ownerId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "trashedAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "drive_item_content_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "contentRef" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "drive_item_template_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "templateOf" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "drive_item_upload_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "uploadState" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "drive_item_trashed_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "trashedAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "drive_item_permission", + "dartName": "DriveItemPermission", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "invitedEmail", + "fieldName": "invitedEmail", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "role", + "fieldName": "role", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:AccessRole" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "inheritedFromId", + "fieldName": "inheritedFromId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "grantedById", + "fieldName": "grantedById", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "grantedAt", + "fieldName": "grantedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "expiresAt", + "fieldName": "expiresAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "viaPublicationId", + "fieldName": "viaPublicationId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "drive_item_permission_fk_0", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "drive_item_permission_fk_1", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "drive_item_permission_fk_2", + "columns": [ + "viaPublicationId" + ], + "referenceTable": "publication", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "perm_item_user_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "inheritedFromId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "invitedEmail" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false, + "nullsDistinct": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "perm_user_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "perm_email_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "invitedEmail" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "perm_expires_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "expiresAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "perm_granted_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "grantedAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "drive_item_user_state", + "dartName": "DriveItemUserState", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "starred", + "fieldName": "starred", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastOpenedAt", + "fieldName": "lastOpenedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastEditedAt", + "fieldName": "lastEditedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "pinnedOffline", + "fieldName": "pinnedOffline", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "shortcutParentId", + "fieldName": "shortcutParentId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "viaLink", + "fieldName": "viaLink", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "drive_item_user_state_fk_0", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "drive_item_user_state_fk_1", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "drive_item_user_state_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "drive_item_user_recent_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "lastOpenedAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "embedded_object", + "dartName": "EmbeddedObject", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetId", + "fieldName": "sheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kind", + "fieldName": "kind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:EmbeddedObjectKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "anchorJson", + "fieldName": "anchorJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "specJson", + "fieldName": "specJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "zIndex", + "fieldName": "zIndex", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "title", + "fieldName": "title", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "altText", + "fieldName": "altText", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "embedded_object_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "embedded_object_fk_1", + "columns": [ + "sheetId" + ], + "referenceTable": "sheet", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "embedded_object_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "feedback_report", + "dartName": "FeedbackReport", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kind", + "fieldName": "kind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:FeedbackKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "message", + "fieldName": "message", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "app", + "fieldName": "app", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "appVersion", + "fieldName": "appVersion", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "platform", + "fieldName": "platform", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "route", + "fieldName": "route", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "stackTrace", + "fieldName": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "contextJson", + "fieldName": "contextJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "feedback_report_created_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "filter_view", + "dartName": "FilterView", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetId", + "fieldName": "sheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rangeJson", + "fieldName": "rangeJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "criteriaJson", + "fieldName": "criteriaJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sortJson", + "fieldName": "sortJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdBy", + "fieldName": "createdBy", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "filter_view_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "filter_view_fk_1", + "columns": [ + "sheetId" + ], + "referenceTable": "sheet", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "filter_view_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "headless_change", + "dartName": "HeadlessChange", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "changeId", + "fieldName": "changeId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kind", + "fieldName": "kind", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "documentId", + "fieldName": "documentId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "inverseJson", + "fieldName": "inverseJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "metaField", + "fieldName": "metaField", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "metaBeforeJson", + "fieldName": "metaBeforeJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "metaAfterJson", + "fieldName": "metaAfterJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "actorKind", + "fieldName": "actorKind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:ActorKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "label", + "fieldName": "label", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "toolName", + "fieldName": "toolName", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revertedAt", + "fieldName": "revertedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "headless_change_fk_0", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "headless_change_id_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "changeId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "headless_change_created_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "item_version", + "dartName": "ItemVersion", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kind", + "fieldName": "kind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:VersionKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdById", + "fieldName": "createdById", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authors", + "fieldName": "authors", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "storageKind", + "fieldName": "storageKind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:VersionStorage" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "snapshotFileId", + "fieldName": "snapshotFileId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sizeBytes", + "fieldName": "sizeBytes", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "item_version_fk_0", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "item_version_item_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "item_version_state", + "dartName": "ItemVersionState", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastEditAt", + "fieldName": "lastEditAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "dirtySince", + "fieldName": "dirtySince", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastVersionAt", + "fieldName": "lastVersionAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "editorsSinceLastVersion", + "fieldName": "editorsSinceLastVersion", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastRevision", + "fieldName": "lastRevision", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "capturingSince", + "fieldName": "capturingSince", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "item_version_state_fk_0", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "item_version_state_item_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "item_version_state_dirty_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "dirtySince" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "item_view_day", + "dartName": "ItemViewDay", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "day", + "fieldName": "day", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "views", + "fieldName": "views", + "columnType": 6, + "isNullable": false, + "columnDefault": "1", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastViewedAt", + "fieldName": "lastViewedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "item_view_day_fk_0", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "item_view_day_fk_1", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "item_view_day_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "day" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "item_view_day_item_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "day" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "macro", + "dartName": "Macro", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "projectId", + "fieldName": "projectId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "functionName", + "fieldName": "functionName", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "shortcutSlot", + "fieldName": "shortcutSlot", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "macro_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "macro_fk_1", + "columns": [ + "projectId" + ], + "referenceTable": "script_project", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "macro_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "merged_range", + "dartName": "MergedRange", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetId", + "fieldName": "sheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rangeJson", + "fieldName": "rangeJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "merged_range_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "merged_range_fk_1", + "columns": [ + "sheetId" + ], + "referenceTable": "sheet", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "merged_range_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "named_range", + "dartName": "NamedRange", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spreadsheetId", + "fieldName": "spreadsheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rangeJson", + "fieldName": "rangeJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "formula", + "fieldName": "formula", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "comment", + "fieldName": "comment", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "metaJson", + "fieldName": "metaJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "named_range_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "named_range_fk_1", + "columns": [ + "spreadsheetId" + ], + "referenceTable": "spreadsheet", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "named_range_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "notification", + "dartName": "UserNotification", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kind", + "fieldName": "kind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:NotificationKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "actorId", + "fieldName": "actorId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "payload", + "fieldName": "payload", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "readAt", + "fieldName": "readAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "emailedAt", + "fieldName": "emailedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "emailPending", + "fieldName": "emailPending", + "columnType": 1, + "isNullable": true, + "columnDefault": "false", + "dartType": "bool?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "notification_fk_0", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "notification_user_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "notification_email_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "emailPending" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "notification_created_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "brin", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "ownership_transfer", + "dartName": "OwnershipTransfer", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fromUserId", + "fieldName": "fromUserId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "toUserId", + "fieldName": "toUserId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "handledAt", + "fieldName": "handledAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "accepted", + "fieldName": "accepted", + "columnType": 1, + "isNullable": true, + "dartType": "bool?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "ownership_transfer_fk_0", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "ownership_transfer_fk_1", + "columns": [ + "toUserId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "ownership_transfer_item_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "handledAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "personal_access_token", + "dartName": "PersonalAccessToken", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "tokenHash", + "fieldName": "tokenHash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "prefix", + "fieldName": "prefix", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "scopes", + "fieldName": "scopes", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "expiresAt", + "fieldName": "expiresAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastUsedAt", + "fieldName": "lastUsedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revokedAt", + "fieldName": "revokedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "personal_access_token_fk_0", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "personal_access_token_user_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "personal_access_token_hash_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "tokenHash" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "pivot_table", + "dartName": "PivotTable", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetId", + "fieldName": "sheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "anchorRowId", + "fieldName": "anchorRowId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "anchorColId", + "fieldName": "anchorColId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sourceRangeJson", + "fieldName": "sourceRangeJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "specJson", + "fieldName": "specJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "pivot_table_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "pivot_table_fk_1", + "columns": [ + "sheetId" + ], + "referenceTable": "sheet", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "pivot_table_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "protected_range", + "dartName": "ProtectedRange", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetId", + "fieldName": "sheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rangeJson", + "fieldName": "rangeJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "exceptRangesJson", + "fieldName": "exceptRangesJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "description", + "fieldName": "description", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "warningOnly", + "fieldName": "warningOnly", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "editorsJson", + "fieldName": "editorsJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdBy", + "fieldName": "createdBy", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "protected_range_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "protected_range_fk_1", + "columns": [ + "sheetId" + ], + "referenceTable": "sheet", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "protected_range_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "publication", + "dartName": "Publication", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "publicId", + "fieldName": "publicId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "ownerId", + "fieldName": "ownerId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "siteUrl", + "fieldName": "siteUrl", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "webhookUrl", + "fieldName": "webhookUrl", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "verifiedHost", + "fieldName": "verifiedHost", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "verifiedAt", + "fieldName": "verifiedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "templateItemId", + "fieldName": "templateItemId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "termsUrl", + "fieldName": "termsUrl", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fields", + "fieldName": "fields", + "columnType": 8, + "isNullable": false, + "dartType": "protocol:PublicationFields" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "signingSecret", + "fieldName": "signingSecret", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "previousSigningSecret", + "fieldName": "previousSigningSecret", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "previousSecretUntil", + "fieldName": "previousSecretUntil", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "apiKeyHash", + "fieldName": "apiKeyHash", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "apiKeyLast4", + "fieldName": "apiKeyLast4", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "enabled", + "fieldName": "enabled", + "columnType": 1, + "isNullable": false, + "columnDefault": "true", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "publication_fk_0", + "columns": [ + "ownerId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "publication_fk_1", + "columns": [ + "templateItemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "publication_public_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "publicId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "publication_owner_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "ownerId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "publication_api_key_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "apiKeyHash" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "publication_block", + "dartName": "PublicationBlock", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "publicationId", + "fieldName": "publicationId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "at", + "fieldName": "at", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "publication_block_fk_0", + "columns": [ + "publicationId" + ], + "referenceTable": "publication", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "publication_block_fk_1", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "publication_block_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "publicationId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "publication_consent", + "dartName": "PublicationConsent", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "publicationId", + "fieldName": "publicationId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "consentKey", + "fieldName": "consentKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "at", + "fieldName": "at", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "publication_consent_fk_0", + "columns": [ + "publicationId" + ], + "referenceTable": "publication", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "publication_consent_fk_1", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "publication_consent_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "publicationId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "publication_delivery", + "dartName": "PublicationDelivery", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "publicationId", + "fieldName": "publicationId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "submissionId", + "fieldName": "submissionId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "webhookId", + "fieldName": "webhookId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "type", + "fieldName": "type", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sequence", + "fieldName": "sequence", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "payload", + "fieldName": "payload", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "attempts", + "fieldName": "attempts", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "nextAttemptAt", + "fieldName": "nextAttemptAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "leaseUntil", + "fieldName": "leaseUntil", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastStatus", + "fieldName": "lastStatus", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastError", + "fieldName": "lastError", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "deliveredAt", + "fieldName": "deliveredAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "failedAt", + "fieldName": "failedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "publication_delivery_fk_0", + "columns": [ + "publicationId" + ], + "referenceTable": "publication", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "publication_delivery_fk_1", + "columns": [ + "submissionId" + ], + "referenceTable": "submission", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "publication_delivery_webhook_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "webhookId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "publication_delivery_due_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "nextAttemptAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "publication_delivery_publication_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "publicationId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "publication_moderator", + "dartName": "PublicationModerator", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "publicationId", + "fieldName": "publicationId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "email", + "fieldName": "email", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "publication_moderator_fk_0", + "columns": [ + "publicationId" + ], + "referenceTable": "publication", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "publication_moderator_fk_1", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "publication_moderator_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "publicationId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "publication_moderator_user_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "rev_file", + "dartName": "RevFile", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileUuid", + "fieldName": "fileUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kind", + "fieldName": "kind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:RevFileKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "headRevision", + "fieldName": "headRevision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "prunedBelow", + "fieldName": "prunedBelow", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "initPending", + "fieldName": "initPending", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "purging", + "fieldName": "purging", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "schemaHash", + "fieldName": "schemaHash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "stats", + "fieldName": "stats", + "columnType": 0, + "isNullable": false, + "columnDefault": "'{}'", + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "contentCount", + "fieldName": "contentCount", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "rev_file_fk_0", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 2 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "rev_file_uuid_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileUuid" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "rev_file_item_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "rev_hook_state", + "dartName": "RevHookState", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "cursorsJson", + "fieldName": "cursorsJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "leaseOwner", + "fieldName": "leaseOwner", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "leaseUntil", + "fieldName": "leaseUntil", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "attempts", + "fieldName": "attempts", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastError", + "fieldName": "lastError", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "nextAttemptAt", + "fieldName": "nextAttemptAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "rev_hook_state_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "rev_hook_state_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "rev_hook_state_due_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "nextAttemptAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "rev_op", + "dartName": "RevOp", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "clientOpId", + "fieldName": "clientOpId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "baseRevision", + "fieldName": "baseRevision", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authorId", + "fieldName": "authorId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authorUuid", + "fieldName": "authorUuid", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sessionId", + "fieldName": "sessionId", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "onBehalfOfSessionId", + "fieldName": "onBehalfOfSessionId", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "actorKind", + "fieldName": "actorKind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:ActorKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "label", + "fieldName": "label", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "groupId", + "fieldName": "groupId", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "groupIndex", + "fieldName": "groupIndex", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "groupLast", + "fieldName": "groupLast", + "columnType": 1, + "isNullable": false, + "columnDefault": "true", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "recordId", + "fieldName": "recordId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "offline", + "fieldName": "offline", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "payload", + "fieldName": "payload", + "columnType": 5, + "isNullable": true, + "dartType": "dart:typed_data:ByteData?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "changeCount", + "fieldName": "changeCount", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "summaryJson", + "fieldName": "summaryJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "detailJson", + "fieldName": "detailJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "outcomeJson", + "fieldName": "outcomeJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "appliedEqualsSubmitted", + "fieldName": "appliedEqualsSubmitted", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "clientCreatedAt", + "fieldName": "clientCreatedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "committedAt", + "fieldName": "committedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "rev_op_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "rev_op_rev_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "revision" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "rev_op_client_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "clientOpId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "rev_op_record_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "recordId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "rev_op_committed_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "committedAt" + } + ], + "type": "brin", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "script_authorization", + "dartName": "ScriptAuthorization", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spreadsheetUuid", + "fieldName": "spreadsheetUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "scopes", + "fieldName": "scopes", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "grantedAt", + "fieldName": "grantedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revokedAt", + "fieldName": "revokedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "script_auth_user_sheet_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "spreadsheetUuid" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "script_build", + "dartName": "ScriptBuild", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "projectId", + "fieldName": "projectId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "status", + "fieldName": "status", + "columnType": 0, + "isNullable": false, + "columnDefault": "'ok'", + "dartType": "protocol:ScriptBuildStatus" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sourceHash", + "fieldName": "sourceHash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "bytecodeFileUuid", + "fieldName": "bytecodeFileUuid", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "diagnosticsJson", + "fieldName": "diagnosticsJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "exportsJson", + "fieldName": "exportsJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "apiVersion", + "fieldName": "apiVersion", + "columnType": 6, + "isNullable": false, + "columnDefault": "1", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "compilerVersion", + "fieldName": "compilerVersion", + "columnType": 0, + "isNullable": false, + "columnDefault": "''", + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "requestedBy", + "fieldName": "requestedBy", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastGoodSourceHash", + "fieldName": "lastGoodSourceHash", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastGoodBytecodeFileUuid", + "fieldName": "lastGoodBytecodeFileUuid", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastGoodExportsJson", + "fieldName": "lastGoodExportsJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastGoodBuiltAt", + "fieldName": "lastGoodBuiltAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "positionsFileUuid", + "fieldName": "positionsFileUuid", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "builtAt", + "fieldName": "builtAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "script_build_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "script_build_fk_1", + "columns": [ + "projectId" + ], + "referenceTable": "script_project", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "script_build_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "script_execution", + "dartName": "ScriptExecution", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "uuid", + "fieldName": "uuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spreadsheetUuid", + "fieldName": "spreadsheetUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "projectId", + "fieldName": "projectId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "functionName", + "fieldName": "functionName", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kind", + "fieldName": "kind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:ScriptExecutionKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "triggerId", + "fieldName": "triggerId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "runAsUserId", + "fieldName": "runAsUserId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "runtime", + "fieldName": "runtime", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:ScriptRuntimeKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "status", + "fieldName": "status", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:ScriptExecutionStatus" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "buildSourceHash", + "fieldName": "buildSourceHash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "startedAt", + "fieldName": "startedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "durationMs", + "fieldName": "durationMs", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "logs", + "fieldName": "logs", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "errorMessage", + "fieldName": "errorMessage", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "errorStackJson", + "fieldName": "errorStackJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "changeId", + "fieldName": "changeId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "cellsRead", + "fieldName": "cellsRead", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "cellsWritten", + "fieldName": "cellsWritten", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fetchCalls", + "fieldName": "fetchCalls", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "callCount", + "fieldName": "callCount", + "columnType": 6, + "isNullable": false, + "columnDefault": "1", + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "script_exec_uuid_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "uuid" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "script_exec_sheet_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "spreadsheetUuid" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "startedAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "script_exec_user_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "startedAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "script_file", + "dartName": "ScriptFile", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "projectId", + "fieldName": "projectId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sortKey", + "fieldName": "sortKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "source", + "fieldName": "source", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "contentHash", + "fieldName": "contentHash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedBy", + "fieldName": "updatedBy", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "script_file_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "script_file_fk_1", + "columns": [ + "projectId" + ], + "referenceTable": "script_project", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "script_file_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "script_job", + "dartName": "ScriptJob", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kind", + "fieldName": "kind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:ScriptExecutionKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spreadsheetUuid", + "fieldName": "spreadsheetUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemUuid", + "fieldName": "itemUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "triggerId", + "fieldName": "triggerId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "runAsUserId", + "fieldName": "runAsUserId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "functionName", + "fieldName": "functionName", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "payloadJson", + "fieldName": "payloadJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "status", + "fieldName": "status", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:ScriptExecutionStatus" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "enqueuedAt", + "fieldName": "enqueuedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "leaseOwner", + "fieldName": "leaseOwner", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "leaseUntil", + "fieldName": "leaseUntil", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "attempts", + "fieldName": "attempts", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "coalesced", + "fieldName": "coalesced", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "resultJson", + "fieldName": "resultJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "finishedAt", + "fieldName": "finishedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "script_job_status_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "status" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "enqueuedAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "script_job_trigger_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "triggerId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "status" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "script_job_user_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "runAsUserId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "status" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "script_project", + "dartName": "ScriptProject", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spreadsheetId", + "fieldName": "spreadsheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "settingsJson", + "fieldName": "settingsJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "script_project_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "script_project_fk_1", + "columns": [ + "spreadsheetId" + ], + "referenceTable": "spreadsheet", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "script_project_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "script_property", + "dartName": "ScriptProperty", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "projectId", + "fieldName": "projectId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "key", + "fieldName": "key", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "value", + "fieldName": "value", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "script_property_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "script_property_fk_1", + "columns": [ + "projectId" + ], + "referenceTable": "script_project", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "script_property_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "script_quota_usage", + "dartName": "ScriptQuotaUsage", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "day", + "fieldName": "day", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "serverRuntimeMs", + "fieldName": "serverRuntimeMs", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "clientRuntimeMs", + "fieldName": "clientRuntimeMs", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "urlFetchCalls", + "fieldName": "urlFetchCalls", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "urlFetchBytes", + "fieldName": "urlFetchBytes", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "triggerRuns", + "fieldName": "triggerRuns", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "script_quota_user_day_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "day" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "script_trigger", + "dartName": "ScriptTrigger", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "projectId", + "fieldName": "projectId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kind", + "fieldName": "kind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:TriggerKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "functionName", + "fieldName": "functionName", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "scheduleJson", + "fieldName": "scheduleJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "runAsUserId", + "fieldName": "runAsUserId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "enabled", + "fieldName": "enabled", + "columnType": 1, + "isNullable": false, + "columnDefault": "true", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "optionsJson", + "fieldName": "optionsJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "script_trigger_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "script_trigger_fk_1", + "columns": [ + "projectId" + ], + "referenceTable": "script_project", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "script_trigger_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "script_trigger_state", + "dartName": "ScriptTriggerState", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "triggerId", + "fieldName": "triggerId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spreadsheetUuid", + "fieldName": "spreadsheetUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "scheduleJson", + "fieldName": "scheduleJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "nextRunAt", + "fieldName": "nextRunAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastRunAt", + "fieldName": "lastRunAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastStatus", + "fieldName": "lastStatus", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:ScriptExecutionStatus?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "consecutiveFailures", + "fieldName": "consecutiveFailures", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "disabledReason", + "fieldName": "disabledReason", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "runningSince", + "fieldName": "runningSince", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastNotifiedAt", + "fieldName": "lastNotifiedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "script_trigger_state_id_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "triggerId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "script_trigger_state_due_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "nextRunAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "script_user_property", + "dartName": "ScriptUserProperty", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileUuid", + "fieldName": "fileUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "key", + "fieldName": "key", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "value", + "fieldName": "value", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "script_user_property_fk_0", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "script_user_property_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileUuid" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "key" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "server_change_record", + "dartName": "ServerChangeRecord", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "changeId", + "fieldName": "changeId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileUuid", + "fieldName": "fileUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "actorKind", + "fieldName": "actorKind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:ActorKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "label", + "fieldName": "label", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "inverseJson", + "fieldName": "inverseJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "inverseFileId", + "fieldName": "inverseFileId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "forwardFileId", + "fieldName": "forwardFileId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "recordId", + "fieldName": "recordId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "cellsAffected", + "fieldName": "cellsAffected", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "expiresAt", + "fieldName": "expiresAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revertedAt", + "fieldName": "revertedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revertChangeId", + "fieldName": "revertChangeId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "server_change_record_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "recordId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "server_change_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileUuid" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "server_change_id_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "changeId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "share_link", + "dartName": "ShareLink", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "token", + "fieldName": "token", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "role", + "fieldName": "role", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:AccessRole?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdById", + "fieldName": "createdById", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "share_link_fk_0", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "share_link_item_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "share_link_token_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "token" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "sheet", + "dartName": "Sheet", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spreadsheetId", + "fieldName": "spreadsheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sortKey", + "fieldName": "sortKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kind", + "fieldName": "kind", + "columnType": 0, + "isNullable": false, + "columnDefault": "'grid'", + "dartType": "protocol:SheetKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "hidden", + "fieldName": "hidden", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "tabColor", + "fieldName": "tabColor", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rightToLeft", + "fieldName": "rightToLeft", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "showGridlines", + "fieldName": "showGridlines", + "columnType": 1, + "isNullable": false, + "columnDefault": "true", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "frozenRows", + "fieldName": "frozenRows", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "frozenColumns", + "fieldName": "frozenColumns", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "defaultRowHeight", + "fieldName": "defaultRowHeight", + "columnType": 3, + "isNullable": false, + "columnDefault": "21.0", + "dartType": "double" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "defaultColumnWidth", + "fieldName": "defaultColumnWidth", + "columnType": 3, + "isNullable": false, + "columnDefault": "100.0", + "dartType": "double" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "formatJson", + "fieldName": "formatJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "printSettingsJson", + "fieldName": "printSettingsJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "sheet_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "sheet_fk_1", + "columns": [ + "spreadsheetId" + ], + "referenceTable": "spreadsheet", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "sheet_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "sheet_order_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "spreadsheetId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "sortKey" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "sheet_column", + "dartName": "SheetColumn", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetId", + "fieldName": "sheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sortKey", + "fieldName": "sortKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "width", + "fieldName": "width", + "columnType": 3, + "isNullable": true, + "dartType": "double?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "hidden", + "fieldName": "hidden", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "formatJson", + "fieldName": "formatJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "sheet_column_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "sheet_column_fk_1", + "columns": [ + "sheetId" + ], + "referenceTable": "sheet", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "sheet_column_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "sheet_column_order_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "sheetId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "sortKey" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "sheet_row", + "dartName": "SheetRow", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetId", + "fieldName": "sheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sortKey", + "fieldName": "sortKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "height", + "fieldName": "height", + "columnType": 3, + "isNullable": true, + "dartType": "double?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "hidden", + "fieldName": "hidden", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "formatJson", + "fieldName": "formatJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "sheet_row_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "sheet_row_fk_1", + "columns": [ + "sheetId" + ], + "referenceTable": "sheet", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "sheet_row_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "sheet_row_order_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "sheetId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "sortKey" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "sheets_import_job", + "dartName": "SheetsImportJob", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "uuid", + "fieldName": "uuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authUserId", + "fieldName": "authUserId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spreadsheetUuid", + "fieldName": "spreadsheetUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "uploadFileId", + "fieldName": "uploadFileId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileName", + "fieldName": "fileName", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "format", + "fieldName": "format", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "optionsJson", + "fieldName": "optionsJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "activeSheetId", + "fieldName": "activeSheetId", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "status", + "fieldName": "status", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:SheetsImportStatus" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "progressDone", + "fieldName": "progressDone", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "progressTotal", + "fieldName": "progressTotal", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "reportJson", + "fieldName": "reportJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetIdsJson", + "fieldName": "sheetIdsJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "changeId", + "fieldName": "changeId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "errorCode", + "fieldName": "errorCode", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "error", + "fieldName": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "cancelRequested", + "fieldName": "cancelRequested", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "leaseOwner", + "fieldName": "leaseOwner", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "leaseUntil", + "fieldName": "leaseUntil", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "sheets_import_job_uuid_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "uuid" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "sheets_import_job_user_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "status" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "sheets_snapshot_index", + "dartName": "SheetsSnapshotIndex", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemVersionId", + "fieldName": "itemVersionId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetsJson", + "fieldName": "sheetsJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "changedRangesJson", + "fieldName": "changedRangesJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authorIds", + "fieldName": "authorIds", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "diffFileId", + "fieldName": "diffFileId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "sheets_snapshot_index_fk_0", + "columns": [ + "itemVersionId" + ], + "referenceTable": "item_version", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "sheets_snapshot_index_version_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemVersionId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "slide", + "dartName": "Slide", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "deckId", + "fieldName": "deckId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sortKey", + "fieldName": "sortKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "groupId", + "fieldName": "groupId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "layoutId", + "fieldName": "layoutId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "backgroundJson", + "fieldName": "backgroundJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "skipped", + "fieldName": "skipped", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "notes", + "fieldName": "notes", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "transitionJson", + "fieldName": "transitionJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "hideMasterElements", + "fieldName": "hideMasterElements", + "columnType": 1, + "isNullable": true, + "dartType": "bool?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "timingsJson", + "fieldName": "timingsJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_fk_1", + "columns": [ + "deckId" + ], + "referenceTable": "deck", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_order_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "deckId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "sortKey" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "slide_build", + "dartName": "SlideBuild", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "slideId", + "fieldName": "slideId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "elementId", + "fieldName": "elementId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kind", + "fieldName": "kind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:BuildKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "effect", + "fieldName": "effect", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sortKey", + "fieldName": "sortKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "trigger", + "fieldName": "trigger", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:BuildTrigger" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "delayMs", + "fieldName": "delayMs", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "durationMs", + "fieldName": "durationMs", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "easing", + "fieldName": "easing", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "optionsJson", + "fieldName": "optionsJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_build_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_build_fk_1", + "columns": [ + "slideId" + ], + "referenceTable": "slide", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_build_fk_2", + "columns": [ + "elementId" + ], + "referenceTable": "slide_element", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_build_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_build_slide_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "slideId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "sortKey" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_build_element_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "elementId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "slide_element", + "dartName": "SlideElement", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "slideId", + "fieldName": "slideId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "layoutId", + "fieldName": "layoutId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "masterId", + "fieldName": "masterId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "parentId", + "fieldName": "parentId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kind", + "fieldName": "kind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:SlideElementKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "x", + "fieldName": "x", + "columnType": 3, + "isNullable": true, + "dartType": "double?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "y", + "fieldName": "y", + "columnType": 3, + "isNullable": true, + "dartType": "double?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "width", + "fieldName": "width", + "columnType": 3, + "isNullable": true, + "dartType": "double?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "height", + "fieldName": "height", + "columnType": 3, + "isNullable": true, + "dartType": "double?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rotation", + "fieldName": "rotation", + "columnType": 3, + "isNullable": true, + "dartType": "double?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "flipH", + "fieldName": "flipH", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "flipV", + "fieldName": "flipV", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "zKey", + "fieldName": "zKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "readingKey", + "fieldName": "readingKey", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "locked", + "fieldName": "locked", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "hidden", + "fieldName": "hidden", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "placeholderType", + "fieldName": "placeholderType", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:PlaceholderType?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "placeholderOf", + "fieldName": "placeholderOf", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "matchKey", + "fieldName": "matchKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "text", + "fieldName": "text", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "textStyleJson", + "fieldName": "textStyleJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fillJson", + "fieldName": "fillJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "strokeJson", + "fieldName": "strokeJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "effectsJson", + "fieldName": "effectsJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "opacity", + "fieldName": "opacity", + "columnType": 3, + "isNullable": true, + "dartType": "double?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "dataJson", + "fieldName": "dataJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "linkJson", + "fieldName": "linkJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "altText", + "fieldName": "altText", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "decorative", + "fieldName": "decorative", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_element_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_element_fk_1", + "columns": [ + "slideId" + ], + "referenceTable": "slide", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_element_fk_2", + "columns": [ + "layoutId" + ], + "referenceTable": "slide_layout", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_element_fk_3", + "columns": [ + "masterId" + ], + "referenceTable": "slide_master", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_element_fk_4", + "columns": [ + "parentId" + ], + "referenceTable": "slide_element", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_element_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_element_slide_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "slideId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "zKey" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_element_layout_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "layoutId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_element_master_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "masterId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_element_parent_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "parentId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "slide_group", + "dartName": "SlideGroup", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "deckId", + "fieldName": "deckId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "title", + "fieldName": "title", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sortKey", + "fieldName": "sortKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "parentId", + "fieldName": "parentId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "color", + "fieldName": "color", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "skipped", + "fieldName": "skipped", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_group_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_group_fk_1", + "columns": [ + "deckId" + ], + "referenceTable": "deck", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_group_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_group_order_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "deckId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "sortKey" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "slide_layout", + "dartName": "SlideLayout", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "masterId", + "fieldName": "masterId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "key", + "fieldName": "key", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sortKey", + "fieldName": "sortKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "backgroundJson", + "fieldName": "backgroundJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "hideMasterElements", + "fieldName": "hideMasterElements", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "hidden", + "fieldName": "hidden", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_layout_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_layout_fk_1", + "columns": [ + "masterId" + ], + "referenceTable": "slide_master", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_layout_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_layout_master_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "masterId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "slide_master", + "dartName": "SlideMaster", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "themeId", + "fieldName": "themeId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sortKey", + "fieldName": "sortKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "backgroundJson", + "fieldName": "backgroundJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_master_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_master_fk_1", + "columns": [ + "themeId" + ], + "referenceTable": "deck_theme", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_master_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_master_theme_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "themeId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "slide_table_axis", + "dartName": "SlideTableAxis", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "elementId", + "fieldName": "elementId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "dimension", + "fieldName": "dimension", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:TableDimension" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sortKey", + "fieldName": "sortKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "size", + "fieldName": "size", + "columnType": 3, + "isNullable": true, + "dartType": "double?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "header", + "fieldName": "header", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_table_axis_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_table_axis_fk_1", + "columns": [ + "elementId" + ], + "referenceTable": "slide_element", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_table_axis_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_table_axis_element_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "elementId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "sortKey" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "slide_table_cell", + "dartName": "SlideTableCell", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "elementId", + "fieldName": "elementId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rowId", + "fieldName": "rowId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "columnId", + "fieldName": "columnId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "text", + "fieldName": "text", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fill", + "fieldName": "fill", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "borderTop", + "fieldName": "borderTop", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "borderRight", + "fieldName": "borderRight", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "borderBottom", + "fieldName": "borderBottom", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "borderLeft", + "fieldName": "borderLeft", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "vAlign", + "fieldName": "vAlign", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "padding", + "fieldName": "padding", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rowSpan", + "fieldName": "rowSpan", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "colSpan", + "fieldName": "colSpan", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_table_cell_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_table_cell_fk_1", + "columns": [ + "elementId" + ], + "referenceTable": "slide_element", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_table_cell_fk_2", + "columns": [ + "rowId" + ], + "referenceTable": "slide_table_axis", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_table_cell_fk_3", + "columns": [ + "columnId" + ], + "referenceTable": "slide_table_axis", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_table_cell_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_table_cell_element_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "elementId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "slides_snapshot_index", + "dartName": "SlidesSnapshotIndex", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemVersionId", + "fieldName": "itemVersionId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "slidesJson", + "fieldName": "slidesJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "changesJson", + "fieldName": "changesJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authorIds", + "fieldName": "authorIds", + "columnType": 8, + "isNullable": false, + "dartType": "List" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slides_snapshot_index_fk_0", + "columns": [ + "itemVersionId" + ], + "referenceTable": "item_version", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slides_snapshot_index_version_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemVersionId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "spreadsheet", + "dartName": "Spreadsheet", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "title", + "fieldName": "title", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "locale", + "fieldName": "locale", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "timeZone", + "fieldName": "timeZone", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "recalcMode", + "fieldName": "recalcMode", + "columnType": 0, + "isNullable": false, + "columnDefault": "'onChange'", + "dartType": "protocol:RecalcMode" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "iterativeCalc", + "fieldName": "iterativeCalc", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "maxIterations", + "fieldName": "maxIterations", + "columnType": 6, + "isNullable": false, + "columnDefault": "50", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "convergenceThreshold", + "fieldName": "convergenceThreshold", + "columnType": 3, + "isNullable": false, + "columnDefault": "0.05", + "dartType": "double" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "defaultFontFamily", + "fieldName": "defaultFontFamily", + "columnType": 0, + "isNullable": false, + "columnDefault": "'Inter'", + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "defaultFontSize", + "fieldName": "defaultFontSize", + "columnType": 3, + "isNullable": false, + "columnDefault": "10.0", + "dartType": "double" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "themeJson", + "fieldName": "themeJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "displayLanguage", + "fieldName": "displayLanguage", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdBy", + "fieldName": "createdBy", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "spreadsheet_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "spreadsheet_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "storage_reservation", + "dartName": "StorageReservation", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileUuid", + "fieldName": "fileUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "bytes", + "fieldName": "bytes", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "expiresAt", + "fieldName": "expiresAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "storage_reservation_fk_0", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "storage_reservation_fk_1", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "storage_reservation_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileUuid" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "storage_reservation_user_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "storage_reservation_expiry_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "expiresAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "stored_file", + "dartName": "StoredFile", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileUuid", + "fieldName": "fileUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "ownerId", + "fieldName": "ownerId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kind", + "fieldName": "kind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:StoredFileKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "storageId", + "fieldName": "storageId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "path", + "fieldName": "path", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileName", + "fieldName": "fileName", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "mimeType", + "fieldName": "mimeType", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sizeBytes", + "fieldName": "sizeBytes", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "status", + "fieldName": "status", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:StoredFileStatus" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "completedAt", + "fieldName": "completedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "expiresAt", + "fieldName": "expiresAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "stored_file_fk_0", + "columns": [ + "ownerId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "stored_file_fk_1", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "stored_file_uuid_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileUuid" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "stored_file_item_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "stored_file_expiry_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "expiresAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "stored_file_owner_kind_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "ownerId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "kind" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "stored_file_status_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "status" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "submission", + "dartName": "Submission", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "uuid", + "fieldName": "uuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "publicationId", + "fieldName": "publicationId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "ref", + "fieldName": "ref", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "status", + "fieldName": "status", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:SubmissionStatus" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "statusBeforeSubmit", + "fieldName": "statusBeforeSubmit", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:SubmissionStatus?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "delivery", + "fieldName": "delivery", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:SubmissionDeliveryState?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "values", + "fieldName": "values", + "columnType": 8, + "isNullable": false, + "dartType": "protocol:SubmissionValues" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "publicUrl", + "fieldName": "publicUrl", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "feedbackThreadId", + "fieldName": "feedbackThreadId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdById", + "fieldName": "createdById", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "disconnectedAt", + "fieldName": "disconnectedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "submission_fk_0", + "columns": [ + "publicationId" + ], + "referenceTable": "publication", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "submission_fk_1", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "submission_uuid_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "uuid" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "submission_item_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "submission_publication_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "publicationId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "status" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "submission_asset", + "dartName": "SubmissionAsset", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "submissionId", + "fieldName": "submissionId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileUuid", + "fieldName": "fileUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "submission_asset_fk_0", + "columns": [ + "submissionId" + ], + "referenceTable": "submission", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "submission_asset_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "submissionId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileUuid" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "submission_asset_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileUuid" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "submission_revision", + "dartName": "SubmissionRevision", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "submissionId", + "fieldName": "submissionId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sequence", + "fieldName": "sequence", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "versionId", + "fieldName": "versionId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "values", + "fieldName": "values", + "columnType": 8, + "isNullable": false, + "dartType": "protocol:SubmissionValues" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "payload", + "fieldName": "payload", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "submittedById", + "fieldName": "submittedById", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "submittedAt", + "fieldName": "submittedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "submission_revision_fk_0", + "columns": [ + "submissionId" + ], + "referenceTable": "submission", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "submission_revision_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "submissionId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "sequence" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "usage_counter_day", + "dartName": "UsageCounterDay", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "day", + "fieldName": "day", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "value", + "fieldName": "value", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "usage_counter_day_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "day" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "name" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "usage_day_stats", + "dartName": "UsageDayStats", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "day", + "fieldName": "day", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "includeAdmins", + "fieldName": "includeAdmins", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "active", + "fieldName": "active", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "editors", + "fieldName": "editors", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "drive", + "fieldName": "drive", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "write", + "fieldName": "write", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheets", + "fieldName": "sheets", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "slides", + "fieldName": "slides", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "mcp", + "fieldName": "mcp", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "weekly", + "fieldName": "weekly", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "monthly", + "fieldName": "monthly", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "computedAt", + "fieldName": "computedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "usage_day_stats_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "day" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "includeAdmins" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "user_activity_day", + "dartName": "UserActivityDay", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "day", + "fieldName": "day", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "app", + "fieldName": "app", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:UsageApp" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "edited", + "fieldName": "edited", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "user_activity_day_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "day" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "app" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "user_activity_day_day_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "day" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "user_activity_settings", + "dartName": "UserActivitySettings", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "showViewHistory", + "fieldName": "showViewHistory", + "columnType": 1, + "isNullable": false, + "columnDefault": "true", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "user_activity_settings_fk_0", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "user_activity_settings_user_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "user_preferences", + "dartName": "UserPreferences", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "appTheme", + "fieldName": "appTheme", + "columnType": 0, + "isNullable": false, + "columnDefault": "'system'", + "dartType": "protocol:AppThemeMode" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "accentColor", + "fieldName": "accentColor", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "density", + "fieldName": "density", + "columnType": 0, + "isNullable": false, + "columnDefault": "'comfortable'", + "dartType": "protocol:UiDensity" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "reduceMotion", + "fieldName": "reduceMotion", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "keymapOverrides", + "fieldName": "keymapOverrides", + "columnType": 0, + "isNullable": false, + "columnDefault": "'{}'", + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "writeDefaults", + "fieldName": "writeDefaults", + "columnType": 0, + "isNullable": false, + "columnDefault": "'{}'", + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetsDefaults", + "fieldName": "sheetsDefaults", + "columnType": 0, + "isNullable": false, + "columnDefault": "'{}'", + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "slidesDefaults", + "fieldName": "slidesDefaults", + "columnType": 0, + "isNullable": false, + "columnDefault": "'{}'", + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "slidesPresenter", + "fieldName": "slidesPresenter", + "columnType": 0, + "isNullable": false, + "columnDefault": "'{}'", + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "driveDefaults", + "fieldName": "driveDefaults", + "columnType": 0, + "isNullable": false, + "columnDefault": "'{}'", + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "notificationSettings", + "fieldName": "notificationSettings", + "columnType": 0, + "isNullable": false, + "columnDefault": "'{}'", + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "aiEnabled", + "fieldName": "aiEnabled", + "columnType": 1, + "isNullable": false, + "columnDefault": "true", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "user_preferences_fk_0", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "user_preferences_user_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "user_profile", + "dartName": "UserProfile", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authUserId", + "fieldName": "authUserId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "displayName", + "fieldName": "displayName", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "email", + "fieldName": "email", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "avatarFileId", + "fieldName": "avatarFileId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "avatarColor", + "fieldName": "avatarColor", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "locale", + "fieldName": "locale", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "timeZone", + "fieldName": "timeZone", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastSeenAt", + "fieldName": "lastSeenAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "welcomeContentAt", + "fieldName": "welcomeContentAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "user_profile_fk_0", + "columns": [ + "authUserId" + ], + "referenceTable": "serverpod_auth_core_user", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "user_profile_auth_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "authUserId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "user_profile_email_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "user_profile_created_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "user_storage", + "dartName": "UserStorage", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "usedBytes", + "fieldName": "usedBytes", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "reservedBytes", + "fieldName": "reservedBytes", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "documentsBytes", + "fieldName": "documentsBytes", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spreadsheetsBytes", + "fieldName": "spreadsheetsBytes", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "presentationsBytes", + "fieldName": "presentationsBytes", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "filesBytes", + "fieldName": "filesBytes", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "trashBytes", + "fieldName": "trashBytes", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "quotaBytesOverride", + "fieldName": "quotaBytesOverride", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "overQuotaSince", + "fieldName": "overQuotaSince", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "reconciledAt", + "fieldName": "reconciledAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "user_storage_fk_0", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "user_storage_user_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "write_diff_cache", + "dartName": "WriteDiffCache", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "documentId", + "fieldName": "documentId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fromRevision", + "fieldName": "fromRevision", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "toRevision", + "fieldName": "toRevision", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "json", + "fieldName": "json", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "write_diff_cache_fk_0", + "columns": [ + "documentId" + ], + "referenceTable": "document", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "write_diff_cache_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "documentId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fromRevision" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "toRevision" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "write_diff_cache_created_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "brin", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "write_theme", + "dartName": "WriteTheme", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "uuid", + "fieldName": "uuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "ownerId", + "fieldName": "ownerId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "isBuiltin", + "fieldName": "isBuiltin", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "builtinKey", + "fieldName": "builtinKey", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "description", + "fieldName": "description", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "schemaVersion", + "fieldName": "schemaVersion", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "version", + "fieldName": "version", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "json", + "fieldName": "json", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "contentHash", + "fieldName": "contentHash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "deletedAt", + "fieldName": "deletedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "write_theme_fk_0", + "columns": [ + "ownerId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "write_theme_uuid_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "uuid" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "write_theme_owner_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "ownerId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "deletedAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "write_theme_builtin_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "builtinKey" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "write_theme_revision", + "dartName": "WriteThemeRevision", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "themeId", + "fieldName": "themeId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "version", + "fieldName": "version", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "json", + "fieldName": "json", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "savedById", + "fieldName": "savedById", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "actorKind", + "fieldName": "actorKind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:ActorKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "write_theme_revision_fk_0", + "columns": [ + "themeId" + ], + "referenceTable": "write_theme", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "write_theme_rev_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "themeId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "version" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_cloud_storage", + "dartName": "CloudStorageEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "storageId", + "fieldName": "storageId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "path", + "fieldName": "path", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "addedTime", + "fieldName": "addedTime", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "expiration", + "fieldName": "expiration", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "byteData", + "fieldName": "byteData", + "columnType": 5, + "isNullable": false, + "dartType": "dart:typed_data:ByteData" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "verified", + "fieldName": "verified", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "contentType", + "fieldName": "contentType", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "cacheControl", + "fieldName": "cacheControl", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "contentDisposition", + "fieldName": "contentDisposition", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "contentEncoding", + "fieldName": "contentEncoding", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "customMetadata", + "fieldName": "customMetadata", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "serverpod_cloud_storage_path_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "storageId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "path" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "serverpod_cloud_storage_expiration", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "expiration" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_cloud_storage_direct_download", + "dartName": "CloudStorageDirectDownloadEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "storageId", + "fieldName": "storageId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "path", + "fieldName": "path", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "expiration", + "fieldName": "expiration", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authKey", + "fieldName": "authKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "downloadFileName", + "fieldName": "downloadFileName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "contentType", + "fieldName": "contentType", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "serverpod_cloud_storage_direct_download_auth_key", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "authKey" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "serverpod_cloud_storage_direct_download_expiration", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "expiration" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_cloud_storage_direct_upload", + "dartName": "CloudStorageDirectUploadEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "storageId", + "fieldName": "storageId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "path", + "fieldName": "path", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "expiration", + "fieldName": "expiration", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authKey", + "fieldName": "authKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "maxFileSize", + "fieldName": "maxFileSize", + "columnType": 6, + "isNullable": false, + "columnDefault": "10485760", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "contentLength", + "fieldName": "contentLength", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "preventOverwrite", + "fieldName": "preventOverwrite", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "contentType", + "fieldName": "contentType", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "cacheControl", + "fieldName": "cacheControl", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "contentDisposition", + "fieldName": "contentDisposition", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "contentEncoding", + "fieldName": "contentEncoding", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "customMetadata", + "fieldName": "customMetadata", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "serverpod_cloud_storage_direct_upload_storage_path", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "storageId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "path" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_future_call", + "dartName": "FutureCallEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "time", + "fieldName": "time", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "serializedObject", + "fieldName": "serializedObject", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "serverId", + "fieldName": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "identifier", + "fieldName": "identifier", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "scheduling", + "fieldName": "scheduling", + "columnType": 8, + "isNullable": true, + "dartType": "protocol:FutureCallScheduling?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "serverpod_future_call_time_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "time" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "serverpod_future_call_serverId_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "serverId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "serverpod_future_call_identifier_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "identifier" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_future_call_claim", + "dartName": "FutureCallClaimEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "futureCallId", + "fieldName": "futureCallId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastHeartbeatTime", + "fieldName": "lastHeartbeatTime", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "serverpod_future_call_claim_fk_0", + "columns": [ + "futureCallId" + ], + "referenceTable": "serverpod_future_call", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "future_call_unique_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "futureCallId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_health_connection_info", + "dartName": "ServerHealthConnectionInfo", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "serverId", + "fieldName": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "timestamp", + "fieldName": "timestamp", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "active", + "fieldName": "active", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "closing", + "fieldName": "closing", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "idle", + "fieldName": "idle", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "granularity", + "fieldName": "granularity", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "serverpod_health_connection_info_timestamp_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "timestamp" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "serverId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "granularity" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_health_metric", + "dartName": "ServerHealthMetric", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "serverId", + "fieldName": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "timestamp", + "fieldName": "timestamp", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "isHealthy", + "fieldName": "isHealthy", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "value", + "fieldName": "value", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "granularity", + "fieldName": "granularity", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "serverpod_health_metric_timestamp_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "timestamp" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "serverId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "name" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "granularity" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_log", + "dartName": "LogEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sessionLogId", + "fieldName": "sessionLogId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "messageId", + "fieldName": "messageId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "reference", + "fieldName": "reference", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "serverId", + "fieldName": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "time", + "fieldName": "time", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "logLevel", + "fieldName": "logLevel", + "columnType": 6, + "isNullable": false, + "dartType": "protocol:LogLevel" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "message", + "fieldName": "message", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "error", + "fieldName": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "stackTrace", + "fieldName": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "order", + "fieldName": "order", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "serverpod_log_fk_0", + "columns": [ + "sessionLogId" + ], + "referenceTable": "serverpod_session_log", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "serverpod_log_sessionLogId_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "sessionLogId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "order" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_message_log", + "dartName": "MessageLogEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sessionLogId", + "fieldName": "sessionLogId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "serverId", + "fieldName": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "messageId", + "fieldName": "messageId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "endpoint", + "fieldName": "endpoint", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "messageName", + "fieldName": "messageName", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "duration", + "fieldName": "duration", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "error", + "fieldName": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "stackTrace", + "fieldName": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "slow", + "fieldName": "slow", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "order", + "fieldName": "order", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "serverpod_message_log_fk_0", + "columns": [ + "sessionLogId" + ], + "referenceTable": "serverpod_session_log", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "serverpod_message_log_sessionLogId_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "sessionLogId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "order" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_method", + "dartName": "MethodInfo", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "endpoint", + "fieldName": "endpoint", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "method", + "fieldName": "method", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "serverpod_method_endpoint_method_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "endpoint" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "method" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_migrations", + "dartName": "DatabaseMigrationVersion", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "module", + "fieldName": "module", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "version", + "fieldName": "version", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "timestamp", + "fieldName": "timestamp", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "serverpod_migrations_ids", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "module" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_query_log", + "dartName": "QueryLogEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "serverId", + "fieldName": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sessionLogId", + "fieldName": "sessionLogId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "messageId", + "fieldName": "messageId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "query", + "fieldName": "query", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "duration", + "fieldName": "duration", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "numRows", + "fieldName": "numRows", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "error", + "fieldName": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "stackTrace", + "fieldName": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "slow", + "fieldName": "slow", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "order", + "fieldName": "order", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "serverpod_query_log_fk_0", + "columns": [ + "sessionLogId" + ], + "referenceTable": "serverpod_session_log", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "serverpod_query_log_sessionLogId_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "sessionLogId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "order" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_readwrite_test", + "dartName": "ReadWriteTestEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "number", + "fieldName": "number", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_runtime_settings", + "dartName": "RuntimeSettings", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "logSettings", + "fieldName": "logSettings", + "columnType": 8, + "isNullable": false, + "dartType": "protocol:LogSettings" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "logSettingsOverrides", + "fieldName": "logSettingsOverrides", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "logServiceCalls", + "fieldName": "logServiceCalls", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "logMalformedCalls", + "fieldName": "logMalformedCalls", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_session_log", + "dartName": "SessionLogEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "serverId", + "fieldName": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "time", + "fieldName": "time", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "module", + "fieldName": "module", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "endpoint", + "fieldName": "endpoint", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "method", + "fieldName": "method", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "duration", + "fieldName": "duration", + "columnType": 3, + "isNullable": true, + "dartType": "double?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "numQueries", + "fieldName": "numQueries", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "slow", + "fieldName": "slow", + "columnType": 1, + "isNullable": true, + "dartType": "bool?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "error", + "fieldName": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "stackTrace", + "fieldName": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authenticatedUserId", + "fieldName": "authenticatedUserId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "isOpen", + "fieldName": "isOpen", + "columnType": 1, + "isNullable": true, + "dartType": "bool?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "touched", + "fieldName": "touched", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "serverpod_session_log_serverid_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "serverId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "serverpod_session_log_time_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "time" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "serverpod_session_log_touched_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "touched" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "serverpod_session_log_isopen_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "isOpen" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_auth_idp_anonymous_account", + "dartName": "AnonymousAccount", + "module": "serverpod_auth_idp", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authUserId", + "fieldName": "authUserId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "serverpod_auth_idp_anonymous_account_fk_0", + "columns": [ + "authUserId" + ], + "referenceTable": "serverpod_auth_core_user", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_auth_idp_apple_account", + "dartName": "AppleAccount", + "module": "serverpod_auth_idp", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userIdentifier", + "fieldName": "userIdentifier", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "refreshToken", + "fieldName": "refreshToken", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "refreshTokenRequestedWithBundleIdentifier", + "fieldName": "refreshTokenRequestedWithBundleIdentifier", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastRefreshedAt", + "fieldName": "lastRefreshedAt", + "columnType": 4, + "isNullable": false, + "columnDefault": "now", + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authUserId", + "fieldName": "authUserId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "email", + "fieldName": "email", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "isEmailVerified", + "fieldName": "isEmailVerified", + "columnType": 1, + "isNullable": true, + "dartType": "bool?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "isPrivateEmail", + "fieldName": "isPrivateEmail", + "columnType": 1, + "isNullable": true, + "dartType": "bool?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "firstName", + "fieldName": "firstName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastName", + "fieldName": "lastName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "serverpod_auth_idp_apple_account_fk_0", + "columns": [ + "authUserId" + ], + "referenceTable": "serverpod_auth_core_user", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "serverpod_auth_apple_account_identifier", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userIdentifier" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_auth_idp_email_account", + "dartName": "EmailAccount", + "module": "serverpod_auth_idp", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authUserId", + "fieldName": "authUserId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "email", + "fieldName": "email", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "passwordHash", + "fieldName": "passwordHash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "serverpod_auth_idp_email_account_fk_0", + "columns": [ + "authUserId" + ], + "referenceTable": "serverpod_auth_core_user", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "serverpod_auth_idp_email_account_email", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_auth_idp_email_account_password_reset_request", + "dartName": "EmailAccountPasswordResetRequest", + "module": "serverpod_auth_idp", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "emailAccountId", + "fieldName": "emailAccountId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "columnDefault": "now", + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "challengeId", + "fieldName": "challengeId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "setPasswordChallengeId", + "fieldName": "setPasswordChallengeId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "serverpod_auth_idp_email_account_password_reset_request_fk_0", + "columns": [ + "emailAccountId" + ], + "referenceTable": "serverpod_auth_idp_email_account", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "serverpod_auth_idp_email_account_password_reset_request_fk_1", + "columns": [ + "challengeId" + ], + "referenceTable": "serverpod_auth_idp_secret_challenge", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "serverpod_auth_idp_email_account_password_reset_request_fk_2", + "columns": [ + "setPasswordChallengeId" + ], + "referenceTable": "serverpod_auth_idp_secret_challenge", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_auth_idp_email_account_request", + "dartName": "EmailAccountRequest", + "module": "serverpod_auth_idp", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "columnDefault": "now", + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "email", + "fieldName": "email", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "challengeId", + "fieldName": "challengeId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createAccountChallengeId", + "fieldName": "createAccountChallengeId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "serverpod_auth_idp_email_account_request_fk_0", + "columns": [ + "challengeId" + ], + "referenceTable": "serverpod_auth_idp_secret_challenge", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "serverpod_auth_idp_email_account_request_fk_1", + "columns": [ + "createAccountChallengeId" + ], + "referenceTable": "serverpod_auth_idp_secret_challenge", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "serverpod_auth_idp_email_account_request_email", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_auth_idp_facebook_account", + "dartName": "FacebookAccount", + "module": "serverpod_auth_idp", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authUserId", + "fieldName": "authUserId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userIdentifier", + "fieldName": "userIdentifier", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "email", + "fieldName": "email", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fullName", + "fieldName": "fullName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "firstName", + "fieldName": "firstName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastName", + "fieldName": "lastName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "serverpod_auth_idp_facebook_account_fk_0", + "columns": [ + "authUserId" + ], + "referenceTable": "serverpod_auth_core_user", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "serverpod_auth_facebook_account_user_identifier", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userIdentifier" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_auth_idp_firebase_account", + "dartName": "FirebaseAccount", + "module": "serverpod_auth_idp", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authUserId", + "fieldName": "authUserId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "created", + "fieldName": "created", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "email", + "fieldName": "email", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "phone", + "fieldName": "phone", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userIdentifier", + "fieldName": "userIdentifier", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "serverpod_auth_idp_firebase_account_fk_0", + "columns": [ + "authUserId" + ], + "referenceTable": "serverpod_auth_core_user", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "serverpod_auth_firebase_account_user_identifier", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userIdentifier" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_auth_idp_github_account", + "dartName": "GitHubAccount", + "module": "serverpod_auth_idp", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authUserId", + "fieldName": "authUserId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userIdentifier", + "fieldName": "userIdentifier", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "email", + "fieldName": "email", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "created", + "fieldName": "created", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "serverpod_auth_idp_github_account_fk_0", + "columns": [ + "authUserId" + ], + "referenceTable": "serverpod_auth_core_user", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "serverpod_auth_github_account_user_identifier", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userIdentifier" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_auth_idp_google_account", + "dartName": "GoogleAccount", + "module": "serverpod_auth_idp", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authUserId", + "fieldName": "authUserId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "created", + "fieldName": "created", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "email", + "fieldName": "email", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userIdentifier", + "fieldName": "userIdentifier", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "serverpod_auth_idp_google_account_fk_0", + "columns": [ + "authUserId" + ], + "referenceTable": "serverpod_auth_core_user", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "serverpod_auth_google_account_user_identifier", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userIdentifier" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_auth_idp_microsoft_account", + "dartName": "MicrosoftAccount", + "module": "serverpod_auth_idp", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authUserId", + "fieldName": "authUserId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userIdentifier", + "fieldName": "userIdentifier", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "email", + "fieldName": "email", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "created", + "fieldName": "created", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "serverpod_auth_idp_microsoft_account_fk_0", + "columns": [ + "authUserId" + ], + "referenceTable": "serverpod_auth_core_user", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "serverpod_auth_microsoft_account_user_identifier", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userIdentifier" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_auth_idp_passkey_account", + "dartName": "PasskeyAccount", + "module": "serverpod_auth_idp", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authUserId", + "fieldName": "authUserId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "keyId", + "fieldName": "keyId", + "columnType": 5, + "isNullable": false, + "dartType": "dart:typed_data:ByteData" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "keyIdBase64", + "fieldName": "keyIdBase64", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "clientDataJSON", + "fieldName": "clientDataJSON", + "columnType": 5, + "isNullable": false, + "dartType": "dart:typed_data:ByteData" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "attestationObject", + "fieldName": "attestationObject", + "columnType": 5, + "isNullable": false, + "dartType": "dart:typed_data:ByteData" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "originalChallenge", + "fieldName": "originalChallenge", + "columnType": 5, + "isNullable": false, + "dartType": "dart:typed_data:ByteData" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "serverpod_auth_idp_passkey_account_fk_0", + "columns": [ + "authUserId" + ], + "referenceTable": "serverpod_auth_core_user", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "serverpod_auth_idp_passkey_account_key_id_base64", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "keyIdBase64" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_auth_idp_passkey_challenge", + "dartName": "PasskeyChallenge", + "module": "serverpod_auth_idp", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "challenge", + "fieldName": "challenge", + "columnType": 5, + "isNullable": false, + "dartType": "dart:typed_data:ByteData" + } + ], + "foreignKeys": [], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_auth_idp_rate_limited_request_attempt", + "dartName": "RateLimitedRequestAttempt", + "module": "serverpod_auth_idp", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "domain", + "fieldName": "domain", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "source", + "fieldName": "source", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "key", + "fieldName": "key", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "ipAddress", + "fieldName": "ipAddress", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "attemptedAt", + "fieldName": "attemptedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "extraData", + "fieldName": "extraData", + "columnType": 8, + "isNullable": true, + "dartType": "Map?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "serverpod_auth_idp_rate_limited_request_attempt_composite", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "domain" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "source" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "key" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "attemptedAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_auth_idp_secret_challenge", + "dartName": "SecretChallenge", + "module": "serverpod_auth_idp", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "challengeCodeHash", + "fieldName": "challengeCodeHash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_auth_core_jwt_refresh_token", + "dartName": "RefreshToken", + "module": "serverpod_auth_core", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authUserId", + "fieldName": "authUserId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "scopeNames", + "fieldName": "scopeNames", + "columnType": 8, + "isNullable": false, + "dartType": "Set" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "extraClaims", + "fieldName": "extraClaims", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "method", + "fieldName": "method", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fixedSecret", + "fieldName": "fixedSecret", + "columnType": 5, + "isNullable": false, + "dartType": "dart:typed_data:ByteData" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rotatingSecretHash", + "fieldName": "rotatingSecretHash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastUpdatedAt", + "fieldName": "lastUpdatedAt", + "columnType": 4, + "isNullable": false, + "columnDefault": "now", + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "columnDefault": "now", + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "serverpod_auth_core_jwt_refresh_token_fk_0", + "columns": [ + "authUserId" + ], + "referenceTable": "serverpod_auth_core_user", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "serverpod_auth_core_jwt_refresh_token_last_updated_at", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "lastUpdatedAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_auth_core_profile", + "dartName": "UserProfile", + "module": "serverpod_auth_core", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authUserId", + "fieldName": "authUserId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userName", + "fieldName": "userName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fullName", + "fieldName": "fullName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "email", + "fieldName": "email", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "columnDefault": "now", + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "imageId", + "fieldName": "imageId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "serverpod_auth_core_profile_fk_0", + "columns": [ + "authUserId" + ], + "referenceTable": "serverpod_auth_core_user", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "serverpod_auth_core_profile_fk_1", + "columns": [ + "imageId" + ], + "referenceTable": "serverpod_auth_core_profile_image", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 3, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "serverpod_auth_profile_user_profile_email_auth_user_id", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "authUserId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_auth_core_profile_image", + "dartName": "UserProfileImage", + "module": "serverpod_auth_core", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userProfileId", + "fieldName": "userProfileId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "columnDefault": "now", + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "storageId", + "fieldName": "storageId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "path", + "fieldName": "path", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "url", + "fieldName": "url", + "columnType": 0, + "isNullable": false, + "dartType": "Uri" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "serverpod_auth_core_profile_image_fk_0", + "columns": [ + "userProfileId" + ], + "referenceTable": "serverpod_auth_core_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_auth_core_session", + "dartName": "ServerSideSession", + "module": "serverpod_auth_core", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authUserId", + "fieldName": "authUserId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "scopeNames", + "fieldName": "scopeNames", + "columnType": 8, + "isNullable": false, + "dartType": "Set" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "columnDefault": "now", + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastUsedAt", + "fieldName": "lastUsedAt", + "columnType": 4, + "isNullable": false, + "columnDefault": "now", + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "expiresAt", + "fieldName": "expiresAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "expireAfterUnusedFor", + "fieldName": "expireAfterUnusedFor", + "columnType": 6, + "isNullable": true, + "dartType": "Duration?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sessionKeyHash", + "fieldName": "sessionKeyHash", + "columnType": 5, + "isNullable": false, + "dartType": "dart:typed_data:ByteData" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sessionKeySalt", + "fieldName": "sessionKeySalt", + "columnType": 5, + "isNullable": false, + "dartType": "dart:typed_data:ByteData" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "method", + "fieldName": "method", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "serverpod_auth_core_session_fk_0", + "columns": [ + "authUserId" + ], + "referenceTable": "serverpod_auth_core_user", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "serverpod_auth_core_user", + "dartName": "AuthUser", + "module": "serverpod_auth_core", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "scopeNames", + "fieldName": "scopeNames", + "columnType": 8, + "isNullable": false, + "dartType": "Set" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "blocked", + "fieldName": "blocked", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [], + "managed": true + } + ], + "installedModules": [ + { + "__className__": "serverpod.DatabaseMigrationVersionModel", + "module": "wonky", + "version": "20261020142413171-analytics-indexes" + }, + { + "__className__": "serverpod.DatabaseMigrationVersion", + "module": "serverpod", + "version": "20260824182259319" + }, + { + "__className__": "serverpod.DatabaseMigrationVersion", + "module": "serverpod_auth_idp", + "version": "20260924105404509" + }, + { + "__className__": "serverpod.DatabaseMigrationVersion", + "module": "serverpod_auth_core", + "version": "20260924105232991" + } + ], + "migrationApiVersion": 1 +} \ No newline at end of file diff --git a/wonky_server/migrations/20261020142413171-analytics-indexes/definition.sql b/wonky_server/migrations/20261020142413171-analytics-indexes/definition.sql new file mode 100644 index 00000000..03c376d0 --- /dev/null +++ b/wonky_server/migrations/20261020142413171-analytics-indexes/definition.sql @@ -0,0 +1,4354 @@ +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; + +-- +-- Class AccessRequest as table access_request +-- +CREATE TABLE "access_request" ( + "id" bigserial PRIMARY KEY, + "itemId" bigint NOT NULL, + "requesterId" bigint NOT NULL, + "requestedRole" text NOT NULL, + "message" text, + "createdAt" timestamp without time zone NOT NULL, + "handledAt" timestamp without time zone, + "handledById" bigint, + "outcome" text +); + +-- Indexes +CREATE INDEX "access_request_item_idx" ON "access_request" USING btree ("itemId", "handledAt"); + +-- +-- Class ActivityEvent as table activity_event +-- +CREATE TABLE "activity_event" ( + "id" bigserial PRIMARY KEY, + "itemId" bigint NOT NULL, + "actorId" bigint, + "actorKind" text NOT NULL, + "type" text NOT NULL, + "summary" text NOT NULL, + "at" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "activity_item_idx" ON "activity_event" USING btree ("itemId", "at"); +CREATE INDEX "activity_type_at_idx" ON "activity_event" USING btree ("type", "at"); + +-- +-- Class AiFunctionCache as table ai_function_cache +-- +CREATE TABLE "ai_function_cache" ( + "id" bigserial PRIMARY KEY, + "key" text NOT NULL, + "spreadsheetUuid" uuid NOT NULL, + "model" text NOT NULL, + "value" text NOT NULL, + "error" text, + "createdAt" timestamp without time zone NOT NULL, + "hits" bigint NOT NULL DEFAULT 0 +); + +-- Indexes +CREATE UNIQUE INDEX "ai_function_cache_key_idx" ON "ai_function_cache" USING btree ("key"); +CREATE INDEX "ai_function_cache_sheet_idx" ON "ai_function_cache" USING btree ("spreadsheetUuid"); + +-- +-- Class AiPreviewRecord as table ai_preview_record +-- +CREATE TABLE "ai_preview_record" ( + "id" bigserial PRIMARY KEY, + "previewId" text NOT NULL, + "userId" bigint NOT NULL, + "fileUuid" uuid NOT NULL, + "previewJson" text NOT NULL, + "changesJson" text NOT NULL, + "createdAt" timestamp without time zone NOT NULL, + "expiresAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "ai_preview_id_idx" ON "ai_preview_record" USING btree ("previewId"); +CREATE INDEX "ai_preview_expires_idx" ON "ai_preview_record" USING btree ("expiresAt"); + +-- +-- Class AiUsage as table ai_usage +-- +CREATE TABLE "ai_usage" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "model" text NOT NULL, + "feature" text NOT NULL, + "inputTokens" bigint NOT NULL, + "outputTokens" bigint NOT NULL, + "cacheReadTokens" bigint NOT NULL, + "cacheWriteTokens" bigint NOT NULL, + "at" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "ai_usage_user_at_idx" ON "ai_usage" USING btree ("userId", "at"); +CREATE INDEX "ai_usage_at_idx" ON "ai_usage" USING btree ("at"); + +-- +-- Class AiUserKey as table ai_user_key +-- +CREATE TABLE "ai_user_key" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "provider" text NOT NULL, + "apiKey" text NOT NULL, + "createdAt" timestamp without time zone NOT NULL, + "updatedAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "ai_user_key_user_idx" ON "ai_user_key" USING btree ("userId"); + +-- +-- Class AiUserSetting as table ai_user_setting +-- +CREATE TABLE "ai_user_setting" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "quality" text NOT NULL DEFAULT 'best'::text, + "updatedAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "ai_user_setting_user_idx" ON "ai_user_setting" USING btree ("userId"); + +-- +-- Class AssistantMessage as table assistant_message +-- +CREATE TABLE "assistant_message" ( + "id" bigserial PRIMARY KEY, + "threadId" bigint NOT NULL, + "role" text NOT NULL, + "contentJson" text, + "displayText" text NOT NULL, + "toolCallsJson" text, + "visible" boolean NOT NULL DEFAULT true, + "replay" boolean NOT NULL DEFAULT true, + "runId" text, + "stopReason" text, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "assistant_message_thread_idx" ON "assistant_message" USING btree ("threadId", "id"); + +-- +-- Class AssistantThread as table assistant_thread +-- +CREATE TABLE "assistant_thread" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "itemId" bigint, + "title" text NOT NULL, + "contextRevision" bigint, + "contextMarkdown" text, + "createdAt" timestamp without time zone NOT NULL, + "updatedAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "assistant_thread_user_item_idx" ON "assistant_thread" USING btree ("userId", "itemId", "updatedAt"); + +-- +-- Class Banding as table banding +-- +CREATE TABLE "banding" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "sheetId" uuid NOT NULL, + "rangeJson" text NOT NULL, + "styleJson" text NOT NULL, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "banding_file_idx" ON "banding" USING btree ("fileId", "id"); + +-- +-- Class BasicFilter as table basic_filter +-- +CREATE TABLE "basic_filter" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "sheetId" uuid NOT NULL, + "rangeJson" text NOT NULL, + "criteriaJson" text NOT NULL, + "sortJson" text, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "basic_filter_file_idx" ON "basic_filter" USING btree ("fileId", "id"); + +-- +-- Class BoardAiUsage as table board_ai_usage +-- +CREATE TABLE "board_ai_usage" ( + "id" bigserial PRIMARY KEY, + "day" text NOT NULL, + "provider" text NOT NULL, + "model" text NOT NULL, + "feature" text NOT NULL, + "requests" bigint NOT NULL, + "inputTokens" bigint NOT NULL, + "outputTokens" bigint NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "board_ai_usage_idx" ON "board_ai_usage" USING btree ("day", "provider", "model", "feature"); + +-- +-- Class BoardBundleSuggestion as table board_bundle_suggestion +-- +CREATE TABLE "board_bundle_suggestion" ( + "id" bigserial PRIMARY KEY, + "title" text NOT NULL, + "rationale" text NOT NULL, + "area" text, + "postIds" json NOT NULL, + "state" text NOT NULL, + "createdAt" timestamp without time zone NOT NULL +); + +-- +-- Class BoardComment as table board_comment +-- +CREATE TABLE "board_comment" ( + "id" bigserial PRIMARY KEY, + "uuid" uuid NOT NULL, + "postId" bigint, + "taskId" bigint, + "authorId" bigint, + "body" text NOT NULL, + "systemEvent" text, + "moderation" text NOT NULL, + "moderationReason" text, + "needsCheck" boolean NOT NULL DEFAULT false, + "createdAt" timestamp without time zone NOT NULL, + "editedAt" timestamp without time zone, + "deletedAt" timestamp without time zone, + "removedAt" timestamp without time zone +); + +-- Indexes +CREATE UNIQUE INDEX "board_comment_uuid_idx" ON "board_comment" USING btree ("uuid"); +CREATE INDEX "board_comment_post_idx" ON "board_comment" USING btree ("postId", "createdAt"); +CREATE INDEX "board_comment_task_idx" ON "board_comment" USING btree ("taskId", "createdAt"); + +-- +-- Class BoardFlag as table board_flag +-- +CREATE TABLE "board_flag" ( + "id" bigserial PRIMARY KEY, + "postId" bigint, + "commentId" bigint, + "userId" bigint NOT NULL, + "reason" text NOT NULL, + "note" text, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "board_flag_post_idx" ON "board_flag" USING btree ("postId", "userId"); +CREATE INDEX "board_flag_comment_idx" ON "board_flag" USING btree ("commentId", "userId"); + +-- +-- Class BoardGithubDelivery as table board_github_delivery +-- +CREATE TABLE "board_github_delivery" ( + "id" bigserial PRIMARY KEY, + "deliveryId" text NOT NULL, + "event" text NOT NULL, + "receivedAt" timestamp without time zone NOT NULL, + "payload" text, + "processedAt" timestamp without time zone, + "attempts" bigint NOT NULL DEFAULT 0 +); + +-- Indexes +CREATE UNIQUE INDEX "board_github_delivery_idx" ON "board_github_delivery" USING btree ("deliveryId"); + +-- +-- Class BoardModerationLog as table board_moderation_log +-- +CREATE TABLE "board_moderation_log" ( + "id" bigserial PRIMARY KEY, + "adminId" bigint NOT NULL, + "action" text NOT NULL, + "targetKind" text NOT NULL, + "targetId" bigint NOT NULL, + "beforeJson" text, + "afterJson" text, + "reason" text, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "board_moderation_log_target_idx" ON "board_moderation_log" USING btree ("targetKind", "targetId"); + +-- +-- Class BoardPost as table board_post +-- +CREATE TABLE "board_post" ( + "id" bigserial PRIMARY KEY, + "authorId" bigint, + "kind" text NOT NULL, + "reportedKind" text NOT NULL, + "area" text, + "size" text, + "aiLabels" boolean NOT NULL DEFAULT true, + "title" text NOT NULL, + "body" text NOT NULL, + "contextJson" text, + "appHint" text NOT NULL, + "screenshotFileId" bigint, + "status" text NOT NULL, + "moderation" text NOT NULL, + "moderationReason" text, + "needsCheck" boolean NOT NULL DEFAULT false, + "editedByModerator" boolean NOT NULL DEFAULT false, + "triageState" text NOT NULL, + "triageJson" text, + "triageAttempts" bigint NOT NULL DEFAULT 0, + "suggestedTitle" text, + "summary" text, + "duplicateOfId" bigint, + "possibleDuplicateOfId" bigint, + "duplicateHintDismissed" boolean NOT NULL DEFAULT false, + "declineReason" text, + "taskId" bigint, + "score" bigint NOT NULL DEFAULT 0, + "voteCount" bigint NOT NULL DEFAULT 0, + "commentCount" bigint NOT NULL DEFAULT 0, + "flagCount" bigint NOT NULL DEFAULT 0, + "createdAt" timestamp without time zone NOT NULL, + "editedAt" timestamp without time zone, + "deletedAt" timestamp without time zone, + "removedAt" timestamp without time zone +); + +-- Indexes +CREATE INDEX "board_post_list_idx" ON "board_post" USING btree ("moderation", "kind", "status", "score"); +CREATE INDEX "board_post_author_idx" ON "board_post" USING btree ("authorId"); +CREATE INDEX "board_post_task_idx" ON "board_post" USING btree ("taskId"); + +-- +-- Class BoardPullRequest as table board_pull_request +-- +CREATE TABLE "board_pull_request" ( + "id" bigserial PRIMARY KEY, + "prNumber" bigint NOT NULL, + "taskId" bigint, + "authorLogin" text NOT NULL, + "headSha" text NOT NULL, + "state" text NOT NULL, + "gateState" text NOT NULL, + "gateReason" text, + "gateFirstFailedAt" timestamp without time zone, + "gateCommentId" bigint, + "reviewCommentId" bigint, + "lastReviewSha" text, + "lastReviewJson" text, + "lastReviewAt" timestamp without time zone, + "reviewDay" text, + "reviewCount" bigint NOT NULL DEFAULT 0, + "mergeCommitSha" text, + "reviewPendingSha" text, + "reviewDueAt" timestamp without time zone, + "createdAt" timestamp without time zone NOT NULL, + "updatedAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "board_pull_request_number_idx" ON "board_pull_request" USING btree ("prNumber"); + +-- +-- Class BoardTask as table board_task +-- +CREATE TABLE "board_task" ( + "id" bigserial PRIMARY KEY, + "title" text NOT NULL, + "area" text NOT NULL, + "size" text NOT NULL, + "status" text NOT NULL, + "promptBody" text NOT NULL, + "promptGeneratedAt" timestamp without time zone, + "promptRequestedAt" timestamp without time zone, + "promptNote" text, + "promptExcludedCommentIds" json, + "promptEditedById" bigint, + "promptEditedAt" timestamp without time zone, + "createdById" bigint NOT NULL, + "publishedAt" timestamp without time zone, + "claimedById" bigint, + "claimedAt" timestamp without time zone, + "claimExpiresAt" timestamp without time zone, + "claimWarnedAt" timestamp without time zone, + "claimCode" text, + "pullRequestUrl" text, + "prNumber" bigint, + "prAuthorLogin" text, + "mergeCommitSha" text, + "doneAt" timestamp without time zone, + "shippedDeploySha" text, + "shippedAt" timestamp without time zone, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "board_task_status_idx" ON "board_task" USING btree ("status"); +CREATE INDEX "board_task_claim_idx" ON "board_task" USING btree ("claimedById"); + +-- +-- Class BoardUserProfile as table board_user_profile +-- +CREATE TABLE "board_user_profile" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "githubLogin" text, + "blockedAt" timestamp without time zone, + "blockedUntil" timestamp without time zone, + "blockedReason" text, + "blockedById" bigint +); + +-- Indexes +CREATE UNIQUE INDEX "board_user_profile_user_idx" ON "board_user_profile" USING btree ("userId"); + +-- +-- Class BoardVote as table board_vote +-- +CREATE TABLE "board_vote" ( + "id" bigserial PRIMARY KEY, + "postId" bigint NOT NULL, + "userId" bigint NOT NULL, + "value" bigint NOT NULL, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "board_vote_unique_idx" ON "board_vote" USING btree ("postId", "userId"); +CREATE INDEX "board_vote_recent_idx" ON "board_vote" USING btree ("postId", "createdAt"); + +-- +-- Class Cell as table cell +-- +CREATE TABLE "cell" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "sheetId" uuid NOT NULL, + "rowId" uuid NOT NULL, + "columnId" uuid NOT NULL, + "content" text, + "note" text, + "numberFormat" text, + "fontFamily" text, + "fontSize" double precision, + "bold" boolean, + "italic" boolean, + "underline" boolean, + "strikethrough" boolean, + "textColor" text, + "fillColor" text, + "hAlign" text, + "vAlign" text, + "wrap" text, + "rotation" bigint, + "borderTop" text, + "borderRight" text, + "borderBottom" text, + "borderLeft" text, + "linkUrl" text, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "cell_row_idx" ON "cell" USING btree ("sheetId", "rowId"); +CREATE INDEX "cell_col_idx" ON "cell" USING btree ("sheetId", "columnId"); + +-- +-- Class CellHistory as table cell_history +-- +CREATE TABLE "cell_history" ( + "id" bigserial PRIMARY KEY, + "fileUuid" uuid NOT NULL, + "sheetId" uuid NOT NULL, + "rowId" uuid NOT NULL, + "colId" uuid NOT NULL, + "revision" bigint NOT NULL, + "userUuid" uuid NOT NULL, + "actorKind" text NOT NULL, + "label" text NOT NULL, + "at" timestamp without time zone NOT NULL, + "before" text, + "after" text +); + +-- Indexes +CREATE INDEX "cell_history_cell_idx" ON "cell_history" USING btree ("fileUuid", "sheetId", "rowId", "colId", "at"); +CREATE UNIQUE INDEX "cell_history_change_idx" ON "cell_history" USING btree ("fileUuid", "revision", "rowId", "colId"); + +-- +-- Class ChartLink as table chart_link +-- +CREATE TABLE "chart_link" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "elementId" uuid NOT NULL, + "spreadsheetItemUuid" uuid NOT NULL, + "chartObjectId" uuid NOT NULL, + "sheetId" text, + "sourceSpecJson" text NOT NULL, + "dataSnapshotJson" text NOT NULL, + "sourceVersion" text NOT NULL, + "updatedAt" timestamp without time zone NOT NULL, + "updatedBy" uuid NOT NULL, + "autoUpdate" boolean NOT NULL DEFAULT false, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "chart_link_file_idx" ON "chart_link" USING btree ("fileId", "id"); +CREATE INDEX "chart_link_element_idx" ON "chart_link" USING btree ("elementId"); + +-- +-- Class CodeState as table code_state +-- +CREATE TABLE "code_state" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "elementId" uuid NOT NULL, + "sortKey" text NOT NULL, + "label" text, + "code" text NOT NULL, + "language" text, + "title" text, + "highlight" text, + "annotationsJson" text, + "transitionJson" text, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "code_state_file_idx" ON "code_state" USING btree ("fileId", "id"); +CREATE INDEX "code_state_element_idx" ON "code_state" USING btree ("elementId", "sortKey"); + +-- +-- Class Comment as table comment +-- +CREATE TABLE "comment" ( + "id" bigserial PRIMARY KEY, + "threadId" bigint NOT NULL, + "uuid" uuid, + "authorId" bigint, + "authorKind" text NOT NULL, + "body" text NOT NULL, + "mentions" json NOT NULL, + "reactions" text NOT NULL DEFAULT '{}'::text, + "createdAt" timestamp without time zone NOT NULL, + "editedAt" timestamp without time zone, + "deletedAt" timestamp without time zone, + "systemEvent" text, + "publicationId" bigint +); + +-- Indexes +CREATE INDEX "comment_thread_idx" ON "comment" USING btree ("threadId", "createdAt"); +CREATE UNIQUE INDEX "comment_uuid_idx" ON "comment" USING btree ("uuid"); +CREATE INDEX "comment_created_idx" ON "comment" USING btree ("createdAt"); + +-- +-- Class CommentThread as table comment_thread +-- +CREATE TABLE "comment_thread" ( + "id" bigserial PRIMARY KEY, + "uuid" uuid NOT NULL, + "itemId" bigint NOT NULL, + "anchorKind" text NOT NULL, + "anchorJson" text NOT NULL, + "quotedText" text, + "status" text NOT NULL DEFAULT 'open'::text, + "createdById" bigint NOT NULL, + "createdAt" timestamp without time zone NOT NULL, + "updatedAt" timestamp without time zone, + "resolvedById" bigint, + "resolvedAt" timestamp without time zone, + "assigneeId" bigint, + "statusBeforeOrphan" text, + "orphanReasonJson" text, + "suggestionId" text +); + +-- Indexes +CREATE INDEX "comment_thread_item_idx" ON "comment_thread" USING btree ("itemId", "status"); +CREATE UNIQUE INDEX "comment_thread_uuid_idx" ON "comment_thread" USING btree ("uuid"); + +-- +-- Class ConditionalFormatRule as table conditional_format_rule +-- +CREATE TABLE "conditional_format_rule" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "sheetId" uuid NOT NULL, + "sortKey" text NOT NULL, + "rangesJson" text NOT NULL, + "ruleJson" text NOT NULL, + "enabled" boolean NOT NULL DEFAULT true, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "conditional_format_rule_file_idx" ON "conditional_format_rule" USING btree ("fileId", "id"); + +-- +-- Class DataValidationRule as table data_validation_rule +-- +CREATE TABLE "data_validation_rule" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "sheetId" uuid NOT NULL, + "rangesJson" text NOT NULL, + "criteriaJson" text NOT NULL, + "strict" boolean NOT NULL DEFAULT false, + "showDropdown" boolean NOT NULL DEFAULT true, + "displayStyle" text, + "helpText" text, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "data_validation_rule_file_idx" ON "data_validation_rule" USING btree ("fileId", "id"); + +-- +-- Class Deck as table deck +-- +CREATE TABLE "deck" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "title" text NOT NULL, + "width" double precision NOT NULL DEFAULT 1920.0, + "height" double precision NOT NULL DEFAULT 1080.0, + "sizePreset" text NOT NULL DEFAULT 'widescreen16x9'::text, + "themeId" uuid, + "appearance" text NOT NULL DEFAULT 'light'::text, + "language" text, + "showSlideNumbers" boolean NOT NULL DEFAULT false, + "hideNumberOnTitle" boolean NOT NULL DEFAULT true, + "firstSlideNumber" bigint NOT NULL DEFAULT 1, + "footerText" text, + "defaultsJson" text, + "guidesJson" text, + "presentJson" text, + "createdBy" uuid NOT NULL, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "deck_file_idx" ON "deck" USING btree ("fileId", "id"); + +-- +-- Class DeckTheme as table deck_theme +-- +CREATE TABLE "deck_theme" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "deckId" uuid NOT NULL, + "name" text NOT NULL, + "sourceKey" text, + "colorsJson" text NOT NULL, + "fontsJson" text NOT NULL, + "textStylesJson" text NOT NULL, + "backgroundJson" text NOT NULL, + "shapeStyleJson" text, + "tableStyleJson" text, + "codeStyleJson" text, + "chartStyleJson" text, + "sortKey" text NOT NULL, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "deck_theme_file_idx" ON "deck_theme" USING btree ("fileId", "id"); +CREATE INDEX "deck_theme_deck_idx" ON "deck_theme" USING btree ("deckId"); + +-- +-- Class DimensionGroup as table dimension_group +-- +CREATE TABLE "dimension_group" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "sheetId" uuid NOT NULL, + "dimension" text NOT NULL, + "startId" uuid NOT NULL, + "endId" uuid NOT NULL, + "depth" bigint NOT NULL, + "collapsed" boolean NOT NULL DEFAULT false, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "dimension_group_file_idx" ON "dimension_group" USING btree ("fileId", "id"); + +-- +-- Class Document as table document +-- +CREATE TABLE "document" ( + "id" bigserial PRIMARY KEY, + "uuid" uuid NOT NULL, + "itemId" bigint NOT NULL, + "headRevision" bigint NOT NULL DEFAULT 0, + "latestSnapshotRevision" bigint NOT NULL DEFAULT 0, + "themeId" uuid, + "pageSetupJson" text NOT NULL DEFAULT '{}'::text, + "language" text, + "frontMatter" text, + "charCount" bigint NOT NULL DEFAULT 0, + "wordCount" bigint NOT NULL DEFAULT 0, + "createdAt" timestamp without time zone NOT NULL, + "updatedAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "document_uuid_idx" ON "document" USING btree ("uuid"); +CREATE UNIQUE INDEX "document_item_idx" ON "document" USING btree ("itemId"); + +-- +-- Class DocumentImportReport as table document_import_report +-- +CREATE TABLE "document_import_report" ( + "id" bigserial PRIMARY KEY, + "documentId" bigint NOT NULL, + "userId" bigint NOT NULL, + "warningsJson" text NOT NULL, + "createdAt" timestamp without time zone NOT NULL, + "seenAt" timestamp without time zone +); + +-- Indexes +CREATE INDEX "document_import_report_idx" ON "document_import_report" USING btree ("documentId", "userId"); + +-- +-- Class DocumentMetaChange as table document_meta_change +-- +CREATE TABLE "document_meta_change" ( + "id" bigserial PRIMARY KEY, + "documentId" bigint NOT NULL, + "field" text NOT NULL, + "clientOpId" uuid, + "beforeJson" text NOT NULL, + "afterJson" text NOT NULL, + "authorId" bigint, + "actorKind" text NOT NULL, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "document_meta_change_idx" ON "document_meta_change" USING btree ("documentId", "createdAt"); +CREATE UNIQUE INDEX "document_meta_change_client_idx" ON "document_meta_change" USING btree ("documentId", "clientOpId"); + +-- +-- Class DocumentOp as table document_op +-- +CREATE TABLE "document_op" ( + "id" bigserial PRIMARY KEY, + "documentId" bigint NOT NULL, + "revision" bigint NOT NULL, + "clientOpId" uuid NOT NULL, + "authorId" bigint, + "actorKind" text NOT NULL, + "sessionId" text, + "kind" text NOT NULL, + "baseRevision" bigint NOT NULL, + "deltaJson" text NOT NULL, + "inverseJson" text NOT NULL, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "document_op_rev_idx" ON "document_op" USING btree ("documentId", "revision"); +CREATE UNIQUE INDEX "document_op_client_idx" ON "document_op" USING btree ("documentId", "clientOpId"); +CREATE INDEX "document_op_created_idx" ON "document_op" USING brin ("createdAt"); + +-- +-- Class DocumentSnapshot as table document_snapshot +-- +CREATE TABLE "document_snapshot" ( + "id" bigserial PRIMARY KEY, + "documentId" bigint NOT NULL, + "revision" bigint NOT NULL, + "deltaJson" text NOT NULL, + "compressed" boolean NOT NULL, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "document_snapshot_idx" ON "document_snapshot" USING btree ("documentId", "revision"); + +-- +-- Class DriveItem as table drive_item +-- +CREATE TABLE "drive_item" ( + "id" bigserial PRIMARY KEY, + "uuid" uuid NOT NULL, + "kind" text NOT NULL, + "name" text NOT NULL, + "ownerId" bigint NOT NULL, + "parentId" bigint, + "description" text, + "contentRef" uuid, + "thumbnailFileId" uuid, + "sizeBytes" bigint NOT NULL DEFAULT 0, + "attachmentBytes" bigint NOT NULL DEFAULT 0, + "kindMask" bigint NOT NULL DEFAULT 0, + "mimeType" text, + "fileCategory" text, + "uploadState" text, + "fileMetaJson" text, + "previewFileId" uuid, + "createdAt" timestamp without time zone NOT NULL, + "createdById" bigint NOT NULL, + "modifiedAt" timestamp without time zone NOT NULL, + "modifiedById" bigint, + "trashedAt" timestamp without time zone, + "trashedById" bigint, + "templateOf" text, + "templateKey" text, + "editorsCanShare" boolean NOT NULL DEFAULT true, + "nonEditorsCanExport" boolean NOT NULL DEFAULT true, + "viewersSeeComments" boolean NOT NULL DEFAULT false, + "searchText" text +); + +-- Indexes +CREATE UNIQUE INDEX "drive_item_uuid_idx" ON "drive_item" USING btree ("uuid"); +CREATE INDEX "drive_item_parent_idx" ON "drive_item" USING btree ("parentId"); +CREATE INDEX "drive_item_owner_idx" ON "drive_item" USING btree ("ownerId", "trashedAt"); +CREATE INDEX "drive_item_content_idx" ON "drive_item" USING btree ("contentRef"); +CREATE INDEX "drive_item_template_idx" ON "drive_item" USING btree ("templateOf"); +CREATE INDEX "drive_item_upload_idx" ON "drive_item" USING btree ("uploadState", "createdAt"); +CREATE INDEX "drive_item_trashed_idx" ON "drive_item" USING btree ("trashedAt"); + +-- +-- Class DriveItemPermission as table drive_item_permission +-- +CREATE TABLE "drive_item_permission" ( + "id" bigserial PRIMARY KEY, + "itemId" bigint NOT NULL, + "userId" bigint, + "invitedEmail" text, + "role" text NOT NULL, + "inheritedFromId" bigint, + "grantedById" bigint NOT NULL, + "grantedAt" timestamp without time zone NOT NULL, + "expiresAt" timestamp without time zone, + "viaPublicationId" bigint +); + +-- Indexes +CREATE UNIQUE INDEX "perm_item_user_idx" ON "drive_item_permission" USING btree ("itemId", "userId", "inheritedFromId", "invitedEmail") NULLS NOT DISTINCT; +CREATE INDEX "perm_user_idx" ON "drive_item_permission" USING btree ("userId"); +CREATE INDEX "perm_email_idx" ON "drive_item_permission" USING btree ("invitedEmail"); +CREATE INDEX "perm_expires_idx" ON "drive_item_permission" USING btree ("expiresAt"); +CREATE INDEX "perm_granted_idx" ON "drive_item_permission" USING btree ("grantedAt"); + +-- +-- Class DriveItemUserState as table drive_item_user_state +-- +CREATE TABLE "drive_item_user_state" ( + "id" bigserial PRIMARY KEY, + "itemId" bigint NOT NULL, + "userId" bigint NOT NULL, + "starred" boolean NOT NULL DEFAULT false, + "lastOpenedAt" timestamp without time zone, + "lastEditedAt" timestamp without time zone, + "pinnedOffline" boolean NOT NULL DEFAULT false, + "shortcutParentId" bigint, + "viaLink" boolean NOT NULL DEFAULT false +); + +-- Indexes +CREATE UNIQUE INDEX "drive_item_user_state_idx" ON "drive_item_user_state" USING btree ("itemId", "userId"); +CREATE INDEX "drive_item_user_recent_idx" ON "drive_item_user_state" USING btree ("userId", "lastOpenedAt"); + +-- +-- Class EmbeddedObject as table embedded_object +-- +CREATE TABLE "embedded_object" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "sheetId" uuid NOT NULL, + "kind" text NOT NULL, + "anchorJson" text NOT NULL, + "specJson" text NOT NULL, + "zIndex" bigint NOT NULL DEFAULT 0, + "title" text, + "altText" text, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "embedded_object_file_idx" ON "embedded_object" USING btree ("fileId", "id"); + +-- +-- Class FeedbackReport as table feedback_report +-- +CREATE TABLE "feedback_report" ( + "id" bigserial PRIMARY KEY, + "userId" bigint, + "kind" text NOT NULL, + "message" text NOT NULL, + "app" text NOT NULL, + "appVersion" text NOT NULL, + "platform" text NOT NULL, + "route" text, + "stackTrace" text, + "contextJson" text, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "feedback_report_created_idx" ON "feedback_report" USING btree ("createdAt"); + +-- +-- Class FilterView as table filter_view +-- +CREATE TABLE "filter_view" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "sheetId" uuid NOT NULL, + "name" text NOT NULL, + "rangeJson" text NOT NULL, + "criteriaJson" text NOT NULL, + "sortJson" text, + "createdBy" uuid NOT NULL, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "filter_view_file_idx" ON "filter_view" USING btree ("fileId", "id"); + +-- +-- Class HeadlessChange as table headless_change +-- +CREATE TABLE "headless_change" ( + "id" bigserial PRIMARY KEY, + "changeId" uuid NOT NULL, + "kind" text NOT NULL, + "itemId" bigint NOT NULL, + "documentId" bigint, + "revision" bigint, + "inverseJson" text, + "metaField" text, + "metaBeforeJson" text, + "metaAfterJson" text, + "userId" bigint NOT NULL, + "actorKind" text NOT NULL, + "label" text, + "toolName" text NOT NULL, + "createdAt" timestamp without time zone NOT NULL, + "revertedAt" timestamp without time zone +); + +-- Indexes +CREATE UNIQUE INDEX "headless_change_id_idx" ON "headless_change" USING btree ("changeId"); +CREATE INDEX "headless_change_created_idx" ON "headless_change" USING btree ("createdAt"); + +-- +-- Class ItemVersion as table item_version +-- +CREATE TABLE "item_version" ( + "id" bigserial PRIMARY KEY, + "itemId" bigint NOT NULL, + "kind" text NOT NULL, + "name" text, + "createdAt" timestamp without time zone NOT NULL, + "createdById" bigint, + "authors" json NOT NULL, + "storageKind" text NOT NULL, + "revision" bigint, + "snapshotFileId" uuid, + "sizeBytes" bigint NOT NULL DEFAULT 0 +); + +-- Indexes +CREATE INDEX "item_version_item_idx" ON "item_version" USING btree ("itemId", "createdAt"); + +-- +-- Class ItemVersionState as table item_version_state +-- +CREATE TABLE "item_version_state" ( + "id" bigserial PRIMARY KEY, + "itemId" bigint NOT NULL, + "lastEditAt" timestamp without time zone NOT NULL, + "dirtySince" timestamp without time zone, + "lastVersionAt" timestamp without time zone, + "editorsSinceLastVersion" json NOT NULL, + "lastRevision" bigint, + "capturingSince" timestamp without time zone +); + +-- Indexes +CREATE UNIQUE INDEX "item_version_state_item_idx" ON "item_version_state" USING btree ("itemId"); +CREATE INDEX "item_version_state_dirty_idx" ON "item_version_state" USING btree ("dirtySince"); + +-- +-- Class ItemViewDay as table item_view_day +-- +CREATE TABLE "item_view_day" ( + "id" bigserial PRIMARY KEY, + "itemId" bigint NOT NULL, + "userId" bigint NOT NULL, + "day" timestamp without time zone NOT NULL, + "views" bigint NOT NULL DEFAULT 1, + "lastViewedAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "item_view_day_idx" ON "item_view_day" USING btree ("itemId", "userId", "day"); +CREATE INDEX "item_view_day_item_idx" ON "item_view_day" USING btree ("itemId", "day"); + +-- +-- Class Macro as table macro +-- +CREATE TABLE "macro" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "projectId" uuid NOT NULL, + "name" text NOT NULL, + "functionName" text NOT NULL, + "shortcutSlot" bigint, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "macro_file_idx" ON "macro" USING btree ("fileId", "id"); + +-- +-- Class MergedRange as table merged_range +-- +CREATE TABLE "merged_range" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "sheetId" uuid NOT NULL, + "rangeJson" text NOT NULL, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "merged_range_file_idx" ON "merged_range" USING btree ("fileId", "id"); + +-- +-- Class NamedRange as table named_range +-- +CREATE TABLE "named_range" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "spreadsheetId" uuid NOT NULL, + "name" text NOT NULL, + "rangeJson" text, + "formula" text, + "comment" text, + "metaJson" text, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "named_range_file_idx" ON "named_range" USING btree ("fileId", "id"); + +-- +-- Class UserNotification as table notification +-- +CREATE TABLE "notification" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "kind" text NOT NULL, + "itemId" bigint, + "actorId" bigint, + "payload" text NOT NULL, + "createdAt" timestamp without time zone NOT NULL, + "readAt" timestamp without time zone, + "emailedAt" timestamp without time zone, + "emailPending" boolean DEFAULT false +); + +-- Indexes +CREATE INDEX "notification_user_idx" ON "notification" USING btree ("userId", "createdAt"); +CREATE INDEX "notification_email_idx" ON "notification" USING btree ("emailPending", "createdAt"); +CREATE INDEX "notification_created_idx" ON "notification" USING brin ("createdAt"); + +-- +-- Class OwnershipTransfer as table ownership_transfer +-- +CREATE TABLE "ownership_transfer" ( + "id" bigserial PRIMARY KEY, + "itemId" bigint NOT NULL, + "fromUserId" bigint NOT NULL, + "toUserId" bigint NOT NULL, + "createdAt" timestamp without time zone NOT NULL, + "handledAt" timestamp without time zone, + "accepted" boolean +); + +-- Indexes +CREATE INDEX "ownership_transfer_item_idx" ON "ownership_transfer" USING btree ("itemId", "handledAt"); + +-- +-- Class PersonalAccessToken as table personal_access_token +-- +CREATE TABLE "personal_access_token" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "name" text NOT NULL, + "tokenHash" text NOT NULL, + "prefix" text NOT NULL, + "scopes" json NOT NULL, + "expiresAt" timestamp without time zone, + "lastUsedAt" timestamp without time zone, + "createdAt" timestamp without time zone NOT NULL, + "revokedAt" timestamp without time zone +); + +-- Indexes +CREATE INDEX "personal_access_token_user_idx" ON "personal_access_token" USING btree ("userId"); +CREATE UNIQUE INDEX "personal_access_token_hash_idx" ON "personal_access_token" USING btree ("tokenHash"); + +-- +-- Class PivotTable as table pivot_table +-- +CREATE TABLE "pivot_table" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "sheetId" uuid NOT NULL, + "anchorRowId" uuid NOT NULL, + "anchorColId" uuid NOT NULL, + "sourceRangeJson" text NOT NULL, + "specJson" text NOT NULL, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "pivot_table_file_idx" ON "pivot_table" USING btree ("fileId", "id"); + +-- +-- Class ProtectedRange as table protected_range +-- +CREATE TABLE "protected_range" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "sheetId" uuid NOT NULL, + "rangeJson" text, + "exceptRangesJson" text, + "description" text, + "warningOnly" boolean NOT NULL DEFAULT false, + "editorsJson" text NOT NULL, + "createdBy" uuid NOT NULL, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "protected_range_file_idx" ON "protected_range" USING btree ("fileId", "id"); + +-- +-- Class Publication as table publication +-- +CREATE TABLE "publication" ( + "id" bigserial PRIMARY KEY, + "publicId" text NOT NULL, + "ownerId" bigint NOT NULL, + "name" text NOT NULL, + "siteUrl" text NOT NULL, + "webhookUrl" text NOT NULL, + "verifiedHost" text, + "verifiedAt" timestamp without time zone, + "templateItemId" bigint, + "termsUrl" text, + "fields" json NOT NULL, + "signingSecret" text NOT NULL, + "previousSigningSecret" text, + "previousSecretUntil" timestamp without time zone, + "apiKeyHash" text, + "apiKeyLast4" text, + "enabled" boolean NOT NULL DEFAULT true, + "createdAt" timestamp without time zone NOT NULL, + "updatedAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "publication_public_idx" ON "publication" USING btree ("publicId"); +CREATE INDEX "publication_owner_idx" ON "publication" USING btree ("ownerId"); +CREATE INDEX "publication_api_key_idx" ON "publication" USING btree ("apiKeyHash"); + +-- +-- Class PublicationBlock as table publication_block +-- +CREATE TABLE "publication_block" ( + "id" bigserial PRIMARY KEY, + "publicationId" bigint NOT NULL, + "userId" bigint NOT NULL, + "at" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "publication_block_idx" ON "publication_block" USING btree ("publicationId", "userId"); + +-- +-- Class PublicationConsent as table publication_consent +-- +CREATE TABLE "publication_consent" ( + "id" bigserial PRIMARY KEY, + "publicationId" bigint NOT NULL, + "userId" bigint NOT NULL, + "consentKey" text NOT NULL, + "at" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "publication_consent_idx" ON "publication_consent" USING btree ("publicationId", "userId"); + +-- +-- Class PublicationDelivery as table publication_delivery +-- +CREATE TABLE "publication_delivery" ( + "id" bigserial PRIMARY KEY, + "publicationId" bigint NOT NULL, + "submissionId" bigint, + "webhookId" text NOT NULL, + "type" text NOT NULL, + "sequence" bigint, + "payload" text NOT NULL, + "attempts" bigint NOT NULL DEFAULT 0, + "nextAttemptAt" timestamp without time zone, + "leaseUntil" timestamp without time zone, + "lastStatus" bigint, + "lastError" text, + "deliveredAt" timestamp without time zone, + "failedAt" timestamp without time zone, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "publication_delivery_webhook_idx" ON "publication_delivery" USING btree ("webhookId"); +CREATE INDEX "publication_delivery_due_idx" ON "publication_delivery" USING btree ("nextAttemptAt"); +CREATE INDEX "publication_delivery_publication_idx" ON "publication_delivery" USING btree ("publicationId", "createdAt"); + +-- +-- Class PublicationModerator as table publication_moderator +-- +CREATE TABLE "publication_moderator" ( + "id" bigserial PRIMARY KEY, + "publicationId" bigint NOT NULL, + "userId" bigint, + "email" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "publication_moderator_idx" ON "publication_moderator" USING btree ("publicationId", "email"); +CREATE INDEX "publication_moderator_user_idx" ON "publication_moderator" USING btree ("userId"); + +-- +-- Class RevFile as table rev_file +-- +CREATE TABLE "rev_file" ( + "id" bigserial PRIMARY KEY, + "fileUuid" uuid NOT NULL, + "kind" text NOT NULL, + "itemId" bigint NOT NULL, + "headRevision" bigint NOT NULL DEFAULT 0, + "prunedBelow" bigint NOT NULL DEFAULT 0, + "initPending" boolean NOT NULL DEFAULT false, + "purging" boolean NOT NULL DEFAULT false, + "schemaHash" text NOT NULL, + "stats" text NOT NULL DEFAULT '{}'::text, + "contentCount" bigint NOT NULL DEFAULT 0, + "createdAt" timestamp without time zone NOT NULL, + "updatedAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "rev_file_uuid_idx" ON "rev_file" USING btree ("fileUuid"); +CREATE UNIQUE INDEX "rev_file_item_idx" ON "rev_file" USING btree ("itemId"); + +-- +-- Class RevHookState as table rev_hook_state +-- +CREATE TABLE "rev_hook_state" ( + "id" bigserial PRIMARY KEY, + "fileId" bigint NOT NULL, + "cursorsJson" text NOT NULL, + "leaseOwner" text, + "leaseUntil" timestamp without time zone, + "attempts" bigint NOT NULL DEFAULT 0, + "lastError" text, + "nextAttemptAt" timestamp without time zone, + "updatedAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "rev_hook_state_file_idx" ON "rev_hook_state" USING btree ("fileId"); +CREATE INDEX "rev_hook_state_due_idx" ON "rev_hook_state" USING btree ("nextAttemptAt"); + +-- +-- Class RevOp as table rev_op +-- +CREATE TABLE "rev_op" ( + "id" bigserial PRIMARY KEY, + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL, + "clientOpId" uuid NOT NULL, + "baseRevision" bigint NOT NULL, + "authorId" bigint, + "authorUuid" uuid, + "sessionId" text, + "onBehalfOfSessionId" text, + "actorKind" text NOT NULL, + "label" text NOT NULL, + "groupId" text, + "groupIndex" bigint NOT NULL DEFAULT 0, + "groupLast" boolean NOT NULL DEFAULT true, + "recordId" uuid, + "offline" boolean NOT NULL DEFAULT false, + "payload" bytea, + "changeCount" bigint NOT NULL, + "summaryJson" text, + "detailJson" text, + "outcomeJson" text, + "appliedEqualsSubmitted" boolean NOT NULL, + "clientCreatedAt" timestamp without time zone, + "committedAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "rev_op_rev_idx" ON "rev_op" USING btree ("fileId", "revision"); +CREATE UNIQUE INDEX "rev_op_client_idx" ON "rev_op" USING btree ("fileId", "clientOpId"); +CREATE INDEX "rev_op_record_idx" ON "rev_op" USING btree ("recordId"); +CREATE INDEX "rev_op_committed_idx" ON "rev_op" USING brin ("committedAt"); + +-- +-- Class ScriptAuthorization as table script_authorization +-- +CREATE TABLE "script_authorization" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "spreadsheetUuid" uuid NOT NULL, + "scopes" json NOT NULL, + "grantedAt" timestamp without time zone NOT NULL, + "revokedAt" timestamp without time zone +); + +-- Indexes +CREATE UNIQUE INDEX "script_auth_user_sheet_idx" ON "script_authorization" USING btree ("userId", "spreadsheetUuid"); + +-- +-- Class ScriptBuild as table script_build +-- +CREATE TABLE "script_build" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "projectId" uuid NOT NULL, + "status" text NOT NULL DEFAULT 'ok'::text, + "sourceHash" text NOT NULL, + "bytecodeFileUuid" uuid, + "diagnosticsJson" text NOT NULL, + "exportsJson" text NOT NULL, + "apiVersion" bigint NOT NULL DEFAULT 1, + "compilerVersion" text NOT NULL DEFAULT ''::text, + "requestedBy" uuid, + "lastGoodSourceHash" text, + "lastGoodBytecodeFileUuid" uuid, + "lastGoodExportsJson" text, + "lastGoodBuiltAt" timestamp without time zone, + "positionsFileUuid" uuid, + "builtAt" timestamp without time zone NOT NULL, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "script_build_file_idx" ON "script_build" USING btree ("fileId", "id"); + +-- +-- Class ScriptExecution as table script_execution +-- +CREATE TABLE "script_execution" ( + "id" bigserial PRIMARY KEY, + "uuid" uuid NOT NULL, + "spreadsheetUuid" uuid NOT NULL, + "projectId" uuid, + "functionName" text NOT NULL, + "kind" text NOT NULL, + "triggerId" uuid, + "userId" bigint NOT NULL, + "runAsUserId" bigint NOT NULL, + "runtime" text NOT NULL, + "status" text NOT NULL, + "buildSourceHash" text NOT NULL, + "startedAt" timestamp without time zone NOT NULL, + "durationMs" bigint NOT NULL, + "logs" text NOT NULL, + "errorMessage" text, + "errorStackJson" text, + "changeId" uuid, + "cellsRead" bigint NOT NULL, + "cellsWritten" bigint NOT NULL, + "fetchCalls" bigint NOT NULL, + "callCount" bigint NOT NULL DEFAULT 1 +); + +-- Indexes +CREATE UNIQUE INDEX "script_exec_uuid_idx" ON "script_execution" USING btree ("uuid"); +CREATE INDEX "script_exec_sheet_idx" ON "script_execution" USING btree ("spreadsheetUuid", "startedAt"); +CREATE INDEX "script_exec_user_idx" ON "script_execution" USING btree ("userId", "startedAt"); + +-- +-- Class ScriptFile as table script_file +-- +CREATE TABLE "script_file" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "projectId" uuid NOT NULL, + "name" text NOT NULL, + "sortKey" text NOT NULL, + "source" text NOT NULL, + "contentHash" text NOT NULL, + "updatedBy" uuid NOT NULL, + "updatedAt" timestamp without time zone NOT NULL, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "script_file_file_idx" ON "script_file" USING btree ("fileId", "id"); + +-- +-- Class ScriptJob as table script_job +-- +CREATE TABLE "script_job" ( + "id" bigserial PRIMARY KEY, + "kind" text NOT NULL, + "spreadsheetUuid" uuid NOT NULL, + "itemUuid" uuid NOT NULL, + "triggerId" uuid, + "runAsUserId" bigint NOT NULL, + "functionName" text NOT NULL, + "payloadJson" text NOT NULL, + "status" text NOT NULL, + "enqueuedAt" timestamp without time zone NOT NULL, + "leaseOwner" text, + "leaseUntil" timestamp without time zone, + "attempts" bigint NOT NULL DEFAULT 0, + "coalesced" bigint NOT NULL DEFAULT 0, + "resultJson" text, + "finishedAt" timestamp without time zone +); + +-- Indexes +CREATE INDEX "script_job_status_idx" ON "script_job" USING btree ("status", "enqueuedAt"); +CREATE INDEX "script_job_trigger_idx" ON "script_job" USING btree ("triggerId", "status"); +CREATE INDEX "script_job_user_idx" ON "script_job" USING btree ("runAsUserId", "status"); + +-- +-- Class ScriptProject as table script_project +-- +CREATE TABLE "script_project" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "spreadsheetId" uuid NOT NULL, + "name" text NOT NULL, + "settingsJson" text NOT NULL, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "script_project_file_idx" ON "script_project" USING btree ("fileId", "id"); + +-- +-- Class ScriptProperty as table script_property +-- +CREATE TABLE "script_property" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "projectId" uuid NOT NULL, + "key" text NOT NULL, + "value" text NOT NULL, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "script_property_file_idx" ON "script_property" USING btree ("fileId", "id"); + +-- +-- Class ScriptQuotaUsage as table script_quota_usage +-- +CREATE TABLE "script_quota_usage" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "day" timestamp without time zone NOT NULL, + "serverRuntimeMs" bigint NOT NULL DEFAULT 0, + "clientRuntimeMs" bigint NOT NULL DEFAULT 0, + "urlFetchCalls" bigint NOT NULL DEFAULT 0, + "urlFetchBytes" bigint NOT NULL DEFAULT 0, + "triggerRuns" bigint NOT NULL DEFAULT 0 +); + +-- Indexes +CREATE UNIQUE INDEX "script_quota_user_day_idx" ON "script_quota_usage" USING btree ("userId", "day"); + +-- +-- Class ScriptTrigger as table script_trigger +-- +CREATE TABLE "script_trigger" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "projectId" uuid NOT NULL, + "kind" text NOT NULL, + "functionName" text NOT NULL, + "scheduleJson" text, + "runAsUserId" uuid NOT NULL, + "enabled" boolean NOT NULL DEFAULT true, + "optionsJson" text, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "script_trigger_file_idx" ON "script_trigger" USING btree ("fileId", "id"); + +-- +-- Class ScriptTriggerState as table script_trigger_state +-- +CREATE TABLE "script_trigger_state" ( + "id" bigserial PRIMARY KEY, + "triggerId" uuid NOT NULL, + "spreadsheetUuid" uuid NOT NULL, + "scheduleJson" text, + "nextRunAt" timestamp without time zone, + "lastRunAt" timestamp without time zone, + "lastStatus" text, + "consecutiveFailures" bigint NOT NULL DEFAULT 0, + "disabledReason" text, + "runningSince" timestamp without time zone, + "lastNotifiedAt" timestamp without time zone +); + +-- Indexes +CREATE UNIQUE INDEX "script_trigger_state_id_idx" ON "script_trigger_state" USING btree ("triggerId"); +CREATE INDEX "script_trigger_state_due_idx" ON "script_trigger_state" USING btree ("nextRunAt"); + +-- +-- Class ScriptUserProperty as table script_user_property +-- +CREATE TABLE "script_user_property" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "fileUuid" uuid NOT NULL, + "key" text NOT NULL, + "value" text NOT NULL, + "updatedAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "script_user_property_idx" ON "script_user_property" USING btree ("userId", "fileUuid", "key"); + +-- +-- Class ServerChangeRecord as table server_change_record +-- +CREATE TABLE "server_change_record" ( + "id" bigserial PRIMARY KEY, + "changeId" uuid NOT NULL, + "fileUuid" uuid NOT NULL, + "userId" bigint NOT NULL, + "actorKind" text NOT NULL, + "label" text NOT NULL, + "inverseJson" text, + "inverseFileId" uuid, + "forwardFileId" uuid, + "recordId" uuid, + "cellsAffected" bigint NOT NULL, + "createdAt" timestamp without time zone NOT NULL, + "expiresAt" timestamp without time zone NOT NULL, + "revertedAt" timestamp without time zone, + "revertChangeId" uuid +); + +-- Indexes +CREATE INDEX "server_change_record_idx" ON "server_change_record" USING btree ("recordId"); +CREATE INDEX "server_change_file_idx" ON "server_change_record" USING btree ("fileUuid", "createdAt"); +CREATE UNIQUE INDEX "server_change_id_idx" ON "server_change_record" USING btree ("changeId"); + +-- +-- Class ShareLink as table share_link +-- +CREATE TABLE "share_link" ( + "id" bigserial PRIMARY KEY, + "itemId" bigint NOT NULL, + "token" text NOT NULL, + "role" text, + "createdById" bigint NOT NULL, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "share_link_item_idx" ON "share_link" USING btree ("itemId"); +CREATE UNIQUE INDEX "share_link_token_idx" ON "share_link" USING btree ("token"); + +-- +-- Class Sheet as table sheet +-- +CREATE TABLE "sheet" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "spreadsheetId" uuid NOT NULL, + "name" text NOT NULL, + "sortKey" text NOT NULL, + "kind" text NOT NULL DEFAULT 'grid'::text, + "hidden" boolean NOT NULL DEFAULT false, + "tabColor" text, + "rightToLeft" boolean NOT NULL DEFAULT false, + "showGridlines" boolean NOT NULL DEFAULT true, + "frozenRows" bigint NOT NULL DEFAULT 0, + "frozenColumns" bigint NOT NULL DEFAULT 0, + "defaultRowHeight" double precision NOT NULL DEFAULT 21.0, + "defaultColumnWidth" double precision NOT NULL DEFAULT 100.0, + "formatJson" text, + "printSettingsJson" text, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "sheet_file_idx" ON "sheet" USING btree ("fileId", "id"); +CREATE INDEX "sheet_order_idx" ON "sheet" USING btree ("spreadsheetId", "sortKey"); + +-- +-- Class SheetColumn as table sheet_column +-- +CREATE TABLE "sheet_column" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "sheetId" uuid NOT NULL, + "sortKey" text NOT NULL, + "width" double precision, + "hidden" boolean NOT NULL DEFAULT false, + "formatJson" text, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "sheet_column_file_idx" ON "sheet_column" USING btree ("fileId", "id"); +CREATE INDEX "sheet_column_order_idx" ON "sheet_column" USING btree ("sheetId", "sortKey"); + +-- +-- Class SheetRow as table sheet_row +-- +CREATE TABLE "sheet_row" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "sheetId" uuid NOT NULL, + "sortKey" text NOT NULL, + "height" double precision, + "hidden" boolean NOT NULL DEFAULT false, + "formatJson" text, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "sheet_row_file_idx" ON "sheet_row" USING btree ("fileId", "id"); +CREATE INDEX "sheet_row_order_idx" ON "sheet_row" USING btree ("sheetId", "sortKey"); + +-- +-- Class SheetsImportJob as table sheets_import_job +-- +CREATE TABLE "sheets_import_job" ( + "id" bigserial PRIMARY KEY, + "uuid" uuid NOT NULL, + "userId" bigint NOT NULL, + "authUserId" uuid NOT NULL, + "spreadsheetUuid" uuid NOT NULL, + "uploadFileId" uuid NOT NULL, + "fileName" text NOT NULL, + "format" text NOT NULL, + "optionsJson" text NOT NULL, + "activeSheetId" text, + "status" text NOT NULL, + "progressDone" bigint NOT NULL, + "progressTotal" bigint NOT NULL, + "reportJson" text, + "sheetIdsJson" text, + "changeId" uuid, + "errorCode" text, + "error" text, + "cancelRequested" boolean NOT NULL DEFAULT false, + "createdAt" timestamp without time zone NOT NULL, + "updatedAt" timestamp without time zone NOT NULL, + "leaseOwner" text, + "leaseUntil" timestamp without time zone +); + +-- Indexes +CREATE UNIQUE INDEX "sheets_import_job_uuid_idx" ON "sheets_import_job" USING btree ("uuid"); +CREATE INDEX "sheets_import_job_user_idx" ON "sheets_import_job" USING btree ("userId", "status"); + +-- +-- Class SheetsSnapshotIndex as table sheets_snapshot_index +-- +CREATE TABLE "sheets_snapshot_index" ( + "id" bigserial PRIMARY KEY, + "itemVersionId" bigint NOT NULL, + "sheetsJson" text NOT NULL, + "changedRangesJson" text NOT NULL, + "authorIds" json NOT NULL, + "diffFileId" uuid +); + +-- Indexes +CREATE UNIQUE INDEX "sheets_snapshot_index_version_idx" ON "sheets_snapshot_index" USING btree ("itemVersionId"); + +-- +-- Class Slide as table slide +-- +CREATE TABLE "slide" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "deckId" uuid NOT NULL, + "sortKey" text NOT NULL, + "groupId" uuid, + "layoutId" uuid, + "backgroundJson" text, + "skipped" boolean NOT NULL DEFAULT false, + "notes" text, + "transitionJson" text, + "hideMasterElements" boolean, + "timingsJson" text, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "slide_file_idx" ON "slide" USING btree ("fileId", "id"); +CREATE INDEX "slide_order_idx" ON "slide" USING btree ("deckId", "sortKey"); + +-- +-- Class SlideBuild as table slide_build +-- +CREATE TABLE "slide_build" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "slideId" uuid NOT NULL, + "elementId" uuid NOT NULL, + "kind" text NOT NULL, + "effect" text NOT NULL, + "sortKey" text NOT NULL, + "trigger" text NOT NULL, + "delayMs" bigint NOT NULL DEFAULT 0, + "durationMs" bigint NOT NULL, + "easing" text NOT NULL, + "optionsJson" text, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "slide_build_file_idx" ON "slide_build" USING btree ("fileId", "id"); +CREATE INDEX "slide_build_slide_idx" ON "slide_build" USING btree ("slideId", "sortKey"); +CREATE INDEX "slide_build_element_idx" ON "slide_build" USING btree ("elementId"); + +-- +-- Class SlideElement as table slide_element +-- +CREATE TABLE "slide_element" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "slideId" uuid, + "layoutId" uuid, + "masterId" uuid, + "parentId" uuid, + "kind" text NOT NULL, + "name" text, + "x" double precision, + "y" double precision, + "width" double precision, + "height" double precision, + "rotation" double precision, + "flipH" boolean NOT NULL DEFAULT false, + "flipV" boolean NOT NULL DEFAULT false, + "zKey" text NOT NULL, + "readingKey" text, + "locked" boolean NOT NULL DEFAULT false, + "hidden" boolean NOT NULL DEFAULT false, + "placeholderType" text, + "placeholderOf" uuid, + "matchKey" text NOT NULL, + "text" text, + "textStyleJson" text, + "fillJson" text, + "strokeJson" text, + "effectsJson" text, + "opacity" double precision, + "dataJson" text, + "linkJson" text, + "altText" text, + "decorative" boolean NOT NULL DEFAULT false, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "slide_element_file_idx" ON "slide_element" USING btree ("fileId", "id"); +CREATE INDEX "slide_element_slide_idx" ON "slide_element" USING btree ("slideId", "zKey"); +CREATE INDEX "slide_element_layout_idx" ON "slide_element" USING btree ("layoutId"); +CREATE INDEX "slide_element_master_idx" ON "slide_element" USING btree ("masterId"); +CREATE INDEX "slide_element_parent_idx" ON "slide_element" USING btree ("parentId"); + +-- +-- Class SlideGroup as table slide_group +-- +CREATE TABLE "slide_group" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "deckId" uuid NOT NULL, + "title" text NOT NULL, + "sortKey" text NOT NULL, + "parentId" uuid, + "color" text, + "skipped" boolean NOT NULL DEFAULT false, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "slide_group_file_idx" ON "slide_group" USING btree ("fileId", "id"); +CREATE INDEX "slide_group_order_idx" ON "slide_group" USING btree ("deckId", "sortKey"); + +-- +-- Class SlideLayout as table slide_layout +-- +CREATE TABLE "slide_layout" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "masterId" uuid NOT NULL, + "name" text NOT NULL, + "key" text, + "sortKey" text NOT NULL, + "backgroundJson" text, + "hideMasterElements" boolean NOT NULL DEFAULT false, + "hidden" boolean NOT NULL DEFAULT false, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "slide_layout_file_idx" ON "slide_layout" USING btree ("fileId", "id"); +CREATE INDEX "slide_layout_master_idx" ON "slide_layout" USING btree ("masterId"); + +-- +-- Class SlideMaster as table slide_master +-- +CREATE TABLE "slide_master" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "themeId" uuid NOT NULL, + "name" text NOT NULL, + "sortKey" text NOT NULL, + "backgroundJson" text, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "slide_master_file_idx" ON "slide_master" USING btree ("fileId", "id"); +CREATE INDEX "slide_master_theme_idx" ON "slide_master" USING btree ("themeId"); + +-- +-- Class SlideTableAxis as table slide_table_axis +-- +CREATE TABLE "slide_table_axis" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "elementId" uuid NOT NULL, + "dimension" text NOT NULL, + "sortKey" text NOT NULL, + "size" double precision, + "header" boolean NOT NULL DEFAULT false, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "slide_table_axis_file_idx" ON "slide_table_axis" USING btree ("fileId", "id"); +CREATE INDEX "slide_table_axis_element_idx" ON "slide_table_axis" USING btree ("elementId", "sortKey"); + +-- +-- Class SlideTableCell as table slide_table_cell +-- +CREATE TABLE "slide_table_cell" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "elementId" uuid NOT NULL, + "rowId" uuid NOT NULL, + "columnId" uuid NOT NULL, + "text" text, + "fill" text, + "borderTop" text, + "borderRight" text, + "borderBottom" text, + "borderLeft" text, + "vAlign" text, + "padding" text, + "rowSpan" bigint, + "colSpan" bigint, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "slide_table_cell_file_idx" ON "slide_table_cell" USING btree ("fileId", "id"); +CREATE INDEX "slide_table_cell_element_idx" ON "slide_table_cell" USING btree ("elementId"); + +-- +-- Class SlidesSnapshotIndex as table slides_snapshot_index +-- +CREATE TABLE "slides_snapshot_index" ( + "id" bigserial PRIMARY KEY, + "itemVersionId" bigint NOT NULL, + "slidesJson" text NOT NULL, + "changesJson" text NOT NULL, + "authorIds" json NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "slides_snapshot_index_version_idx" ON "slides_snapshot_index" USING btree ("itemVersionId"); + +-- +-- Class Spreadsheet as table spreadsheet +-- +CREATE TABLE "spreadsheet" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "fileId" bigint NOT NULL, + "revision" bigint NOT NULL DEFAULT 0, + "title" text NOT NULL, + "locale" text NOT NULL, + "timeZone" text NOT NULL, + "recalcMode" text NOT NULL DEFAULT 'onChange'::text, + "iterativeCalc" boolean NOT NULL DEFAULT false, + "maxIterations" bigint NOT NULL DEFAULT 50, + "convergenceThreshold" double precision NOT NULL DEFAULT 0.05, + "defaultFontFamily" text NOT NULL DEFAULT 'Inter'::text, + "defaultFontSize" double precision NOT NULL DEFAULT 10.0, + "themeJson" text NOT NULL, + "displayLanguage" text, + "createdBy" uuid NOT NULL, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "spreadsheet_file_idx" ON "spreadsheet" USING btree ("fileId", "id"); + +-- +-- Class StorageReservation as table storage_reservation +-- +CREATE TABLE "storage_reservation" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "fileUuid" uuid NOT NULL, + "itemId" bigint, + "bytes" bigint NOT NULL, + "createdAt" timestamp without time zone NOT NULL, + "expiresAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "storage_reservation_file_idx" ON "storage_reservation" USING btree ("fileUuid"); +CREATE INDEX "storage_reservation_user_idx" ON "storage_reservation" USING btree ("userId"); +CREATE INDEX "storage_reservation_expiry_idx" ON "storage_reservation" USING btree ("expiresAt"); + +-- +-- Class StoredFile as table stored_file +-- +CREATE TABLE "stored_file" ( + "id" bigserial PRIMARY KEY, + "fileUuid" uuid NOT NULL, + "ownerId" bigint, + "itemId" bigint, + "kind" text NOT NULL, + "storageId" text NOT NULL, + "path" text NOT NULL, + "fileName" text NOT NULL, + "mimeType" text NOT NULL, + "sizeBytes" bigint NOT NULL, + "status" text NOT NULL, + "createdAt" timestamp without time zone NOT NULL, + "completedAt" timestamp without time zone, + "expiresAt" timestamp without time zone +); + +-- Indexes +CREATE UNIQUE INDEX "stored_file_uuid_idx" ON "stored_file" USING btree ("fileUuid"); +CREATE INDEX "stored_file_item_idx" ON "stored_file" USING btree ("itemId"); +CREATE INDEX "stored_file_expiry_idx" ON "stored_file" USING btree ("expiresAt"); +CREATE INDEX "stored_file_owner_kind_idx" ON "stored_file" USING btree ("ownerId", "kind", "createdAt"); +CREATE INDEX "stored_file_status_idx" ON "stored_file" USING btree ("status", "createdAt"); + +-- +-- Class Submission as table submission +-- +CREATE TABLE "submission" ( + "id" bigserial PRIMARY KEY, + "uuid" uuid NOT NULL, + "publicationId" bigint NOT NULL, + "itemId" bigint NOT NULL, + "ref" text, + "status" text NOT NULL, + "statusBeforeSubmit" text, + "delivery" text, + "values" json NOT NULL, + "publicUrl" text, + "feedbackThreadId" bigint, + "createdById" bigint NOT NULL, + "createdAt" timestamp without time zone NOT NULL, + "updatedAt" timestamp without time zone NOT NULL, + "disconnectedAt" timestamp without time zone +); + +-- Indexes +CREATE UNIQUE INDEX "submission_uuid_idx" ON "submission" USING btree ("uuid"); +CREATE UNIQUE INDEX "submission_item_idx" ON "submission" USING btree ("itemId"); +CREATE INDEX "submission_publication_idx" ON "submission" USING btree ("publicationId", "status"); + +-- +-- Class SubmissionAsset as table submission_asset +-- +CREATE TABLE "submission_asset" ( + "id" bigserial PRIMARY KEY, + "submissionId" bigint NOT NULL, + "fileUuid" uuid NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "submission_asset_idx" ON "submission_asset" USING btree ("submissionId", "fileUuid"); +CREATE INDEX "submission_asset_file_idx" ON "submission_asset" USING btree ("fileUuid"); + +-- +-- Class SubmissionRevision as table submission_revision +-- +CREATE TABLE "submission_revision" ( + "id" bigserial PRIMARY KEY, + "submissionId" bigint NOT NULL, + "sequence" bigint NOT NULL, + "revision" bigint NOT NULL, + "versionId" bigint, + "values" json NOT NULL, + "payload" text NOT NULL, + "submittedById" bigint NOT NULL, + "submittedAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "submission_revision_idx" ON "submission_revision" USING btree ("submissionId", "sequence"); + +-- +-- Class UsageCounterDay as table usage_counter_day +-- +CREATE TABLE "usage_counter_day" ( + "id" bigserial PRIMARY KEY, + "day" timestamp without time zone NOT NULL, + "name" text NOT NULL, + "value" bigint NOT NULL DEFAULT 0 +); + +-- Indexes +CREATE UNIQUE INDEX "usage_counter_day_idx" ON "usage_counter_day" USING btree ("day", "name"); + +-- +-- Class UsageDayStats as table usage_day_stats +-- +CREATE TABLE "usage_day_stats" ( + "id" bigserial PRIMARY KEY, + "day" timestamp without time zone NOT NULL, + "includeAdmins" boolean NOT NULL, + "active" bigint NOT NULL, + "editors" bigint NOT NULL, + "drive" bigint NOT NULL, + "write" bigint NOT NULL, + "sheets" bigint NOT NULL, + "slides" bigint NOT NULL, + "mcp" bigint NOT NULL, + "weekly" bigint NOT NULL, + "monthly" bigint NOT NULL, + "computedAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "usage_day_stats_idx" ON "usage_day_stats" USING btree ("day", "includeAdmins"); + +-- +-- Class UserActivityDay as table user_activity_day +-- +CREATE TABLE "user_activity_day" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "day" timestamp without time zone NOT NULL, + "app" text NOT NULL, + "edited" boolean NOT NULL DEFAULT false +); + +-- Indexes +CREATE UNIQUE INDEX "user_activity_day_idx" ON "user_activity_day" USING btree ("userId", "day", "app"); +CREATE INDEX "user_activity_day_day_idx" ON "user_activity_day" USING btree ("day"); + +-- +-- Class UserActivitySettings as table user_activity_settings +-- +CREATE TABLE "user_activity_settings" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "showViewHistory" boolean NOT NULL DEFAULT true, + "updatedAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "user_activity_settings_user_idx" ON "user_activity_settings" USING btree ("userId"); + +-- +-- Class UserPreferences as table user_preferences +-- +CREATE TABLE "user_preferences" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "appTheme" text NOT NULL DEFAULT 'system'::text, + "accentColor" text, + "density" text NOT NULL DEFAULT 'comfortable'::text, + "reduceMotion" boolean NOT NULL DEFAULT false, + "keymapOverrides" text NOT NULL DEFAULT '{}'::text, + "writeDefaults" text NOT NULL DEFAULT '{}'::text, + "sheetsDefaults" text NOT NULL DEFAULT '{}'::text, + "slidesDefaults" text NOT NULL DEFAULT '{}'::text, + "slidesPresenter" text NOT NULL DEFAULT '{}'::text, + "driveDefaults" text NOT NULL DEFAULT '{}'::text, + "notificationSettings" text NOT NULL DEFAULT '{}'::text, + "aiEnabled" boolean NOT NULL DEFAULT true, + "updatedAt" timestamp without time zone +); + +-- Indexes +CREATE UNIQUE INDEX "user_preferences_user_idx" ON "user_preferences" USING btree ("userId"); + +-- +-- Class UserProfile as table user_profile +-- +CREATE TABLE "user_profile" ( + "id" bigserial PRIMARY KEY, + "authUserId" uuid NOT NULL, + "displayName" text NOT NULL, + "email" text NOT NULL, + "avatarFileId" uuid, + "avatarColor" text NOT NULL, + "locale" text, + "timeZone" text, + "createdAt" timestamp without time zone NOT NULL, + "lastSeenAt" timestamp without time zone, + "welcomeContentAt" timestamp without time zone +); + +-- Indexes +CREATE UNIQUE INDEX "user_profile_auth_idx" ON "user_profile" USING btree ("authUserId"); +CREATE UNIQUE INDEX "user_profile_email_idx" ON "user_profile" USING btree ("email"); +CREATE INDEX "user_profile_created_idx" ON "user_profile" USING btree ("createdAt"); + +-- +-- Class UserStorage as table user_storage +-- +CREATE TABLE "user_storage" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "usedBytes" bigint NOT NULL DEFAULT 0, + "reservedBytes" bigint NOT NULL DEFAULT 0, + "documentsBytes" bigint NOT NULL DEFAULT 0, + "spreadsheetsBytes" bigint NOT NULL DEFAULT 0, + "presentationsBytes" bigint NOT NULL DEFAULT 0, + "filesBytes" bigint NOT NULL DEFAULT 0, + "trashBytes" bigint NOT NULL DEFAULT 0, + "quotaBytesOverride" bigint, + "overQuotaSince" timestamp without time zone, + "reconciledAt" timestamp without time zone, + "updatedAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "user_storage_user_idx" ON "user_storage" USING btree ("userId"); + +-- +-- Class WriteDiffCache as table write_diff_cache +-- +CREATE TABLE "write_diff_cache" ( + "id" bigserial PRIMARY KEY, + "documentId" bigint NOT NULL, + "fromRevision" bigint NOT NULL, + "toRevision" bigint NOT NULL, + "json" text NOT NULL, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "write_diff_cache_idx" ON "write_diff_cache" USING btree ("documentId", "fromRevision", "toRevision"); +CREATE INDEX "write_diff_cache_created_idx" ON "write_diff_cache" USING brin ("createdAt"); + +-- +-- Class WriteTheme as table write_theme +-- +CREATE TABLE "write_theme" ( + "id" bigserial PRIMARY KEY, + "uuid" uuid NOT NULL, + "ownerId" bigint, + "isBuiltin" boolean NOT NULL, + "builtinKey" text, + "name" text NOT NULL, + "description" text, + "schemaVersion" bigint NOT NULL, + "version" bigint NOT NULL, + "json" text NOT NULL, + "contentHash" text NOT NULL, + "createdAt" timestamp without time zone NOT NULL, + "updatedAt" timestamp without time zone NOT NULL, + "deletedAt" timestamp without time zone +); + +-- Indexes +CREATE UNIQUE INDEX "write_theme_uuid_idx" ON "write_theme" USING btree ("uuid"); +CREATE INDEX "write_theme_owner_idx" ON "write_theme" USING btree ("ownerId", "deletedAt"); +CREATE UNIQUE INDEX "write_theme_builtin_idx" ON "write_theme" USING btree ("builtinKey"); + +-- +-- Class WriteThemeRevision as table write_theme_revision +-- +CREATE TABLE "write_theme_revision" ( + "id" bigserial PRIMARY KEY, + "themeId" bigint NOT NULL, + "version" bigint NOT NULL, + "json" text NOT NULL, + "savedById" bigint, + "actorKind" text NOT NULL, + "createdAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "write_theme_rev_idx" ON "write_theme_revision" USING btree ("themeId", "version"); + +-- +-- Class CloudStorageEntry as table serverpod_cloud_storage +-- +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"); + +-- +-- Class CloudStorageDirectDownloadEntry as table serverpod_cloud_storage_direct_download +-- +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"); + +-- +-- Class CloudStorageDirectUploadEntry as table serverpod_cloud_storage_direct_upload +-- +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"); + +-- +-- Class FutureCallEntry as table serverpod_future_call +-- +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"); + +-- +-- Class FutureCallClaimEntry as table serverpod_future_call_claim +-- +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"); + +-- +-- Class ServerHealthConnectionInfo as table serverpod_health_connection_info +-- +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"); + +-- +-- Class ServerHealthMetric as table serverpod_health_metric +-- +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"); + +-- +-- Class LogEntry as table serverpod_log +-- +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"); + +-- +-- Class MessageLogEntry as table serverpod_message_log +-- +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"); + +-- +-- Class MethodInfo as table serverpod_method +-- +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"); + +-- +-- Class DatabaseMigrationVersion as table serverpod_migrations +-- +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"); + +-- +-- Class QueryLogEntry as table serverpod_query_log +-- +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"); + +-- +-- Class ReadWriteTestEntry as table serverpod_readwrite_test +-- +CREATE TABLE "serverpod_readwrite_test" ( + "id" bigserial PRIMARY KEY, + "number" bigint NOT NULL +); + +-- +-- Class RuntimeSettings as table serverpod_runtime_settings +-- +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 +); + +-- +-- Class SessionLogEntry as table serverpod_session_log +-- +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"); + +-- +-- Class AnonymousAccount as table serverpod_auth_idp_anonymous_account +-- +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 +); + +-- +-- Class AppleAccount as table serverpod_auth_idp_apple_account +-- +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"); + +-- +-- Class EmailAccount as table serverpod_auth_idp_email_account +-- +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"); + +-- +-- Class EmailAccountPasswordResetRequest as table serverpod_auth_idp_email_account_password_reset_request +-- +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 +); + +-- +-- Class EmailAccountRequest as table serverpod_auth_idp_email_account_request +-- +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"); + +-- +-- Class FacebookAccount as table serverpod_auth_idp_facebook_account +-- +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"); + +-- +-- Class FirebaseAccount as table serverpod_auth_idp_firebase_account +-- +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"); + +-- +-- Class GitHubAccount as table serverpod_auth_idp_github_account +-- +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"); + +-- +-- Class GoogleAccount as table serverpod_auth_idp_google_account +-- +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"); + +-- +-- Class MicrosoftAccount as table serverpod_auth_idp_microsoft_account +-- +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"); + +-- +-- Class PasskeyAccount as table serverpod_auth_idp_passkey_account +-- +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"); + +-- +-- Class PasskeyChallenge as table serverpod_auth_idp_passkey_challenge +-- +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 +); + +-- +-- Class RateLimitedRequestAttempt as table serverpod_auth_idp_rate_limited_request_attempt +-- +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"); + +-- +-- Class SecretChallenge as table serverpod_auth_idp_secret_challenge +-- +CREATE TABLE "serverpod_auth_idp_secret_challenge" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid_v7(), + "challengeCodeHash" text NOT NULL +); + +-- +-- Class RefreshToken as table serverpod_auth_core_jwt_refresh_token +-- +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"); + +-- +-- Class UserProfile as table serverpod_auth_core_profile +-- +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"); + +-- +-- Class UserProfileImage as table serverpod_auth_core_profile_image +-- +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 +); + +-- +-- Class ServerSideSession as table serverpod_auth_core_session +-- +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 +); + +-- +-- Class AuthUser as table serverpod_auth_core_user +-- +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 +); + +-- +-- Foreign relations for "access_request" table +-- +ALTER TABLE ONLY "access_request" + ADD CONSTRAINT "access_request_fk_0" + FOREIGN KEY("itemId") + REFERENCES "drive_item"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "access_request" + ADD CONSTRAINT "access_request_fk_1" + FOREIGN KEY("requesterId") + REFERENCES "user_profile"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "activity_event" table +-- +ALTER TABLE ONLY "activity_event" + ADD CONSTRAINT "activity_event_fk_0" + FOREIGN KEY("itemId") + REFERENCES "drive_item"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "ai_usage" table +-- +ALTER TABLE ONLY "ai_usage" + ADD CONSTRAINT "ai_usage_fk_0" + FOREIGN KEY("userId") + REFERENCES "user_profile"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "ai_user_key" table +-- +ALTER TABLE ONLY "ai_user_key" + ADD CONSTRAINT "ai_user_key_fk_0" + FOREIGN KEY("userId") + REFERENCES "user_profile"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "ai_user_setting" table +-- +ALTER TABLE ONLY "ai_user_setting" + ADD CONSTRAINT "ai_user_setting_fk_0" + FOREIGN KEY("userId") + REFERENCES "user_profile"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "assistant_message" table +-- +ALTER TABLE ONLY "assistant_message" + ADD CONSTRAINT "assistant_message_fk_0" + FOREIGN KEY("threadId") + REFERENCES "assistant_thread"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "assistant_thread" table +-- +ALTER TABLE ONLY "assistant_thread" + ADD CONSTRAINT "assistant_thread_fk_0" + FOREIGN KEY("userId") + REFERENCES "user_profile"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "assistant_thread" + ADD CONSTRAINT "assistant_thread_fk_1" + FOREIGN KEY("itemId") + REFERENCES "drive_item"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "banding" table +-- +ALTER TABLE ONLY "banding" + ADD CONSTRAINT "banding_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "banding" + ADD CONSTRAINT "banding_fk_1" + FOREIGN KEY("sheetId") + REFERENCES "sheet"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; + +-- +-- Foreign relations for "basic_filter" table +-- +ALTER TABLE ONLY "basic_filter" + ADD CONSTRAINT "basic_filter_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "basic_filter" + ADD CONSTRAINT "basic_filter_fk_1" + FOREIGN KEY("sheetId") + REFERENCES "sheet"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; + +-- +-- Foreign relations for "board_comment" table +-- +ALTER TABLE ONLY "board_comment" + ADD CONSTRAINT "board_comment_fk_0" + FOREIGN KEY("postId") + REFERENCES "board_post"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "board_comment" + ADD CONSTRAINT "board_comment_fk_1" + FOREIGN KEY("taskId") + REFERENCES "board_task"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "board_comment" + ADD CONSTRAINT "board_comment_fk_2" + FOREIGN KEY("authorId") + REFERENCES "user_profile"("id") + ON DELETE SET NULL + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "board_flag" table +-- +ALTER TABLE ONLY "board_flag" + ADD CONSTRAINT "board_flag_fk_0" + FOREIGN KEY("postId") + REFERENCES "board_post"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "board_flag" + ADD CONSTRAINT "board_flag_fk_1" + FOREIGN KEY("commentId") + REFERENCES "board_comment"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "board_flag" + ADD CONSTRAINT "board_flag_fk_2" + FOREIGN KEY("userId") + REFERENCES "user_profile"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "board_post" table +-- +ALTER TABLE ONLY "board_post" + ADD CONSTRAINT "board_post_fk_0" + FOREIGN KEY("authorId") + REFERENCES "user_profile"("id") + ON DELETE SET NULL + ON UPDATE NO ACTION; +ALTER TABLE ONLY "board_post" + ADD CONSTRAINT "board_post_fk_1" + FOREIGN KEY("screenshotFileId") + REFERENCES "stored_file"("id") + ON DELETE SET NULL + ON UPDATE NO ACTION; +ALTER TABLE ONLY "board_post" + ADD CONSTRAINT "board_post_fk_2" + FOREIGN KEY("taskId") + REFERENCES "board_task"("id") + ON DELETE SET NULL + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "board_pull_request" table +-- +ALTER TABLE ONLY "board_pull_request" + ADD CONSTRAINT "board_pull_request_fk_0" + FOREIGN KEY("taskId") + REFERENCES "board_task"("id") + ON DELETE SET NULL + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "board_task" table +-- +ALTER TABLE ONLY "board_task" + ADD CONSTRAINT "board_task_fk_0" + FOREIGN KEY("claimedById") + REFERENCES "user_profile"("id") + ON DELETE SET NULL + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "board_user_profile" table +-- +ALTER TABLE ONLY "board_user_profile" + ADD CONSTRAINT "board_user_profile_fk_0" + FOREIGN KEY("userId") + REFERENCES "user_profile"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "board_vote" table +-- +ALTER TABLE ONLY "board_vote" + ADD CONSTRAINT "board_vote_fk_0" + FOREIGN KEY("postId") + REFERENCES "board_post"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "board_vote" + ADD CONSTRAINT "board_vote_fk_1" + FOREIGN KEY("userId") + REFERENCES "user_profile"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "cell" table +-- +ALTER TABLE ONLY "cell" + ADD CONSTRAINT "cell_fk_0" + FOREIGN KEY("sheetId") + REFERENCES "sheet"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; + +-- +-- Foreign relations for "chart_link" table +-- +ALTER TABLE ONLY "chart_link" + ADD CONSTRAINT "chart_link_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "chart_link" + ADD CONSTRAINT "chart_link_fk_1" + FOREIGN KEY("elementId") + REFERENCES "slide_element"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; + +-- +-- Foreign relations for "code_state" table +-- +ALTER TABLE ONLY "code_state" + ADD CONSTRAINT "code_state_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "code_state" + ADD CONSTRAINT "code_state_fk_1" + FOREIGN KEY("elementId") + REFERENCES "slide_element"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; + +-- +-- Foreign relations for "comment" table +-- +ALTER TABLE ONLY "comment" + ADD CONSTRAINT "comment_fk_0" + FOREIGN KEY("threadId") + REFERENCES "comment_thread"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "comment" + ADD CONSTRAINT "comment_fk_1" + FOREIGN KEY("publicationId") + REFERENCES "publication"("id") + ON DELETE SET NULL + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "comment_thread" table +-- +ALTER TABLE ONLY "comment_thread" + ADD CONSTRAINT "comment_thread_fk_0" + FOREIGN KEY("itemId") + REFERENCES "drive_item"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "conditional_format_rule" table +-- +ALTER TABLE ONLY "conditional_format_rule" + ADD CONSTRAINT "conditional_format_rule_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "conditional_format_rule" + ADD CONSTRAINT "conditional_format_rule_fk_1" + FOREIGN KEY("sheetId") + REFERENCES "sheet"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; + +-- +-- Foreign relations for "data_validation_rule" table +-- +ALTER TABLE ONLY "data_validation_rule" + ADD CONSTRAINT "data_validation_rule_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "data_validation_rule" + ADD CONSTRAINT "data_validation_rule_fk_1" + FOREIGN KEY("sheetId") + REFERENCES "sheet"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; + +-- +-- Foreign relations for "deck" table +-- +ALTER TABLE ONLY "deck" + ADD CONSTRAINT "deck_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "deck_theme" table +-- +ALTER TABLE ONLY "deck_theme" + ADD CONSTRAINT "deck_theme_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "deck_theme" + ADD CONSTRAINT "deck_theme_fk_1" + FOREIGN KEY("deckId") + REFERENCES "deck"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; + +-- +-- Foreign relations for "dimension_group" table +-- +ALTER TABLE ONLY "dimension_group" + ADD CONSTRAINT "dimension_group_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "dimension_group" + ADD CONSTRAINT "dimension_group_fk_1" + FOREIGN KEY("sheetId") + REFERENCES "sheet"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; + +-- +-- Foreign relations for "document" table +-- +ALTER TABLE ONLY "document" + ADD CONSTRAINT "document_fk_0" + FOREIGN KEY("itemId") + REFERENCES "drive_item"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "document_import_report" table +-- +ALTER TABLE ONLY "document_import_report" + ADD CONSTRAINT "document_import_report_fk_0" + FOREIGN KEY("documentId") + REFERENCES "document"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "document_meta_change" table +-- +ALTER TABLE ONLY "document_meta_change" + ADD CONSTRAINT "document_meta_change_fk_0" + FOREIGN KEY("documentId") + REFERENCES "document"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "document_op" table +-- +ALTER TABLE ONLY "document_op" + ADD CONSTRAINT "document_op_fk_0" + FOREIGN KEY("documentId") + REFERENCES "document"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "document_snapshot" table +-- +ALTER TABLE ONLY "document_snapshot" + ADD CONSTRAINT "document_snapshot_fk_0" + FOREIGN KEY("documentId") + REFERENCES "document"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "drive_item" table +-- +ALTER TABLE ONLY "drive_item" + ADD CONSTRAINT "drive_item_fk_0" + FOREIGN KEY("ownerId") + REFERENCES "user_profile"("id") + ON DELETE RESTRICT + ON UPDATE NO ACTION; +ALTER TABLE ONLY "drive_item" + ADD CONSTRAINT "drive_item_fk_1" + FOREIGN KEY("parentId") + REFERENCES "drive_item"("id") + ON DELETE SET NULL + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "drive_item_permission" table +-- +ALTER TABLE ONLY "drive_item_permission" + ADD CONSTRAINT "drive_item_permission_fk_0" + FOREIGN KEY("itemId") + REFERENCES "drive_item"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "drive_item_permission" + ADD CONSTRAINT "drive_item_permission_fk_1" + FOREIGN KEY("userId") + REFERENCES "user_profile"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "drive_item_permission" + ADD CONSTRAINT "drive_item_permission_fk_2" + FOREIGN KEY("viaPublicationId") + REFERENCES "publication"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "drive_item_user_state" table +-- +ALTER TABLE ONLY "drive_item_user_state" + ADD CONSTRAINT "drive_item_user_state_fk_0" + FOREIGN KEY("itemId") + REFERENCES "drive_item"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "drive_item_user_state" + ADD CONSTRAINT "drive_item_user_state_fk_1" + FOREIGN KEY("userId") + REFERENCES "user_profile"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "embedded_object" table +-- +ALTER TABLE ONLY "embedded_object" + ADD CONSTRAINT "embedded_object_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "embedded_object" + ADD CONSTRAINT "embedded_object_fk_1" + FOREIGN KEY("sheetId") + REFERENCES "sheet"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; + +-- +-- Foreign relations for "filter_view" table +-- +ALTER TABLE ONLY "filter_view" + ADD CONSTRAINT "filter_view_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "filter_view" + ADD CONSTRAINT "filter_view_fk_1" + FOREIGN KEY("sheetId") + REFERENCES "sheet"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; + +-- +-- Foreign relations for "headless_change" table +-- +ALTER TABLE ONLY "headless_change" + ADD CONSTRAINT "headless_change_fk_0" + FOREIGN KEY("itemId") + REFERENCES "drive_item"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "item_version" table +-- +ALTER TABLE ONLY "item_version" + ADD CONSTRAINT "item_version_fk_0" + FOREIGN KEY("itemId") + REFERENCES "drive_item"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "item_version_state" table +-- +ALTER TABLE ONLY "item_version_state" + ADD CONSTRAINT "item_version_state_fk_0" + FOREIGN KEY("itemId") + REFERENCES "drive_item"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "item_view_day" table +-- +ALTER TABLE ONLY "item_view_day" + ADD CONSTRAINT "item_view_day_fk_0" + FOREIGN KEY("itemId") + REFERENCES "drive_item"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "item_view_day" + ADD CONSTRAINT "item_view_day_fk_1" + FOREIGN KEY("userId") + REFERENCES "user_profile"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "macro" table +-- +ALTER TABLE ONLY "macro" + ADD CONSTRAINT "macro_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "macro" + ADD CONSTRAINT "macro_fk_1" + FOREIGN KEY("projectId") + REFERENCES "script_project"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; + +-- +-- Foreign relations for "merged_range" table +-- +ALTER TABLE ONLY "merged_range" + ADD CONSTRAINT "merged_range_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "merged_range" + ADD CONSTRAINT "merged_range_fk_1" + FOREIGN KEY("sheetId") + REFERENCES "sheet"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; + +-- +-- Foreign relations for "named_range" table +-- +ALTER TABLE ONLY "named_range" + ADD CONSTRAINT "named_range_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "named_range" + ADD CONSTRAINT "named_range_fk_1" + FOREIGN KEY("spreadsheetId") + REFERENCES "spreadsheet"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; + +-- +-- Foreign relations for "notification" table +-- +ALTER TABLE ONLY "notification" + ADD CONSTRAINT "notification_fk_0" + FOREIGN KEY("userId") + REFERENCES "user_profile"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "ownership_transfer" table +-- +ALTER TABLE ONLY "ownership_transfer" + ADD CONSTRAINT "ownership_transfer_fk_0" + FOREIGN KEY("itemId") + REFERENCES "drive_item"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "ownership_transfer" + ADD CONSTRAINT "ownership_transfer_fk_1" + FOREIGN KEY("toUserId") + REFERENCES "user_profile"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "personal_access_token" table +-- +ALTER TABLE ONLY "personal_access_token" + ADD CONSTRAINT "personal_access_token_fk_0" + FOREIGN KEY("userId") + REFERENCES "user_profile"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "pivot_table" table +-- +ALTER TABLE ONLY "pivot_table" + ADD CONSTRAINT "pivot_table_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "pivot_table" + ADD CONSTRAINT "pivot_table_fk_1" + FOREIGN KEY("sheetId") + REFERENCES "sheet"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; + +-- +-- Foreign relations for "protected_range" table +-- +ALTER TABLE ONLY "protected_range" + ADD CONSTRAINT "protected_range_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "protected_range" + ADD CONSTRAINT "protected_range_fk_1" + FOREIGN KEY("sheetId") + REFERENCES "sheet"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; + +-- +-- Foreign relations for "publication" table +-- +ALTER TABLE ONLY "publication" + ADD CONSTRAINT "publication_fk_0" + FOREIGN KEY("ownerId") + REFERENCES "user_profile"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "publication" + ADD CONSTRAINT "publication_fk_1" + FOREIGN KEY("templateItemId") + REFERENCES "drive_item"("id") + ON DELETE SET NULL + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "publication_block" table +-- +ALTER TABLE ONLY "publication_block" + ADD CONSTRAINT "publication_block_fk_0" + FOREIGN KEY("publicationId") + REFERENCES "publication"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "publication_block" + ADD CONSTRAINT "publication_block_fk_1" + FOREIGN KEY("userId") + REFERENCES "user_profile"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "publication_consent" table +-- +ALTER TABLE ONLY "publication_consent" + ADD CONSTRAINT "publication_consent_fk_0" + FOREIGN KEY("publicationId") + REFERENCES "publication"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "publication_consent" + ADD CONSTRAINT "publication_consent_fk_1" + FOREIGN KEY("userId") + REFERENCES "user_profile"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "publication_delivery" table +-- +ALTER TABLE ONLY "publication_delivery" + ADD CONSTRAINT "publication_delivery_fk_0" + FOREIGN KEY("publicationId") + REFERENCES "publication"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "publication_delivery" + ADD CONSTRAINT "publication_delivery_fk_1" + FOREIGN KEY("submissionId") + REFERENCES "submission"("id") + ON DELETE SET NULL + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "publication_moderator" table +-- +ALTER TABLE ONLY "publication_moderator" + ADD CONSTRAINT "publication_moderator_fk_0" + FOREIGN KEY("publicationId") + REFERENCES "publication"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "publication_moderator" + ADD CONSTRAINT "publication_moderator_fk_1" + FOREIGN KEY("userId") + REFERENCES "user_profile"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "rev_file" table +-- +ALTER TABLE ONLY "rev_file" + ADD CONSTRAINT "rev_file_fk_0" + FOREIGN KEY("itemId") + REFERENCES "drive_item"("id") + ON DELETE RESTRICT + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "rev_hook_state" table +-- +ALTER TABLE ONLY "rev_hook_state" + ADD CONSTRAINT "rev_hook_state_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "rev_op" table +-- +ALTER TABLE ONLY "rev_op" + ADD CONSTRAINT "rev_op_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "script_build" table +-- +ALTER TABLE ONLY "script_build" + ADD CONSTRAINT "script_build_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "script_build" + ADD CONSTRAINT "script_build_fk_1" + FOREIGN KEY("projectId") + REFERENCES "script_project"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; + +-- +-- Foreign relations for "script_file" table +-- +ALTER TABLE ONLY "script_file" + ADD CONSTRAINT "script_file_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "script_file" + ADD CONSTRAINT "script_file_fk_1" + FOREIGN KEY("projectId") + REFERENCES "script_project"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; + +-- +-- Foreign relations for "script_project" table +-- +ALTER TABLE ONLY "script_project" + ADD CONSTRAINT "script_project_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "script_project" + ADD CONSTRAINT "script_project_fk_1" + FOREIGN KEY("spreadsheetId") + REFERENCES "spreadsheet"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; + +-- +-- Foreign relations for "script_property" table +-- +ALTER TABLE ONLY "script_property" + ADD CONSTRAINT "script_property_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "script_property" + ADD CONSTRAINT "script_property_fk_1" + FOREIGN KEY("projectId") + REFERENCES "script_project"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; + +-- +-- Foreign relations for "script_trigger" table +-- +ALTER TABLE ONLY "script_trigger" + ADD CONSTRAINT "script_trigger_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "script_trigger" + ADD CONSTRAINT "script_trigger_fk_1" + FOREIGN KEY("projectId") + REFERENCES "script_project"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; + +-- +-- Foreign relations for "script_user_property" table +-- +ALTER TABLE ONLY "script_user_property" + ADD CONSTRAINT "script_user_property_fk_0" + FOREIGN KEY("userId") + REFERENCES "user_profile"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "share_link" table +-- +ALTER TABLE ONLY "share_link" + ADD CONSTRAINT "share_link_fk_0" + FOREIGN KEY("itemId") + REFERENCES "drive_item"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "sheet" table +-- +ALTER TABLE ONLY "sheet" + ADD CONSTRAINT "sheet_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "sheet" + ADD CONSTRAINT "sheet_fk_1" + FOREIGN KEY("spreadsheetId") + REFERENCES "spreadsheet"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; + +-- +-- Foreign relations for "sheet_column" table +-- +ALTER TABLE ONLY "sheet_column" + ADD CONSTRAINT "sheet_column_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "sheet_column" + ADD CONSTRAINT "sheet_column_fk_1" + FOREIGN KEY("sheetId") + REFERENCES "sheet"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; + +-- +-- Foreign relations for "sheet_row" table +-- +ALTER TABLE ONLY "sheet_row" + ADD CONSTRAINT "sheet_row_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "sheet_row" + ADD CONSTRAINT "sheet_row_fk_1" + FOREIGN KEY("sheetId") + REFERENCES "sheet"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; + +-- +-- Foreign relations for "sheets_snapshot_index" table +-- +ALTER TABLE ONLY "sheets_snapshot_index" + ADD CONSTRAINT "sheets_snapshot_index_fk_0" + FOREIGN KEY("itemVersionId") + REFERENCES "item_version"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "slide" table +-- +ALTER TABLE ONLY "slide" + ADD CONSTRAINT "slide_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "slide" + ADD CONSTRAINT "slide_fk_1" + FOREIGN KEY("deckId") + REFERENCES "deck"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; + +-- +-- Foreign relations for "slide_build" table +-- +ALTER TABLE ONLY "slide_build" + ADD CONSTRAINT "slide_build_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "slide_build" + ADD CONSTRAINT "slide_build_fk_1" + FOREIGN KEY("slideId") + REFERENCES "slide"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; +ALTER TABLE ONLY "slide_build" + ADD CONSTRAINT "slide_build_fk_2" + FOREIGN KEY("elementId") + REFERENCES "slide_element"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; + +-- +-- Foreign relations for "slide_element" table +-- +ALTER TABLE ONLY "slide_element" + ADD CONSTRAINT "slide_element_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "slide_element" + ADD CONSTRAINT "slide_element_fk_1" + FOREIGN KEY("slideId") + REFERENCES "slide"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; +ALTER TABLE ONLY "slide_element" + ADD CONSTRAINT "slide_element_fk_2" + FOREIGN KEY("layoutId") + REFERENCES "slide_layout"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; +ALTER TABLE ONLY "slide_element" + ADD CONSTRAINT "slide_element_fk_3" + FOREIGN KEY("masterId") + REFERENCES "slide_master"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; +ALTER TABLE ONLY "slide_element" + ADD CONSTRAINT "slide_element_fk_4" + FOREIGN KEY("parentId") + REFERENCES "slide_element"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; + +-- +-- Foreign relations for "slide_group" table +-- +ALTER TABLE ONLY "slide_group" + ADD CONSTRAINT "slide_group_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "slide_group" + ADD CONSTRAINT "slide_group_fk_1" + FOREIGN KEY("deckId") + REFERENCES "deck"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; + +-- +-- Foreign relations for "slide_layout" table +-- +ALTER TABLE ONLY "slide_layout" + ADD CONSTRAINT "slide_layout_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "slide_layout" + ADD CONSTRAINT "slide_layout_fk_1" + FOREIGN KEY("masterId") + REFERENCES "slide_master"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; + +-- +-- Foreign relations for "slide_master" table +-- +ALTER TABLE ONLY "slide_master" + ADD CONSTRAINT "slide_master_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "slide_master" + ADD CONSTRAINT "slide_master_fk_1" + FOREIGN KEY("themeId") + REFERENCES "deck_theme"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; + +-- +-- Foreign relations for "slide_table_axis" table +-- +ALTER TABLE ONLY "slide_table_axis" + ADD CONSTRAINT "slide_table_axis_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "slide_table_axis" + ADD CONSTRAINT "slide_table_axis_fk_1" + FOREIGN KEY("elementId") + REFERENCES "slide_element"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; + +-- +-- Foreign relations for "slide_table_cell" table +-- +ALTER TABLE ONLY "slide_table_cell" + ADD CONSTRAINT "slide_table_cell_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "slide_table_cell" + ADD CONSTRAINT "slide_table_cell_fk_1" + FOREIGN KEY("elementId") + REFERENCES "slide_element"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; +ALTER TABLE ONLY "slide_table_cell" + ADD CONSTRAINT "slide_table_cell_fk_2" + FOREIGN KEY("rowId") + REFERENCES "slide_table_axis"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; +ALTER TABLE ONLY "slide_table_cell" + ADD CONSTRAINT "slide_table_cell_fk_3" + FOREIGN KEY("columnId") + REFERENCES "slide_table_axis"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION + DEFERRABLE INITIALLY DEFERRED; + +-- +-- Foreign relations for "slides_snapshot_index" table +-- +ALTER TABLE ONLY "slides_snapshot_index" + ADD CONSTRAINT "slides_snapshot_index_fk_0" + FOREIGN KEY("itemVersionId") + REFERENCES "item_version"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "spreadsheet" table +-- +ALTER TABLE ONLY "spreadsheet" + ADD CONSTRAINT "spreadsheet_fk_0" + FOREIGN KEY("fileId") + REFERENCES "rev_file"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "storage_reservation" table +-- +ALTER TABLE ONLY "storage_reservation" + ADD CONSTRAINT "storage_reservation_fk_0" + FOREIGN KEY("userId") + REFERENCES "user_profile"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "storage_reservation" + ADD CONSTRAINT "storage_reservation_fk_1" + FOREIGN KEY("itemId") + REFERENCES "drive_item"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "stored_file" table +-- +ALTER TABLE ONLY "stored_file" + ADD CONSTRAINT "stored_file_fk_0" + FOREIGN KEY("ownerId") + REFERENCES "user_profile"("id") + ON DELETE SET NULL + ON UPDATE NO ACTION; +ALTER TABLE ONLY "stored_file" + ADD CONSTRAINT "stored_file_fk_1" + FOREIGN KEY("itemId") + REFERENCES "drive_item"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "submission" table +-- +ALTER TABLE ONLY "submission" + ADD CONSTRAINT "submission_fk_0" + FOREIGN KEY("publicationId") + REFERENCES "publication"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; +ALTER TABLE ONLY "submission" + ADD CONSTRAINT "submission_fk_1" + FOREIGN KEY("itemId") + REFERENCES "drive_item"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "submission_asset" table +-- +ALTER TABLE ONLY "submission_asset" + ADD CONSTRAINT "submission_asset_fk_0" + FOREIGN KEY("submissionId") + REFERENCES "submission"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "submission_revision" table +-- +ALTER TABLE ONLY "submission_revision" + ADD CONSTRAINT "submission_revision_fk_0" + FOREIGN KEY("submissionId") + REFERENCES "submission"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "user_activity_settings" table +-- +ALTER TABLE ONLY "user_activity_settings" + ADD CONSTRAINT "user_activity_settings_fk_0" + FOREIGN KEY("userId") + REFERENCES "user_profile"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "user_preferences" table +-- +ALTER TABLE ONLY "user_preferences" + ADD CONSTRAINT "user_preferences_fk_0" + FOREIGN KEY("userId") + REFERENCES "user_profile"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "user_profile" table +-- +ALTER TABLE ONLY "user_profile" + ADD CONSTRAINT "user_profile_fk_0" + FOREIGN KEY("authUserId") + REFERENCES "serverpod_auth_core_user"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "user_storage" table +-- +ALTER TABLE ONLY "user_storage" + ADD CONSTRAINT "user_storage_fk_0" + FOREIGN KEY("userId") + REFERENCES "user_profile"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "write_diff_cache" table +-- +ALTER TABLE ONLY "write_diff_cache" + ADD CONSTRAINT "write_diff_cache_fk_0" + FOREIGN KEY("documentId") + REFERENCES "document"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "write_theme" table +-- +ALTER TABLE ONLY "write_theme" + ADD CONSTRAINT "write_theme_fk_0" + FOREIGN KEY("ownerId") + REFERENCES "user_profile"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "write_theme_revision" table +-- +ALTER TABLE ONLY "write_theme_revision" + ADD CONSTRAINT "write_theme_revision_fk_0" + FOREIGN KEY("themeId") + REFERENCES "write_theme"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "serverpod_future_call_claim" table +-- +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; + +-- +-- Foreign relations for "serverpod_log" table +-- +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; + +-- +-- Foreign relations for "serverpod_message_log" table +-- +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; + +-- +-- Foreign relations for "serverpod_query_log" table +-- +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; + +-- +-- Foreign relations for "serverpod_auth_idp_anonymous_account" table +-- +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; + +-- +-- Foreign relations for "serverpod_auth_idp_apple_account" table +-- +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; + +-- +-- Foreign relations for "serverpod_auth_idp_email_account" table +-- +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; + +-- +-- Foreign relations for "serverpod_auth_idp_email_account_password_reset_request" table +-- +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; + +-- +-- Foreign relations for "serverpod_auth_idp_email_account_request" table +-- +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; + +-- +-- Foreign relations for "serverpod_auth_idp_facebook_account" table +-- +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; + +-- +-- Foreign relations for "serverpod_auth_idp_firebase_account" table +-- +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; + +-- +-- Foreign relations for "serverpod_auth_idp_github_account" table +-- +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; + +-- +-- Foreign relations for "serverpod_auth_idp_google_account" table +-- +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; + +-- +-- Foreign relations for "serverpod_auth_idp_microsoft_account" table +-- +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; + +-- +-- Foreign relations for "serverpod_auth_idp_passkey_account" table +-- +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; + +-- +-- Foreign relations for "serverpod_auth_core_jwt_refresh_token" table +-- +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; + +-- +-- Foreign relations for "serverpod_auth_core_profile" table +-- +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; + +-- +-- Foreign relations for "serverpod_auth_core_profile_image" table +-- +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; + +-- +-- Foreign relations for "serverpod_auth_core_session" table +-- +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 wonky +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('wonky', '20261020142413171-analytics-indexes', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20261020142413171-analytics-indexes', "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 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; diff --git a/wonky_server/migrations/20261020142413171-analytics-indexes/definition_project.json b/wonky_server/migrations/20261020142413171-analytics-indexes/definition_project.json new file mode 100644 index 00000000..fd5fd797 --- /dev/null +++ b/wonky_server/migrations/20261020142413171-analytics-indexes/definition_project.json @@ -0,0 +1,16945 @@ +{ + "__className__": "serverpod.DatabaseDefinition", + "schemaVersion": 2, + "moduleName": "wonky", + "tables": [ + { + "__className__": "serverpod.TableDefinition", + "name": "access_request", + "dartName": "AccessRequest", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "requesterId", + "fieldName": "requesterId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "requestedRole", + "fieldName": "requestedRole", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:AccessRole" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "message", + "fieldName": "message", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "handledAt", + "fieldName": "handledAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "handledById", + "fieldName": "handledById", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "outcome", + "fieldName": "outcome", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:AccessRequestOutcome?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "access_request_fk_0", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "access_request_fk_1", + "columns": [ + "requesterId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "access_request_item_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "handledAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "activity_event", + "dartName": "ActivityEvent", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "actorId", + "fieldName": "actorId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "actorKind", + "fieldName": "actorKind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:ActorKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "type", + "fieldName": "type", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:ActivityType" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "summary", + "fieldName": "summary", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "at", + "fieldName": "at", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "activity_event_fk_0", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "activity_item_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "at" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "activity_type_at_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "type" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "at" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "ai_function_cache", + "dartName": "AiFunctionCache", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "key", + "fieldName": "key", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spreadsheetUuid", + "fieldName": "spreadsheetUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "model", + "fieldName": "model", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "value", + "fieldName": "value", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "error", + "fieldName": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "hits", + "fieldName": "hits", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "ai_function_cache_key_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "key" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "ai_function_cache_sheet_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "spreadsheetUuid" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "ai_preview_record", + "dartName": "AiPreviewRecord", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "previewId", + "fieldName": "previewId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileUuid", + "fieldName": "fileUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "previewJson", + "fieldName": "previewJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "changesJson", + "fieldName": "changesJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "expiresAt", + "fieldName": "expiresAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "ai_preview_id_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "previewId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "ai_preview_expires_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "expiresAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "ai_usage", + "dartName": "AiUsage", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "model", + "fieldName": "model", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "feature", + "fieldName": "feature", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "inputTokens", + "fieldName": "inputTokens", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "outputTokens", + "fieldName": "outputTokens", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "cacheReadTokens", + "fieldName": "cacheReadTokens", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "cacheWriteTokens", + "fieldName": "cacheWriteTokens", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "at", + "fieldName": "at", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "ai_usage_fk_0", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "ai_usage_user_at_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "at" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "ai_usage_at_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "at" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "ai_user_key", + "dartName": "AiUserKey", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "provider", + "fieldName": "provider", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:AiProvider" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "apiKey", + "fieldName": "apiKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "ai_user_key_fk_0", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "ai_user_key_user_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "ai_user_setting", + "dartName": "AiUserSetting", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "quality", + "fieldName": "quality", + "columnType": 0, + "isNullable": false, + "columnDefault": "'best'", + "dartType": "protocol:AiQuality" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "ai_user_setting_fk_0", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "ai_user_setting_user_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "assistant_message", + "dartName": "AssistantMessage", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "threadId", + "fieldName": "threadId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "role", + "fieldName": "role", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "contentJson", + "fieldName": "contentJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "displayText", + "fieldName": "displayText", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "toolCallsJson", + "fieldName": "toolCallsJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "visible", + "fieldName": "visible", + "columnType": 1, + "isNullable": false, + "columnDefault": "true", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "replay", + "fieldName": "replay", + "columnType": 1, + "isNullable": false, + "columnDefault": "true", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "runId", + "fieldName": "runId", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "stopReason", + "fieldName": "stopReason", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "assistant_message_fk_0", + "columns": [ + "threadId" + ], + "referenceTable": "assistant_thread", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "assistant_message_thread_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "threadId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "assistant_thread", + "dartName": "AssistantThread", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "title", + "fieldName": "title", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "contextRevision", + "fieldName": "contextRevision", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "contextMarkdown", + "fieldName": "contextMarkdown", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "assistant_thread_fk_0", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "assistant_thread_fk_1", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "assistant_thread_user_item_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "updatedAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "banding", + "dartName": "Banding", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetId", + "fieldName": "sheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rangeJson", + "fieldName": "rangeJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "styleJson", + "fieldName": "styleJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "banding_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "banding_fk_1", + "columns": [ + "sheetId" + ], + "referenceTable": "sheet", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "banding_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "basic_filter", + "dartName": "BasicFilter", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetId", + "fieldName": "sheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rangeJson", + "fieldName": "rangeJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "criteriaJson", + "fieldName": "criteriaJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sortJson", + "fieldName": "sortJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "basic_filter_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "basic_filter_fk_1", + "columns": [ + "sheetId" + ], + "referenceTable": "sheet", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "basic_filter_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "board_ai_usage", + "dartName": "BoardAiUsage", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "day", + "fieldName": "day", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "provider", + "fieldName": "provider", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "model", + "fieldName": "model", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "feature", + "fieldName": "feature", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "requests", + "fieldName": "requests", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "inputTokens", + "fieldName": "inputTokens", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "outputTokens", + "fieldName": "outputTokens", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_ai_usage_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "day" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "provider" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "model" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "feature" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "board_bundle_suggestion", + "dartName": "BoardBundleSuggestion", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "title", + "fieldName": "title", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rationale", + "fieldName": "rationale", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "area", + "fieldName": "area", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:BoardArea?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "postIds", + "fieldName": "postIds", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "state", + "fieldName": "state", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "board_comment", + "dartName": "BoardComment", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "uuid", + "fieldName": "uuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "postId", + "fieldName": "postId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "taskId", + "fieldName": "taskId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authorId", + "fieldName": "authorId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "body", + "fieldName": "body", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "systemEvent", + "fieldName": "systemEvent", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "moderation", + "fieldName": "moderation", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:BoardModeration" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "moderationReason", + "fieldName": "moderationReason", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "needsCheck", + "fieldName": "needsCheck", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "editedAt", + "fieldName": "editedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "deletedAt", + "fieldName": "deletedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "removedAt", + "fieldName": "removedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "board_comment_fk_0", + "columns": [ + "postId" + ], + "referenceTable": "board_post", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "board_comment_fk_1", + "columns": [ + "taskId" + ], + "referenceTable": "board_task", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "board_comment_fk_2", + "columns": [ + "authorId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_comment_uuid_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "uuid" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_comment_post_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "postId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_comment_task_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "taskId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "board_flag", + "dartName": "BoardFlag", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "postId", + "fieldName": "postId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "commentId", + "fieldName": "commentId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "reason", + "fieldName": "reason", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:BoardFlagReason" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "note", + "fieldName": "note", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "board_flag_fk_0", + "columns": [ + "postId" + ], + "referenceTable": "board_post", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "board_flag_fk_1", + "columns": [ + "commentId" + ], + "referenceTable": "board_comment", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "board_flag_fk_2", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_flag_post_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "postId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_flag_comment_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "commentId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "board_github_delivery", + "dartName": "BoardGithubDelivery", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "deliveryId", + "fieldName": "deliveryId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "event", + "fieldName": "event", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "receivedAt", + "fieldName": "receivedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "payload", + "fieldName": "payload", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "processedAt", + "fieldName": "processedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "attempts", + "fieldName": "attempts", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_github_delivery_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "deliveryId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "board_moderation_log", + "dartName": "BoardModerationLog", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "adminId", + "fieldName": "adminId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "action", + "fieldName": "action", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "targetKind", + "fieldName": "targetKind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:BoardTargetKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "targetId", + "fieldName": "targetId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "beforeJson", + "fieldName": "beforeJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "afterJson", + "fieldName": "afterJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "reason", + "fieldName": "reason", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_moderation_log_target_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "targetKind" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "targetId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "board_post", + "dartName": "BoardPost", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authorId", + "fieldName": "authorId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kind", + "fieldName": "kind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:BoardPostKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "reportedKind", + "fieldName": "reportedKind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:BoardPostKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "area", + "fieldName": "area", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:BoardArea?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "size", + "fieldName": "size", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:BoardSize?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "aiLabels", + "fieldName": "aiLabels", + "columnType": 1, + "isNullable": false, + "columnDefault": "true", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "title", + "fieldName": "title", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "body", + "fieldName": "body", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "contextJson", + "fieldName": "contextJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "appHint", + "fieldName": "appHint", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "screenshotFileId", + "fieldName": "screenshotFileId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "status", + "fieldName": "status", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:BoardPostStatus" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "moderation", + "fieldName": "moderation", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:BoardModeration" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "moderationReason", + "fieldName": "moderationReason", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "needsCheck", + "fieldName": "needsCheck", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "editedByModerator", + "fieldName": "editedByModerator", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "triageState", + "fieldName": "triageState", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:BoardTriageState" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "triageJson", + "fieldName": "triageJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "triageAttempts", + "fieldName": "triageAttempts", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "suggestedTitle", + "fieldName": "suggestedTitle", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "summary", + "fieldName": "summary", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "duplicateOfId", + "fieldName": "duplicateOfId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "possibleDuplicateOfId", + "fieldName": "possibleDuplicateOfId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "duplicateHintDismissed", + "fieldName": "duplicateHintDismissed", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "declineReason", + "fieldName": "declineReason", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "taskId", + "fieldName": "taskId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "score", + "fieldName": "score", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "voteCount", + "fieldName": "voteCount", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "commentCount", + "fieldName": "commentCount", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "flagCount", + "fieldName": "flagCount", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "editedAt", + "fieldName": "editedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "deletedAt", + "fieldName": "deletedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "removedAt", + "fieldName": "removedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "board_post_fk_0", + "columns": [ + "authorId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "board_post_fk_1", + "columns": [ + "screenshotFileId" + ], + "referenceTable": "stored_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "board_post_fk_2", + "columns": [ + "taskId" + ], + "referenceTable": "board_task", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_post_list_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "moderation" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "kind" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "status" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "score" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_post_author_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "authorId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_post_task_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "taskId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "board_pull_request", + "dartName": "BoardPullRequest", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "prNumber", + "fieldName": "prNumber", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "taskId", + "fieldName": "taskId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authorLogin", + "fieldName": "authorLogin", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "headSha", + "fieldName": "headSha", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "state", + "fieldName": "state", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "gateState", + "fieldName": "gateState", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "gateReason", + "fieldName": "gateReason", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "gateFirstFailedAt", + "fieldName": "gateFirstFailedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "gateCommentId", + "fieldName": "gateCommentId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "reviewCommentId", + "fieldName": "reviewCommentId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastReviewSha", + "fieldName": "lastReviewSha", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastReviewJson", + "fieldName": "lastReviewJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastReviewAt", + "fieldName": "lastReviewAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "reviewDay", + "fieldName": "reviewDay", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "reviewCount", + "fieldName": "reviewCount", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "mergeCommitSha", + "fieldName": "mergeCommitSha", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "reviewPendingSha", + "fieldName": "reviewPendingSha", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "reviewDueAt", + "fieldName": "reviewDueAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "board_pull_request_fk_0", + "columns": [ + "taskId" + ], + "referenceTable": "board_task", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_pull_request_number_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "prNumber" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "board_task", + "dartName": "BoardTask", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "title", + "fieldName": "title", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "area", + "fieldName": "area", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:BoardArea" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "size", + "fieldName": "size", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:BoardSize" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "status", + "fieldName": "status", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:BoardTaskStatus" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "promptBody", + "fieldName": "promptBody", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "promptGeneratedAt", + "fieldName": "promptGeneratedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "promptRequestedAt", + "fieldName": "promptRequestedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "promptNote", + "fieldName": "promptNote", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "promptExcludedCommentIds", + "fieldName": "promptExcludedCommentIds", + "columnType": 8, + "isNullable": true, + "dartType": "List?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "promptEditedById", + "fieldName": "promptEditedById", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "promptEditedAt", + "fieldName": "promptEditedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdById", + "fieldName": "createdById", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "publishedAt", + "fieldName": "publishedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "claimedById", + "fieldName": "claimedById", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "claimedAt", + "fieldName": "claimedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "claimExpiresAt", + "fieldName": "claimExpiresAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "claimWarnedAt", + "fieldName": "claimWarnedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "claimCode", + "fieldName": "claimCode", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "pullRequestUrl", + "fieldName": "pullRequestUrl", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "prNumber", + "fieldName": "prNumber", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "prAuthorLogin", + "fieldName": "prAuthorLogin", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "mergeCommitSha", + "fieldName": "mergeCommitSha", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "doneAt", + "fieldName": "doneAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "shippedDeploySha", + "fieldName": "shippedDeploySha", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "shippedAt", + "fieldName": "shippedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "board_task_fk_0", + "columns": [ + "claimedById" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_task_status_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "status" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_task_claim_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "claimedById" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "board_user_profile", + "dartName": "BoardUserProfile", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "githubLogin", + "fieldName": "githubLogin", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "blockedAt", + "fieldName": "blockedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "blockedUntil", + "fieldName": "blockedUntil", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "blockedReason", + "fieldName": "blockedReason", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "blockedById", + "fieldName": "blockedById", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "board_user_profile_fk_0", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_user_profile_user_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "board_vote", + "dartName": "BoardVote", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "postId", + "fieldName": "postId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "value", + "fieldName": "value", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "board_vote_fk_0", + "columns": [ + "postId" + ], + "referenceTable": "board_post", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "board_vote_fk_1", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_vote_unique_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "postId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "board_vote_recent_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "postId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "cell", + "dartName": "Cell", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetId", + "fieldName": "sheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rowId", + "fieldName": "rowId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "columnId", + "fieldName": "columnId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "content", + "fieldName": "content", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "note", + "fieldName": "note", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "numberFormat", + "fieldName": "numberFormat", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fontFamily", + "fieldName": "fontFamily", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fontSize", + "fieldName": "fontSize", + "columnType": 3, + "isNullable": true, + "dartType": "double?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "bold", + "fieldName": "bold", + "columnType": 1, + "isNullable": true, + "dartType": "bool?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "italic", + "fieldName": "italic", + "columnType": 1, + "isNullable": true, + "dartType": "bool?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "underline", + "fieldName": "underline", + "columnType": 1, + "isNullable": true, + "dartType": "bool?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "strikethrough", + "fieldName": "strikethrough", + "columnType": 1, + "isNullable": true, + "dartType": "bool?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "textColor", + "fieldName": "textColor", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fillColor", + "fieldName": "fillColor", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "hAlign", + "fieldName": "hAlign", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:HorizontalAlign?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "vAlign", + "fieldName": "vAlign", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:VerticalAlign?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "wrap", + "fieldName": "wrap", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:WrapStrategy?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rotation", + "fieldName": "rotation", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "borderTop", + "fieldName": "borderTop", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "borderRight", + "fieldName": "borderRight", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "borderBottom", + "fieldName": "borderBottom", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "borderLeft", + "fieldName": "borderLeft", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "linkUrl", + "fieldName": "linkUrl", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "cell_fk_0", + "columns": [ + "sheetId" + ], + "referenceTable": "sheet", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "cell_row_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "sheetId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "rowId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "cell_col_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "sheetId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "columnId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "cell_history", + "dartName": "CellHistory", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileUuid", + "fieldName": "fileUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetId", + "fieldName": "sheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rowId", + "fieldName": "rowId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "colId", + "fieldName": "colId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userUuid", + "fieldName": "userUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "actorKind", + "fieldName": "actorKind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:ActorKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "label", + "fieldName": "label", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "at", + "fieldName": "at", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "before", + "fieldName": "before", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "after", + "fieldName": "after", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "cell_history_cell_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileUuid" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "sheetId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "rowId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "colId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "at" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "cell_history_change_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileUuid" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "revision" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "rowId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "colId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "chart_link", + "dartName": "ChartLink", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "elementId", + "fieldName": "elementId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spreadsheetItemUuid", + "fieldName": "spreadsheetItemUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "chartObjectId", + "fieldName": "chartObjectId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetId", + "fieldName": "sheetId", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sourceSpecJson", + "fieldName": "sourceSpecJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "dataSnapshotJson", + "fieldName": "dataSnapshotJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sourceVersion", + "fieldName": "sourceVersion", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedBy", + "fieldName": "updatedBy", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "autoUpdate", + "fieldName": "autoUpdate", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "chart_link_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "chart_link_fk_1", + "columns": [ + "elementId" + ], + "referenceTable": "slide_element", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "chart_link_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "chart_link_element_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "elementId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "code_state", + "dartName": "CodeState", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "elementId", + "fieldName": "elementId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sortKey", + "fieldName": "sortKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "label", + "fieldName": "label", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "code", + "fieldName": "code", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "language", + "fieldName": "language", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "title", + "fieldName": "title", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "highlight", + "fieldName": "highlight", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "annotationsJson", + "fieldName": "annotationsJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "transitionJson", + "fieldName": "transitionJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "code_state_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "code_state_fk_1", + "columns": [ + "elementId" + ], + "referenceTable": "slide_element", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "code_state_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "code_state_element_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "elementId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "sortKey" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "comment", + "dartName": "Comment", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "threadId", + "fieldName": "threadId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "uuid", + "fieldName": "uuid", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authorId", + "fieldName": "authorId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authorKind", + "fieldName": "authorKind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:ActorKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "body", + "fieldName": "body", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "mentions", + "fieldName": "mentions", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "reactions", + "fieldName": "reactions", + "columnType": 0, + "isNullable": false, + "columnDefault": "'{}'", + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "editedAt", + "fieldName": "editedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "deletedAt", + "fieldName": "deletedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "systemEvent", + "fieldName": "systemEvent", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:CommentSystemEvent?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "publicationId", + "fieldName": "publicationId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "comment_fk_0", + "columns": [ + "threadId" + ], + "referenceTable": "comment_thread", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "comment_fk_1", + "columns": [ + "publicationId" + ], + "referenceTable": "publication", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "comment_thread_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "threadId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "comment_uuid_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "uuid" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "comment_created_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "comment_thread", + "dartName": "CommentThread", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "uuid", + "fieldName": "uuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "anchorKind", + "fieldName": "anchorKind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:CommentAnchorKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "anchorJson", + "fieldName": "anchorJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "quotedText", + "fieldName": "quotedText", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "status", + "fieldName": "status", + "columnType": 0, + "isNullable": false, + "columnDefault": "'open'", + "dartType": "protocol:CommentStatus" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdById", + "fieldName": "createdById", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "resolvedById", + "fieldName": "resolvedById", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "resolvedAt", + "fieldName": "resolvedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "assigneeId", + "fieldName": "assigneeId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "statusBeforeOrphan", + "fieldName": "statusBeforeOrphan", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:CommentStatus?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "orphanReasonJson", + "fieldName": "orphanReasonJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "suggestionId", + "fieldName": "suggestionId", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "comment_thread_fk_0", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "comment_thread_item_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "status" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "comment_thread_uuid_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "uuid" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "conditional_format_rule", + "dartName": "ConditionalFormatRule", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetId", + "fieldName": "sheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sortKey", + "fieldName": "sortKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rangesJson", + "fieldName": "rangesJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "ruleJson", + "fieldName": "ruleJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "enabled", + "fieldName": "enabled", + "columnType": 1, + "isNullable": false, + "columnDefault": "true", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "conditional_format_rule_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "conditional_format_rule_fk_1", + "columns": [ + "sheetId" + ], + "referenceTable": "sheet", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "conditional_format_rule_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "data_validation_rule", + "dartName": "DataValidationRule", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetId", + "fieldName": "sheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rangesJson", + "fieldName": "rangesJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "criteriaJson", + "fieldName": "criteriaJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "strict", + "fieldName": "strict", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "showDropdown", + "fieldName": "showDropdown", + "columnType": 1, + "isNullable": false, + "columnDefault": "true", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "displayStyle", + "fieldName": "displayStyle", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "helpText", + "fieldName": "helpText", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "data_validation_rule_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "data_validation_rule_fk_1", + "columns": [ + "sheetId" + ], + "referenceTable": "sheet", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "data_validation_rule_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "deck", + "dartName": "Deck", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "title", + "fieldName": "title", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "width", + "fieldName": "width", + "columnType": 3, + "isNullable": false, + "columnDefault": "1920.0", + "dartType": "double" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "height", + "fieldName": "height", + "columnType": 3, + "isNullable": false, + "columnDefault": "1080.0", + "dartType": "double" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sizePreset", + "fieldName": "sizePreset", + "columnType": 0, + "isNullable": false, + "columnDefault": "'widescreen16x9'", + "dartType": "protocol:SlideSizePreset" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "themeId", + "fieldName": "themeId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "appearance", + "fieldName": "appearance", + "columnType": 0, + "isNullable": false, + "columnDefault": "'light'", + "dartType": "protocol:DeckAppearance" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "language", + "fieldName": "language", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "showSlideNumbers", + "fieldName": "showSlideNumbers", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "hideNumberOnTitle", + "fieldName": "hideNumberOnTitle", + "columnType": 1, + "isNullable": false, + "columnDefault": "true", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "firstSlideNumber", + "fieldName": "firstSlideNumber", + "columnType": 6, + "isNullable": false, + "columnDefault": "1", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "footerText", + "fieldName": "footerText", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "defaultsJson", + "fieldName": "defaultsJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "guidesJson", + "fieldName": "guidesJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "presentJson", + "fieldName": "presentJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdBy", + "fieldName": "createdBy", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "deck_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "deck_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "deck_theme", + "dartName": "DeckTheme", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "deckId", + "fieldName": "deckId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sourceKey", + "fieldName": "sourceKey", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "colorsJson", + "fieldName": "colorsJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fontsJson", + "fieldName": "fontsJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "textStylesJson", + "fieldName": "textStylesJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "backgroundJson", + "fieldName": "backgroundJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "shapeStyleJson", + "fieldName": "shapeStyleJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "tableStyleJson", + "fieldName": "tableStyleJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "codeStyleJson", + "fieldName": "codeStyleJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "chartStyleJson", + "fieldName": "chartStyleJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sortKey", + "fieldName": "sortKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "deck_theme_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "deck_theme_fk_1", + "columns": [ + "deckId" + ], + "referenceTable": "deck", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "deck_theme_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "deck_theme_deck_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "deckId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "dimension_group", + "dartName": "DimensionGroup", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetId", + "fieldName": "sheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "dimension", + "fieldName": "dimension", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:Dimension" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "startId", + "fieldName": "startId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "endId", + "fieldName": "endId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "depth", + "fieldName": "depth", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "collapsed", + "fieldName": "collapsed", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "dimension_group_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "dimension_group_fk_1", + "columns": [ + "sheetId" + ], + "referenceTable": "sheet", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "dimension_group_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "document", + "dartName": "Document", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "uuid", + "fieldName": "uuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "headRevision", + "fieldName": "headRevision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "latestSnapshotRevision", + "fieldName": "latestSnapshotRevision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "themeId", + "fieldName": "themeId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "pageSetupJson", + "fieldName": "pageSetupJson", + "columnType": 0, + "isNullable": false, + "columnDefault": "'{}'", + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "language", + "fieldName": "language", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "frontMatter", + "fieldName": "frontMatter", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "charCount", + "fieldName": "charCount", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "wordCount", + "fieldName": "wordCount", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "document_fk_0", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "document_uuid_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "uuid" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "document_item_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "document_import_report", + "dartName": "DocumentImportReport", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "documentId", + "fieldName": "documentId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "warningsJson", + "fieldName": "warningsJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "seenAt", + "fieldName": "seenAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "document_import_report_fk_0", + "columns": [ + "documentId" + ], + "referenceTable": "document", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "document_import_report_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "documentId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "document_meta_change", + "dartName": "DocumentMetaChange", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "documentId", + "fieldName": "documentId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "field", + "fieldName": "field", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "clientOpId", + "fieldName": "clientOpId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "beforeJson", + "fieldName": "beforeJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "afterJson", + "fieldName": "afterJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authorId", + "fieldName": "authorId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "actorKind", + "fieldName": "actorKind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:ActorKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "document_meta_change_fk_0", + "columns": [ + "documentId" + ], + "referenceTable": "document", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "document_meta_change_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "documentId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "document_meta_change_client_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "documentId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "clientOpId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "document_op", + "dartName": "DocumentOp", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "documentId", + "fieldName": "documentId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "clientOpId", + "fieldName": "clientOpId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authorId", + "fieldName": "authorId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "actorKind", + "fieldName": "actorKind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:ActorKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sessionId", + "fieldName": "sessionId", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kind", + "fieldName": "kind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:DocumentOpKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "baseRevision", + "fieldName": "baseRevision", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "deltaJson", + "fieldName": "deltaJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "inverseJson", + "fieldName": "inverseJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "document_op_fk_0", + "columns": [ + "documentId" + ], + "referenceTable": "document", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "document_op_rev_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "documentId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "revision" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "document_op_client_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "documentId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "clientOpId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "document_op_created_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "brin", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "document_snapshot", + "dartName": "DocumentSnapshot", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "documentId", + "fieldName": "documentId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "deltaJson", + "fieldName": "deltaJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "compressed", + "fieldName": "compressed", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "document_snapshot_fk_0", + "columns": [ + "documentId" + ], + "referenceTable": "document", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "document_snapshot_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "documentId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "revision" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "drive_item", + "dartName": "DriveItem", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "uuid", + "fieldName": "uuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kind", + "fieldName": "kind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:DriveItemKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "ownerId", + "fieldName": "ownerId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "parentId", + "fieldName": "parentId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "description", + "fieldName": "description", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "contentRef", + "fieldName": "contentRef", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "thumbnailFileId", + "fieldName": "thumbnailFileId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sizeBytes", + "fieldName": "sizeBytes", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "attachmentBytes", + "fieldName": "attachmentBytes", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kindMask", + "fieldName": "kindMask", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "mimeType", + "fieldName": "mimeType", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileCategory", + "fieldName": "fileCategory", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:FileCategory?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "uploadState", + "fieldName": "uploadState", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:FileUploadState?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileMetaJson", + "fieldName": "fileMetaJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "previewFileId", + "fieldName": "previewFileId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdById", + "fieldName": "createdById", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "modifiedAt", + "fieldName": "modifiedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "modifiedById", + "fieldName": "modifiedById", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "trashedAt", + "fieldName": "trashedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "trashedById", + "fieldName": "trashedById", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "templateOf", + "fieldName": "templateOf", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:TemplateCategory?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "templateKey", + "fieldName": "templateKey", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "editorsCanShare", + "fieldName": "editorsCanShare", + "columnType": 1, + "isNullable": false, + "columnDefault": "true", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "nonEditorsCanExport", + "fieldName": "nonEditorsCanExport", + "columnType": 1, + "isNullable": false, + "columnDefault": "true", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "viewersSeeComments", + "fieldName": "viewersSeeComments", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "searchText", + "fieldName": "searchText", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "drive_item_fk_0", + "columns": [ + "ownerId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 2 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "drive_item_fk_1", + "columns": [ + "parentId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "drive_item_uuid_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "uuid" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "drive_item_parent_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "parentId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "drive_item_owner_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "ownerId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "trashedAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "drive_item_content_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "contentRef" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "drive_item_template_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "templateOf" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "drive_item_upload_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "uploadState" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "drive_item_trashed_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "trashedAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "drive_item_permission", + "dartName": "DriveItemPermission", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "invitedEmail", + "fieldName": "invitedEmail", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "role", + "fieldName": "role", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:AccessRole" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "inheritedFromId", + "fieldName": "inheritedFromId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "grantedById", + "fieldName": "grantedById", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "grantedAt", + "fieldName": "grantedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "expiresAt", + "fieldName": "expiresAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "viaPublicationId", + "fieldName": "viaPublicationId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "drive_item_permission_fk_0", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "drive_item_permission_fk_1", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "drive_item_permission_fk_2", + "columns": [ + "viaPublicationId" + ], + "referenceTable": "publication", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "perm_item_user_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "inheritedFromId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "invitedEmail" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false, + "nullsDistinct": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "perm_user_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "perm_email_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "invitedEmail" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "perm_expires_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "expiresAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "perm_granted_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "grantedAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "drive_item_user_state", + "dartName": "DriveItemUserState", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "starred", + "fieldName": "starred", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastOpenedAt", + "fieldName": "lastOpenedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastEditedAt", + "fieldName": "lastEditedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "pinnedOffline", + "fieldName": "pinnedOffline", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "shortcutParentId", + "fieldName": "shortcutParentId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "viaLink", + "fieldName": "viaLink", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "drive_item_user_state_fk_0", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "drive_item_user_state_fk_1", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "drive_item_user_state_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "drive_item_user_recent_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "lastOpenedAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "embedded_object", + "dartName": "EmbeddedObject", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetId", + "fieldName": "sheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kind", + "fieldName": "kind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:EmbeddedObjectKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "anchorJson", + "fieldName": "anchorJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "specJson", + "fieldName": "specJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "zIndex", + "fieldName": "zIndex", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "title", + "fieldName": "title", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "altText", + "fieldName": "altText", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "embedded_object_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "embedded_object_fk_1", + "columns": [ + "sheetId" + ], + "referenceTable": "sheet", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "embedded_object_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "feedback_report", + "dartName": "FeedbackReport", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kind", + "fieldName": "kind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:FeedbackKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "message", + "fieldName": "message", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "app", + "fieldName": "app", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "appVersion", + "fieldName": "appVersion", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "platform", + "fieldName": "platform", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "route", + "fieldName": "route", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "stackTrace", + "fieldName": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "contextJson", + "fieldName": "contextJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "feedback_report_created_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "filter_view", + "dartName": "FilterView", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetId", + "fieldName": "sheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rangeJson", + "fieldName": "rangeJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "criteriaJson", + "fieldName": "criteriaJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sortJson", + "fieldName": "sortJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdBy", + "fieldName": "createdBy", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "filter_view_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "filter_view_fk_1", + "columns": [ + "sheetId" + ], + "referenceTable": "sheet", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "filter_view_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "headless_change", + "dartName": "HeadlessChange", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "changeId", + "fieldName": "changeId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kind", + "fieldName": "kind", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "documentId", + "fieldName": "documentId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "inverseJson", + "fieldName": "inverseJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "metaField", + "fieldName": "metaField", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "metaBeforeJson", + "fieldName": "metaBeforeJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "metaAfterJson", + "fieldName": "metaAfterJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "actorKind", + "fieldName": "actorKind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:ActorKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "label", + "fieldName": "label", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "toolName", + "fieldName": "toolName", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revertedAt", + "fieldName": "revertedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "headless_change_fk_0", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "headless_change_id_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "changeId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "headless_change_created_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "item_version", + "dartName": "ItemVersion", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kind", + "fieldName": "kind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:VersionKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdById", + "fieldName": "createdById", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authors", + "fieldName": "authors", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "storageKind", + "fieldName": "storageKind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:VersionStorage" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "snapshotFileId", + "fieldName": "snapshotFileId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sizeBytes", + "fieldName": "sizeBytes", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "item_version_fk_0", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "item_version_item_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "item_version_state", + "dartName": "ItemVersionState", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastEditAt", + "fieldName": "lastEditAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "dirtySince", + "fieldName": "dirtySince", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastVersionAt", + "fieldName": "lastVersionAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "editorsSinceLastVersion", + "fieldName": "editorsSinceLastVersion", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastRevision", + "fieldName": "lastRevision", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "capturingSince", + "fieldName": "capturingSince", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "item_version_state_fk_0", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "item_version_state_item_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "item_version_state_dirty_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "dirtySince" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "item_view_day", + "dartName": "ItemViewDay", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "day", + "fieldName": "day", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "views", + "fieldName": "views", + "columnType": 6, + "isNullable": false, + "columnDefault": "1", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastViewedAt", + "fieldName": "lastViewedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "item_view_day_fk_0", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "item_view_day_fk_1", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "item_view_day_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "day" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "item_view_day_item_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "day" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "macro", + "dartName": "Macro", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "projectId", + "fieldName": "projectId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "functionName", + "fieldName": "functionName", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "shortcutSlot", + "fieldName": "shortcutSlot", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "macro_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "macro_fk_1", + "columns": [ + "projectId" + ], + "referenceTable": "script_project", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "macro_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "merged_range", + "dartName": "MergedRange", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetId", + "fieldName": "sheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rangeJson", + "fieldName": "rangeJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "merged_range_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "merged_range_fk_1", + "columns": [ + "sheetId" + ], + "referenceTable": "sheet", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "merged_range_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "named_range", + "dartName": "NamedRange", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spreadsheetId", + "fieldName": "spreadsheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rangeJson", + "fieldName": "rangeJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "formula", + "fieldName": "formula", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "comment", + "fieldName": "comment", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "metaJson", + "fieldName": "metaJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "named_range_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "named_range_fk_1", + "columns": [ + "spreadsheetId" + ], + "referenceTable": "spreadsheet", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "named_range_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "notification", + "dartName": "UserNotification", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kind", + "fieldName": "kind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:NotificationKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "actorId", + "fieldName": "actorId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "payload", + "fieldName": "payload", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "readAt", + "fieldName": "readAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "emailedAt", + "fieldName": "emailedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "emailPending", + "fieldName": "emailPending", + "columnType": 1, + "isNullable": true, + "columnDefault": "false", + "dartType": "bool?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "notification_fk_0", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "notification_user_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "notification_email_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "emailPending" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "notification_created_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "brin", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "ownership_transfer", + "dartName": "OwnershipTransfer", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fromUserId", + "fieldName": "fromUserId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "toUserId", + "fieldName": "toUserId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "handledAt", + "fieldName": "handledAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "accepted", + "fieldName": "accepted", + "columnType": 1, + "isNullable": true, + "dartType": "bool?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "ownership_transfer_fk_0", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "ownership_transfer_fk_1", + "columns": [ + "toUserId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "ownership_transfer_item_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "handledAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "personal_access_token", + "dartName": "PersonalAccessToken", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "tokenHash", + "fieldName": "tokenHash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "prefix", + "fieldName": "prefix", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "scopes", + "fieldName": "scopes", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "expiresAt", + "fieldName": "expiresAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastUsedAt", + "fieldName": "lastUsedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revokedAt", + "fieldName": "revokedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "personal_access_token_fk_0", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "personal_access_token_user_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "personal_access_token_hash_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "tokenHash" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "pivot_table", + "dartName": "PivotTable", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetId", + "fieldName": "sheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "anchorRowId", + "fieldName": "anchorRowId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "anchorColId", + "fieldName": "anchorColId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sourceRangeJson", + "fieldName": "sourceRangeJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "specJson", + "fieldName": "specJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "pivot_table_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "pivot_table_fk_1", + "columns": [ + "sheetId" + ], + "referenceTable": "sheet", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "pivot_table_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "protected_range", + "dartName": "ProtectedRange", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetId", + "fieldName": "sheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rangeJson", + "fieldName": "rangeJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "exceptRangesJson", + "fieldName": "exceptRangesJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "description", + "fieldName": "description", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "warningOnly", + "fieldName": "warningOnly", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "editorsJson", + "fieldName": "editorsJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdBy", + "fieldName": "createdBy", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "protected_range_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "protected_range_fk_1", + "columns": [ + "sheetId" + ], + "referenceTable": "sheet", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "protected_range_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "publication", + "dartName": "Publication", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "publicId", + "fieldName": "publicId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "ownerId", + "fieldName": "ownerId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "siteUrl", + "fieldName": "siteUrl", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "webhookUrl", + "fieldName": "webhookUrl", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "verifiedHost", + "fieldName": "verifiedHost", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "verifiedAt", + "fieldName": "verifiedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "templateItemId", + "fieldName": "templateItemId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "termsUrl", + "fieldName": "termsUrl", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fields", + "fieldName": "fields", + "columnType": 8, + "isNullable": false, + "dartType": "protocol:PublicationFields" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "signingSecret", + "fieldName": "signingSecret", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "previousSigningSecret", + "fieldName": "previousSigningSecret", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "previousSecretUntil", + "fieldName": "previousSecretUntil", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "apiKeyHash", + "fieldName": "apiKeyHash", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "apiKeyLast4", + "fieldName": "apiKeyLast4", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "enabled", + "fieldName": "enabled", + "columnType": 1, + "isNullable": false, + "columnDefault": "true", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "publication_fk_0", + "columns": [ + "ownerId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "publication_fk_1", + "columns": [ + "templateItemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "publication_public_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "publicId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "publication_owner_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "ownerId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "publication_api_key_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "apiKeyHash" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "publication_block", + "dartName": "PublicationBlock", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "publicationId", + "fieldName": "publicationId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "at", + "fieldName": "at", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "publication_block_fk_0", + "columns": [ + "publicationId" + ], + "referenceTable": "publication", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "publication_block_fk_1", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "publication_block_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "publicationId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "publication_consent", + "dartName": "PublicationConsent", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "publicationId", + "fieldName": "publicationId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "consentKey", + "fieldName": "consentKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "at", + "fieldName": "at", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "publication_consent_fk_0", + "columns": [ + "publicationId" + ], + "referenceTable": "publication", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "publication_consent_fk_1", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "publication_consent_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "publicationId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "publication_delivery", + "dartName": "PublicationDelivery", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "publicationId", + "fieldName": "publicationId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "submissionId", + "fieldName": "submissionId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "webhookId", + "fieldName": "webhookId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "type", + "fieldName": "type", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sequence", + "fieldName": "sequence", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "payload", + "fieldName": "payload", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "attempts", + "fieldName": "attempts", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "nextAttemptAt", + "fieldName": "nextAttemptAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "leaseUntil", + "fieldName": "leaseUntil", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastStatus", + "fieldName": "lastStatus", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastError", + "fieldName": "lastError", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "deliveredAt", + "fieldName": "deliveredAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "failedAt", + "fieldName": "failedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "publication_delivery_fk_0", + "columns": [ + "publicationId" + ], + "referenceTable": "publication", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "publication_delivery_fk_1", + "columns": [ + "submissionId" + ], + "referenceTable": "submission", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "publication_delivery_webhook_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "webhookId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "publication_delivery_due_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "nextAttemptAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "publication_delivery_publication_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "publicationId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "publication_moderator", + "dartName": "PublicationModerator", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "publicationId", + "fieldName": "publicationId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "email", + "fieldName": "email", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "publication_moderator_fk_0", + "columns": [ + "publicationId" + ], + "referenceTable": "publication", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "publication_moderator_fk_1", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "publication_moderator_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "publicationId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "publication_moderator_user_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "rev_file", + "dartName": "RevFile", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileUuid", + "fieldName": "fileUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kind", + "fieldName": "kind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:RevFileKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "headRevision", + "fieldName": "headRevision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "prunedBelow", + "fieldName": "prunedBelow", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "initPending", + "fieldName": "initPending", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "purging", + "fieldName": "purging", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "schemaHash", + "fieldName": "schemaHash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "stats", + "fieldName": "stats", + "columnType": 0, + "isNullable": false, + "columnDefault": "'{}'", + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "contentCount", + "fieldName": "contentCount", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "rev_file_fk_0", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 2 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "rev_file_uuid_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileUuid" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "rev_file_item_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "rev_hook_state", + "dartName": "RevHookState", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "cursorsJson", + "fieldName": "cursorsJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "leaseOwner", + "fieldName": "leaseOwner", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "leaseUntil", + "fieldName": "leaseUntil", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "attempts", + "fieldName": "attempts", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastError", + "fieldName": "lastError", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "nextAttemptAt", + "fieldName": "nextAttemptAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "rev_hook_state_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "rev_hook_state_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "rev_hook_state_due_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "nextAttemptAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "rev_op", + "dartName": "RevOp", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "clientOpId", + "fieldName": "clientOpId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "baseRevision", + "fieldName": "baseRevision", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authorId", + "fieldName": "authorId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authorUuid", + "fieldName": "authorUuid", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sessionId", + "fieldName": "sessionId", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "onBehalfOfSessionId", + "fieldName": "onBehalfOfSessionId", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "actorKind", + "fieldName": "actorKind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:ActorKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "label", + "fieldName": "label", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "groupId", + "fieldName": "groupId", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "groupIndex", + "fieldName": "groupIndex", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "groupLast", + "fieldName": "groupLast", + "columnType": 1, + "isNullable": false, + "columnDefault": "true", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "recordId", + "fieldName": "recordId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "offline", + "fieldName": "offline", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "payload", + "fieldName": "payload", + "columnType": 5, + "isNullable": true, + "dartType": "dart:typed_data:ByteData?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "changeCount", + "fieldName": "changeCount", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "summaryJson", + "fieldName": "summaryJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "detailJson", + "fieldName": "detailJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "outcomeJson", + "fieldName": "outcomeJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "appliedEqualsSubmitted", + "fieldName": "appliedEqualsSubmitted", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "clientCreatedAt", + "fieldName": "clientCreatedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "committedAt", + "fieldName": "committedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "rev_op_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "rev_op_rev_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "revision" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "rev_op_client_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "clientOpId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "rev_op_record_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "recordId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "rev_op_committed_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "committedAt" + } + ], + "type": "brin", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "script_authorization", + "dartName": "ScriptAuthorization", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spreadsheetUuid", + "fieldName": "spreadsheetUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "scopes", + "fieldName": "scopes", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "grantedAt", + "fieldName": "grantedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revokedAt", + "fieldName": "revokedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "script_auth_user_sheet_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "spreadsheetUuid" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "script_build", + "dartName": "ScriptBuild", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "projectId", + "fieldName": "projectId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "status", + "fieldName": "status", + "columnType": 0, + "isNullable": false, + "columnDefault": "'ok'", + "dartType": "protocol:ScriptBuildStatus" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sourceHash", + "fieldName": "sourceHash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "bytecodeFileUuid", + "fieldName": "bytecodeFileUuid", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "diagnosticsJson", + "fieldName": "diagnosticsJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "exportsJson", + "fieldName": "exportsJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "apiVersion", + "fieldName": "apiVersion", + "columnType": 6, + "isNullable": false, + "columnDefault": "1", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "compilerVersion", + "fieldName": "compilerVersion", + "columnType": 0, + "isNullable": false, + "columnDefault": "''", + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "requestedBy", + "fieldName": "requestedBy", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastGoodSourceHash", + "fieldName": "lastGoodSourceHash", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastGoodBytecodeFileUuid", + "fieldName": "lastGoodBytecodeFileUuid", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastGoodExportsJson", + "fieldName": "lastGoodExportsJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastGoodBuiltAt", + "fieldName": "lastGoodBuiltAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "positionsFileUuid", + "fieldName": "positionsFileUuid", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "builtAt", + "fieldName": "builtAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "script_build_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "script_build_fk_1", + "columns": [ + "projectId" + ], + "referenceTable": "script_project", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "script_build_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "script_execution", + "dartName": "ScriptExecution", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "uuid", + "fieldName": "uuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spreadsheetUuid", + "fieldName": "spreadsheetUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "projectId", + "fieldName": "projectId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "functionName", + "fieldName": "functionName", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kind", + "fieldName": "kind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:ScriptExecutionKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "triggerId", + "fieldName": "triggerId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "runAsUserId", + "fieldName": "runAsUserId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "runtime", + "fieldName": "runtime", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:ScriptRuntimeKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "status", + "fieldName": "status", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:ScriptExecutionStatus" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "buildSourceHash", + "fieldName": "buildSourceHash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "startedAt", + "fieldName": "startedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "durationMs", + "fieldName": "durationMs", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "logs", + "fieldName": "logs", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "errorMessage", + "fieldName": "errorMessage", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "errorStackJson", + "fieldName": "errorStackJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "changeId", + "fieldName": "changeId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "cellsRead", + "fieldName": "cellsRead", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "cellsWritten", + "fieldName": "cellsWritten", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fetchCalls", + "fieldName": "fetchCalls", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "callCount", + "fieldName": "callCount", + "columnType": 6, + "isNullable": false, + "columnDefault": "1", + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "script_exec_uuid_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "uuid" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "script_exec_sheet_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "spreadsheetUuid" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "startedAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "script_exec_user_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "startedAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "script_file", + "dartName": "ScriptFile", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "projectId", + "fieldName": "projectId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sortKey", + "fieldName": "sortKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "source", + "fieldName": "source", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "contentHash", + "fieldName": "contentHash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedBy", + "fieldName": "updatedBy", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "script_file_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "script_file_fk_1", + "columns": [ + "projectId" + ], + "referenceTable": "script_project", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "script_file_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "script_job", + "dartName": "ScriptJob", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kind", + "fieldName": "kind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:ScriptExecutionKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spreadsheetUuid", + "fieldName": "spreadsheetUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemUuid", + "fieldName": "itemUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "triggerId", + "fieldName": "triggerId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "runAsUserId", + "fieldName": "runAsUserId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "functionName", + "fieldName": "functionName", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "payloadJson", + "fieldName": "payloadJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "status", + "fieldName": "status", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:ScriptExecutionStatus" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "enqueuedAt", + "fieldName": "enqueuedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "leaseOwner", + "fieldName": "leaseOwner", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "leaseUntil", + "fieldName": "leaseUntil", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "attempts", + "fieldName": "attempts", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "coalesced", + "fieldName": "coalesced", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "resultJson", + "fieldName": "resultJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "finishedAt", + "fieldName": "finishedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "script_job_status_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "status" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "enqueuedAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "script_job_trigger_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "triggerId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "status" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "script_job_user_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "runAsUserId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "status" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "script_project", + "dartName": "ScriptProject", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spreadsheetId", + "fieldName": "spreadsheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "settingsJson", + "fieldName": "settingsJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "script_project_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "script_project_fk_1", + "columns": [ + "spreadsheetId" + ], + "referenceTable": "spreadsheet", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "script_project_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "script_property", + "dartName": "ScriptProperty", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "projectId", + "fieldName": "projectId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "key", + "fieldName": "key", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "value", + "fieldName": "value", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "script_property_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "script_property_fk_1", + "columns": [ + "projectId" + ], + "referenceTable": "script_project", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "script_property_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "script_quota_usage", + "dartName": "ScriptQuotaUsage", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "day", + "fieldName": "day", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "serverRuntimeMs", + "fieldName": "serverRuntimeMs", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "clientRuntimeMs", + "fieldName": "clientRuntimeMs", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "urlFetchCalls", + "fieldName": "urlFetchCalls", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "urlFetchBytes", + "fieldName": "urlFetchBytes", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "triggerRuns", + "fieldName": "triggerRuns", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "script_quota_user_day_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "day" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "script_trigger", + "dartName": "ScriptTrigger", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "projectId", + "fieldName": "projectId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kind", + "fieldName": "kind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:TriggerKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "functionName", + "fieldName": "functionName", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "scheduleJson", + "fieldName": "scheduleJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "runAsUserId", + "fieldName": "runAsUserId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "enabled", + "fieldName": "enabled", + "columnType": 1, + "isNullable": false, + "columnDefault": "true", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "optionsJson", + "fieldName": "optionsJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "script_trigger_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "script_trigger_fk_1", + "columns": [ + "projectId" + ], + "referenceTable": "script_project", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "script_trigger_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "script_trigger_state", + "dartName": "ScriptTriggerState", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "triggerId", + "fieldName": "triggerId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spreadsheetUuid", + "fieldName": "spreadsheetUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "scheduleJson", + "fieldName": "scheduleJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "nextRunAt", + "fieldName": "nextRunAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastRunAt", + "fieldName": "lastRunAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastStatus", + "fieldName": "lastStatus", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:ScriptExecutionStatus?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "consecutiveFailures", + "fieldName": "consecutiveFailures", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "disabledReason", + "fieldName": "disabledReason", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "runningSince", + "fieldName": "runningSince", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastNotifiedAt", + "fieldName": "lastNotifiedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "script_trigger_state_id_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "triggerId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "script_trigger_state_due_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "nextRunAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "script_user_property", + "dartName": "ScriptUserProperty", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileUuid", + "fieldName": "fileUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "key", + "fieldName": "key", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "value", + "fieldName": "value", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "script_user_property_fk_0", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "script_user_property_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileUuid" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "key" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "server_change_record", + "dartName": "ServerChangeRecord", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "changeId", + "fieldName": "changeId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileUuid", + "fieldName": "fileUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "actorKind", + "fieldName": "actorKind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:ActorKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "label", + "fieldName": "label", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "inverseJson", + "fieldName": "inverseJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "inverseFileId", + "fieldName": "inverseFileId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "forwardFileId", + "fieldName": "forwardFileId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "recordId", + "fieldName": "recordId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "cellsAffected", + "fieldName": "cellsAffected", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "expiresAt", + "fieldName": "expiresAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revertedAt", + "fieldName": "revertedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revertChangeId", + "fieldName": "revertChangeId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "server_change_record_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "recordId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "server_change_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileUuid" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "server_change_id_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "changeId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "share_link", + "dartName": "ShareLink", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "token", + "fieldName": "token", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "role", + "fieldName": "role", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:AccessRole?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdById", + "fieldName": "createdById", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "share_link_fk_0", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "share_link_item_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "share_link_token_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "token" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "sheet", + "dartName": "Sheet", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spreadsheetId", + "fieldName": "spreadsheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sortKey", + "fieldName": "sortKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kind", + "fieldName": "kind", + "columnType": 0, + "isNullable": false, + "columnDefault": "'grid'", + "dartType": "protocol:SheetKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "hidden", + "fieldName": "hidden", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "tabColor", + "fieldName": "tabColor", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rightToLeft", + "fieldName": "rightToLeft", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "showGridlines", + "fieldName": "showGridlines", + "columnType": 1, + "isNullable": false, + "columnDefault": "true", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "frozenRows", + "fieldName": "frozenRows", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "frozenColumns", + "fieldName": "frozenColumns", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "defaultRowHeight", + "fieldName": "defaultRowHeight", + "columnType": 3, + "isNullable": false, + "columnDefault": "21.0", + "dartType": "double" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "defaultColumnWidth", + "fieldName": "defaultColumnWidth", + "columnType": 3, + "isNullable": false, + "columnDefault": "100.0", + "dartType": "double" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "formatJson", + "fieldName": "formatJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "printSettingsJson", + "fieldName": "printSettingsJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "sheet_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "sheet_fk_1", + "columns": [ + "spreadsheetId" + ], + "referenceTable": "spreadsheet", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "sheet_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "sheet_order_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "spreadsheetId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "sortKey" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "sheet_column", + "dartName": "SheetColumn", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetId", + "fieldName": "sheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sortKey", + "fieldName": "sortKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "width", + "fieldName": "width", + "columnType": 3, + "isNullable": true, + "dartType": "double?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "hidden", + "fieldName": "hidden", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "formatJson", + "fieldName": "formatJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "sheet_column_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "sheet_column_fk_1", + "columns": [ + "sheetId" + ], + "referenceTable": "sheet", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "sheet_column_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "sheet_column_order_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "sheetId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "sortKey" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "sheet_row", + "dartName": "SheetRow", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetId", + "fieldName": "sheetId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sortKey", + "fieldName": "sortKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "height", + "fieldName": "height", + "columnType": 3, + "isNullable": true, + "dartType": "double?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "hidden", + "fieldName": "hidden", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "formatJson", + "fieldName": "formatJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "sheet_row_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "sheet_row_fk_1", + "columns": [ + "sheetId" + ], + "referenceTable": "sheet", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "sheet_row_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "sheet_row_order_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "sheetId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "sortKey" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "sheets_import_job", + "dartName": "SheetsImportJob", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "uuid", + "fieldName": "uuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authUserId", + "fieldName": "authUserId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spreadsheetUuid", + "fieldName": "spreadsheetUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "uploadFileId", + "fieldName": "uploadFileId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileName", + "fieldName": "fileName", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "format", + "fieldName": "format", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "optionsJson", + "fieldName": "optionsJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "activeSheetId", + "fieldName": "activeSheetId", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "status", + "fieldName": "status", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:SheetsImportStatus" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "progressDone", + "fieldName": "progressDone", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "progressTotal", + "fieldName": "progressTotal", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "reportJson", + "fieldName": "reportJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetIdsJson", + "fieldName": "sheetIdsJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "changeId", + "fieldName": "changeId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "errorCode", + "fieldName": "errorCode", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "error", + "fieldName": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "cancelRequested", + "fieldName": "cancelRequested", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "leaseOwner", + "fieldName": "leaseOwner", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "leaseUntil", + "fieldName": "leaseUntil", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "sheets_import_job_uuid_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "uuid" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "sheets_import_job_user_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "status" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "sheets_snapshot_index", + "dartName": "SheetsSnapshotIndex", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemVersionId", + "fieldName": "itemVersionId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetsJson", + "fieldName": "sheetsJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "changedRangesJson", + "fieldName": "changedRangesJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authorIds", + "fieldName": "authorIds", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "diffFileId", + "fieldName": "diffFileId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "sheets_snapshot_index_fk_0", + "columns": [ + "itemVersionId" + ], + "referenceTable": "item_version", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "sheets_snapshot_index_version_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemVersionId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "slide", + "dartName": "Slide", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "deckId", + "fieldName": "deckId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sortKey", + "fieldName": "sortKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "groupId", + "fieldName": "groupId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "layoutId", + "fieldName": "layoutId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "backgroundJson", + "fieldName": "backgroundJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "skipped", + "fieldName": "skipped", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "notes", + "fieldName": "notes", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "transitionJson", + "fieldName": "transitionJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "hideMasterElements", + "fieldName": "hideMasterElements", + "columnType": 1, + "isNullable": true, + "dartType": "bool?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "timingsJson", + "fieldName": "timingsJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_fk_1", + "columns": [ + "deckId" + ], + "referenceTable": "deck", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_order_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "deckId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "sortKey" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "slide_build", + "dartName": "SlideBuild", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "slideId", + "fieldName": "slideId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "elementId", + "fieldName": "elementId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kind", + "fieldName": "kind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:BuildKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "effect", + "fieldName": "effect", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sortKey", + "fieldName": "sortKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "trigger", + "fieldName": "trigger", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:BuildTrigger" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "delayMs", + "fieldName": "delayMs", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "durationMs", + "fieldName": "durationMs", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "easing", + "fieldName": "easing", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "optionsJson", + "fieldName": "optionsJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_build_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_build_fk_1", + "columns": [ + "slideId" + ], + "referenceTable": "slide", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_build_fk_2", + "columns": [ + "elementId" + ], + "referenceTable": "slide_element", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_build_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_build_slide_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "slideId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "sortKey" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_build_element_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "elementId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "slide_element", + "dartName": "SlideElement", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "slideId", + "fieldName": "slideId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "layoutId", + "fieldName": "layoutId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "masterId", + "fieldName": "masterId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "parentId", + "fieldName": "parentId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kind", + "fieldName": "kind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:SlideElementKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "x", + "fieldName": "x", + "columnType": 3, + "isNullable": true, + "dartType": "double?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "y", + "fieldName": "y", + "columnType": 3, + "isNullable": true, + "dartType": "double?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "width", + "fieldName": "width", + "columnType": 3, + "isNullable": true, + "dartType": "double?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "height", + "fieldName": "height", + "columnType": 3, + "isNullable": true, + "dartType": "double?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rotation", + "fieldName": "rotation", + "columnType": 3, + "isNullable": true, + "dartType": "double?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "flipH", + "fieldName": "flipH", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "flipV", + "fieldName": "flipV", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "zKey", + "fieldName": "zKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "readingKey", + "fieldName": "readingKey", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "locked", + "fieldName": "locked", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "hidden", + "fieldName": "hidden", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "placeholderType", + "fieldName": "placeholderType", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:PlaceholderType?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "placeholderOf", + "fieldName": "placeholderOf", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "matchKey", + "fieldName": "matchKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "text", + "fieldName": "text", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "textStyleJson", + "fieldName": "textStyleJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fillJson", + "fieldName": "fillJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "strokeJson", + "fieldName": "strokeJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "effectsJson", + "fieldName": "effectsJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "opacity", + "fieldName": "opacity", + "columnType": 3, + "isNullable": true, + "dartType": "double?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "dataJson", + "fieldName": "dataJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "linkJson", + "fieldName": "linkJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "altText", + "fieldName": "altText", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "decorative", + "fieldName": "decorative", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_element_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_element_fk_1", + "columns": [ + "slideId" + ], + "referenceTable": "slide", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_element_fk_2", + "columns": [ + "layoutId" + ], + "referenceTable": "slide_layout", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_element_fk_3", + "columns": [ + "masterId" + ], + "referenceTable": "slide_master", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_element_fk_4", + "columns": [ + "parentId" + ], + "referenceTable": "slide_element", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_element_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_element_slide_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "slideId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "zKey" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_element_layout_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "layoutId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_element_master_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "masterId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_element_parent_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "parentId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "slide_group", + "dartName": "SlideGroup", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "deckId", + "fieldName": "deckId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "title", + "fieldName": "title", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sortKey", + "fieldName": "sortKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "parentId", + "fieldName": "parentId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "color", + "fieldName": "color", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "skipped", + "fieldName": "skipped", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_group_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_group_fk_1", + "columns": [ + "deckId" + ], + "referenceTable": "deck", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_group_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_group_order_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "deckId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "sortKey" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "slide_layout", + "dartName": "SlideLayout", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "masterId", + "fieldName": "masterId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "key", + "fieldName": "key", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sortKey", + "fieldName": "sortKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "backgroundJson", + "fieldName": "backgroundJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "hideMasterElements", + "fieldName": "hideMasterElements", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "hidden", + "fieldName": "hidden", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_layout_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_layout_fk_1", + "columns": [ + "masterId" + ], + "referenceTable": "slide_master", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_layout_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_layout_master_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "masterId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "slide_master", + "dartName": "SlideMaster", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "themeId", + "fieldName": "themeId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sortKey", + "fieldName": "sortKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "backgroundJson", + "fieldName": "backgroundJson", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_master_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_master_fk_1", + "columns": [ + "themeId" + ], + "referenceTable": "deck_theme", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_master_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_master_theme_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "themeId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "slide_table_axis", + "dartName": "SlideTableAxis", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "elementId", + "fieldName": "elementId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "dimension", + "fieldName": "dimension", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:TableDimension" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sortKey", + "fieldName": "sortKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "size", + "fieldName": "size", + "columnType": 3, + "isNullable": true, + "dartType": "double?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "header", + "fieldName": "header", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_table_axis_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_table_axis_fk_1", + "columns": [ + "elementId" + ], + "referenceTable": "slide_element", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_table_axis_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_table_axis_element_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "elementId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "sortKey" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "slide_table_cell", + "dartName": "SlideTableCell", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "elementId", + "fieldName": "elementId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rowId", + "fieldName": "rowId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "columnId", + "fieldName": "columnId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "text", + "fieldName": "text", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fill", + "fieldName": "fill", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "borderTop", + "fieldName": "borderTop", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "borderRight", + "fieldName": "borderRight", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "borderBottom", + "fieldName": "borderBottom", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "borderLeft", + "fieldName": "borderLeft", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "vAlign", + "fieldName": "vAlign", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "padding", + "fieldName": "padding", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rowSpan", + "fieldName": "rowSpan", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "colSpan", + "fieldName": "colSpan", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_table_cell_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_table_cell_fk_1", + "columns": [ + "elementId" + ], + "referenceTable": "slide_element", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_table_cell_fk_2", + "columns": [ + "rowId" + ], + "referenceTable": "slide_table_axis", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slide_table_cell_fk_3", + "columns": [ + "columnId" + ], + "referenceTable": "slide_table_axis", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_table_cell_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slide_table_cell_element_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "elementId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "slides_snapshot_index", + "dartName": "SlidesSnapshotIndex", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemVersionId", + "fieldName": "itemVersionId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "slidesJson", + "fieldName": "slidesJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "changesJson", + "fieldName": "changesJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authorIds", + "fieldName": "authorIds", + "columnType": 8, + "isNullable": false, + "dartType": "List" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "slides_snapshot_index_fk_0", + "columns": [ + "itemVersionId" + ], + "referenceTable": "item_version", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "slides_snapshot_index_version_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemVersionId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "spreadsheet", + "dartName": "Spreadsheet", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileId", + "fieldName": "fileId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "title", + "fieldName": "title", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "locale", + "fieldName": "locale", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "timeZone", + "fieldName": "timeZone", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "recalcMode", + "fieldName": "recalcMode", + "columnType": 0, + "isNullable": false, + "columnDefault": "'onChange'", + "dartType": "protocol:RecalcMode" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "iterativeCalc", + "fieldName": "iterativeCalc", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "maxIterations", + "fieldName": "maxIterations", + "columnType": 6, + "isNullable": false, + "columnDefault": "50", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "convergenceThreshold", + "fieldName": "convergenceThreshold", + "columnType": 3, + "isNullable": false, + "columnDefault": "0.05", + "dartType": "double" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "defaultFontFamily", + "fieldName": "defaultFontFamily", + "columnType": 0, + "isNullable": false, + "columnDefault": "'Inter'", + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "defaultFontSize", + "fieldName": "defaultFontSize", + "columnType": 3, + "isNullable": false, + "columnDefault": "10.0", + "dartType": "double" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "themeJson", + "fieldName": "themeJson", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "displayLanguage", + "fieldName": "displayLanguage", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdBy", + "fieldName": "createdBy", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "spreadsheet_fk_0", + "columns": [ + "fileId" + ], + "referenceTable": "rev_file", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "spreadsheet_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "storage_reservation", + "dartName": "StorageReservation", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileUuid", + "fieldName": "fileUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "bytes", + "fieldName": "bytes", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "expiresAt", + "fieldName": "expiresAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "storage_reservation_fk_0", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "storage_reservation_fk_1", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "storage_reservation_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileUuid" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "storage_reservation_user_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "storage_reservation_expiry_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "expiresAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "stored_file", + "dartName": "StoredFile", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileUuid", + "fieldName": "fileUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "ownerId", + "fieldName": "ownerId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "kind", + "fieldName": "kind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:StoredFileKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "storageId", + "fieldName": "storageId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "path", + "fieldName": "path", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileName", + "fieldName": "fileName", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "mimeType", + "fieldName": "mimeType", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sizeBytes", + "fieldName": "sizeBytes", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "status", + "fieldName": "status", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:StoredFileStatus" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "completedAt", + "fieldName": "completedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "expiresAt", + "fieldName": "expiresAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "stored_file_fk_0", + "columns": [ + "ownerId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "stored_file_fk_1", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "stored_file_uuid_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileUuid" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "stored_file_item_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "stored_file_expiry_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "expiresAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "stored_file_owner_kind_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "ownerId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "kind" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "stored_file_status_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "status" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "submission", + "dartName": "Submission", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "uuid", + "fieldName": "uuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "publicationId", + "fieldName": "publicationId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "itemId", + "fieldName": "itemId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "ref", + "fieldName": "ref", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "status", + "fieldName": "status", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:SubmissionStatus" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "statusBeforeSubmit", + "fieldName": "statusBeforeSubmit", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:SubmissionStatus?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "delivery", + "fieldName": "delivery", + "columnType": 0, + "isNullable": true, + "dartType": "protocol:SubmissionDeliveryState?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "values", + "fieldName": "values", + "columnType": 8, + "isNullable": false, + "dartType": "protocol:SubmissionValues" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "publicUrl", + "fieldName": "publicUrl", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "feedbackThreadId", + "fieldName": "feedbackThreadId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdById", + "fieldName": "createdById", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "disconnectedAt", + "fieldName": "disconnectedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "submission_fk_0", + "columns": [ + "publicationId" + ], + "referenceTable": "publication", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "submission_fk_1", + "columns": [ + "itemId" + ], + "referenceTable": "drive_item", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "submission_uuid_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "uuid" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "submission_item_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "itemId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "submission_publication_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "publicationId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "status" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "submission_asset", + "dartName": "SubmissionAsset", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "submissionId", + "fieldName": "submissionId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fileUuid", + "fieldName": "fileUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "submission_asset_fk_0", + "columns": [ + "submissionId" + ], + "referenceTable": "submission", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "submission_asset_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "submissionId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileUuid" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "submission_asset_file_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fileUuid" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "submission_revision", + "dartName": "SubmissionRevision", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "submissionId", + "fieldName": "submissionId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sequence", + "fieldName": "sequence", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "revision", + "fieldName": "revision", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "versionId", + "fieldName": "versionId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "values", + "fieldName": "values", + "columnType": 8, + "isNullable": false, + "dartType": "protocol:SubmissionValues" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "payload", + "fieldName": "payload", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "submittedById", + "fieldName": "submittedById", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "submittedAt", + "fieldName": "submittedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "submission_revision_fk_0", + "columns": [ + "submissionId" + ], + "referenceTable": "submission", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "submission_revision_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "submissionId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "sequence" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "usage_counter_day", + "dartName": "UsageCounterDay", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "day", + "fieldName": "day", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "value", + "fieldName": "value", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "usage_counter_day_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "day" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "name" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "usage_day_stats", + "dartName": "UsageDayStats", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "day", + "fieldName": "day", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "includeAdmins", + "fieldName": "includeAdmins", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "active", + "fieldName": "active", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "editors", + "fieldName": "editors", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "drive", + "fieldName": "drive", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "write", + "fieldName": "write", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheets", + "fieldName": "sheets", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "slides", + "fieldName": "slides", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "mcp", + "fieldName": "mcp", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "weekly", + "fieldName": "weekly", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "monthly", + "fieldName": "monthly", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "computedAt", + "fieldName": "computedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "usage_day_stats_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "day" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "includeAdmins" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "user_activity_day", + "dartName": "UserActivityDay", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "day", + "fieldName": "day", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "app", + "fieldName": "app", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:UsageApp" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "edited", + "fieldName": "edited", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "user_activity_day_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "day" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "app" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "user_activity_day_day_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "day" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "user_activity_settings", + "dartName": "UserActivitySettings", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "showViewHistory", + "fieldName": "showViewHistory", + "columnType": 1, + "isNullable": false, + "columnDefault": "true", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "user_activity_settings_fk_0", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "user_activity_settings_user_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "user_preferences", + "dartName": "UserPreferences", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "appTheme", + "fieldName": "appTheme", + "columnType": 0, + "isNullable": false, + "columnDefault": "'system'", + "dartType": "protocol:AppThemeMode" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "accentColor", + "fieldName": "accentColor", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "density", + "fieldName": "density", + "columnType": 0, + "isNullable": false, + "columnDefault": "'comfortable'", + "dartType": "protocol:UiDensity" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "reduceMotion", + "fieldName": "reduceMotion", + "columnType": 1, + "isNullable": false, + "columnDefault": "false", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "keymapOverrides", + "fieldName": "keymapOverrides", + "columnType": 0, + "isNullable": false, + "columnDefault": "'{}'", + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "writeDefaults", + "fieldName": "writeDefaults", + "columnType": 0, + "isNullable": false, + "columnDefault": "'{}'", + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheetsDefaults", + "fieldName": "sheetsDefaults", + "columnType": 0, + "isNullable": false, + "columnDefault": "'{}'", + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "slidesDefaults", + "fieldName": "slidesDefaults", + "columnType": 0, + "isNullable": false, + "columnDefault": "'{}'", + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "slidesPresenter", + "fieldName": "slidesPresenter", + "columnType": 0, + "isNullable": false, + "columnDefault": "'{}'", + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "driveDefaults", + "fieldName": "driveDefaults", + "columnType": 0, + "isNullable": false, + "columnDefault": "'{}'", + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "notificationSettings", + "fieldName": "notificationSettings", + "columnType": 0, + "isNullable": false, + "columnDefault": "'{}'", + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "aiEnabled", + "fieldName": "aiEnabled", + "columnType": 1, + "isNullable": false, + "columnDefault": "true", + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "user_preferences_fk_0", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "user_preferences_user_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "user_profile", + "dartName": "UserProfile", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "authUserId", + "fieldName": "authUserId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "displayName", + "fieldName": "displayName", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "email", + "fieldName": "email", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "avatarFileId", + "fieldName": "avatarFileId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "avatarColor", + "fieldName": "avatarColor", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "locale", + "fieldName": "locale", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "timeZone", + "fieldName": "timeZone", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastSeenAt", + "fieldName": "lastSeenAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "welcomeContentAt", + "fieldName": "welcomeContentAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "user_profile_fk_0", + "columns": [ + "authUserId" + ], + "referenceTable": "serverpod_auth_core_user", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "user_profile_auth_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "authUserId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "user_profile_email_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "user_profile_created_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "user_storage", + "dartName": "UserStorage", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userId", + "fieldName": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "usedBytes", + "fieldName": "usedBytes", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "reservedBytes", + "fieldName": "reservedBytes", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "documentsBytes", + "fieldName": "documentsBytes", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spreadsheetsBytes", + "fieldName": "spreadsheetsBytes", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "presentationsBytes", + "fieldName": "presentationsBytes", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "filesBytes", + "fieldName": "filesBytes", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "trashBytes", + "fieldName": "trashBytes", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "quotaBytesOverride", + "fieldName": "quotaBytesOverride", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "overQuotaSince", + "fieldName": "overQuotaSince", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "reconciledAt", + "fieldName": "reconciledAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "user_storage_fk_0", + "columns": [ + "userId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "user_storage_user_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "write_diff_cache", + "dartName": "WriteDiffCache", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "documentId", + "fieldName": "documentId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fromRevision", + "fieldName": "fromRevision", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "toRevision", + "fieldName": "toRevision", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "json", + "fieldName": "json", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "write_diff_cache_fk_0", + "columns": [ + "documentId" + ], + "referenceTable": "document", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "write_diff_cache_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "documentId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fromRevision" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "toRevision" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "write_diff_cache_created_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "brin", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "write_theme", + "dartName": "WriteTheme", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "uuid", + "fieldName": "uuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "ownerId", + "fieldName": "ownerId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "isBuiltin", + "fieldName": "isBuiltin", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "builtinKey", + "fieldName": "builtinKey", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "description", + "fieldName": "description", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "schemaVersion", + "fieldName": "schemaVersion", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "version", + "fieldName": "version", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "json", + "fieldName": "json", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "contentHash", + "fieldName": "contentHash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "updatedAt", + "fieldName": "updatedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "deletedAt", + "fieldName": "deletedAt", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "write_theme_fk_0", + "columns": [ + "ownerId" + ], + "referenceTable": "user_profile", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "write_theme_uuid_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "uuid" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "write_theme_owner_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "ownerId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "deletedAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "write_theme_builtin_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "builtinKey" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "write_theme_revision", + "dartName": "WriteThemeRevision", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "themeId", + "fieldName": "themeId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "version", + "fieldName": "version", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "json", + "fieldName": "json", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "savedById", + "fieldName": "savedById", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "actorKind", + "fieldName": "actorKind", + "columnType": 0, + "isNullable": false, + "dartType": "protocol:ActorKind" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "createdAt", + "fieldName": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "write_theme_revision_fk_0", + "columns": [ + "themeId" + ], + "referenceTable": "write_theme", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "write_theme_rev_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "themeId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "version" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + } + ], + "installedModules": [ + { + "__className__": "serverpod.DatabaseMigrationVersion", + "module": "serverpod", + "version": "20260824182259319" + }, + { + "__className__": "serverpod.DatabaseMigrationVersion", + "module": "serverpod_auth_idp", + "version": "20260924105404509" + }, + { + "__className__": "serverpod.DatabaseMigrationVersion", + "module": "serverpod_auth_core", + "version": "20260924105232991" + } + ], + "migrationApiVersion": 1 +} \ No newline at end of file diff --git a/wonky_server/migrations/20261020142413171-analytics-indexes/migration.json b/wonky_server/migrations/20261020142413171-analytics-indexes/migration.json new file mode 100644 index 00000000..8008b7f7 --- /dev/null +++ b/wonky_server/migrations/20261020142413171-analytics-indexes/migration.json @@ -0,0 +1,313 @@ +{ + "__className__": "serverpod.DatabaseMigration", + "actions": [ + { + "__className__": "serverpod.DatabaseMigrationAction", + "type": "alterTable", + "alterTable": { + "__className__": "serverpod.TableMigration", + "name": "activity_event", + "schema": "public", + "addColumns": [], + "deleteColumns": [], + "modifyColumns": [], + "addIndexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "activity_type_at_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "type" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "at" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "deleteIndexes": [], + "addForeignKeys": [], + "deleteForeignKeys": [], + "warnings": [] + } + }, + { + "__className__": "serverpod.DatabaseMigrationAction", + "type": "alterTable", + "alterTable": { + "__className__": "serverpod.TableMigration", + "name": "ai_usage", + "schema": "public", + "addColumns": [], + "deleteColumns": [], + "modifyColumns": [], + "addIndexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "ai_usage_at_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "at" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "deleteIndexes": [], + "addForeignKeys": [], + "deleteForeignKeys": [], + "warnings": [] + } + }, + { + "__className__": "serverpod.DatabaseMigrationAction", + "type": "alterTable", + "alterTable": { + "__className__": "serverpod.TableMigration", + "name": "comment", + "schema": "public", + "addColumns": [], + "deleteColumns": [], + "modifyColumns": [], + "addIndexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "comment_created_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "deleteIndexes": [], + "addForeignKeys": [], + "deleteForeignKeys": [], + "warnings": [] + } + }, + { + "__className__": "serverpod.DatabaseMigrationAction", + "type": "alterTable", + "alterTable": { + "__className__": "serverpod.TableMigration", + "name": "drive_item_permission", + "schema": "public", + "addColumns": [], + "deleteColumns": [], + "modifyColumns": [], + "addIndexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "perm_granted_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "grantedAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "deleteIndexes": [], + "addForeignKeys": [], + "deleteForeignKeys": [], + "warnings": [] + } + }, + { + "__className__": "serverpod.DatabaseMigrationAction", + "type": "createTable", + "createTable": { + "__className__": "serverpod.TableDefinition", + "name": "usage_day_stats", + "dartName": "UsageDayStats", + "module": "wonky", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "day", + "fieldName": "day", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "includeAdmins", + "fieldName": "includeAdmins", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "active", + "fieldName": "active", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "editors", + "fieldName": "editors", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "drive", + "fieldName": "drive", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "write", + "fieldName": "write", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "sheets", + "fieldName": "sheets", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "slides", + "fieldName": "slides", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "mcp", + "fieldName": "mcp", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "weekly", + "fieldName": "weekly", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "monthly", + "fieldName": "monthly", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "computedAt", + "fieldName": "computedAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "usage_day_stats_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "day" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "includeAdmins" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + } + }, + { + "__className__": "serverpod.DatabaseMigrationAction", + "type": "alterTable", + "alterTable": { + "__className__": "serverpod.TableMigration", + "name": "user_profile", + "schema": "public", + "addColumns": [], + "deleteColumns": [], + "modifyColumns": [], + "addIndexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "user_profile_created_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "createdAt" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "deleteIndexes": [], + "addForeignKeys": [], + "deleteForeignKeys": [], + "warnings": [] + } + } + ], + "warnings": [], + "migrationApiVersion": 1 +} \ No newline at end of file diff --git a/wonky_server/migrations/20261020142413171-analytics-indexes/migration.sql b/wonky_server/migrations/20261020142413171-analytics-indexes/migration.sql new file mode 100644 index 00000000..0280cffa --- /dev/null +++ b/wonky_server/migrations/20261020142413171-analytics-indexes/migration.sql @@ -0,0 +1,79 @@ +BEGIN; + +-- +-- ACTION ALTER TABLE +-- +CREATE INDEX "activity_type_at_idx" ON "activity_event" USING btree ("type", "at"); +-- +-- ACTION ALTER TABLE +-- +CREATE INDEX "ai_usage_at_idx" ON "ai_usage" USING btree ("at"); +-- +-- ACTION ALTER TABLE +-- +CREATE INDEX "comment_created_idx" ON "comment" USING btree ("createdAt"); +-- +-- ACTION ALTER TABLE +-- +CREATE INDEX "perm_granted_idx" ON "drive_item_permission" USING btree ("grantedAt"); +-- +-- ACTION CREATE TABLE +-- +CREATE TABLE "usage_day_stats" ( + "id" bigserial PRIMARY KEY, + "day" timestamp without time zone NOT NULL, + "includeAdmins" boolean NOT NULL, + "active" bigint NOT NULL, + "editors" bigint NOT NULL, + "drive" bigint NOT NULL, + "write" bigint NOT NULL, + "sheets" bigint NOT NULL, + "slides" bigint NOT NULL, + "mcp" bigint NOT NULL, + "weekly" bigint NOT NULL, + "monthly" bigint NOT NULL, + "computedAt" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "usage_day_stats_idx" ON "usage_day_stats" USING btree ("day", "includeAdmins"); + +-- +-- ACTION ALTER TABLE +-- +CREATE INDEX "user_profile_created_idx" ON "user_profile" USING btree ("createdAt"); + +-- +-- MIGRATION VERSION FOR wonky +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('wonky', '20261020142413171-analytics-indexes', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20261020142413171-analytics-indexes', "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 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; diff --git a/wonky_server/migrations/migration_registry.txt b/wonky_server/migrations/migration_registry.txt index 02d7a1f7..e9a3ae48 100644 --- a/wonky_server/migrations/migration_registry.txt +++ b/wonky_server/migrations/migration_registry.txt @@ -30,3 +30,5 @@ 20261018144655713-neutral-record-names 20261019202955634-board-claim-limits 20261020084059086-publications +20261020133251149-usage-analytics +20261020142413171-analytics-indexes diff --git a/wonky_server/test/integration/platform/analytics/analytics_endpoint_test.dart b/wonky_server/test/integration/platform/analytics/analytics_endpoint_test.dart new file mode 100644 index 00000000..6cee9466 --- /dev/null +++ b/wonky_server/test/integration/platform/analytics/analytics_endpoint_test.dart @@ -0,0 +1,358 @@ +@Tags(['integration']) +library; + +import 'package:clock/clock.dart'; +import 'package:serverpod/serverpod.dart'; +import 'package:test/test.dart'; +import 'package:wonky_server/src/platform/activity/activity_service.dart'; +import 'package:wonky_server/src/platform/analytics/analytics_service.dart'; +import 'package:wonky_server/src/platform/analytics/usage_tracker.dart'; +import 'package:wonky_server/src/platform/common/actor.dart'; +import 'package:wonky_server/src/platform/common/models.dart'; + +import '../../../support/board/board_harness.dart'; +import '../../../support/test_drive.dart'; +import '../../../support/test_users.dart'; +import '../../../support/wonky_serverpod.dart'; + +Matcher _wonky(WonkyErrorCode code) => + throwsA(isA().having((e) => e.code, 'code', code)); + +var _window = 0; + +/// Usage analytics (specs/19): tracking and the admin overview. +/// +/// The test database is shared by test files running in parallel and kept +/// between runs. Every test therefore works in a 500-day window of its own +/// in the far future (no other test writes there) under a fixed clock, and +/// clears that window first: it deletes the window's activity, rollup and +/// counter rows and moves sign-ups, events, comments, shares and AI usage +/// left there by earlier runs to the year 2000. People are created with the +/// real clock (unique emails), then signed up inside the window. +void main() { + withWonkyServerpod('Given usage analytics', (sessionBuilder, endpoints) { + late DateTime noon; + + Future clearWindow() async { + final session = sessionBuilder.build(); + final from = noon.subtract(const Duration(days: 450)); + final to = noon.add(const Duration(days: 30)); + for (final table in [ + 'user_activity_day', + 'usage_day_stats', + 'usage_counter_day', + ]) { + await session.db.unsafeExecute( + 'DELETE FROM $table WHERE day >= @from AND day < @to', + parameters: QueryParameters.named({'from': from, 'to': to}), + ); + } + for (final (table, column) in [ + ('user_profile', 'createdAt'), + ('activity_event', 'at'), + ('comment', 'createdAt'), + ('drive_item_permission', 'grantedAt'), + ('ai_usage', 'at'), + ]) { + await session.db.unsafeExecute( + 'UPDATE $table SET "$column" = @old ' + 'WHERE "$column" >= @from AND "$column" < @to', + parameters: QueryParameters.named({ + 'from': from, + 'to': to, + 'old': DateTime.utc(2000), + }), + ); + } + } + + setUp(() async { + _window++; + noon = DateTime.utc(2300, 1, 1, 12).add(Duration(days: 500 * _window)); + UsageTracker.reset(); + await clearWindow(); + await AnalyticsService.clearCache(sessionBuilder.build()); + }); + + /// Runs [body] at [noon] plus [days]. + Future at(Future Function() body, {int days = 0}) => + withClock(Clock.fixed(noon.add(Duration(days: days))), body); + + /// A person (an admin with [admin]) who signed up at [noon] plus + /// [days]. + Future person( + String name, { + bool admin = false, + int days = 0, + }) async { + final user = admin + ? await BoardHarness.admin(sessionBuilder, name: name) + : await TestUsers.create(sessionBuilder, name: name); + await sessionBuilder.build().db.unsafeExecute( + 'UPDATE user_profile SET "createdAt" = @at WHERE id = @id', + parameters: QueryParameters.named({ + 'at': noon.add(Duration(days: days)), + 'id': user.id, + }), + ); + return user; + } + + Future overview( + TestUser admin, { + int days = 30, + bool includeAdmins = false, + }) async { + await AnalyticsService.clearCache(sessionBuilder.build()); + return at( + () => endpoints.analytics.overview( + admin.endpointSession, + days, + includeAdmins, + ), + ); + } + + group('when the caller is not an admin', () { + test('then the overview is forbidden', () async { + final anna = await person('Anna'); + + await expectLater( + endpoints.analytics.overview(anna.endpointSession, 30, false), + _wonky(WonkyErrorCode.forbidden), + ); + }); + }); + + test('when an unsupported period is asked then it is invalid', () async { + final admin = await person('Admin', admin: true); + + await expectLater( + endpoints.analytics.overview(admin.endpointSession, 14, false), + _wonky(WonkyErrorCode.invalidArgument), + ); + }); + + test('when two people ping their apps then today has two active users ' + 'by app and admins are left out', () async { + final (anna, bo, admin) = ( + await person('Anna'), + await person('Bo'), + await person('Admin', admin: true), + ); + await at(() async { + await endpoints.analytics.ping(anna.endpointSession, UsageApp.write); + await endpoints.analytics.ping(anna.endpointSession, UsageApp.write); + await endpoints.analytics.ping(bo.endpointSession, UsageApp.sheets); + await endpoints.analytics.ping(admin.endpointSession, UsageApp.drive); + }); + + final o = await overview(admin); + + expect(o.activeToday, 2); + expect(o.series.last.write, 1); + expect(o.series.last.sheets, 1); + expect(o.series.last.drive, 0); + expect(o.newAccounts, 2); + expect(o.series.last.signups, 2); + }); + + test('when admins are included then their activity counts', () async { + final admin = await person('Admin', admin: true); + await at( + () => endpoints.analytics.ping(admin.endpointSession, UsageApp.drive), + ); + + final o = await overview(admin, includeAdmins: true); + + expect(o.activeToday, 1); + expect(o.series.last.drive, 1); + expect(o.newAccounts, 1); + }); + + test('when someone creates a document then they are an editor and the ' + 'document is counted, the welcome content is not', () async { + final (anna, admin) = ( + await person('Anna'), + await person('Admin', admin: true), + ); + await at(() async { + await endpoints.user.getMe(anna.endpointSession); // welcome content + await TestDrive.document(endpoints, anna, name: 'Plan'); + }); + + final o = await overview(admin); + + expect(o.series.last.editors, 1); + expect(o.series.last.write, 1); + expect(o.series.last.documents, 1); + expect(o.series.last.spreadsheets, 0); + }); + + test('when someone was active 10 days ago then they count for the month ' + 'but not the week', () async { + final (anna, admin) = ( + await person('Anna', days: -20), + await person('Admin', admin: true, days: -20), + ); + await at( + () => endpoints.analytics.ping(anna.endpointSession, UsageApp.slides), + days: -10, + ); + + final o = await overview(admin); + + expect(o.activeToday, 0); + expect(o.weekly, 0); + expect(o.monthly, 1); + expect(o.series[o.series.length - 11].active, 1); + expect(o.series[o.series.length - 11].slides, 1); + }); + + test('when an MCP client calls tools then the calls and the MCP user ' + 'are counted', () async { + final (anna, admin) = ( + await person('Anna'), + await person('Admin', admin: true), + ); + final session = sessionBuilder.build(); + await at(() async { + await UsageTracker.mcpCall(session, anna.id); + await UsageTracker.mcpCall(session, anna.id); + }); + + final o = await overview(admin); + + expect(o.series.last.mcp, 1); + expect(o.series.last.mcpCalls, 2); + }); + + test('when an item is shared then the share and the shared item are ' + 'counted', () async { + final (anna, bo, admin) = ( + await person('Anna'), + await person('Bo'), + await person('Admin', admin: true), + ); + await at(() async { + final doc = await TestDrive.document(endpoints, anna); + await TestDrive.share(endpoints, doc, anna, bo, AccessRole.editor); + }); + + final o = await overview(admin); + + expect(o.series.last.shares, 1); + }); + + test('when an account signs up and is active in its first week then its ' + 'cohort shows it in week 0', () async { + final (anna, admin) = ( + await person('Anna'), + await person('Admin', admin: true), + ); + await at( + () => endpoints.analytics.ping(anna.endpointSession, UsageApp.write), + ); + + final o = await overview(admin); + + final cohort = o.cohorts.last; + expect(cohort.week, AnalyticsService.weekOf(noon)); + expect(cohort.size, 1); + expect(cohort.active, [1]); + }); + + test('when a finished day was computed once then later reads come from ' + 'the rollup and today stays live', () async { + final (anna, bo, admin) = ( + await person('Anna', days: -5), + await person('Bo', days: -5), + await person('Admin', admin: true, days: -5), + ); + await at( + () => endpoints.analytics.ping(anna.endpointSession, UsageApp.write), + days: -2, + ); + await overview(admin); + // A row for the finished day that the rollup must not pick up again. + final session = sessionBuilder.build(); + await UserActivityDay.db.insertRow( + session, + UserActivityDay( + userId: bo.id, + day: ActivityService.dayOf(noon.subtract(const Duration(days: 2))), + app: UsageApp.write, + ), + ); + await at( + () => endpoints.analytics.ping(bo.endpointSession, UsageApp.sheets), + ); + + final o = await overview(admin); + + expect(o.series[o.series.length - 3].active, 1); + expect(o.activeToday, 1); + final stored = await UsageDayStats.db.find( + session, + where: (t) => + t.day.equals( + ActivityService.dayOf(noon.subtract(const Duration(days: 2))), + ) & + t.includeAdmins.equals(false), + ); + expect(stored.single.write, 1); + }); + + test('when the purge runs then activity older than 400 days is ' + 'deleted', () async { + final anna = await person('Anna'); + final session = sessionBuilder.build(); + await at( + () => UsageTracker.active(session, anna.id, UsageApp.write), + days: -401, + ); + await at(() => UsageTracker.active(session, anna.id, UsageApp.write)); + + await at(() => UsageTracker.purge(session)); + + final rows = await UserActivityDay.db.find( + session, + where: (t) => t.userId.equals(anna.id), + ); + expect(rows, hasLength(1)); + }); + + test('when a script edits an item then nobody becomes active', () async { + final (anna, admin) = ( + await person('Anna'), + await person('Admin', admin: true), + ); + final doc = await at(() => TestDrive.document(endpoints, anna)); + UsageTracker.reset(); + final session = sessionBuilder.build(); + final item = await DriveItem.db.findFirstRow( + session, + where: (t) => t.uuid.equals(doc.uuid), + ); + await at( + () => UsageTracker.edited( + session, + Actor( + userId: anna.id, + authUserId: anna.authUserId, + kind: ActorKind.script, + ), + item!.id!, + ), + days: 1, + ); + + final o = await at( + () => endpoints.analytics.overview(admin.endpointSession, 7, false), + days: 1, + ); + + expect(o.series.last.active, 0); + }); + }); +} diff --git a/wonky_server/test/integration/test_tools/serverpod_test_tools.dart b/wonky_server/test/integration/test_tools/serverpod_test_tools.dart index 86e90d17..3751acec 100644 --- a/wonky_server/test/integration/test_tools/serverpod_test_tools.dart +++ b/wonky_server/test/integration/test_tools/serverpod_test_tools.dart @@ -64,6 +64,10 @@ import 'package:wonky_server/src/generated/platform/ai/models/inline_ai_request. as _i4c3y8bm; import 'package:wonky_server/src/generated/platform/ai/models/proofread_event.dart' as _ib6yu876; +import 'package:wonky_server/src/generated/platform/analytics/models/analytics_overview.dart' + as _ijo91y9q; +import 'package:wonky_server/src/generated/platform/analytics/models/usage_app.dart' + as _idlxfxe3; import 'package:wonky_server/src/generated/platform/board/models/board_area.dart' as _i2y7swbd; import 'package:wonky_server/src/generated/platform/board/models/board_bundle_suggestion_view.dart' @@ -463,6 +467,8 @@ class TestEndpoints { late final _AssistantEndpoint assistant; + late final _AnalyticsEndpoint analytics; + late final _BoardEndpoint board; late final _CommentEndpoint comment; @@ -557,6 +563,10 @@ class _InternalTestEndpoints extends TestEndpoints endpoints, serializationManager, ); + analytics = _AnalyticsEndpoint( + endpoints, + serializationManager, + ); board = _BoardEndpoint( endpoints, serializationManager, @@ -1660,6 +1670,83 @@ class _AssistantEndpoint { } } +class _AnalyticsEndpoint { + _AnalyticsEndpoint( + this._endpointDispatch, + this._serializationManager, + ); + + final _is.EndpointDispatch _endpointDispatch; + + final _is.SerializationManager _serializationManager; + + _ida.Future ping( + _ist.TestSessionBuilder sessionBuilder, + _idlxfxe3.UsageApp app, + ) async { + return _ist.callAwaitableFunctionAndHandleExceptions(() async { + var _localUniqueSession = + (sessionBuilder as _ist.InternalTestSessionBuilder).internalBuild( + endpoint: 'analytics', + method: 'ping', + ); + try { + var _localCallContext = await _endpointDispatch.getMethodCallContext( + createSessionCallback: (_) => _localUniqueSession, + endpointPath: 'analytics', + methodName: 'ping', + parameters: _ist.testObjectToJson({'app': app}), + serializationManager: _serializationManager, + ); + var _localReturnValue = + await (_localCallContext.method.call( + _localUniqueSession, + _localCallContext.arguments, + ) + as _ida.Future); + return _localReturnValue; + } finally { + await _localUniqueSession.close(); + } + }); + } + + _ida.Future<_ijo91y9q.AnalyticsOverview> overview( + _ist.TestSessionBuilder sessionBuilder, + int days, + bool includeAdmins, + ) async { + return _ist.callAwaitableFunctionAndHandleExceptions(() async { + var _localUniqueSession = + (sessionBuilder as _ist.InternalTestSessionBuilder).internalBuild( + endpoint: 'analytics', + method: 'overview', + ); + try { + var _localCallContext = await _endpointDispatch.getMethodCallContext( + createSessionCallback: (_) => _localUniqueSession, + endpointPath: 'analytics', + methodName: 'overview', + parameters: _ist.testObjectToJson({ + 'days': days, + 'includeAdmins': includeAdmins, + }), + serializationManager: _serializationManager, + ); + var _localReturnValue = + await (_localCallContext.method.call( + _localUniqueSession, + _localCallContext.arguments, + ) + as _ida.Future<_ijo91y9q.AnalyticsOverview>); + return _localReturnValue; + } finally { + await _localUniqueSession.close(); + } + }); + } +} + class _BoardEndpoint { _BoardEndpoint( this._endpointDispatch, diff --git a/wonky_server/web/pages/privacy.html b/wonky_server/web/pages/privacy.html index b8aa4315..1d323d5c 100644 --- a/wonky_server/web/pages/privacy.html +++ b/wonky_server/web/pages/privacy.html @@ -76,7 +76,7 @@

Privacy policy

-

Effective 13 October 2026

+

Effective 20 October 2026

This policy explains what personal data Wonky Work (Wonky Write and Wonky Sheets, “the service”) collects, why, and the choices you have. The service is provided by Serverpod AB, @@ -93,6 +93,9 @@

What we collect

choices.
  • Technical data: log data such as IP address, browser type, timestamps and error reports, used to run and secure the service.
  • +
  • Usage data: on which days you used which Wonky Work app (or an MCP + client with your access token), whether you created or edited something that day, and when + you were last seen. We keep it for up to 400 days. It never includes what is in your files.
  • How we use it

    @@ -100,6 +103,8 @@

    How we use it

  • To provide the service: storing and syncing your files, real-time collaboration, sharing, offline access and notifications (including emails you can turn off).
  • To keep the service secure and reliable, prevent abuse and fix problems.
  • +
  • To understand how the service is used, as aggregate statistics for our team (for + example how many people use each app), and to improve it.
  • To respond to your requests and support questions.
  • We do not sell your personal data, show ads or use tracking cookies. The legal bases we