diff --git a/packages/wonky_app/lib/l10n/wonky_app_en.arb b/packages/wonky_app/lib/l10n/wonky_app_en.arb index 922d7785..47b5921d 100644 --- a/packages/wonky_app/lib/l10n/wonky_app_en.arb +++ b/packages/wonky_app/lib/l10n/wonky_app_en.arb @@ -2052,6 +2052,31 @@ } } }, + "boardSimilarShow": "Show #{number} {title}", + "@boardSimilarShow": { + "description": "Screen-reader label of a similar issue's title in the report dialog: it opens the issue's details.", + "placeholders": { + "number": { + "type": "int" + }, + "title": { + "type": "String" + } + } + }, + "boardSimilarLoadFailed": "Couldn't load this issue. Try again later.", + "boardTaskCommentsLabel": "Comments for the prompt", + "boardTaskCommentsHint": "The AI reads the checked comments when it writes the prompt.", + "boardCommentsPromptHint": "Checked comments go into the task prompt when you select this issue for building.", + "boardCommentInPrompt": "Include the comment by {name} in the task prompt", + "@boardCommentInPrompt": { + "description": "Screen-reader label of an admin's checkbox on an issue comment.", + "placeholders": { + "name": { + "type": "String" + } + } + }, "boardReportVoteInstead": "Vote instead", "boardReportVoted": "Voted", "boardReportVotedFor": "Voted for #{number}", @@ -2388,7 +2413,6 @@ "boardEmptyHint": "Change the filters, or be the first to report one.", "boardEmptyTasks": "No tasks up for grabs", "boardEmptyTasksHint": "Admins publish tasks from the most wanted issues. Check back soon.", - "boardDoneTasks": "Finished tasks", "boardUpvoteLabel": "Upvote, {score} votes", "@boardUpvoteLabel": { "description": "Semantics label of the up-vote button.", @@ -2496,6 +2520,7 @@ "boardSelectForBuilding": "Select for building", "boardDeclineEllipsis": "Decline…", "boardMergeEllipsis": "Merge into…", + "boardLabelsEllipsis": "Labels…", "boardBlockEllipsis": "Block user from the board…", "boardEditEllipsis": "Edit…", "boardDismiss": "Dismiss", 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 b2f70987..7a144d50 100644 --- a/packages/wonky_app/lib/l10n/wonky_app_en_XA.arb +++ b/packages/wonky_app/lib/l10n/wonky_app_en_XA.arb @@ -904,6 +904,12 @@ "boardReportBodyTooLong": "[Ţĥé ðéšçŕîþţîöñ îš ţöö ļöñĝ: åţ ɱöšţ {max} çĥåŕåçţéŕš. one two three f]", "boardReportSimilarTitle": "[Šîɱîļåŕ îššûéš one t]", "boardReportSimilarVotes": "[{count, plural, =1{1 ṽöţé} other{{count} ṽöţéš}} one]", + "boardSimilarShow": "[Šĥöŵ #{number} {title} on]", + "boardSimilarLoadFailed": "[Çöûļðñ'ţ ļöåð ţĥîš îššûé. Ţŕý åĝåîñ ļåţéŕ. one two three]", + "boardTaskCommentsLabel": "[Çöɱɱéñţš ƒöŕ ţĥé þŕöɱþţ one two]", + "boardTaskCommentsHint": "[Ţĥé ÅÎ ŕéåðš ţĥé çĥéçķéð çöɱɱéñţš ŵĥéñ îţ ŵŕîţéš ţĥé þŕöɱþţ. one two three four]", + "boardCommentsPromptHint": "[Çĥéçķéð çöɱɱéñţš ĝö îñţö ţĥé ţåšķ þŕöɱþţ ŵĥéñ ýöû šéļéçţ ţĥîš îššûé ƒöŕ ƀûîļðîñĝ. one two three four five]", + "boardCommentInPrompt": "[Îñçļûðé ţĥé çöɱɱéñţ ƀý {name} îñ ţĥé ţåšķ þŕöɱþţ one two thre]", "boardReportVoteInstead": "[Ṽöţé îñšţéåð one]", "boardReportVoted": "[Ṽöţéð on]", "boardReportVotedFor": "[Ṽöţéð ƒöŕ #{number} one]", @@ -1060,7 +1066,6 @@ "boardEmptyHint": "[Çĥåñĝé ţĥé ƒîļţéŕš, öŕ ƀé ţĥé ƒîŕšţ ţö ŕéþöŕţ öñé. one two three f]", "boardEmptyTasks": "[Ñö ţåšķš ûþ ƒöŕ ĝŕåƀš one tw]", "boardEmptyTasksHint": "[Åðɱîñš þûƀļîšĥ ţåšķš ƒŕöɱ ţĥé ɱöšţ ŵåñţéð îššûéš. Çĥéçķ ƀåçķ šööñ. one two three four f]", - "boardDoneTasks": "[Ƒîñîšĥéð ţåšķš one t]", "boardUpvoteLabel": "[Ûþṽöţé, {score} ṽöţéš one t]", "boardDownvoteLabel": "[Ðöŵñṽöţé, {score} ṽöţéš one t]", "boardRemoveUpvote": "[Ŕéɱöṽé ûþṽöţé one t]", @@ -1099,6 +1104,7 @@ "boardSelectForBuilding": "[Šéļéçţ ƒöŕ ƀûîļðîñĝ one tw]", "boardDeclineEllipsis": "[Ðéçļîñé… one]", "boardMergeEllipsis": "[Ṁéŕĝé îñţö… one]", + "boardLabelsEllipsis": "[Ļåƀéļš… one]", "boardBlockEllipsis": "[Ɓļöçķ ûšéŕ ƒŕöɱ ţĥé ƀöåŕð… one two]", "boardEditEllipsis": "[Éðîţ… on]", "boardDismiss": "[Ðîšɱîšš one]", diff --git a/packages/wonky_app/lib/src/board/board_commands.dart b/packages/wonky_app/lib/src/board/board_commands.dart index 11671f23..084ca83e 100644 --- a/packages/wonky_app/lib/src/board/board_commands.dart +++ b/packages/wonky_app/lib/src/board/board_commands.dart @@ -27,6 +27,35 @@ String boardTaskUrl(ShellServices s, int number) => String boardPrLines(int task, String code) => 'Wonky-Task: T-$task\nWonky-Claim: $code'; +/// The comments of the issues [numbers] the *Create task* dialog offers for +/// the prompt's context (specs/16 §9.3): the visible ones people wrote, the +/// ones the prompt can include. [first] is issue `numbers.first`, already +/// read. A failing read offers none. +Future> _taskComments( + BoardRepository repo, + List numbers, + BoardPostView first, +) async { + final out = []; + for (final n in numbers) { + try { + final post = n == first.number ? first : await repo.getPost(n); + for (final c in await repo.listComments(n)) { + if (c.deleted || + c.systemEvent != null || + c.moderation != BoardModeration.visible || + c.body.trim().isEmpty) { + continue; + } + out.add((postNumber: n, postTitle: post.title, comment: c)); + } + } on Object { + continue; + } + } + return out; +} + /// `shell.board.*` (specs/16 §14) apart from `report` / `open`, which come /// with the report dialog. Every state change is undoable on the shell /// stack through [BoardUndoHandler] (the server inverse); admin commands are @@ -921,6 +950,8 @@ List> boardCommands(ShellServices s) { 'size': JsonSchema.string( enumValues: [for (final x in BoardSize.values) x.name], ), + // Comments (uuids) left out of the prompt's context (§9.3). + 'excludedComments': const JsonSchema.array(JsonSchema.string()), }, required: const ['postNumbers'], ), @@ -928,6 +959,10 @@ List> boardCommands(ShellServices s) { final numbers = [ for (final x in a.values['postNumbers']! as List) (x as num).toInt(), ]; + var excluded = [ + for (final x in a.values['excludedComments'] as List? ?? const []) + UuidValue.withValidation('$x'), + ]; var title = a.string('title'); var area = switch (a.string('area')) { final String x => BoardArea.values.byName(x), @@ -946,18 +981,36 @@ List> boardCommands(ShellServices s) { area ??= first.area ?? BoardArea.suite; size ??= first.size ?? BoardSize.small; } else { + // The issue page passes the comments its admin unchecked: the + // dialog then lists none. + final comments = a.values.containsKey('excludedComments') + ? const [] + : await _taskComments(repo(), numbers, first); + if (!bc.mounted) return const CommandResult.cancelled(); final r = await showBoardTaskDialog( bc, count: numbers.length, title: title ?? first.title, area: area ?? first.area ?? BoardArea.suite, size: size ?? first.size ?? BoardSize.small, + comments: comments, ); if (r == null) return const CommandResult.cancelled(); - (title, area, size) = r; + (:title, :area, :size) = ( + title: r.title, + area: r.area, + size: r.size, + ); + if (comments.isNotEmpty) excluded = r.excludedComments; } } - final t = await repo().createTask(numbers, title, area, size); + final t = await repo().createTask( + numbers, + title, + area, + size, + excludedComments: excluded, + ); ctx.record( entry(BoardUndoOp.createTask, { 'task': t.number, @@ -965,6 +1018,8 @@ List> boardCommands(ShellServices s) { 'title': title, 'area': area.name, 'size': size.name, + if (excluded.isNotEmpty) + 'excluded': [for (final u in excluded) u.uuid], }), ); hub.changed(task: t.number); @@ -1011,7 +1066,7 @@ List> boardCommands(ShellServices s) { size: t.size, ); if (r == null) return const CommandResult.cancelled(); - (title, area, size) = r; + (:title, :area, :size, excludedComments: _) = r; } title ??= t.title; area ??= t.area; @@ -1134,7 +1189,7 @@ List> boardCommands(ShellServices s) { size: size ?? first.size, ); if (r == null) return const CommandResult.cancelled(); - (title, area, size) = r; + (:title, :area, :size, excludedComments: _) = r; } } final t = await repo().mergeTasks(numbers, title, area, size); diff --git a/packages/wonky_app/lib/src/board/board_repository.dart b/packages/wonky_app/lib/src/board/board_repository.dart index fd942d3a..7edcf76b 100644 --- a/packages/wonky_app/lib/src/board/board_repository.dart +++ b/packages/wonky_app/lib/src/board/board_repository.dart @@ -86,12 +86,16 @@ abstract class BoardRepository { Future reopen(int number); Future blockUser(int userId, String reason, {DateTime? until}); Future unblockUser(int userId); + + /// [excludedComments]: comments of the posts left out of the prompt's + /// context (specs/16 §9.3). Future createTask( List postNumbers, String title, BoardArea area, - BoardSize size, - ); + BoardSize size, { + List excludedComments = const [], + }); Future updateTask( int number, String title, @@ -317,8 +321,17 @@ class ServerBoardRepository implements BoardRepository { List postNumbers, String title, BoardArea area, - BoardSize size, - ) => api.guard((c) => c.board.createTask(postNumbers, title, area, size)); + BoardSize size, { + List excludedComments = const [], + }) => api.guard( + (c) => c.board.createTask( + postNumbers, + title, + area, + size, + excludedComments: excludedComments.isEmpty ? null : excludedComments, + ), + ); @override Future updateTask( diff --git a/packages/wonky_app/lib/src/board/board_undo.dart b/packages/wonky_app/lib/src/board/board_undo.dart index 94baaa96..fb5e9c64 100644 --- a/packages/wonky_app/lib/src/board/board_undo.dart +++ b/packages/wonky_app/lib/src/board/board_undo.dart @@ -258,6 +258,10 @@ class BoardUndoHandler extends UndoHandler { d['title']! as String, BoardArea.values.byName(d['area']! as String), BoardSize.values.byName(d['size']! as String), + excludedComments: [ + for (final u in d['excluded'] as List? ?? const []) + UuidValue.withValidation(u as String), + ], ); _hub.changed(task: t.number); return e.withData({'task': t.number}); diff --git a/packages/wonky_app/lib/src/board/pages/board_comment_actions.dart b/packages/wonky_app/lib/src/board/pages/board_comment_actions.dart index 0aabbbaa..cf03230f 100644 --- a/packages/wonky_app/lib/src/board/pages/board_comment_actions.dart +++ b/packages/wonky_app/lib/src/board/pages/board_comment_actions.dart @@ -76,6 +76,8 @@ class BoardCommentActions extends CommentThreadActions { required this.services, required this.postNumber, this.open = true, + this.excluded, + this.onSelect, }); final ShellServices services; @@ -84,6 +86,13 @@ class BoardCommentActions extends CommentThreadActions { /// Whether new comments are accepted (not on removed or deleted posts). final bool open; + /// Admins choosing the comments for a task prompt (specs/16 §9.3): the + /// uuids left out (unchecked). Null: no checkboxes. + final Set? excluded; + + /// A comment was checked (true) or unchecked. + final void Function(String uuid, bool selected)? onSelect; + BoardHub get _hub => BoardHub.of(services); BoardCommentView? _view(ThreadComment c) => @@ -128,6 +137,22 @@ class BoardCommentActions extends CommentThreadActions { @override String? replyHint(WonkyAppLocalizations l) => l.boardCommentHint; + // Only visible comments people wrote can go into a prompt. + @override + bool? selected(ThreadComment c) { + final ex = excluded; + if (ex == null || c.systemText != null) return null; + if (_view(c)?.moderation != BoardModeration.visible) return null; + return !ex.contains(c.id); + } + + @override + void select(ThreadComment c, bool selected) => onSelect?.call(c.id, selected); + + @override + String selectLabel(WonkyAppLocalizations l, ThreadComment c) => + l.boardCommentInPrompt(c.authorName ?? l.someone); + @override Future reply(String body, {List mentions = const []}) => _invoke('shell.board.comment.add', {..._target, 'body': body}); diff --git a/packages/wonky_app/lib/src/board/pages/board_dialogs.dart b/packages/wonky_app/lib/src/board/pages/board_dialogs.dart index 035797ea..fcddb268 100644 --- a/packages/wonky_app/lib/src/board/pages/board_dialogs.dart +++ b/packages/wonky_app/lib/src/board/pages/board_dialogs.dart @@ -428,15 +428,45 @@ Future<(BoardPostKind, BoardArea?, BoardSize?)?> showBoardLabelsDialog( ); } +/// A comment the *Create task* dialog offers for the prompt's context: on +/// issue [postNumber] ([postTitle]). +typedef BoardTaskComment = ({ + int postNumber, + String postTitle, + BoardCommentView comment, +}); + +/// What *Create task* / *Edit task* / *Merge tasks* answered: the title, +/// labels and, when creating, the comments left out of the prompt. +typedef BoardTaskDialogResult = ({ + String title, + BoardArea area, + BoardSize size, + List excludedComments, +}); + +/// The checklist line of [c]: `Anna Berg: first words of the comment…`. +String boardCommentLine(BoardCommentView c, WonkyAppLocalizations l) { + final text = c.body + .replaceAll(RegExp(r'[*_`~>#\[\]]'), '') + .replaceAll(RegExp(r'\s+'), ' ') + .trim(); + final clipped = text.length <= 140 ? text : '${text.substring(0, 139)}…'; + return '${c.author?.displayName ?? l.boardDeletedUser}: $clipped'; +} + /// *Create task from N issues…* ([count] set), *Merge N tasks…* -/// ([mergeCount] set) or *Edit task*. -Future<(String, BoardArea, BoardSize)?> showBoardTaskDialog( +/// ([mergeCount] set) or *Edit task*. When creating, [comments] are the +/// issues' comments, one checkbox each (checked: in the prompt's context, +/// specs/16 §9.3). +Future showBoardTaskDialog( BuildContext context, { int? count, int? mergeCount, required String title, required BoardArea area, required BoardSize size, + List comments = const [], }) async { final l = WonkyAppLocalizations.of(context); final r = await showWonkyFormDialog( @@ -453,6 +483,7 @@ Future<(String, BoardArea, BoardSize)?> showBoardTaskDialog( _ => null, }, dialogKey: 'dialog.board.task', + width: comments.isEmpty ? 420 : 520, fields: [ TextFieldSpec( id: 'title', @@ -476,6 +507,20 @@ Future<(String, BoardArea, BoardSize)?> showBoardTaskDialog( }, initial: size.name, ), + if (comments.isNotEmpty) + ChecklistFieldSpec( + id: 'comments', + label: l.boardTaskCommentsLabel, + description: l.boardTaskCommentsHint, + items: [ + for (final c in comments) + ChecklistItem( + value: c.comment.uuid.uuid, + label: boardCommentLine(c.comment, l), + group: '#${c.postNumber} ${c.postTitle}', + ), + ], + ), ], buttons: [ DialogButtonSpec(id: 'cancel', label: l.actionCancel), @@ -492,10 +537,15 @@ Future<(String, BoardArea, BoardSize)?> showBoardTaskDialog( ), ); if (r?.buttonId != 'ok') return null; + final kept = r!.checked('comments').toSet(); return ( - r!.text('title').trim(), - BoardArea.values.byName(r.text('area')), - BoardSize.values.byName(r.text('size')), + title: r.text('title').trim(), + area: BoardArea.values.byName(r.text('area')), + size: BoardSize.values.byName(r.text('size')), + excludedComments: [ + for (final c in comments) + if (!kept.contains(c.comment.uuid.uuid)) c.comment.uuid, + ], ); } diff --git a/packages/wonky_app/lib/src/board/pages/board_page.dart b/packages/wonky_app/lib/src/board/pages/board_page.dart index dfce8cfd..2d60f02b 100644 --- a/packages/wonky_app/lib/src/board/pages/board_page.dart +++ b/packages/wonky_app/lib/src/board/pages/board_page.dart @@ -799,9 +799,7 @@ class _BoardPostListState extends State { ? _selectionBar(l, theme, inset) : _filters(l, inset), ), - Expanded( - child: _done ? _DoneLayout(services: s, posts: list) : list, - ), + Expanded(child: list), ], ); } @@ -846,37 +844,6 @@ class _SearchChip extends StatelessWidget { bool _sameSet(Set a, Set b) => a.length == b.length && a.containsAll(b); -/// The Done tab: finished tasks above the done and shipped posts. -class _DoneLayout extends StatelessWidget { - const _DoneLayout({required this.services, required this.posts}); - - final ShellServices services; - final Widget posts; - - @override - Widget build(BuildContext context) { - final l = WonkyAppLocalizations.of(context); - final inset = shellPageInset(MediaQuery.sizeOf(context).width); - return Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - ConstrainedBox( - constraints: const BoxConstraints(maxHeight: 220), - child: BoardTaskList( - key: const ValueKey('board.doneTasks'), - services: services, - statuses: const [BoardTaskStatus.done, BoardTaskStatus.shipped], - compact: true, - title: l.boardDoneTasks, - horizontalPadding: math.max(0, inset - 8), - ), - ), - Expanded(child: posts), - ], - ); - } -} - /// One post in the board list (specs/16 §4.4): the vote control, title, /// labels, status, comment count, author and age, screenshot icon. `+` / /// `-` on the focused row vote (specs/16 §4.7); Enter opens the post. diff --git a/packages/wonky_app/lib/src/board/pages/board_trail.dart b/packages/wonky_app/lib/src/board/pages/board_trail.dart index ab1ed43c..042b4278 100644 --- a/packages/wonky_app/lib/src/board/pages/board_trail.dart +++ b/packages/wonky_app/lib/src/board/pages/board_trail.dart @@ -24,10 +24,10 @@ enum BoardTab { bool get hasPosts => this != BoardTab.tasks && this != BoardTab.claimed; /// Whether the list shows tasks (a task opened from it stays under it). + /// *Done* lists finished issues only (specs/16 §4.4). bool get hasTasks => this == BoardTab.tasks || this == BoardTab.claimed || - this == BoardTab.done || this == BoardTab.review; static BoardTab? byName(String? name) { diff --git a/packages/wonky_app/lib/src/board/pages/post_page.dart b/packages/wonky_app/lib/src/board/pages/post_page.dart index 205f3e0a..02ca93db 100644 --- a/packages/wonky_app/lib/src/board/pages/post_page.dart +++ b/packages/wonky_app/lib/src/board/pages/post_page.dart @@ -57,6 +57,10 @@ class _BoardPostPageState extends State { BoardTrail get _trail => (widget.trail ?? BoardTrail(post: n)).resolve(hub, postKind: _post?.kind); List _comments = const []; + + /// Comments an admin unchecked: left out of the task prompt when the + /// issue is selected for building (specs/16 §9.3). + final Set _excluded = {}; List _similar = const []; String? _screenshotUrl; Object? _error; @@ -194,8 +198,6 @@ class _BoardPostPageState extends State { destructive: destructive, onSelected: onSelected, ); - final votingOpen = - p.status == BoardPostStatus.open || p.status == BoardPostStatus.planned; return [ if (p.isMine && p.canEdit && !p.deleted) item( @@ -230,15 +232,11 @@ class _BoardPostPageState extends State { LucideIcons.flag, () => _invoke('shell.board.flag'), ), + // The common admin actions are in the toolbar ([_adminBar]); the + // rest stays here. if (admin) ...[ const WonkyMenuSeparator(), WonkyMenuLabel(l.boardAdminActions), - item( - 'labels', - l.cmdBoardSetLabels, - LucideIcons.tags, - () => _invoke('shell.board.admin.setLabels'), - ), if (p.suggestedTitle != null) item( 'applyTitle', @@ -257,14 +255,6 @@ class _BoardPostPageState extends State { 'approve': p.moderation != BoardModeration.visible, }), ), - if (p.moderation != BoardModeration.visible && - p.moderation != BoardModeration.removed) - item( - 'approve', - l.boardActionApprove, - LucideIcons.check, - () => _moderate('approve'), - ), if (p.moderation == BoardModeration.visible) item( 'hold', @@ -294,50 +284,6 @@ class _BoardPostPageState extends State { () => _moderate('remove'), destructive: true, ), - if (votingOpen && p.task == null) - item( - 'select', - l.boardSelectForBuilding, - LucideIcons.hammer, - _selectForBuilding, - ), - if (votingOpen && p.task == null) - item( - 'addToTask', - l.boardAddToTaskEllipsis, - LucideIcons.listPlus, - () => boardInvoke(s, 'shell.board.admin.setTaskPosts', { - 'add': [n], - }, context: context), - ), - if (p.status == BoardPostStatus.declined) - item( - 'reopen', - l.cmdBoardReopen, - LucideIcons.rotateCcw, - () => _invoke('shell.board.admin.reopen'), - ) - else if (votingOpen) - item( - 'decline', - l.boardDeclineEllipsis, - LucideIcons.ban, - () => _invoke('shell.board.admin.decline'), - ), - if (p.status == BoardPostStatus.duplicate) - item( - 'unmerge', - l.cmdBoardUnmerge, - LucideIcons.split, - () => _invoke('shell.board.admin.unmerge'), - ) - else - item( - 'merge', - l.boardMergeEllipsis, - LucideIcons.merge, - () => _invoke('shell.board.admin.merge', {'source': n}), - ), if (p.author != null && !p.author!.isAdmin) item( 'block', @@ -355,9 +301,182 @@ class _BoardPostPageState extends State { {'postNumber': n, 'action': action}, ); + /// Whether admins can select this issue for building, so its comments get + /// checkboxes for the task prompt (specs/16 §9.3). + bool _buildable(BoardPostView p) => + hub.isAdmin && + p.task == null && + !p.deleted && + p.moderation == BoardModeration.visible && + (p.status == BoardPostStatus.open || p.status == BoardPostStatus.planned); + + /// The buttons of the admins' toolbar that the window has no room for: + /// their indices in [_adminActions] (reported by the layout). + Set _barHidden = const {}; + + /// The common admin actions (specs/16 §4.5), most important first in + /// [_AdminAction.priority]: they are toolbar buttons until the row is + /// too narrow, then entries of the ⋮ menu. + List<_AdminAction> _adminActions(WonkyAppLocalizations l, BoardPostView p) { + final votingOpen = + p.status == BoardPostStatus.open || p.status == BoardPostStatus.planned; + final held = + p.moderation != BoardModeration.visible && + p.moderation != BoardModeration.removed; + return [ + if (held) + _AdminAction( + 'approve', + l.boardActionApprove, + LucideIcons.check, + () => _moderate('approve'), + primary: true, + priority: 0, + ), + if (_buildable(p)) ...[ + _AdminAction( + 'select', + l.boardSelectForBuilding, + LucideIcons.hammer, + _selectForBuilding, + primary: !held, + priority: 0, + ), + _AdminAction( + 'addToTask', + l.boardAddToTaskEllipsis, + LucideIcons.listPlus, + () => boardInvoke(s, 'shell.board.admin.setTaskPosts', { + 'add': [n], + }, context: context), + priority: 1, + ), + ], + _AdminAction( + 'labels', + l.boardLabelsEllipsis, + LucideIcons.tags, + () => _invoke('shell.board.admin.setLabels'), + priority: 2, + ), + if (p.status == BoardPostStatus.duplicate) + _AdminAction( + 'unmerge', + l.cmdBoardUnmerge, + LucideIcons.split, + () => _invoke('shell.board.admin.unmerge'), + priority: 3, + ) + else + _AdminAction( + 'merge', + l.boardMergeEllipsis, + LucideIcons.merge, + () => _invoke('shell.board.admin.merge', {'source': n}), + priority: 3, + ), + if (p.status == BoardPostStatus.declined) + _AdminAction( + 'reopen', + l.cmdBoardReopen, + LucideIcons.rotateCcw, + () => _invoke('shell.board.admin.reopen'), + priority: 4, + ) + else if (votingOpen) + _AdminAction( + 'decline', + l.boardDeclineEllipsis, + LucideIcons.ban, + () => _invoke('shell.board.admin.decline'), + priority: 4, + ), + ]; + } + + /// The ⋮ button with [_menu]: in the title row for everyone but admins, + /// at the end of the admins' toolbar for them. + Widget _moreButton( + WonkyAppLocalizations l, + BoardPostView p, { + List Function()? before, + }) => WonkyDropdownMenu( + anchor: const ShadAnchor( + childAlignment: AlignmentDirectional.bottomEnd, + overlayAlignment: AlignmentDirectional.topEnd, + ), + entries: () { + final first = before?.call() ?? const []; + return [ + ...first, + if (first.isNotEmpty) const WonkyMenuSeparator(), + ..._menu(l, p), + ]; + }, + builder: (context, ctl) => ShadIconButton.ghost( + key: const ValueKey('board.post.menu'), + semanticLabel: l.moreActions, + icon: const Icon(LucideIcons.ellipsisVertical), + onPressed: ctl.toggle, + ), + ); + + /// The admins' toolbar under the header (specs/16 §4.5): the common + /// admin actions as buttons (keys `board.post.bar.`) and ⋮ at their + /// end, on one row. Buttons that don't fit move into ⋮, least important + /// first (`ToolbarOverflowLayout`, as in the editors' toolbars), as + /// `board.post.menu.` above the menu's own entries. + Widget _adminBar(WonkyAppLocalizations l, BoardPostView p) { + final actions = _adminActions(l, p); + final hidden = _barHidden; + return Semantics( + container: true, + label: l.boardAdminActions, + child: ToolbarOverflowLayout( + key: const ValueKey('board.post.adminBar'), + spacing: 8, + onHiddenChanged: (h) { + if (mounted) setState(() => _barHidden = h); + }, + children: [ + for (final (i, a) in actions.indexed) + ToolbarOverflowChild( + slot: ToolbarSlot.item, + priority: a.priority, + index: i, + child: ExcludeFocus( + excluding: hidden.contains(i), + child: a.button(), + ), + ), + ToolbarOverflowChild( + slot: ToolbarSlot.item, + index: actions.length, + pinned: true, + child: _moreButton( + l, + p, + before: () => [ + for (final (i, a) in actions.indexed) + if (_barHidden.contains(i)) a.menuItem(), + ], + ), + ), + ], + ), + ); + } + Future _selectForBuilding() async { + // The comments unchecked on this page stay out of the prompt; the task + // dialog then asks only for the title and labels. + final shown = {for (final c in _comments) c.uuid.uuid}; final r = await boardInvoke(s, 'shell.board.admin.createTask', { 'postNumbers': [n], + 'excludedComments': [ + for (final u in _excluded) + if (shown.contains(u)) u, + ], }, context: context); final t = (r?.data as Map?)?['taskNumber']; if (t is int && mounted) boardOpenTask(s, t, context: context); @@ -696,19 +815,8 @@ class _BoardPostPageState extends State { ), ), ), - WonkyDropdownMenu( - anchor: const ShadAnchor( - childAlignment: AlignmentDirectional.bottomEnd, - overlayAlignment: AlignmentDirectional.topEnd, - ), - entries: () => _menu(l, p), - builder: (context, ctl) => ShadIconButton.ghost( - key: const ValueKey('board.post.menu'), - semanticLabel: l.moreActions, - icon: const Icon(LucideIcons.ellipsisVertical), - onPressed: ctl.toggle, - ), - ), + // Admins have ⋮ at the end of their toolbar. + if (!hub.isAdmin) _moreButton(l, p), ], ), Wrap( @@ -746,7 +854,7 @@ class _BoardPostPageState extends State { ), ], ), - if (hub.isAdmin) _adminPanel(l, theme, p), + if (hub.isAdmin) ...[_adminBar(l, p), _adminPanel(l, theme, p)], WonkyMarkdown( p.body, key: const ValueKey('board.post.body'), @@ -827,6 +935,18 @@ class _BoardPostPageState extends State { ], ], BoardSectionTitle(l.boardCommentsTitle(p.commentCount)), + if (_buildable(p) && + _comments.any( + (c) => + c.systemEvent == null && + !c.deleted && + c.moderation == BoardModeration.visible, + )) + Text( + l.boardCommentsPromptHint, + key: const ValueKey('board.post.comments.promptHint'), + style: theme.textTheme.muted, + ), CommentThreadBody.custom( key: ValueKey('board.post.comments.$n'), services: s, @@ -834,6 +954,10 @@ class _BoardPostPageState extends State { services: s, postNumber: n, open: commentsOpen, + excluded: _buildable(p) ? _excluded : null, + onSelect: (uuid, selected) => setState( + () => selected ? _excluded.remove(uuid) : _excluded.add(uuid), + ), ), comments: boardThreadComments(l, _comments), ), @@ -882,3 +1006,53 @@ class _BoardPostPageState extends State { ), ); } + +/// One of the common admin actions of the issue page: a toolbar button, +/// or a ⋮ entry when the row has no room for it (specs/16 §4.5). +class _AdminAction { + const _AdminAction( + this.id, + this.label, + this.icon, + this.onPressed, { + this.primary = false, + this.priority = 0, + }); + + final String id; + final String label; + final IconData icon; + final VoidCallback onPressed; + final bool primary; + + /// Lower is more important: higher numbers move into ⋮ first. + final int priority; + + Widget button() { + final key = ValueKey('board.post.bar.$id'); + final leading = Icon(icon, size: 16); + final child = Text(label); + return primary + ? ShadButton( + key: key, + size: ShadButtonSize.sm, + leading: leading, + onPressed: onPressed, + child: child, + ) + : ShadButton.outline( + key: key, + size: ShadButtonSize.sm, + leading: leading, + onPressed: onPressed, + child: child, + ); + } + + WonkyMenuItem menuItem() => WonkyMenuItem( + key: ValueKey('board.post.menu.$id'), + label: label, + icon: icon, + onSelected: onPressed, + ); +} diff --git a/packages/wonky_app/lib/src/board/pages/task_page.dart b/packages/wonky_app/lib/src/board/pages/task_page.dart index 2601eb6c..a6550d8d 100644 --- a/packages/wonky_app/lib/src/board/pages/task_page.dart +++ b/packages/wonky_app/lib/src/board/pages/task_page.dart @@ -247,6 +247,10 @@ class _BoardTaskPageState extends State { final admin = hub.isAdmin; final signedIn = s.auth.isSignedIn; final claimable = t.status == BoardTaskStatus.published; + // Expired claims or removed issues block claiming for a while (§8.4). + final blockedReason = signedIn && claimable && !admin + ? hub.me.value?.claimBlockedReason + : null; return Column( crossAxisAlignment: CrossAxisAlignment.stretch, spacing: 10, @@ -312,7 +316,7 @@ class _BoardTaskPageState extends State { ShadButton( key: const ValueKey('board.task.claim'), leading: const Icon(LucideIcons.hand, size: 16), - enabled: hub.canWrite, + enabled: hub.canWrite && blockedReason == null, onPressed: () => _invoke('shell.board.claim'), child: Text(l.boardClaimTask), ), @@ -356,6 +360,13 @@ class _BoardTaskPageState extends State { ], ], ), + if (blockedReason != null) + BoardNotice( + key: const ValueKey('board.task.notice.claimBlocked'), + icon: LucideIcons.clock, + text: blockedReason, + tone: theme.colorScheme.warning, + ), ], ); } diff --git a/packages/wonky_app/lib/src/board/report/board_report_dialog.dart b/packages/wonky_app/lib/src/board/report/board_report_dialog.dart index 16177898..e0042c93 100644 --- a/packages/wonky_app/lib/src/board/report/board_report_dialog.dart +++ b/packages/wonky_app/lib/src/board/report/board_report_dialog.dart @@ -331,6 +331,18 @@ class BoardReportDialogState extends State // ---- Vote instead ---- + /// The details of similar post [p] in a dialog over this one; its *Vote + /// instead* votes as the row's button does. + Future showSimilar(BoardSimilarPost p) async { + final vote = await showBoardSimilarPostDialog( + context, + repository: s.repositories.board, + post: p, + canVote: _voting == null && !_posting, + ); + if (vote == true && mounted) await voteInstead(p); + } + Future voteInstead(BoardSimilarPost p) async { if (_voting != null || _posting) return; final l = WonkyAppLocalizations.of(context); @@ -776,6 +788,7 @@ class BoardReportDialogState extends State posts: _similar.results, voting: _voting, onVote: voteInstead, + onOpen: showSimilar, ), ), ), diff --git a/packages/wonky_app/lib/src/board/report/similar_posts.dart b/packages/wonky_app/lib/src/board/report/similar_posts.dart index 19cfcfc9..d21c01e2 100644 --- a/packages/wonky_app/lib/src/board/report/similar_posts.dart +++ b/packages/wonky_app/lib/src/board/report/similar_posts.dart @@ -1,11 +1,16 @@ import 'dart:async'; +import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart'; import 'package:shad/shad.dart'; import 'package:wonky_client/wonky_client.dart'; +import 'package:wonky_ui/wonky_ui.dart' show WonkyDialogCloseButton; import '../../l10n/wonky_app_localizations.dart'; +import '../../markdown/wonky_markdown.dart'; import '../board_repository.dart'; +import '../pages/board_labels.dart'; +import '../pages/board_widgets.dart'; /// Finds similar posts while the user types (specs/16 §4.2.2): debounced /// [debounce] after the title or body changes, at least [minWords] words, @@ -19,6 +24,7 @@ class BoardSimilarSearch extends ChangeNotifier { static const minWords = 3; static const maxResults = 5; + static const _suggested = {BoardPostStatus.open, BoardPostStatus.planned}; final BoardRepository repository; final Duration debounce; @@ -54,7 +60,14 @@ class BoardSimilarSearch extends ChangeNotifier { found = const []; } if (_disposed || generation != _generation) return; - _set(found.take(maxResults).toList(growable: false)); + // Built issues are not suggested: done and shipped ones can't be + // voted for (older servers still return done ones). + _set( + found + .where((p) => _suggested.contains(p.status)) + .take(maxResults) + .toList(growable: false), + ); }); } @@ -79,20 +92,25 @@ class BoardSimilarSearch extends ChangeNotifier { } } -/// The *Similar posts* box of the report dialog: one row per post with its -/// number, title, score and *Vote instead* (keys -/// `dialog.board.report.similar.` and `….vote`). +/// The *Similar issues* box of the report dialog: one row per post with its +/// number and title (a link that opens [onOpen], the post's details), its +/// score and *Vote instead* (keys `dialog.board.report.similar.`, +/// `….open` and `….vote`). class BoardSimilarPostsPanel extends StatelessWidget { const BoardSimilarPostsPanel({ super.key, required this.posts, required this.onVote, + this.onOpen, this.voting, }); final List posts; final ValueChanged onVote; + /// Shows the details of a post (the title link); null: plain titles. + final ValueChanged? onOpen; + /// The post being voted for (its button is busy). final int? voting; @@ -136,11 +154,23 @@ class BoardSimilarPostsPanel extends StatelessWidget { ), const SizedBox(width: 6), Expanded( - child: Text( - '#${p.number} ${p.title}', - maxLines: 1, - overflow: TextOverflow.ellipsis, - ), + child: onOpen == null + ? Text( + '#${p.number} ${p.title}', + maxLines: 1, + overflow: TextOverflow.ellipsis, + ) + : _TitleLink( + key: ValueKey( + '$keyPrefix.${p.number}.open', + ), + text: '#${p.number} ${p.title}', + semanticsLabel: l.boardSimilarShow( + p.number, + p.title, + ), + onTap: () => onOpen!(p), + ), ), const SizedBox(width: 8), Semantics( @@ -180,3 +210,228 @@ class BoardSimilarPostsPanel extends StatelessWidget { ); } } + +/// A one-line title that opens something: underlined on hover, the focus +/// ring, Enter / Space. +class _TitleLink extends StatefulWidget { + const _TitleLink({ + super.key, + required this.text, + required this.semanticsLabel, + required this.onTap, + }); + + final String text; + final String semanticsLabel; + final VoidCallback onTap; + + @override + State<_TitleLink> createState() => _TitleLinkState(); +} + +class _TitleLinkState extends State<_TitleLink> { + bool _hover = false; + bool _focus = false; + + @override + Widget build(BuildContext context) { + final cs = ShadTheme.of(context).colorScheme; + return Semantics( + button: true, + label: widget.semanticsLabel, + excludeSemantics: true, + onTap: widget.onTap, + child: FocusableActionDetector( + mouseCursor: SystemMouseCursors.click, + onShowHoverHighlight: (v) => setState(() => _hover = v), + onShowFocusHighlight: (v) => setState(() => _focus = v), + shortcuts: const { + SingleActivator(LogicalKeyboardKey.enter): ActivateIntent(), + SingleActivator(LogicalKeyboardKey.space): ActivateIntent(), + }, + actions: { + ActivateIntent: CallbackAction( + onInvoke: (_) { + widget.onTap(); + return null; + }, + ), + }, + child: GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: widget.onTap, + child: DecoratedBox( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(4), + border: Border.all( + color: _focus ? cs.ring : const Color(0x00000000), + ), + ), + child: Text( + widget.text, + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: TextStyle( + color: cs.foreground, + decoration: _hover ? TextDecoration.underline : null, + decorationColor: cs.foreground, + ), + ), + ), + ), + ), + ); + } +} + +/// The details of a similar post over the report dialog (specs/16 §4.2.2): +/// its number and title, labels, status and score, the author and the +/// Markdown body, read with `board.getPost`. Resolves with true when the +/// user chose *Vote instead* (the report dialog then votes), else null. +/// Key `dialog.board.similarPost` (`….vote`, `….close`, `….body`). +Future showBoardSimilarPostDialog( + BuildContext context, { + required BoardRepository repository, + required BoardSimilarPost post, + bool canVote = true, +}) => showShadDialog( + context: context, + builder: (_) => + _SimilarPostDialog(repository: repository, post: post, canVote: canVote), +); + +class _SimilarPostDialog extends StatefulWidget { + const _SimilarPostDialog({ + required this.repository, + required this.post, + required this.canVote, + }); + + final BoardRepository repository; + final BoardSimilarPost post; + final bool canVote; + + @override + State<_SimilarPostDialog> createState() => _SimilarPostDialogState(); +} + +class _SimilarPostDialogState extends State<_SimilarPostDialog> { + late final Future _view = widget.repository.getPost( + widget.post.number, + ); + + static const _key = 'dialog.board.similarPost'; + + @override + Widget build(BuildContext context) { + final l = WonkyAppLocalizations.of(context); + final theme = ShadTheme.of(context); + final size = MediaQuery.sizeOf(context); + final p = widget.post; + final voted = p.myVote > 0; + return CallbackShortcuts( + bindings: { + const SingleActivator(LogicalKeyboardKey.escape): () => + Navigator.of(context).pop(), + }, + child: ShadDialog( + key: const ValueKey(_key), + closeIcon: const WonkyDialogCloseButton(), + constraints: const BoxConstraints(maxWidth: 640), + title: BoardNumberedTitle( + number: '#${p.number}', + title: p.title, + style: theme.textTheme.large, + maxLines: 3, + ), + actions: [ + ShadButton.outline( + key: const ValueKey('$_key.close'), + onPressed: () => Navigator.of(context).pop(), + child: Text(l.actionClose), + ), + ShadButton( + key: const ValueKey('$_key.vote'), + enabled: widget.canVote && !voted, + onPressed: () => Navigator.of(context).pop(true), + child: Text(voted ? l.boardReportVoted : l.boardReportVoteInstead), + ), + ], + child: SizedBox( + width: size.width < 680 ? size.width - 48 : 592, + child: FutureBuilder( + future: _view, + builder: (context, snap) { + final v = snap.data; + final muted = theme.textTheme.muted.copyWith(fontSize: 12); + final chips = Wrap( + spacing: 6, + runSpacing: 6, + crossAxisAlignment: WrapCrossAlignment.center, + children: [ + ...boardLabelChips( + l, + kind: p.kind, + area: v?.area, + size: v?.size, + ai: v?.aiLabels ?? false, + ), + BoardStatusBadge( + status: p.status, + label: l.boardStatusName(p.status), + ), + Text(l.boardReportSimilarVotes(p.score), style: muted), + ], + ); + final Widget body; + if (snap.hasError) { + body = Text( + l.boardSimilarLoadFailed, + key: const ValueKey('$_key.error'), + style: theme.textTheme.muted, + ); + } else if (v == null) { + body = const Padding( + padding: EdgeInsets.symmetric(vertical: 24), + child: Center(child: ShadSpinner()), + ); + } else { + body = Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + spacing: 12, + children: [ + BoardAuthorLine( + author: v.author, + createdAt: v.createdAt, + editedAt: v.editedAt, + ), + WonkyMarkdown( + v.body, + key: const ValueKey('$_key.body'), + profile: MarkdownProfile.post, + ), + ], + ); + } + return ConstrainedBox( + constraints: BoxConstraints( + maxHeight: (size.height * 0.6).clamp(200, 480).toDouble(), + ), + child: SingleChildScrollView( + padding: const EdgeInsets.symmetric(vertical: 4), + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + mainAxisSize: MainAxisSize.min, + spacing: 14, + children: [chips, body], + ), + ), + ); + }, + ), + ), + ), + ); + } +} diff --git a/packages/wonky_app/lib/src/comments/comment_thread_actions.dart b/packages/wonky_app/lib/src/comments/comment_thread_actions.dart index e5a97b91..c653aa03 100644 --- a/packages/wonky_app/lib/src/comments/comment_thread_actions.dart +++ b/packages/wonky_app/lib/src/comments/comment_thread_actions.dart @@ -164,6 +164,14 @@ abstract class CommentThreadActions { /// The placeholder of the reply box (null: the default). String? replyHint(WonkyAppLocalizations l) => null; + + /// Whether [c] has a checkbox before its author, and whether it is + /// checked; null shows none (the board's comments for a task prompt, + /// specs/16 §9.3). [select] changes it, [selectLabel] names it for + /// screen readers. + bool? selected(ThreadComment c) => null; + void select(ThreadComment c, bool selected) {} + String selectLabel(WonkyAppLocalizations l, ThreadComment c) => ''; } /// Document comments (Write, Sheets, Slides): the `shell.comments.*` diff --git a/packages/wonky_app/lib/src/comments/comments_panel.dart b/packages/wonky_app/lib/src/comments/comments_panel.dart index 0690ddcd..f6e8c2ad 100644 --- a/packages/wonky_app/lib/src/comments/comments_panel.dart +++ b/packages/wonky_app/lib/src/comments/comments_panel.dart @@ -1005,12 +1005,24 @@ class _CommentThreadBodyState extends State { final resolved = a.resolved; final copyLink = a.copyLink; final react = a.react; + final selected = cm.deleted ? null : a.selected(cm); return Column( crossAxisAlignment: CrossAxisAlignment.stretch, mainAxisSize: MainAxisSize.min, children: [ Row( children: [ + if (selected != null) ...[ + Semantics( + label: a.selectLabel(l, cm), + child: ShadCheckbox( + key: ValueKey('$p.comment.${cm.id}.select'), + value: selected, + onChanged: (v) => a.select(cm, v), + ), + ), + const SizedBox(width: 10), + ], WonkyAvatar( name: cm.authorName ?? '?', color: cm.authorColor == null 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 a2ab65a0..54345271 100644 --- a/packages/wonky_app/lib/src/l10n/wonky_app_localizations.dart +++ b/packages/wonky_app/lib/src/l10n/wonky_app_localizations.dart @@ -5518,6 +5518,42 @@ abstract class WonkyAppLocalizations { /// **'{count, plural, =1{1 vote} other{{count} votes}}'** String boardReportSimilarVotes(int count); + /// Screen-reader label of a similar issue's title in the report dialog: it opens the issue's details. + /// + /// In en, this message translates to: + /// **'Show #{number} {title}'** + String boardSimilarShow(int number, String title); + + /// No description provided for @boardSimilarLoadFailed. + /// + /// In en, this message translates to: + /// **'Couldn\'t load this issue. Try again later.'** + String get boardSimilarLoadFailed; + + /// No description provided for @boardTaskCommentsLabel. + /// + /// In en, this message translates to: + /// **'Comments for the prompt'** + String get boardTaskCommentsLabel; + + /// No description provided for @boardTaskCommentsHint. + /// + /// In en, this message translates to: + /// **'The AI reads the checked comments when it writes the prompt.'** + String get boardTaskCommentsHint; + + /// No description provided for @boardCommentsPromptHint. + /// + /// In en, this message translates to: + /// **'Checked comments go into the task prompt when you select this issue for building.'** + String get boardCommentsPromptHint; + + /// Screen-reader label of an admin's checkbox on an issue comment. + /// + /// In en, this message translates to: + /// **'Include the comment by {name} in the task prompt'** + String boardCommentInPrompt(String name); + /// No description provided for @boardReportVoteInstead. /// /// In en, this message translates to: @@ -6454,12 +6490,6 @@ abstract class WonkyAppLocalizations { /// **'Admins publish tasks from the most wanted issues. Check back soon.'** String get boardEmptyTasksHint; - /// No description provided for @boardDoneTasks. - /// - /// In en, this message translates to: - /// **'Finished tasks'** - String get boardDoneTasks; - /// Semantics label of the up-vote button. /// /// In en, this message translates to: @@ -6688,6 +6718,12 @@ abstract class WonkyAppLocalizations { /// **'Merge into…'** String get boardMergeEllipsis; + /// No description provided for @boardLabelsEllipsis. + /// + /// In en, this message translates to: + /// **'Labels…'** + String get boardLabelsEllipsis; + /// No description provided for @boardBlockEllipsis. /// /// 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 6615f62b..3dca68a9 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 @@ -3130,6 +3130,31 @@ class WonkyAppLocalizationsEn extends WonkyAppLocalizations { return '$_temp0'; } + @override + String boardSimilarShow(int number, String title) { + return 'Show #$number $title'; + } + + @override + String get boardSimilarLoadFailed => + 'Couldn\'t load this issue. Try again later.'; + + @override + String get boardTaskCommentsLabel => 'Comments for the prompt'; + + @override + String get boardTaskCommentsHint => + 'The AI reads the checked comments when it writes the prompt.'; + + @override + String get boardCommentsPromptHint => + 'Checked comments go into the task prompt when you select this issue for building.'; + + @override + String boardCommentInPrompt(String name) { + return 'Include the comment by $name in the task prompt'; + } + @override String get boardReportVoteInstead => 'Vote instead'; @@ -3668,9 +3693,6 @@ class WonkyAppLocalizationsEn extends WonkyAppLocalizations { String get boardEmptyTasksHint => 'Admins publish tasks from the most wanted issues. Check back soon.'; - @override - String get boardDoneTasks => 'Finished tasks'; - @override String boardUpvoteLabel(int score) { return 'Upvote, $score votes'; @@ -3808,6 +3830,9 @@ class WonkyAppLocalizationsEn extends WonkyAppLocalizations { @override String get boardMergeEllipsis => 'Merge into…'; + @override + String get boardLabelsEllipsis => 'Labels…'; + @override String get boardBlockEllipsis => 'Block user from the board…'; @@ -7766,6 +7791,31 @@ class WonkyAppLocalizationsEnXa extends WonkyAppLocalizationsEn { return '[$_temp0 one]'; } + @override + String boardSimilarShow(int number, String title) { + return '[Šĥöŵ #$number $title on]'; + } + + @override + String get boardSimilarLoadFailed => + '[Çöûļðñ\'ţ ļöåð ţĥîš îššûé. Ţŕý åĝåîñ ļåţéŕ. one two three]'; + + @override + String get boardTaskCommentsLabel => '[Çöɱɱéñţš ƒöŕ ţĥé þŕöɱþţ one two]'; + + @override + String get boardTaskCommentsHint => + '[Ţĥé ÅÎ ŕéåðš ţĥé çĥéçķéð çöɱɱéñţš ŵĥéñ îţ ŵŕîţéš ţĥé þŕöɱþţ. one two three four]'; + + @override + String get boardCommentsPromptHint => + '[Çĥéçķéð çöɱɱéñţš ĝö îñţö ţĥé ţåšķ þŕöɱþţ ŵĥéñ ýöû šéļéçţ ţĥîš îššûé ƒöŕ ƀûîļðîñĝ. one two three four five]'; + + @override + String boardCommentInPrompt(String name) { + return '[Îñçļûðé ţĥé çöɱɱéñţ ƀý $name îñ ţĥé ţåšķ þŕöɱþţ one two thre]'; + } + @override String get boardReportVoteInstead => '[Ṽöţé îñšţéåð one]'; @@ -8310,9 +8360,6 @@ class WonkyAppLocalizationsEnXa extends WonkyAppLocalizationsEn { String get boardEmptyTasksHint => '[Åðɱîñš þûƀļîšĥ ţåšķš ƒŕöɱ ţĥé ɱöšţ ŵåñţéð îššûéš. Çĥéçķ ƀåçķ šööñ. one two three four f]'; - @override - String get boardDoneTasks => '[Ƒîñîšĥéð ţåšķš one t]'; - @override String boardUpvoteLabel(int score) { return '[Ûþṽöţé, $score ṽöţéš one t]'; @@ -8451,6 +8498,9 @@ class WonkyAppLocalizationsEnXa extends WonkyAppLocalizationsEn { @override String get boardMergeEllipsis => '[Ṁéŕĝé îñţö… one]'; + @override + String get boardLabelsEllipsis => '[Ļåƀéļš… one]'; + @override String get boardBlockEllipsis => '[Ɓļöçķ ûšéŕ ƒŕöɱ ţĥé ƀöåŕð… one two]'; diff --git a/packages/wonky_app/lib/src/shell/form_dialog.dart b/packages/wonky_app/lib/src/shell/form_dialog.dart index f117b621..7a332f9b 100644 --- a/packages/wonky_app/lib/src/shell/form_dialog.dart +++ b/packages/wonky_app/lib/src/shell/form_dialog.dart @@ -140,6 +140,37 @@ class CheckboxFieldSpec extends DialogFieldSpec { final bool initial; } +/// An item of a [ChecklistFieldSpec]: its [value], [label] and the +/// [group] it is listed under (a heading over the items that share it). +class ChecklistItem { + const ChecklistItem({required this.value, required this.label, this.group}); + + final String value; + final String label; + final String? group; +} + +/// A list of checkboxes in a scrolling box (at most [maxHeight] high); the +/// value is the list of checked item values. Keys: +/// `..` per item. +class ChecklistFieldSpec extends DialogFieldSpec { + const ChecklistFieldSpec({ + required super.id, + required super.label, + required this.items, + this.description, + this.initial, + this.maxHeight = 240, + }); + + final List items; + final String? description; + + /// The values checked at first; null checks every item. + final Set? initial; + final double maxHeight; +} + class SelectFieldSpec extends DialogFieldSpec { const SelectFieldSpec({ required super.id, @@ -212,6 +243,11 @@ class DialogResult { String text(String id) => '${values[id] ?? ''}'; bool flag(String id) => values[id] == true; + + /// The checked values of a [ChecklistFieldSpec]. + List checked(String id) => [ + for (final v in values[id] as List? ?? const []) '$v', + ]; } /// Shows [spec]; resolves with the pressed button and field values (null @@ -257,6 +293,11 @@ class _WonkyFormDialogState extends State _text[f.id] = c; case CheckboxFieldSpec(): _values[f.id] = f.initial; + case ChecklistFieldSpec(): + _values[f.id] = { + for (final i in f.items) + if (f.initial?.contains(i.value) ?? true) i.value, + }; case SelectFieldSpec(): _values[f.id] = f.initial; } @@ -281,10 +322,22 @@ class _WonkyFormDialogState extends State } Map get _all => { - ..._values, + for (final e in _values.entries) + // Checklists: the checked values in the items' order. + e.key: e.value is Set ? _checkedOf(e.key) : e.value, for (final e in _text.entries) e.key: e.value.text, }; + List _checkedOf(String id) { + final f = widget.spec.fields.firstWhere((f) => f.id == id); + final set = _values[id]! as Set; + return [ + if (f is ChecklistFieldSpec) + for (final i in f.items) + if (set.contains(i.value)) i.value, + ]; + } + bool _validate() { var ok = true; for (final f in widget.spec.fields) { @@ -322,9 +375,17 @@ class _WonkyFormDialogState extends State 'type': switch (f) { TextFieldSpec() => 'text', CheckboxFieldSpec() => 'checkbox', + ChecklistFieldSpec() => 'checklist', SelectFieldSpec() => 'select', }, 'value': _all[f.id], + if (f is ChecklistFieldSpec) ...{ + 'options': [for (final i in f.items) i.value], + 'optionLabels': { + for (final i in f.items) + i.value: i.group == null ? i.label : '${i.group}: ${i.label}', + }, + }, if (f is SelectFieldSpec) 'options': f.options.keys.toList(), // (v2) What each option says (Slides' Go to slide lists slides // by id; agents need the labels). @@ -346,6 +407,12 @@ class _WonkyFormDialogState extends State case CheckboxFieldSpec(): if (value is! bool) return false; setState(() => _values[id] = value); + case ChecklistFieldSpec(): + final known = {for (final i in f.items) i.value}; + if (value is! List || value.any((v) => !known.contains('$v'))) { + return false; + } + setState(() => _values[id] = {for (final v in value) '$v'}); case SelectFieldSpec(): if (!f.options.containsKey(value)) return false; setState(() => _values[id] = value); @@ -363,6 +430,74 @@ class _WonkyFormDialogState extends State return true; } + Widget _checklist(ChecklistFieldSpec f, ShadThemeData theme, String? key) { + final cs = theme.colorScheme; + final checked = _values[f.id]! as Set; + final rows = []; + String? group; + for (final i in f.items) { + if (i.group != null && i.group != group) { + group = i.group; + rows.add( + Padding( + padding: EdgeInsets.only(top: rows.isEmpty ? 0 : 8, bottom: 2), + child: Text( + group!, + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: theme.textTheme.small.copyWith(color: cs.mutedForeground), + ), + ), + ); + } + rows.add( + Padding( + padding: const EdgeInsets.symmetric(vertical: 3), + child: ShadCheckbox( + key: key == null + ? null + : ValueKey('$key.${f.id}.${i.value}'), + value: checked.contains(i.value), + onChanged: (v) => setState(() { + v ? checked.add(i.value) : checked.remove(i.value); + }), + label: Text(i.label, maxLines: 2, overflow: TextOverflow.ellipsis), + ), + ), + ); + } + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + Text(f.label, style: theme.textTheme.small), + if (f.description != null) ...[ + const SizedBox(height: 2), + Text(f.description!, style: theme.textTheme.muted), + ], + const SizedBox(height: 6), + DecoratedBox( + key: key == null ? null : ValueKey('$key.${f.id}'), + decoration: BoxDecoration( + border: Border.all(color: cs.border), + borderRadius: theme.radius, + ), + child: ConstrainedBox( + constraints: BoxConstraints(maxHeight: f.maxHeight), + child: SingleChildScrollView( + padding: const EdgeInsets.fromLTRB(12, 8, 12, 8), + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + mainAxisSize: MainAxisSize.min, + children: rows, + ), + ), + ), + ), + ], + ); + } + @override Widget build(BuildContext context) { final spec = widget.spec; @@ -428,6 +563,8 @@ class _WonkyFormDialogState extends State label: Text(f.label), ), ); + case ChecklistFieldSpec(): + fields.add(_checklist(f, theme, key)); case SelectFieldSpec(): fields.add( Column( diff --git a/packages/wonky_app/lib/src/testing/fake_board_repository.dart b/packages/wonky_app/lib/src/testing/fake_board_repository.dart index 631a3461..8a753b21 100644 --- a/packages/wonky_app/lib/src/testing/fake_board_repository.dart +++ b/packages/wonky_app/lib/src/testing/fake_board_repository.dart @@ -160,6 +160,14 @@ class FakeBoardRepository implements BoardRepository { bool isAdmin; bool blocked = false; + /// Set: the caller may not claim tasks until then (specs/16 §8.4), with + /// [claimBlockedReason] as the error. + DateTime? claimBlockedUntil; + String claimBlockedReason = "You can't claim tasks for now."; + + /// The comments left out of the prompt of each created task, by task. + final Map> excludedComments = {}; + /// When set, every call throws it (offline, server errors). Object? failWith; @@ -662,6 +670,11 @@ class FakeBoardRepository implements BoardRepository { repository: 'serverpod/wonky', securityContact: 'security@serverpod.dev', claimHours: 48, + maxActiveClaims: 3, + claimBlockedUntil: id == null ? null : claimBlockedUntil, + claimBlockedReason: id == null || claimBlockedUntil == null + ? null + : claimBlockedReason, ); } @@ -815,6 +828,8 @@ class FakeBoardRepository implements BoardRepository { if (p.moderation == BoardModeration.visible && p.deletedAt == null && (kind == null || p.kind == kind) && + (p.status == BoardPostStatus.open || + p.status == BoardPostStatus.planned) && words.any((w) => p.title.toLowerCase().contains(w))) BoardSimilarPost( number: p.number, @@ -1085,8 +1100,11 @@ class FakeBoardRepository implements BoardRepository { final active = tasks.values .where((x) => x.claimedById == userId && _claimValid(x)) .length; - if (active >= 2) { - throw _err(WonkyErrorCode.limitExceeded, 'You have 2 active claims.'); + if (claimBlockedUntil != null) { + throw _err(WonkyErrorCode.forbidden, claimBlockedReason); + } + if (active >= 3) { + throw _err(WonkyErrorCode.limitExceeded, 'You have 3 active claims.'); } t ..status = BoardTaskStatus.claimed @@ -1383,8 +1401,9 @@ class FakeBoardRepository implements BoardRepository { List postNumbers, String title, BoardArea area, - BoardSize size, - ) async { + BoardSize size, { + List excludedComments = const [], + }) async { _log('createTask ${postNumbers.join(',')}'); _admin(); final t = seedTask( @@ -1396,6 +1415,9 @@ class FakeBoardRepository implements BoardRepository { posts: postNumbers, ); t.promptPending = writesPromptLater; + if (excludedComments.isNotEmpty) { + this.excludedComments[t.number] = [...excludedComments]; + } return _taskView(t); } diff --git a/packages/wonky_app/test/board/commands/board_commands_test.dart b/packages/wonky_app/test/board/commands/board_commands_test.dart index 1107c9e7..69df99c1 100644 --- a/packages/wonky_app/test/board/commands/board_commands_test.dart +++ b/packages/wonky_app/test/board/commands/board_commands_test.dart @@ -579,6 +579,24 @@ void main() { expect(redone.posts, [post.number]); }); + test('when creating a task without some comments then the task leaves ' + 'them out, also after redo', () async { + final c = board.seedComment(postNumber: post.number, body: 'Off topic'); + final r = await h.invoke('shell.board.admin.createTask', { + 'postNumbers': [post.number], + 'title': 'Merged cells', + 'area': 'sheets', + 'size': 'small', + 'excludedComments': [c.uuid.uuid], + }); + final n = (r.data! as Map)['taskNumber'] as int; + expect(board.excludedComments[n], [c.uuid]); + + await h.undo(); + await h.redo(); + expect(board.excludedComments[board.tasks.values.last.number], [c.uuid]); + }); + test('when creating a task headless without labels then the first ' "post's title and labels are used", () async { final r = await h.invoke('shell.board.admin.createTask', { diff --git a/packages/wonky_app/test/board/pages/board_page_test.dart b/packages/wonky_app/test/board/pages/board_page_test.dart index fa2e826f..c23aa36f 100644 --- a/packages/wonky_app/test/board/pages/board_page_test.dart +++ b/packages/wonky_app/test/board/pages/board_page_test.dart @@ -134,6 +134,37 @@ void main() { await settleTooltips(tester); }); + for (final b in Brightness.values) { + testWidgets('Given done and shipped tasks in ${b.name} then the Done tab ' + 'lists only the finished issues', (tester) async { + final board = seeded(); + final done = board.seedTask( + title: 'Finished work', + posts: [2], + status: BoardTaskStatus.done, + ); + final shipped = board.seedTask( + title: 'Shipped work', + posts: [4], + status: BoardTaskStatus.shipped, + ); + current = await pumpBoard( + tester, + '/improvements/done', + board: board, + brightness: b, + ); + + expect(row(5), findsOneWidget); + expect(byKey('board.task.${done.number}'), findsNothing); + expect(byKey('board.task.${shipped.number}'), findsNothing); + expect(byKey('board.doneTasks'), findsNothing); + expect(find.text('Finished work'), findsNothing); + expect(board.calls.where((c) => c.startsWith('listTasks')), isEmpty); + await settleTooltips(tester); + }); + } + testWidgets('Given the board when filtering by area then only that area ' 'is listed', (tester) async { current = await pumpBoard(tester, '/improvements', board: seeded()); diff --git a/packages/wonky_app/test/board/pages/board_trail_test.dart b/packages/wonky_app/test/board/pages/board_trail_test.dart index 29fb066d..ecbb048a 100644 --- a/packages/wonky_app/test/board/pages/board_trail_test.dart +++ b/packages/wonky_app/test/board/pages/board_trail_test.dart @@ -24,9 +24,12 @@ void main() { const BoardTrail(list: BoardTab.tasks, task: 1, post: 5), ); expect( - parse('/improvements/t/2?list=done'), - const BoardTrail(list: BoardTab.done, task: 2), + parse('/improvements/t/2?list=claimed'), + const BoardTrail(list: BoardTab.claimed, task: 2), ); + // Done lists finished issues only (specs/16 §4.4): a task under it + // falls back to its own list. + expect(parse('/improvements/t/2?list=done'), const BoardTrail(task: 2)); expect(BoardTrail.parse(Uri.parse('/recent')), isNull); expect(BoardTrail.parse(Uri.parse('/improvements/p/x')), isNull); }); diff --git a/packages/wonky_app/test/board/pages/post_page_test.dart b/packages/wonky_app/test/board/pages/post_page_test.dart index 287ea834..3f9945df 100644 --- a/packages/wonky_app/test/board/pages/post_page_test.dart +++ b/packages/wonky_app/test/board/pages/post_page_test.dart @@ -2,6 +2,7 @@ import 'dart:ui' show Tristate; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; +import 'package:shad/shad.dart' show ShadCheckbox; import 'package:wonky_app/testing.dart'; import 'package:wonky_client/wonky_client.dart'; import 'package:wonky_ui/testing.dart'; @@ -269,17 +270,13 @@ void main() { expect(find.textContaining('spam 0.62'), findsOneWidget); expect(byKey('board.post.flags'), findsOneWidget); expect(find.text('Possible duplicate of #1'), findsOneWidget); + // The common actions are a toolbar, the rest stays in ⋮ (§4.5). + expect(byKey('board.post.adminBar'), findsOneWidget); + for (final k in ['select', 'addToTask', 'labels', 'merge', 'decline']) { + expect(byKey('board.post.bar.$k'), findsOneWidget, reason: k); + } await openMenu(tester); - for (final k in [ - 'labels', - 'applyTitle', - 'hold', - 'remove', - 'decline', - 'merge', - 'select', - 'block', - ]) { + for (final k in ['applyTitle', 'hold', 'remove', 'block']) { expect(byKey('board.post.menu.$k'), findsOneWidget, reason: k); } await tester.tap(byKey('board.post.menu.hold')); @@ -352,4 +349,244 @@ void main() { await settleTooltips(tester); }); } + + group('Given a post with comments', () { + late FakeBoardRepository b; + late List comments; + setUp(() { + b = FakeBoardRepository(isAdmin: true); + final p = b.seedPost(title: 'Paste into merged cells drops styles'); + comments = [ + b.seedComment(postNumber: p.number, body: 'It loses **italic** too.'), + b.seedComment(postNumber: p.number, body: 'Off topic: nice theme.'), + b.seedComment(postNumber: p.number, body: 'Only in Chrome.'), + b.seedComment( + postNumber: p.number, + body: 'Held for review', + moderation: BoardModeration.held, + ), + ]; + }); + + String box(FakeBoardComment c) => 'board.comment.${c.uuid.uuid}.select'; + + Future open( + WidgetTester tester, { + Brightness brightness = Brightness.light, + }) async { + current = await pumpBoard( + tester, + '/improvements/p/1', + board: b, + brightness: brightness, + ); + } + + for (final brightness in Brightness.values) { + testWidgets('when an admin opens it in ${brightness.name} then the ' + 'visible comments have checkboxes, all checked, and the toolbar ' + 'offers Select for building', (tester) async { + final semantics = tester.ensureSemantics(); + await open(tester, brightness: brightness); + + expect(byKey('board.post.bar.select'), findsOneWidget); + expect(byKey('board.post.comments.promptHint'), findsOneWidget); + for (final c in comments.take(3)) { + expect( + tester.widget(byKey(box(c))).value, + isTrue, + reason: c.body, + ); + } + expect(byKey(box(comments[3])), findsNothing, reason: 'held'); + expect( + find.bySemanticsLabel( + 'Include the comment by Bob Stone in the task prompt', + ), + findsNWidgets(3), + ); + expect(tester.takeException(), isNull); + semantics.dispose(); + await settleTooltips(tester); + }); + } + + testWidgets('when an admin unchecks a comment and selects the post for ' + 'building then the task leaves it out, and the dialog lists no ' + 'comments', (tester) async { + await open(tester); + + await tester.tap(byKey(box(comments[1]))); + await tester.pumpAndSettle(); + expect( + tester.widget(byKey(box(comments[1]))).value, + isFalse, + ); + await tester.tap(byKey('board.post.bar.select')); + await tester.pumpAndSettle(); + expect(byKey('dialog.board.task'), findsOneWidget); + expect(byKey('dialog.board.task.comments'), findsNothing); + await tester.tap(byKey('dialog.board.task.ok')); + await tester.pumpAndSettle(); + + final task = b.tasks.values.single; + expect(b.excludedComments[task.number], [comments[1].uuid]); + expect(t().location, '/improvements/t/${task.number}'); + await settleTooltips(tester); + }); + + testWidgets('when every comment stays checked then none is left out', ( + tester, + ) async { + await open(tester); + + await tester.tap(byKey('board.post.bar.select')); + await tester.pumpAndSettle(); + await tester.tap(byKey('dialog.board.task.ok')); + await tester.pumpAndSettle(); + + expect(b.excludedComments, isEmpty); + expect(b.tasks, hasLength(1)); + await settleTooltips(tester); + }); + + testWidgets('when the post is already in a task then there are no ' + 'checkboxes and no Select for building', (tester) async { + b.seedTask(posts: [1], status: BoardTaskStatus.published); + await open(tester); + + expect(byKey('board.post.adminBar'), findsOneWidget); + expect(byKey('board.post.bar.select'), findsNothing); + expect(byKey(box(comments[0])), findsNothing); + expect(byKey('board.post.comments.promptHint'), findsNothing); + await settleTooltips(tester); + }); + + for (final brightness in Brightness.values) { + testWidgets('when an admin opens it in ${brightness.name} then ⋮ ends ' + 'the toolbar row, not the title row', (tester) async { + await open(tester, brightness: brightness); + + final bar = byKey('board.post.adminBar'); + expect( + find.descendant(of: bar, matching: byKey('board.post.menu')), + findsOneWidget, + ); + expect( + find.descendant( + of: byKey('board.post.header'), + matching: byKey('board.post.menu'), + ), + findsNothing, + ); + final menu = tester.getRect(byKey('board.post.menu')); + final select = tester.getRect(byKey('board.post.bar.select')); + final decline = tester.getRect(byKey('board.post.bar.decline')); + expect(menu.center.dy, closeTo(select.center.dy, 1), reason: 'one row'); + expect(menu.left, greaterThan(decline.right), reason: 'at the end'); + await settleTooltips(tester); + }); + } + + testWidgets('when the window is narrow then the buttons that do not fit ' + 'move into ⋮, least important first, and still work', (tester) async { + current = await pumpBoard( + tester, + '/improvements/p/1', + board: b, + size: const Size(420, 800), + ); + + // Select for building stays; Decline and Merge go first. + expect(byKey('board.post.bar.select'), findsOneWidget); + expect( + tester.getRect(byKey('board.post.bar.select')).right, + lessThanOrEqualTo(420), + ); + expect(byKey('board.post.bar.decline').hitTestable(), findsNothing); + expect(byKey('board.post.bar.merge').hitTestable(), findsNothing); + expect(tester.takeException(), isNull); + + await openMenu(tester); + expect(byKey('board.post.menu.decline'), findsOneWidget); + expect(byKey('board.post.menu.merge'), findsOneWidget); + expect(byKey('board.post.menu.select'), findsNothing); + expect(byKey('board.post.menu.hold'), findsOneWidget, reason: 'its own'); + await tester.tap(byKey('board.post.menu.decline')); + await tester.pumpAndSettle(); + expect(byKey('dialog.board.decline'), findsOneWidget); + await settleTooltips(tester); + }); + + // The test font is far wider than the app's, so which buttons fit at a + // given width differs from the browser: check the split, not the count. + testWidgets('then each common action is either a button in the row or ' + 'an entry of ⋮, never both, and the most important stay in the row', ( + tester, + ) async { + await open(tester); + const order = ['select', 'addToTask', 'labels', 'merge', 'decline']; + final inRow = [ + for (final k in order) + if (byKey('board.post.bar.$k').hitTestable().evaluate().isNotEmpty) k, + ]; + await openMenu(tester); + + expect(inRow, contains('select')); + expect(inRow, order.take(inRow.length), reason: 'least important go'); + for (final k in order) { + expect( + byKey('board.post.menu.$k'), + inRow.contains(k) ? findsNothing : findsOneWidget, + reason: k, + ); + } + expect(byKey('board.post.menu.hold'), findsOneWidget); + await settleTooltips(tester); + }); + + testWidgets('when someone who is not an admin opens it then there is no ' + 'toolbar and no checkboxes', (tester) async { + b.isAdmin = false; + await open(tester); + + expect(byKey('board.post.adminBar'), findsNothing); + expect(byKey(box(comments[0])), findsNothing); + await settleTooltips(tester); + }); + }); + + testWidgets('Given the board list when an admin creates a task from ' + 'selected posts then the task dialog lists their comments to choose ' + 'from', (tester) async { + final b = FakeBoardRepository(isAdmin: true); + b.seedPost(title: 'Paste into merged cells drops styles'); + b.seedPost(title: 'Paste loses borders'); + final off = b.seedComment(postNumber: 1, body: 'Off topic: nice theme.'); + b.seedComment(postNumber: 2, body: 'Same with borders.'); + current = await pumpBoard(tester, '/improvements', board: b); + + await tester.tap(byKey('board.select')); + await tester.pumpAndSettle(); + await tester.tap(byKey('board.row.1.select')); + await tester.tap(byKey('board.row.2.select')); + await tester.pumpAndSettle(); + await tester.tap(byKey('board.selection.createTask')); + await tester.pumpAndSettle(); + expect(byKey('dialog.board.task.comments'), findsOneWidget); + expect( + find.descendant( + of: byKey('dialog.board.task.comments'), + matching: find.text('Bob Stone: Same with borders.'), + ), + findsOneWidget, + ); + await tester.tap(byKey('dialog.board.task.comments.${off.uuid.uuid}')); + await tester.pumpAndSettle(); + await tester.tap(byKey('dialog.board.task.ok')); + await tester.pumpAndSettle(); + + expect(b.excludedComments[b.tasks.values.single.number], [off.uuid]); + await settleTooltips(tester); + }); } diff --git a/packages/wonky_app/test/board/report/report_dialog_test.dart b/packages/wonky_app/test/board/report/report_dialog_test.dart index 9908aa95..6c306f53 100644 --- a/packages/wonky_app/test/board/report/report_dialog_test.dart +++ b/packages/wonky_app/test/board/report/report_dialog_test.dart @@ -522,6 +522,77 @@ void main() { expect(saved![BoardReportField.title], 'Paste merged cells fails'); await settle(tester); }); + + Future typeTitle(WidgetTester tester) async { + await enterField( + tester, + field(BoardReportField.title), + 'Paste merged cells fails', + ); + await tester.pump(const Duration(milliseconds: 401)); + await tester.pumpAndSettle(); + } + + testWidgets('when a similar issue is done or shipped then it is not ' + 'suggested', (tester) async { + board.similarPosts = [ + similarPost(412, 'Paste into merged cells'), + similarPost(413, 'Paste fixed', status: BoardPostStatus.done), + similarPost(414, 'Paste shipped', status: BoardPostStatus.shipped), + similarPost(415, 'Paste planned', status: BoardPostStatus.planned), + ]; + await openReport(tester); + await typeTitle(tester); + + expect(key('${BoardSimilarPostsPanel.keyPrefix}.412'), findsOneWidget); + expect(key('${BoardSimilarPostsPanel.keyPrefix}.415'), findsOneWidget); + expect(key('${BoardSimilarPostsPanel.keyPrefix}.413'), findsNothing); + expect(key('${BoardSimilarPostsPanel.keyPrefix}.414'), findsNothing); + await settle(tester); + }); + + for (final b in Brightness.values) { + testWidgets('when opening a similar issue in ${b.name} then a popup ' + 'shows its details and Close returns to the report', (tester) async { + board.similarPosts = [similarPost(412, 'Paste into merged cells')]; + board.postBodies[412] = 'The **bold** is lost after pasting.'; + await openReport(tester, brightness: b); + await typeTitle(tester); + + await tester.tap(key('${BoardSimilarPostsPanel.keyPrefix}.412.open')); + await tester.pumpAndSettle(); + + expect(key('dialog.board.similarPost'), findsOneWidget); + expect(key('dialog.board.similarPost.body'), findsOneWidget); + expect(find.textContaining('is lost after pasting'), findsOneWidget); + expect(find.text('Open'), findsOneWidget, reason: 'the status'); + expect(tester.takeException(), isNull); + + await tester.tap(key('dialog.board.similarPost.close')); + await tester.pumpAndSettle(); + expect(key('dialog.board.similarPost'), findsNothing); + expect(key(BoardReportKeys.dialog), findsOneWidget); + expect(board.votes, isEmpty); + await settle(tester); + }); + } + + testWidgets('when voting from the popup then it votes instead and both ' + 'dialogs close', (tester) async { + board.similarPosts = [similarPost(412, 'Paste into merged cells')]; + await openReport(tester); + await typeTitle(tester); + + await tester.tap(key('${BoardSimilarPostsPanel.keyPrefix}.412.open')); + await tester.pumpAndSettle(); + await tester.tap(key('dialog.board.similarPost.vote')); + await tester.pumpAndSettle(); + + expect(board.log, contains('vote 412 1')); + expect(key('dialog.board.similarPost'), findsNothing); + expect(key(BoardReportKeys.dialog), findsNothing); + await settle(tester); + }); }); group('Given a draft', () { diff --git a/packages/wonky_app/test/board/report/support/report_fakes.dart b/packages/wonky_app/test/board/report/support/report_fakes.dart index 0db4fbec..ae026454 100644 --- a/packages/wonky_app/test/board/report/support/report_fakes.dart +++ b/packages/wonky_app/test/board/report/support/report_fakes.dart @@ -31,6 +31,9 @@ class FakeReportBoard extends UnfakedBoardRepository { claimHours: 48, ); + /// The bodies `getPost` answers, by number. + final Map postBodies = {}; + /// What `similar` answers. List similarPosts = const []; @@ -102,8 +105,12 @@ class FakeReportBoard extends UnfakedBoardRepository { } @override - Future getPost(int number) async => - postView(number: number).copyWith(myVote: 0); + Future getPost(int number) async { + return postView( + number: number, + body: postBodies[number] ?? '', + ).copyWith(myVote: 0); + } @override Future vote(int number, int value) async { @@ -167,11 +174,12 @@ BoardSimilarPost similarPost( BoardPostKind kind = BoardPostKind.bug, int score = 14, int myVote = 0, + BoardPostStatus status = BoardPostStatus.open, }) => BoardSimilarPost( number: number, kind: kind, title: title, - status: BoardPostStatus.open, + status: status, score: score, myVote: myVote, ); diff --git a/specs/16-bugs-and-improvements.md b/specs/16-bugs-and-improvements.md index 636616da..aea98ae4 100644 --- a/specs/16-bugs-and-improvements.md +++ b/specs/16-bugs-and-improvements.md @@ -46,7 +46,7 @@ PR gets an AI review against its task (§13). The integration is built and enabl | B2 | Who sees the board | Everyone, including signed-out visitors | | B3 | Screenshots | Opt-in. A warning about privacy, then an annotation editor that can cover sensitive areas. Screenshots are **public** with the issue, because the person fixing the bug needs them | | B4 | Admins | Users whose (verified) account email is in a configured domain (`serverpod.dev`), via Google or email/password sign-in | -| B5 | Claiming | Only published tasks (selected by admins) can be claimed, for **48 hours** | +| B5 | Claiming | Only published tasks (selected by admins) can be claimed, for **48 hours**. (T-10) At most **3** claims at a time; 3 expired claims, or 2 issues removed by a moderator, block claiming for **2 weeks** (§8.4) | | B6 | Comments | Yes, with simple Markdown formatting | | B7 | Board location | A shared page in `wonky_app`, local to the current app (like Settings) | | B8 | Task prompts | Written by AI and editable by admins; a written prompt publishes its task unless the lint holds it (T-11, §10.2) | @@ -173,7 +173,7 @@ user saw it. │ (•) Report a bug ( ) Suggest an improvement │ │ │ │ Title [ Pasting into a merged cell loses the formatting ] │ -│ ┌ Similar posts ──────────────────────────────────────────────────┐ │ +│ ┌ Similar issues ─────────────────────────────────────────────────┐ │ │ │ #412 Paste into merged cells drops styles ▲ 14 [Vote instead] │ │ │ │ #388 Merged cells: paste behaves oddly ▲ 3 [Vote instead] │ │ │ └──────────────────────────────────────────────────────────────────┘ │ @@ -213,9 +213,20 @@ user saw it. #### 4.2.2 Similar issues - Debounced 400 ms after the title or body changes (minimum 3 words): `board.similar(text, kind)` returns up to 5 - visible issues (Postgres full-text search, §6.4). + visible issues (Postgres full-text search, §6.4). (T-10) Only issues one can still vote for: + `open` and `planned`. Done and shipped issues are built, so they are not suggested (the client + drops them too, for older servers). - Each row has *Vote instead*. It casts the vote (bugs: *I hit this too*), closes the dialog after a confirmation toast, and keeps the draft in case the user comes back. +- (T-10) The row's `#412 Title` is a link (underlined on hover, the focus ring, Enter / Space; + *Show #412 Title* for screen readers; key `dialog.board.report.similar..open`) that opens + the issue's details in a dialog over the report dialog (`showBoardSimilarPostDialog`, key + `dialog.board.similarPost`, max 640 px): the number and title, the kind, area and size chips, + the status badge and the votes, the author line and the Markdown body (`board.getPost`; + *Couldn't load this issue.* when it fails), scrolling at most 60 % of the window. Its actions + are *Close* (and Esc, back to the report with the draft as it was) and *Vote instead* (*Voted* + when already voted), which closes it and votes like the row's button. The single-window rule + holds: the issue page is not opened from there. #### 4.2.3 Screenshot @@ -276,7 +287,7 @@ The board routes are added to every app by `buildShellRouter`, next to `settings | `/improvements/bugs` | Board, tab *Bugs* | | `/improvements/tasks` | *Up for grabs* (published tasks nobody holds) | | `/improvements/claimed` | *Claimed* (claimed and in-review tasks) | -| `/improvements/done` | Done and shipped (issues and tasks) | +| `/improvements/done` | Done and shipped issues (bugs and improvements; T-10: finished tasks are not listed) | | `/improvements/review` | Admins only: moderation queue, bundles, drafts (§9.2) | | `/improvements/search?q=…` | Search results across all issues (§4.4); also `closed=1`, `kind=bug` or `kind=idea` | | `/improvements/p/:number` | Issue page | @@ -301,11 +312,12 @@ The board routes are added to every app by `buildShellRouter`, next to `settings - **Trail rules (`BoardTrail`, `board/pages/board_trail.dart`).** The trail is the board's hierarchy, never the browser history: root › list › task › issue at most. - A list opens an issue or task under it: root › list › item. A list that cannot hold the item - (an issue from *Up for grabs* or *Claimed*, a task from *Improvements*, *Bugs* or the search - results) gives the item's own list. + (an issue from *Up for grabs* or *Claimed*, a task from *Improvements*, *Bugs*, *Done* or the + search results) gives the item's own list. - *Claimed* is treated like *Up for grabs* (a task list). A task's own list follows its status (`BoardTab.ofTask`): *Claimed* while claimed or in review, *Up for grabs* when published (an - expired claim is published), *Done* when done or shipped. + expired claim is published), *Done* when done or shipped (T-10: *Done* lists no tasks, but a + finished task's crumb still names it, the archive it belongs to). - A search belongs to the results view (`BoardTrail.search`; the tabs are never searched): a issue opened from search results keeps the search in its URL (`/improvements/p/5?list=search&q=sort`), so the list crumb returns to @@ -313,7 +325,7 @@ The board routes are added to every app by `buildShellRouter`, next to `settings - A task opens one of its linked issues under itself: root › *Up for grabs* (or the list the task came from) › T-n › #m. - An issue opens a task: the trail truncates to the task (root › list › T-n), never issue › task › - issue › task; the list stays when it shows tasks (*Up for grabs*, *Claimed*, *Done*, *Review*), + issue › task; the list stays when it shows tasks (*Up for grabs*, *Claimed*, *Review*), else the task's own list. - An issue opens another issue (similar issues, merged duplicates, *Duplicate of*, the automatic redirect of a merged duplicate): the new issue replaces the current one (siblings, same @@ -350,6 +362,15 @@ The board routes are added to every app by `buildShellRouter`, next to `settings overflows at 360 px. - Shared links use the current app's base (`/sheets/improvements/p/412`). The server's `/improvements/*` path redirects to `/drive/improvements/*` for links in emails and PRs. +- **Markdown version (T-10).** `/improvements/p/412.md` on the server (not under an app base) is + the issue as Markdown, `text/markdown` with `Cache-Control: no-cache` + (`ImprovementsRedirectRoute`, `BoardMarkdown`): `# #412 Title`, a list of facts (kind, status, + *Duplicate of* / *Declined*, area and size with *(AI)* while unconfirmed, votes, reporter and + day, the task, merged duplicates, the page link and the screenshot link), the body, *Included + details* (pretty JSON) and *Comments (n)* oldest first (`### Name on 2026-10-19`, *(admin)* + for admins). Only public content, as a signed-out visitor sees it: a missing, deleted, + checking, held or removed issue answers 404, and only visible comments people wrote are listed. + Task prompts link the issues there (§10.1), so a coding agent reads them without the web app. ### 4.4 Board page @@ -370,7 +391,8 @@ The board routes are added to every app by `buildShellRouter`, next to `settings - *Bugs* (count of open and planned bugs); - *Up for grabs* (published tasks without a valid claim); - *Claimed* (claimed and in-review tasks; in review = a PR is linked); - - *Done* (no count: it is the archive); + - *Done* (no count: it is the archive of finished bugs and improvements, done and shipped; + T-10: finished tasks are not listed there, their issues are); - *Review* (admins only, with the held count as the badge). The tabs scroll horizontally when they do not fit. *Up for grabs* and *Claimed* follow `watchTasks` live: a claim, release, expiry or linked PR moves a task between them. Each has its @@ -452,15 +474,34 @@ the trail to the task; *Similar issues*, merged duplicates and *Duplicate of* re - *Similar issues* (top 3, from §6.4). - **Comments** (§7.3): a flat list, oldest first, with a composer at the bottom. Signed-out visitors see *Sign in to comment*. +- **Admin toolbar (T-10)**, admins only, under the header (`board.post.adminBar`): one row of + `sm` buttons with icons (keys `board.post.bar.`) and the ⋮ actions menu at its end (for + admins ⋮ leaves the title row; everyone else keeps it there). The buttons are the common + actions, most important first — *Approve* (primary, while held or being checked), *Select + for building* (primary otherwise; while the issue is visible, `open` or `planned` and not in + a task), *Add to task…*, *Labels…* (`shell.board.admin.setLabels`), *Merge into…* (*Unmerge* + for a duplicate), *Decline…* (*Reopen* when declined). When the row is too narrow, buttons + move into ⋮ (above its own entries, `board.post.menu.`), the least important first, as in + the editors' toolbars (`ToolbarOverflowLayout` of `wonky_ui`; ⋮ is pinned and never moves). +- **Comments for the prompt (T-10):** while *Select for building* is offered, every visible + comment people wrote has a checkbox before its author (`board.comment..select`, all + checked; screen readers: *Include the comment by Ada in the task prompt*), with the hint + *Checked comments go into the task prompt when you select this issue for building.* under the + *Comments* heading. The admin reads the comments in full on the page and unchecks the ones the + prompt should not see; *Select for building* sends them as `excludedComments` (§9.3), and the + task dialog then asks only for the title and labels. The checkboxes come from the shared + thread widget (`CommentThreadActions.selected` / `select` / `selectLabel`, off for document + comments). - **Actions menu (⋮)**: - author: *Edit* (while `open` and not in a task), *Delete*; - everyone signed in: *Copy link*, *Flag* (§7.5); - - admins: the moderation and selection actions (§9.2). + - admins: the less common moderation actions (§9.2): *Apply suggested title*, *Edit* / *Edit + and approve*, *Hold*, *Looks fine*, *Remove…* / *Restore*, *Block user…*. ### 4.6 Task page The breadcrumb (§4.3) ends in `T-12 Title` under the list it came from (*Up for grabs*, -*Claimed*, *Done*, *Review*), else under its own list (*Claimed* while claimed or in review, +*Claimed*, *Review*), else under its own list (*Claimed* while claimed or in review, *Done* once done or shipped, else *Up for grabs*). Linked issues open under the task. @@ -469,6 +510,10 @@ task. - status, and the claim state (*Claimed by Ada · 31 h left*, or *Up for grabs*); - the buttons *Claim this task* / *Unclaim this task* (Lucide `ban`, also the icon of `shell.board.release`; §8); admins also get *Link pull request…*; + - (T-10) while the caller may not claim (§8.4; `BoardMe.claimBlockedUntil`), *Claim this + task* is disabled and a warning notice under the buttons gives the server's reason + (`board.task.notice.claimBlocked`: *You can't claim tasks until November 2, 2026: 3 of your + claims expired without a pull request or an unclaim.*); - for the claimant: the **claim code** (`7Q4F-K2M9`) with *Copy*, and the time left. - **Linked issues**: one row per issue with its score and its screenshots. - **How to build it** (always shown, not collapsible; the claimant and admins see every step, others see an outline while the task is up for grabs — the setup link, "Give your coding agent the prompt (claim the task to get the prompt)." and "Open a pull request" without instructions — and nothing once someone else claimed it): @@ -787,8 +832,9 @@ flattened screenshot) to catch readable emails, names or document text the autho (*Trending*, *Top*, *New*, *Most discussed*). The other filters (kind, statuses, area, size, *Mine*, visibility) still apply. - `similar(text, kind)` uses the same words OR-joined as prefixes (`paste:* | cells:*` through - `to_tsquery`), `ts_rank_cd`, and only `visible` issues in `open`/`planned`/`done`. It returns up - to 5. + `to_tsquery`), `ts_rank_cd`, and only `visible` issues in `open`/`planned` (T-10: built issues + are not suggested in the report dialog; the triage's duplicate candidates still include + `done`). It returns up to 5. - **Jev rerank** (when configured): full-text search returns the top 10 candidates, and one Jev request with a `same_` Noul per candidate ("Do `draft` and `candidate` describe the same problem or request?") reorders them. Only candidates with p ≥ 0.3 are shown, at most 5. This is @@ -808,7 +854,7 @@ flattened screenshot) to catch readable emails, names or document text the autho | Edit or delete own comment | | | ✓ | | | Remove screenshot | | | ✓ | ✓ | | Moderate, set labels, merge, select, manage tasks, block users | | | | ✓ | -| Claim a published task | | ✓ (max 2 active claims, not blocked) | ✓ | ✓ | +| Claim a published task | | ✓ (max 3 active claims, not blocked, not claim-blocked §8.4) | ✓ | ✓ | Users blocked from the board (§9.2) can read but not write. Their writing endpoints answer `forbidden` with *You can't post on Bugs & improvements*. @@ -1028,8 +1074,10 @@ The board list itself is not live: it refreshes on focus and on *Load more*. - `board.claimTask(taskNumber)`: - only for `published` tasks; - - fails with `conflict` when the task is already claimed, and with `limitExceeded` when the - caller already has `board.maxActiveClaimsPerUser` (2) active claims; + - fails with `conflict` when the task is already claimed, with `limitExceeded` when the + caller already has `board.maxActiveClaimsPerUser` (3, T-10) active claims (valid `claimed` + ones: a task in review no longer counts), and with `forbidden` and the reason while the + caller is claim-blocked (§8.4); - sets `claimedById`, `claimedAt` and `claimExpiresAt = now + board.claimHours` (48), and generates a new **claim code** (§13.7). The code is returned only to the claimant (task page, `board.getTask`, MCP `board.get_task`) and goes into the PR description (§13.1). @@ -1072,6 +1120,32 @@ The board list itself is not live: it refreshes on focus and on *Load more*. - A successful deploy containing the merge sets `shipped` (§13.6; `board.markShipped` is the admin fallback) and notifies voters again (*Now live on wonky.work*). +### 8.4 Claim blocks (T-10) + +Claiming is blocked for `board.claimBlockDays` (14) days, for non-admins, after either: + +- `board.expiredClaimsToBlock` (3) **expired claims**: claims that ran out without a linked pull + request and without an unclaim (the `expired` activity rows with the claimant as actor, written + by the sweep, by a claim that finds the claim expired, and by an unclaim after the deadline). + A release in time is not counted; neither is a release by an admin; +- `board.invalidPostsToBlock` (2) **issues removed by a moderator** (`moderation: removed`, its + `removedAt`): spam, offensive, personal data and the like. Declined issues are valid reports + and do not count; neither do issues the author deleted. + +The block is computed from the record on every claim and `board.me()` (`BoardTaskClaims. +claimBlock`), not stored: events in time order count per kind, the event that reaches the +threshold starts a block of 14 days from its time, and the count of that kind starts again. So +restoring a removed issue (the undo of *Remove*) lifts the block it caused, and a later +threshold extends a running block. A value of 0 turns that rule off. + +- `board.claimTask` answers `forbidden` with the reason, e.g. *You can't claim tasks until + November 2, 2026: 3 of your claims expired without a pull request or an unclaim.* or *… a + moderator removed 2 of your issues.*; +- `BoardMe.claimBlockedUntil` and `claimBlockedReason` (and `maxActiveClaims`) tell the client: + the task page disables *Claim this task* and shows the reason (§4.6); +- the block only concerns claiming: reporting, voting and commenting are unaffected (a board + block, §9.2, is separate). + ## 9. Admins and moderation ### 9.1 Who is an admin @@ -1095,7 +1169,8 @@ 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. -- `board.me()` returns `{signedIn, isAdmin, blocked, activeClaims, githubLogin?}` for the client. +- `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. - Serverpod scopes are not used: they are tied to the auth session and would need a sync job when the config changes. @@ -1163,9 +1238,23 @@ endpoint call: when the admin has left the page. - **Manual bundle**: on the board, admins get checkboxes on rows. With several issues selected, the action bar offers *Create task from 4 issues…* (title, area, size), and the draft task - links all of them. *Add to task…* adds selected issues to an existing draft, published or - claimed task. The same *Add to task…* is in an issue's ⋮ menu (open issues not in a task, - `board.post.menu.addToTask`), and the task page has *Add issues…* and a remove button per + links all of them. **Comments for the prompt (T-10):** on the issue page the admin checks the + comments right in the thread (§4.5), and *Select for building* passes the unchecked ones. Where + the comments are not on screen (*Create task from N issues…* on the board, a suggestion's + *Edit*), the task dialog lists the visible comments people wrote on the issues, grouped under + `#412 Title`, one checkbox each + (`Name: the first 140 characters`, plain text), all checked, in a scrolling box of at most + 240 px (`ChecklistFieldSpec` of `WonkyDialogSpec`, so MCP can tick them too: type + `checklist`; keys `dialog.board.task.comments` and `dialog.board.task.comments.`). The + unchecked ones go to `createTask(…, excludedComments: [uuid])` and are stored on the task + (`promptExcludedCommentIds`); every prompt the AI writes for the task (§10.1, *Regenerate*, + rewrites) leaves them out, while the other comments, also later ones, are included. Merged + tasks keep each task's left-out comments. `shell.board.admin.createTask` takes + `excludedComments` (uuids) too (given, even empty, the dialog lists no comments) and redo + keeps them; a uuid of another issue's comment is an `invalidArgument`. *Add to task…* adds + selected issues to an existing draft, published or claimed task. The same *Add to task…* is + in an issue's admin toolbar (open issues not in a task, `board.post.bar.addToTask`, §4.5), + and the task page has *Add issues…* and a remove button per linked issue. All of them are `shell.board.admin.setTaskPosts`. - **Changing a task's issues rewrites its prompt** (decided 2026-10-19). When `setTaskPosts` adds or removes issues (an unchanged set is a no-op), or tasks are merged (below), the AI @@ -1251,8 +1340,9 @@ changed. The input: - the task title, area and size; - for each issue: kind, title, body, included details, the screenshot URL (a stable redirect, - `/improvements/p/412/screenshot`), and up to 20 admin and top-voted comments (all as delimited - untrusted data); + `/improvements/p/412/screenshot`), and up to 20 visible comments, oldest first, without the + ones the admin left out when creating the task (T-10, §9.3; all as delimited untrusted + data); - the **spec index**: `specs/README.md` tables plus the headings of the area's spec files. The server reads them from a generated snapshot (`wonky_server/lib/src/platform/board/ai/spec_index.g.dart`, written by `dart run tool/spec_index.dart`; a test fails when it is stale) so it doesn't need a @@ -1282,7 +1372,7 @@ light and dark, the checklist after changes). ## Reports this task comes from -- #412 Paste into merged cells drops styles — https://wonky.work/improvements/p/412 (14 votes) +- #412 Paste into merged cells drops styles — https://wonky.work/improvements/p/412.md (14 votes) … ## When you are done @@ -1304,6 +1394,10 @@ Wonky-Claim: 7Q4F-K2M9 and a short summary of how each acceptance criterion is met. ``` +(T-10) The links of *Reports this task comes from* are the issues' Markdown versions +(`/improvements/p/412.md`, §4.3: body, details and comments), which a coding agent can read +directly; the page link is in that file. + The "When you are done" part is built in code (`TaskPromptTemplate.wrap`, with the two lines in a ```` ``` ```` block). For the claimant the server builds it with their actual claim code (`claimCode:`), as above; admins' views keep the placeholder @@ -1385,7 +1479,7 @@ is opened for a change nobody has seen working. The frame is added when the task | Prompt injection into triage, task prompts or reviews | Jev returns only typed answers (no text that could carry instructions); issues that argue for their own classification are caught by the review band and community flags. Gemini receives issue and PR text as delimited untrusted data and answers through a schema. Task prompts need admin review before publishing (§10.2) and are linted; the fixed template frames the AI text. PR reviews are advisory | | Forged GitHub webhooks, claim takeover through PRs | HMAC-verified webhooks, delivery dedupe, per-claim codes (§13.7) | | Vote manipulation | One vote per account; accounts need a verified email; votes from blocked users are excluded from scores (recomputed on block); P2: weight new accounts lower | -| Claim hoarding | 2 active claims per user; 48 h expiry; admins release; PRs without a valid task auto-close after 7 days | +| Claim hoarding | 3 active claims per user; 48 h expiry; 3 expired claims or 2 removed issues block claiming for 2 weeks (§8.4); admins release; PRs without a valid task auto-close after 7 days | | Runaway AI spend | Separate daily token budgets for Jev and Gemini (§6.1), per-PR review limits (§13.5), rate limits below | | Admin impersonation | Admin rights come only from the server-side domain check (§9.1). *Admin* badges are rendered from the server's flag on each issue or comment, never from the display name | | Enumeration of private data | Board endpoints return display names and avatars only, never emails or user ids beyond what `CommentView` already exposes | @@ -1508,6 +1602,7 @@ fields: promptGeneratedAt: DateTime? promptRequestedAt: DateTime? # an AI pass is scheduled (§10.1) promptNote: String? # why the last AI pass left the body (admins) + promptExcludedCommentIds: List? # comments left out of the prompt (T-10, §9.3) promptEditedById: int? promptEditedAt: DateTime? createdById: int @@ -1653,7 +1748,7 @@ activity rows, admins only; empty for everyone else), `unflag`, |-------|---------| | Read | `me()`, `list(BoardListQuery)` → page, `getPost(number)`, `listComments(postNumber, cursor)`, `similar(text, kind)`, `getScreenshotUrl(postNumber)`, `listTasks(filter, cursor)`, `getTask(number)`, `watchPost(number)`, `watchTasks()` | | Write | `createScreenshotUpload(…)`, `createPost(BoardPostDraft)`, `editPost(number, title, body)`, `deletePost(number)`, `restorePost(number)` (undo), `removeScreenshot(number)`, `vote(number, value)`, `addComment(uuid, postNumber?, taskNumber?, body)` (issues only: a `taskNumber` is refused), `editComment(uuid, body)`, `deleteComment(uuid)`, `restoreComment(uuid)`, `flag(target, reason, note)`, `claimTask(number)`, `releaseTask(number)` | -| Admin | `reviewQueue(section, cursor)`, `moderate(target, action, reason?)`, `setLabels(number, kind?, area?, size?)`, `applySuggestedTitle(number)`, `merge(source, target)`, `unmerge(source)`, `decline(number, reason)`, `reopen(number)`, `blockUser(userId, reason, until?)`, `unblockUser(userId)`, `createTask(postNumbers, title, area, size)`, `updateTask(number, …)`, `setTaskPosts(number, postNumbers)`, `mergeTasks(numbers, title, area, size)`, `unmergeTasks(number)`, `regeneratePrompt(number)`, `setPrompt(number, body)`, `publishTask(number)`, `linkPullRequest(number, url)`, `markDone(number)`, `markShipped(number)`, `cancelTask(number)`, `suggestBundles()`, `dismissSuggestion(id)` | +| Admin | `reviewQueue(section, cursor)`, `moderate(target, action, reason?)`, `setLabels(number, kind?, area?, size?)`, `applySuggestedTitle(number)`, `merge(source, target)`, `unmerge(source)`, `decline(number, reason)`, `reopen(number)`, `blockUser(userId, reason, until?)`, `unblockUser(userId)`, `createTask(postNumbers, title, area, size, {excludedComments})`, `updateTask(number, …)`, `setTaskPosts(number, postNumbers)`, `mergeTasks(numbers, title, area, size)`, `unmergeTasks(number)`, `regeneratePrompt(number)`, `setPrompt(number, body)`, `publishTask(number)`, `linkPullRequest(number, url)`, `markDone(number)`, `markShipped(number)`, `cancelTask(number)`, `suggestBundles()`, `dismissSuggestion(id)` | **Config** (`wonky: board:`, parsed in `BoardConfig.fromMap`, env overrides `WONKY_BOARD_*`): @@ -1667,7 +1762,10 @@ wonky: securityContact: security@serverpod.dev claimHours: 48 claimWarnHours: 6 - maxActiveClaimsPerUser: 2 + maxActiveClaimsPerUser: 3 + expiredClaimsToBlock: 3 # §8.4 (T-10); 0 turns the rule off + invalidPostsToBlock: 2 + claimBlockDays: 14 flagsToHold: 3 publishWhenTriageFails: true limits: {postsPerHour: 5, postsPerDay: 20, commentsPerHour: 30, votesPerHour: 300, @@ -1957,6 +2055,7 @@ The tools are read and write in one scope and are not offered to the in-app assi | `copyPrompt` (fails with *Claim this task to get the prompt.* without one) | – | | `removeScreenshot` | – (the bytes are deleted at once; confirmed) | | `admin.moderate` / `admin.setLabels` / `admin.editPost` (*Edit and approve*) / `admin.applySuggestedTitle` / `admin.merge` / `admin.unmerge` / `admin.decline` / `admin.reopen` / `admin.block` / `admin.createTask` / `admin.updateTask` / `admin.setTaskPosts` / `admin.mergeTasks` (undo: `unmergeTasks`, §9.3) / `admin.regeneratePrompt` / `admin.setPrompt` / `admin.publishTask` / `admin.linkPullRequest` / `admin.markDone` / `admin.markShipped` / `admin.cancelTask` | ✓ (inverse calls, §9.2) | +| `admin.createTask {postNumbers, title?, area?, size?, excludedComments?}` (T-10: the dialog's unchecked comments, §9.3) | ✓ (undo cancels, redo creates it again with the same comments left out) | | `admin.suggestBundles` / `admin.dismissSuggestion` / `admin.dismissDuplicate` (*Not a duplicate*) | – (no server inverse) | **As built (BI-2…BI-6):** all ids above are registered in `board_commands.dart` diff --git a/wonky_client/lib/src/protocol/client.dart b/wonky_client/lib/src/protocol/client.dart index ceec76e3..7fcde455 100644 --- a/wonky_client/lib/src/protocol/client.dart +++ b/wonky_client/lib/src/protocol/client.dart @@ -1183,12 +1183,15 @@ class EndpointBoard extends _isc.EndpointRef { ); /// Creates a draft task from posts and generates its prompt. + /// [excludedComments] are comments of the posts the admin left out of the + /// prompt's context (specs/16 §9.3). _ida.Future<_icqm1m07.BoardTaskView> createTask( List postNumbers, String title, _ix53eas0.BoardArea area, - _iky4nxq3.BoardSize size, - ) => caller.callServerEndpoint<_icqm1m07.BoardTaskView>( + _iky4nxq3.BoardSize size, { + List<_isc.UuidValue>? excludedComments, + }) => caller.callServerEndpoint<_icqm1m07.BoardTaskView>( 'board', 'createTask', { @@ -1196,6 +1199,7 @@ class EndpointBoard extends _isc.EndpointRef { 'title': title, 'area': area, 'size': size, + 'excludedComments': excludedComments, }, ); diff --git a/wonky_client/lib/src/protocol/platform/board/models/board_me.dart b/wonky_client/lib/src/protocol/platform/board/models/board_me.dart index af53905c..1071be0d 100644 --- a/wonky_client/lib/src/protocol/platform/board/models/board_me.dart +++ b/wonky_client/lib/src/protocol/platform/board/models/board_me.dart @@ -28,7 +28,10 @@ abstract class BoardMe required this.repository, required this.securityContact, required this.claimHours, - }); + int? maxActiveClaims, + this.claimBlockedUntil, + this.claimBlockedReason, + }) : maxActiveClaims = maxActiveClaims ?? 3; factory BoardMe({ required bool signedIn, @@ -42,6 +45,9 @@ abstract class BoardMe required String repository, required String securityContact, required int claimHours, + int? maxActiveClaims, + DateTime? claimBlockedUntil, + String? claimBlockedReason, }) = _BoardMeImpl; factory BoardMe.fromJson(Map jsonSerialization) { @@ -59,6 +65,13 @@ abstract class BoardMe repository: jsonSerialization['repository'] as String, securityContact: jsonSerialization['securityContact'] as String, claimHours: jsonSerialization['claimHours'] as int, + maxActiveClaims: jsonSerialization['maxActiveClaims'] as int?, + claimBlockedUntil: jsonSerialization['claimBlockedUntil'] == null + ? null + : _isc.DateTimeJsonExtension.fromJson( + jsonSerialization['claimBlockedUntil'], + ), + claimBlockedReason: jsonSerialization['claimBlockedReason'] as String?, ); } @@ -85,6 +98,14 @@ abstract class BoardMe int claimHours; + /// Claims the caller may hold at a time (`maxActiveClaimsPerUser`). + int maxActiveClaims; + + /// Set while the caller may not claim tasks (specs/16 §8.4). + DateTime? claimBlockedUntil; + + String? claimBlockedReason; + /// Returns a shallow copy of this [BoardMe] /// with some or all fields replaced by the given arguments. @_isc.useResult @@ -100,6 +121,9 @@ abstract class BoardMe String? repository, String? securityContact, int? claimHours, + int? maxActiveClaims, + DateTime? claimBlockedUntil = const _isc.$UndefinedDateTime(), + String? claimBlockedReason, }); @override Map toJson() { @@ -116,6 +140,10 @@ abstract class BoardMe 'repository': repository, 'securityContact': securityContact, 'claimHours': claimHours, + 'maxActiveClaims': maxActiveClaims, + if (claimBlockedUntil != null) + 'claimBlockedUntil': claimBlockedUntil?.toJson(), + if (claimBlockedReason != null) 'claimBlockedReason': claimBlockedReason, }; } @@ -134,6 +162,10 @@ abstract class BoardMe 'repository': repository, 'securityContact': securityContact, 'claimHours': claimHours, + 'maxActiveClaims': maxActiveClaims, + if (claimBlockedUntil != null) + 'claimBlockedUntil': claimBlockedUntil?.toJson(), + if (claimBlockedReason != null) 'claimBlockedReason': claimBlockedReason, }; } @@ -158,6 +190,9 @@ class _BoardMeImpl extends BoardMe { required String repository, required String securityContact, required int claimHours, + int? maxActiveClaims, + DateTime? claimBlockedUntil, + String? claimBlockedReason, }) : super._( signedIn: signedIn, userId: userId, @@ -170,6 +205,9 @@ class _BoardMeImpl extends BoardMe { repository: repository, securityContact: securityContact, claimHours: claimHours, + maxActiveClaims: maxActiveClaims, + claimBlockedUntil: claimBlockedUntil, + claimBlockedReason: claimBlockedReason, ); /// Returns a shallow copy of this [BoardMe] @@ -188,6 +226,9 @@ class _BoardMeImpl extends BoardMe { String? repository, String? securityContact, int? claimHours, + int? maxActiveClaims, + DateTime? claimBlockedUntil = const _isc.$UndefinedDateTime(), + Object? claimBlockedReason = _Undefined, }) { return BoardMe( signedIn: signedIn ?? this.signedIn, @@ -203,6 +244,13 @@ class _BoardMeImpl extends BoardMe { repository: repository ?? this.repository, securityContact: securityContact ?? this.securityContact, claimHours: claimHours ?? this.claimHours, + maxActiveClaims: maxActiveClaims ?? this.maxActiveClaims, + claimBlockedUntil: claimBlockedUntil is _isc.UndefinedSentinel + ? this.claimBlockedUntil + : claimBlockedUntil, + claimBlockedReason: claimBlockedReason is String? + ? claimBlockedReason + : this.claimBlockedReason, ); } } diff --git a/wonky_client/lib/src/protocol/platform/board/models/board_task.dart b/wonky_client/lib/src/protocol/platform/board/models/board_task.dart index 66199445..19d514d3 100644 --- a/wonky_client/lib/src/protocol/platform/board/models/board_task.dart +++ b/wonky_client/lib/src/protocol/platform/board/models/board_task.dart @@ -11,6 +11,7 @@ // 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/board/models/board_area.dart' as _iknrpzcb; import '../../../platform/board/models/board_size.dart' as _ibr3u4cf; import '../../../platform/board/models/board_task_status.dart' as _isr33h3v; @@ -29,6 +30,7 @@ abstract class BoardTask this.promptGeneratedAt, this.promptRequestedAt, this.promptNote, + this.promptExcludedCommentIds, this.promptEditedById, this.promptEditedAt, required this.createdById, @@ -58,6 +60,7 @@ abstract class BoardTask DateTime? promptGeneratedAt, DateTime? promptRequestedAt, String? promptNote, + List? promptExcludedCommentIds, int? promptEditedById, DateTime? promptEditedAt, required int createdById, @@ -98,6 +101,12 @@ abstract class BoardTask jsonSerialization['promptRequestedAt'], ), promptNote: jsonSerialization['promptNote'] as String?, + promptExcludedCommentIds: + jsonSerialization['promptExcludedCommentIds'] == null + ? null + : _i8pkqg1o.Protocol().deserialize>( + jsonSerialization['promptExcludedCommentIds'], + ), promptEditedById: jsonSerialization['promptEditedById'] as int?, promptEditedAt: jsonSerialization['promptEditedAt'] == null ? null @@ -168,6 +177,10 @@ abstract class BoardTask /// up, provider error); shown to admins. String? promptNote; + /// Comments of the task's issues the admin left out of the prompt's + /// context (specs/16 §9.3); every other visible comment is included. + List? promptExcludedCommentIds; + int? promptEditedById; DateTime? promptEditedAt; @@ -216,6 +229,7 @@ abstract class BoardTask DateTime? promptGeneratedAt = const _isc.$UndefinedDateTime(), DateTime? promptRequestedAt = const _isc.$UndefinedDateTime(), String? promptNote, + List? promptExcludedCommentIds = const _isc.$UndefinedList(), int? promptEditedById, DateTime? promptEditedAt = const _isc.$UndefinedDateTime(), int? createdById, @@ -249,6 +263,8 @@ abstract class BoardTask if (promptRequestedAt != null) 'promptRequestedAt': promptRequestedAt?.toJson(), if (promptNote != null) 'promptNote': promptNote, + if (promptExcludedCommentIds != null) + 'promptExcludedCommentIds': promptExcludedCommentIds?.toJson(), if (promptEditedById != null) 'promptEditedById': promptEditedById, if (promptEditedAt != null) 'promptEditedAt': promptEditedAt?.toJson(), 'createdById': createdById, @@ -284,6 +300,8 @@ abstract class BoardTask if (promptRequestedAt != null) 'promptRequestedAt': promptRequestedAt?.toJson(), if (promptNote != null) 'promptNote': promptNote, + if (promptExcludedCommentIds != null) + 'promptExcludedCommentIds': promptExcludedCommentIds?.toJson(), if (promptEditedById != null) 'promptEditedById': promptEditedById, if (promptEditedAt != null) 'promptEditedAt': promptEditedAt?.toJson(), 'createdById': createdById, @@ -323,6 +341,7 @@ class _BoardTaskImpl extends BoardTask { DateTime? promptGeneratedAt, DateTime? promptRequestedAt, String? promptNote, + List? promptExcludedCommentIds, int? promptEditedById, DateTime? promptEditedAt, required int createdById, @@ -350,6 +369,7 @@ class _BoardTaskImpl extends BoardTask { promptGeneratedAt: promptGeneratedAt, promptRequestedAt: promptRequestedAt, promptNote: promptNote, + promptExcludedCommentIds: promptExcludedCommentIds, promptEditedById: promptEditedById, promptEditedAt: promptEditedAt, createdById: createdById, @@ -383,6 +403,7 @@ class _BoardTaskImpl extends BoardTask { DateTime? promptGeneratedAt = const _isc.$UndefinedDateTime(), DateTime? promptRequestedAt = const _isc.$UndefinedDateTime(), Object? promptNote = _Undefined, + List? promptExcludedCommentIds = const _isc.$UndefinedList(), Object? promptEditedById = _Undefined, DateTime? promptEditedAt = const _isc.$UndefinedDateTime(), int? createdById, @@ -415,6 +436,10 @@ class _BoardTaskImpl extends BoardTask { ? this.promptRequestedAt : promptRequestedAt, promptNote: promptNote is String? ? promptNote : this.promptNote, + promptExcludedCommentIds: + promptExcludedCommentIds is _isc.UndefinedSentinel + ? this.promptExcludedCommentIds?.map((e0) => e0).toList() + : promptExcludedCommentIds, promptEditedById: promptEditedById is int? ? promptEditedById : this.promptEditedById, diff --git a/wonky_client/lib/src/protocol/protocol.dart b/wonky_client/lib/src/protocol/protocol.dart index 59fd61a7..808f32a1 100644 --- a/wonky_client/lib/src/protocol/protocol.dart +++ b/wonky_client/lib/src/protocol/protocol.dart @@ -1207,6 +1207,7 @@ class Protocol extends _isc.SerializationManager _isc.getType>, _isc.getType>, _isc.getType?>, + _isc.getType?>, _isc.getType>, _isc.getType>, _isc.getType>, @@ -1247,11 +1248,12 @@ 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>, _isc.getType>, _isc.getType>, _isc.getType>, @@ -3545,6 +3547,12 @@ class Protocol extends _isc.SerializationManager : null) as T; } + if (t == _isc.getType?>()) { + return (data != null + ? (data as List).map((e) => deserialize(e)).toList() + : null) + as T; + } if (t == List<_ifz7dmuf.BoardTaskView>) { return (data as List) .map((e) => deserialize<_ifz7dmuf.BoardTaskView>(e)) @@ -3797,6 +3805,18 @@ class Protocol extends _isc.SerializationManager if (t == List) { return (data as List).map((e) => deserialize(e)).toList() as T; } + if (t == List<_isc.UuidValue>) { + return (data as List).map((e) => deserialize<_isc.UuidValue>(e)).toList() + as T; + } + if (t == _isc.getType?>()) { + return (data != null + ? (data as List) + .map((e) => deserialize<_isc.UuidValue>(e)) + .toList() + : null) + as T; + } if (t == List<_i94c7q23.BoardBundleSuggestionView>) { return (data as List) .map((e) => deserialize<_i94c7q23.BoardBundleSuggestionView>(e)) @@ -3821,10 +3841,6 @@ class Protocol extends _isc.SerializationManager .toList() as T; } - if (t == List<_isc.UuidValue>) { - return (data as List).map((e) => deserialize<_isc.UuidValue>(e)).toList() - as T; - } if (t == List<_i1pzk6fp.TemplateView>) { return (data as List) .map((e) => deserialize<_i1pzk6fp.TemplateView>(e)) diff --git a/wonky_server/lib/src/generated/endpoints.dart b/wonky_server/lib/src/generated/endpoints.dart index a6f30654..75916fa4 100644 --- a/wonky_server/lib/src/generated/endpoints.dart +++ b/wonky_server/lib/src/generated/endpoints.dart @@ -1882,6 +1882,11 @@ class Endpoints extends _is.EndpointDispatch { type: _is.getType<_ikq67o57.BoardSize>(), nullable: false, ), + 'excludedComments': _is.ParameterDescription( + name: 'excludedComments', + type: _is.getType?>(), + nullable: true, + ), }, call: ( @@ -1894,6 +1899,7 @@ class Endpoints extends _is.EndpointDispatch { params['title'], params['area'], params['size'], + excludedComments: params['excludedComments'], ), ), 'updateTask': _is.MethodConnector( diff --git a/wonky_server/lib/src/generated/platform/board/models/board_me.dart b/wonky_server/lib/src/generated/platform/board/models/board_me.dart index 1b01516f..6cbb4ba2 100644 --- a/wonky_server/lib/src/generated/platform/board/models/board_me.dart +++ b/wonky_server/lib/src/generated/platform/board/models/board_me.dart @@ -28,7 +28,10 @@ abstract class BoardMe required this.repository, required this.securityContact, required this.claimHours, - }); + int? maxActiveClaims, + this.claimBlockedUntil, + this.claimBlockedReason, + }) : maxActiveClaims = maxActiveClaims ?? 3; factory BoardMe({ required bool signedIn, @@ -42,6 +45,9 @@ abstract class BoardMe required String repository, required String securityContact, required int claimHours, + int? maxActiveClaims, + DateTime? claimBlockedUntil, + String? claimBlockedReason, }) = _BoardMeImpl; factory BoardMe.fromJson(Map jsonSerialization) { @@ -59,6 +65,13 @@ abstract class BoardMe repository: jsonSerialization['repository'] as String, securityContact: jsonSerialization['securityContact'] as String, claimHours: jsonSerialization['claimHours'] as int, + maxActiveClaims: jsonSerialization['maxActiveClaims'] as int?, + claimBlockedUntil: jsonSerialization['claimBlockedUntil'] == null + ? null + : _is.DateTimeJsonExtension.fromJson( + jsonSerialization['claimBlockedUntil'], + ), + claimBlockedReason: jsonSerialization['claimBlockedReason'] as String?, ); } @@ -85,6 +98,14 @@ abstract class BoardMe int claimHours; + /// Claims the caller may hold at a time (`maxActiveClaimsPerUser`). + int maxActiveClaims; + + /// Set while the caller may not claim tasks (specs/16 §8.4). + DateTime? claimBlockedUntil; + + String? claimBlockedReason; + /// Returns a shallow copy of this [BoardMe] /// with some or all fields replaced by the given arguments. @_is.useResult @@ -100,6 +121,9 @@ abstract class BoardMe String? repository, String? securityContact, int? claimHours, + int? maxActiveClaims, + DateTime? claimBlockedUntil = const _is.$UndefinedDateTime(), + String? claimBlockedReason, }); @override Map toJson() { @@ -116,6 +140,10 @@ abstract class BoardMe 'repository': repository, 'securityContact': securityContact, 'claimHours': claimHours, + 'maxActiveClaims': maxActiveClaims, + if (claimBlockedUntil != null) + 'claimBlockedUntil': claimBlockedUntil?.toJson(), + if (claimBlockedReason != null) 'claimBlockedReason': claimBlockedReason, }; } @@ -134,6 +162,10 @@ abstract class BoardMe 'repository': repository, 'securityContact': securityContact, 'claimHours': claimHours, + 'maxActiveClaims': maxActiveClaims, + if (claimBlockedUntil != null) + 'claimBlockedUntil': claimBlockedUntil?.toJson(), + if (claimBlockedReason != null) 'claimBlockedReason': claimBlockedReason, }; } @@ -158,6 +190,9 @@ class _BoardMeImpl extends BoardMe { required String repository, required String securityContact, required int claimHours, + int? maxActiveClaims, + DateTime? claimBlockedUntil, + String? claimBlockedReason, }) : super._( signedIn: signedIn, userId: userId, @@ -170,6 +205,9 @@ class _BoardMeImpl extends BoardMe { repository: repository, securityContact: securityContact, claimHours: claimHours, + maxActiveClaims: maxActiveClaims, + claimBlockedUntil: claimBlockedUntil, + claimBlockedReason: claimBlockedReason, ); /// Returns a shallow copy of this [BoardMe] @@ -188,6 +226,9 @@ class _BoardMeImpl extends BoardMe { String? repository, String? securityContact, int? claimHours, + int? maxActiveClaims, + DateTime? claimBlockedUntil = const _is.$UndefinedDateTime(), + Object? claimBlockedReason = _Undefined, }) { return BoardMe( signedIn: signedIn ?? this.signedIn, @@ -203,6 +244,13 @@ class _BoardMeImpl extends BoardMe { repository: repository ?? this.repository, securityContact: securityContact ?? this.securityContact, claimHours: claimHours ?? this.claimHours, + maxActiveClaims: maxActiveClaims ?? this.maxActiveClaims, + claimBlockedUntil: claimBlockedUntil is _is.UndefinedSentinel + ? this.claimBlockedUntil + : claimBlockedUntil, + claimBlockedReason: claimBlockedReason is String? + ? claimBlockedReason + : this.claimBlockedReason, ); } } diff --git a/wonky_server/lib/src/generated/platform/board/models/board_task.dart b/wonky_server/lib/src/generated/platform/board/models/board_task.dart index 6146ebf7..938a9f36 100644 --- a/wonky_server/lib/src/generated/platform/board/models/board_task.dart +++ b/wonky_server/lib/src/generated/platform/board/models/board_task.dart @@ -12,6 +12,7 @@ // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _ida; import 'package:serverpod/serverpod.dart' as _is; +import 'package:wonky_server/src/generated/protocol.dart' as _il4umwa0; import '../../../platform/board/models/board_area.dart' as _iknrpzcb; import '../../../platform/board/models/board_size.dart' as _ibr3u4cf; import '../../../platform/board/models/board_task_status.dart' as _isr33h3v; @@ -30,6 +31,7 @@ abstract class BoardTask this.promptGeneratedAt, this.promptRequestedAt, this.promptNote, + this.promptExcludedCommentIds, this.promptEditedById, this.promptEditedAt, required this.createdById, @@ -59,6 +61,7 @@ abstract class BoardTask DateTime? promptGeneratedAt, DateTime? promptRequestedAt, String? promptNote, + List? promptExcludedCommentIds, int? promptEditedById, DateTime? promptEditedAt, required int createdById, @@ -99,6 +102,12 @@ abstract class BoardTask jsonSerialization['promptRequestedAt'], ), promptNote: jsonSerialization['promptNote'] as String?, + promptExcludedCommentIds: + jsonSerialization['promptExcludedCommentIds'] == null + ? null + : _il4umwa0.Protocol().deserialize>( + jsonSerialization['promptExcludedCommentIds'], + ), promptEditedById: jsonSerialization['promptEditedById'] as int?, promptEditedAt: jsonSerialization['promptEditedAt'] == null ? null @@ -171,6 +180,10 @@ abstract class BoardTask /// up, provider error); shown to admins. String? promptNote; + /// Comments of the task's issues the admin left out of the prompt's + /// context (specs/16 §9.3); every other visible comment is included. + List? promptExcludedCommentIds; + int? promptEditedById; DateTime? promptEditedAt; @@ -222,6 +235,7 @@ abstract class BoardTask DateTime? promptGeneratedAt = const _is.$UndefinedDateTime(), DateTime? promptRequestedAt = const _is.$UndefinedDateTime(), String? promptNote, + List? promptExcludedCommentIds = const _is.$UndefinedList(), int? promptEditedById, DateTime? promptEditedAt = const _is.$UndefinedDateTime(), int? createdById, @@ -255,6 +269,8 @@ abstract class BoardTask if (promptRequestedAt != null) 'promptRequestedAt': promptRequestedAt?.toJson(), if (promptNote != null) 'promptNote': promptNote, + if (promptExcludedCommentIds != null) + 'promptExcludedCommentIds': promptExcludedCommentIds?.toJson(), if (promptEditedById != null) 'promptEditedById': promptEditedById, if (promptEditedAt != null) 'promptEditedAt': promptEditedAt?.toJson(), 'createdById': createdById, @@ -290,6 +306,8 @@ abstract class BoardTask if (promptRequestedAt != null) 'promptRequestedAt': promptRequestedAt?.toJson(), if (promptNote != null) 'promptNote': promptNote, + if (promptExcludedCommentIds != null) + 'promptExcludedCommentIds': promptExcludedCommentIds?.toJson(), if (promptEditedById != null) 'promptEditedById': promptEditedById, if (promptEditedAt != null) 'promptEditedAt': promptEditedAt?.toJson(), 'createdById': createdById, @@ -351,6 +369,7 @@ class _BoardTaskImpl extends BoardTask { DateTime? promptGeneratedAt, DateTime? promptRequestedAt, String? promptNote, + List? promptExcludedCommentIds, int? promptEditedById, DateTime? promptEditedAt, required int createdById, @@ -378,6 +397,7 @@ class _BoardTaskImpl extends BoardTask { promptGeneratedAt: promptGeneratedAt, promptRequestedAt: promptRequestedAt, promptNote: promptNote, + promptExcludedCommentIds: promptExcludedCommentIds, promptEditedById: promptEditedById, promptEditedAt: promptEditedAt, createdById: createdById, @@ -411,6 +431,7 @@ class _BoardTaskImpl extends BoardTask { DateTime? promptGeneratedAt = const _is.$UndefinedDateTime(), DateTime? promptRequestedAt = const _is.$UndefinedDateTime(), Object? promptNote = _Undefined, + List? promptExcludedCommentIds = const _is.$UndefinedList(), Object? promptEditedById = _Undefined, DateTime? promptEditedAt = const _is.$UndefinedDateTime(), int? createdById, @@ -443,6 +464,10 @@ class _BoardTaskImpl extends BoardTask { ? this.promptRequestedAt : promptRequestedAt, promptNote: promptNote is String? ? promptNote : this.promptNote, + promptExcludedCommentIds: + promptExcludedCommentIds is _is.UndefinedSentinel + ? this.promptExcludedCommentIds?.map((e0) => e0).toList() + : promptExcludedCommentIds, promptEditedById: promptEditedById is int? ? promptEditedById : this.promptEditedById, @@ -537,6 +562,13 @@ class BoardTaskUpdateTable extends _is.UpdateTable { value, ); + _is.ColumnValue, List> promptExcludedCommentIds( + List? value, + ) => _is.ColumnValue( + table.promptExcludedCommentIds, + value, + ); + _is.ColumnValue promptEditedById(int? value) => _is.ColumnValue( table.promptEditedById, value, @@ -673,6 +705,10 @@ class BoardTaskTable extends _is.Table { 'promptNote', this, ); + promptExcludedCommentIds = _is.ColumnSerializable>( + 'promptExcludedCommentIds', + this, + ); promptEditedById = _is.ColumnInt( 'promptEditedById', this, @@ -766,6 +802,10 @@ class BoardTaskTable extends _is.Table { /// up, provider error); shown to admins. late final _is.ColumnString promptNote; + /// Comments of the task's issues the admin left out of the prompt's + /// context (specs/16 §9.3); every other visible comment is included. + late final _is.ColumnSerializable> promptExcludedCommentIds; + late final _is.ColumnInt promptEditedById; late final _is.ColumnDateTime promptEditedAt; @@ -812,6 +852,7 @@ class BoardTaskTable extends _is.Table { promptGeneratedAt, promptRequestedAt, promptNote, + promptExcludedCommentIds, promptEditedById, promptEditedAt, createdById, diff --git a/wonky_server/lib/src/generated/protocol.dart b/wonky_server/lib/src/generated/protocol.dart index 637dd007..193e0e9d 100644 --- a/wonky_server/lib/src/generated/protocol.dart +++ b/wonky_server/lib/src/generated/protocol.dart @@ -1536,6 +1536,7 @@ class Protocol extends _is.DatabaseSerializationManager _is.getType>, _is.getType>, _is.getType?>, + _is.getType?>, _is.getType>, _is.getType>, _is.getType>, @@ -1575,11 +1576,12 @@ 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>, _is.getType>, _is.getType>, _is.getType>, @@ -3741,6 +3743,12 @@ class Protocol extends _is.DatabaseSerializationManager isNullable: true, dartType: 'String?', ), + _isp.ColumnDefinition( + name: 'promptExcludedCommentIds', + columnType: _isp.ColumnType.json, + isNullable: true, + dartType: 'List?', + ), _isp.ColumnDefinition( name: 'promptEditedById', columnType: _isp.ColumnType.bigint, @@ -16651,6 +16659,12 @@ class Protocol extends _is.DatabaseSerializationManager : null) as T; } + if (t == _is.getType?>()) { + return (data != null + ? (data as List).map((e) => deserialize(e)).toList() + : null) + as T; + } if (t == List<_ifz7dmuf.BoardTaskView>) { return (data as List) .map((e) => deserialize<_ifz7dmuf.BoardTaskView>(e)) @@ -16900,6 +16914,18 @@ class Protocol extends _is.DatabaseSerializationManager .toList() as T; } + if (t == List<_is.UuidValue>) { + return (data as List).map((e) => deserialize<_is.UuidValue>(e)).toList() + as T; + } + if (t == _is.getType?>()) { + return (data != null + ? (data as List) + .map((e) => deserialize<_is.UuidValue>(e)) + .toList() + : null) + as T; + } if (t == List<_i8qikgvy.BoardBundleSuggestionView>) { return (data as List) .map((e) => deserialize<_i8qikgvy.BoardBundleSuggestionView>(e)) @@ -16924,10 +16950,6 @@ class Protocol extends _is.DatabaseSerializationManager .toList() as T; } - if (t == List<_is.UuidValue>) { - return (data as List).map((e) => deserialize<_is.UuidValue>(e)).toList() - as T; - } if (t == List<_ibinmr4r.TemplateView>) { return (data as List) .map((e) => deserialize<_ibinmr4r.TemplateView>(e)) 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 3f0bedff..a46f4a5d 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 @@ -284,6 +284,7 @@ const specIndexSuite = ' ### 8.1 Claim\n' ' ### 8.2 Expiry\n' ' ### 8.3 Linking a PR and finishing\n' + ' ### 8.4 Claim blocks (T-10)\n' ' ## 9. Admins and moderation\n' ' ### 9.1 Who is an admin\n' ' ### 9.2 Admin tools\n' diff --git a/wonky_server/lib/src/platform/board/ai/task_prompt_template.dart b/wonky_server/lib/src/platform/board/ai/task_prompt_template.dart index 405cada9..3e85e7d9 100644 --- a/wonky_server/lib/src/platform/board/ai/task_prompt_template.dart +++ b/wonky_server/lib/src/platform/board/ai/task_prompt_template.dart @@ -34,7 +34,9 @@ abstract final class TaskPromptTemplate { ..writeln() ..writeln('## Reports this task comes from'); for (final p in posts) { - final link = webOrigin.replace(path: '/improvements/p/${p.id}'); + // The issue as Markdown (body, details, comments): an agent reads it + // without the web app (specs/16 §10.1). + final link = webOrigin.replace(path: '/improvements/p/${p.id}.md'); b.writeln( '- #${p.id} ${p.title} — $link ' '(${p.score} ${p.score == 1 ? 'vote' : 'votes'})', diff --git a/wonky_server/lib/src/platform/board/board_common.dart b/wonky_server/lib/src/platform/board/board_common.dart index abdfd126..7b5a7e42 100644 --- a/wonky_server/lib/src/platform/board/board_common.dart +++ b/wonky_server/lib/src/platform/board/board_common.dart @@ -229,6 +229,17 @@ abstract final class BoardText { return b; } + static const _months = [ + 'January', 'February', 'March', 'April', 'May', 'June', 'July', // + 'August', 'September', 'October', 'November', 'December', + ]; + + /// [at] as a day in UTC: `November 2, 2026`. + static String day(DateTime at) { + final d = at.toUtc(); + return '${_months[d.month - 1]} ${d.day}, ${d.year}'; + } + /// Plain text of Markdown [markdown], at most [max] characters. static String plain(String markdown, {int max = 200}) { var t = markdown diff --git a/wonky_server/lib/src/platform/board/board_config.dart b/wonky_server/lib/src/platform/board/board_config.dart index d64d2282..6e18b80e 100644 --- a/wonky_server/lib/src/platform/board/board_config.dart +++ b/wonky_server/lib/src/platform/board/board_config.dart @@ -19,7 +19,10 @@ class BoardConfig { this.securityContact = 'security@serverpod.dev', this.claimHours = 48, this.claimWarnHours = 6, - this.maxActiveClaimsPerUser = 2, + this.maxActiveClaimsPerUser = 3, + this.expiredClaimsToBlock = 3, + this.invalidPostsToBlock = 2, + this.claimBlockDays = 14, this.flagsToHold = 3, this.publishWhenTriageFails = true, this.limits = const BoardLimits(), @@ -44,6 +47,15 @@ class BoardConfig { final int claimWarnHours; final int maxActiveClaimsPerUser; + /// Expired claims (neither delivered nor unclaimed in time) that block + /// the claimant from claiming for [claimBlockDays] (specs/16 §8.4). + final int expiredClaimsToBlock; + + /// Issues removed by a moderator (invalid) that block their author from + /// claiming for [claimBlockDays] (specs/16 §8.4). + final int invalidPostsToBlock; + final int claimBlockDays; + /// Distinct users' flags that hold a visible post or comment. final int flagsToHold; @@ -55,6 +67,7 @@ class BoardConfig { final BoardGithubConfig github; Duration get claimDuration => Duration(hours: claimHours); + Duration get claimBlockDuration => Duration(days: claimBlockDays); static BoardConfig? _current; @@ -100,7 +113,10 @@ class BoardConfig { securityContact: r.s('securityContact', 'security@serverpod.dev'), claimHours: r.i('claimHours', 48), claimWarnHours: r.i('claimWarnHours', 6), - maxActiveClaimsPerUser: r.i('maxActiveClaimsPerUser', 2), + maxActiveClaimsPerUser: r.i('maxActiveClaimsPerUser', 3), + expiredClaimsToBlock: r.i('expiredClaimsToBlock', 3), + invalidPostsToBlock: r.i('invalidPostsToBlock', 2), + claimBlockDays: r.i('claimBlockDays', 14), flagsToHold: r.i('flagsToHold', 3), publishWhenTriageFails: r.b('publishWhenTriageFails', true), limits: BoardLimits( diff --git a/wonky_server/lib/src/platform/board/board_endpoint.dart b/wonky_server/lib/src/platform/board/board_endpoint.dart index d07ca767..a6090129 100644 --- a/wonky_server/lib/src/platform/board/board_endpoint.dart +++ b/wonky_server/lib/src/platform/board/board_endpoint.dart @@ -228,13 +228,23 @@ class BoardEndpoint extends Endpoint { BoardService.unblockUser(session, userId); /// Creates a draft task from posts and generates its prompt. + /// [excludedComments] are comments of the posts the admin left out of the + /// prompt's context (specs/16 §9.3). Future createTask( Session session, List postNumbers, String title, BoardArea area, - BoardSize size, - ) => BoardService.createTask(session, postNumbers, title, area, size); + BoardSize size, { + List? excludedComments, + }) => BoardService.createTask( + session, + postNumbers, + title, + area, + size, + excludedComments: excludedComments ?? const [], + ); Future updateTask( Session session, diff --git a/wonky_server/lib/src/platform/board/board_markdown.dart b/wonky_server/lib/src/platform/board/board_markdown.dart new file mode 100644 index 00000000..55616919 --- /dev/null +++ b/wonky_server/lib/src/platform/board/board_markdown.dart @@ -0,0 +1,148 @@ +import 'dart:convert'; + +import 'package:serverpod/serverpod.dart'; + +import '../common/models.dart'; +import 'board_access.dart'; +import 'board_views.dart'; + +/// The Markdown version of an issue (specs/16 §4.3, §10.1), +/// `/improvements/p/.md`: what a coding agent reads from a task prompt's +/// *Reports this task comes from* links. Public content only, as a +/// signed-out visitor sees it. +abstract final class BoardMarkdown { + /// The Markdown of issue #[number], or null when it is not public + /// (missing, deleted, held, removed or still being checked). + static Future post( + Session session, + int number, { + required Uri webOrigin, + }) async { + const c = BoardCaller.signedOut(); + final row = await BoardPost.db.findById(session, number); + if (row == null || + row.deletedAt != null || + row.moderation != BoardModeration.visible || + !BoardAccess.canSeePost(c, row)) { + return null; + } + final view = await BoardViews.post(session, c, row); + final comments = await BoardComment.db.find( + session, + where: (t) => + t.postId.equals(number) & + t.moderation.equals(BoardModeration.visible) & + t.deletedAt.equals(null) & + t.systemEvent.equals(null), + orderBy: (t) => t.id, + limit: 2000, + ); + return render( + view, + await BoardViews.comments(session, c, comments), + webOrigin: webOrigin, + ); + } + + /// [post] and its [comments] as Markdown: a title line, the facts as a + /// list, the body, the included details and the comments, oldest first. + static String render( + BoardPostView post, + List comments, { + required Uri webOrigin, + }) { + String link(String path) => webOrigin.replace(path: path).toString(); + final n = post.number; + final kind = post.kind == BoardPostKind.bug ? 'Bug' : 'Improvement'; + final b = StringBuffer() + ..writeln('# #$n ${_oneLine(post.title)}') + ..writeln() + ..writeln('- Kind: $kind') + ..writeln('- Status: ${post.status.name}'); + final duplicateOf = post.duplicateOfNumber; + if (duplicateOf != null) { + b.writeln( + '- Duplicate of: #$duplicateOf ' + '(${link('/improvements/p/$duplicateOf.md')})', + ); + } + if (post.declineReason case final reason? when reason.trim().isNotEmpty) { + b.writeln('- Declined: ${_oneLine(reason)}'); + } + final ai = post.aiLabels ? ' (AI)' : ''; + if (post.area case final area?) b.writeln('- Area: ${area.name}$ai'); + if (post.size case final size?) b.writeln('- Size: ${size.name}$ai'); + b.writeln('- Votes: ${post.score}'); + final author = post.author?.displayName ?? 'Deleted user'; + b.writeln('- Reported by: ${_oneLine(author)} on ${_day(post.createdAt)}'); + if (post.task case final task?) { + b.writeln( + '- Task: T-${task.number} ${_oneLine(task.title)} ' + '(${task.status.name})', + ); + } + if (post.mergedFrom.isNotEmpty) { + b.writeln( + '- Duplicates merged into it: ' + '${post.mergedFrom.map((m) => '#$m').join(', ')}', + ); + } + b.writeln('- Page: ${link('/improvements/p/$n')}'); + if (post.hasScreenshot) { + b.writeln('- Screenshot: ${link('/improvements/p/$n/screenshot')}'); + } + b + ..writeln() + ..writeln(post.body.trim()); + final details = _details(post.contextJson); + if (details != null) { + b + ..writeln() + ..writeln('## Included details') + ..writeln() + ..writeln('```json') + ..writeln(details) + ..writeln('```'); + } + final shown = [ + for (final c in comments) + if (!c.deleted && c.systemEvent == null && c.body.trim().isNotEmpty) c, + ]; + b + ..writeln() + ..writeln('## Comments (${shown.length})'); + if (shown.isEmpty) { + b + ..writeln() + ..writeln('No comments yet.'); + } + for (final c in shown) { + final who = c.author?.displayName ?? 'Deleted user'; + final admin = c.author?.isAdmin ?? false ? ' (admin)' : ''; + b + ..writeln() + ..writeln('### ${_oneLine(who)}$admin on ${_day(c.createdAt)}') + ..writeln() + ..writeln(c.body.trim()); + } + return b.toString(); + } + + /// The included details, pretty-printed, or null when there are none. + static String? _details(String? json) { + if (json == null || json.trim().isEmpty) return null; + try { + final value = jsonDecode(json); + if (value is Map && value.isEmpty) return null; + return const JsonEncoder.withIndent(' ').convert(value); + } on FormatException { + return json.trim(); + } + } + + static String _oneLine(String s) => s.replaceAll(RegExp(r'\s+'), ' ').trim(); + + /// `2026-10-19` (UTC). + static String _day(DateTime at) => + at.toUtc().toIso8601String().substring(0, 10); +} diff --git a/wonky_server/lib/src/platform/board/board_posts.dart b/wonky_server/lib/src/platform/board/board_posts.dart index fe4d083c..2f1126d6 100644 --- a/wonky_server/lib/src/platform/board/board_posts.dart +++ b/wonky_server/lib/src/platform/board/board_posts.dart @@ -12,6 +12,7 @@ import 'board_common.dart'; import 'board_config.dart'; import 'board_pipeline.dart'; import 'board_search.dart'; +import 'board_task_claims.dart'; import 'board_views.dart'; /// Posts (specs/16 §4, §5.3, §6.4, §7): reading, the list and search, @@ -38,6 +39,7 @@ abstract final class BoardPosts { repository: config.repository, securityContact: config.securityContact, claimHours: config.claimHours, + maxActiveClaims: config.maxActiveClaimsPerUser, ); } final claims = await BoardTask.db.find( @@ -52,6 +54,9 @@ abstract final class BoardPosts { session, where: (t) => t.userId.equals(c.id), ); + final block = c.isAdmin + ? null + : await BoardTaskClaims.claimBlock(session, c.id); return BoardMe( signedIn: true, userId: c.id, @@ -64,6 +69,9 @@ abstract final class BoardPosts { repository: config.repository, securityContact: config.securityContact, claimHours: config.claimHours, + maxActiveClaims: config.maxActiveClaimsPerUser, + claimBlockedUntil: block?.until, + claimBlockedReason: block?.message, ); } @@ -129,6 +137,9 @@ abstract final class BoardPosts { text, kind: kind, limit: 10, + // Only issues one can still vote for: done and shipped ones are + // built (specs/16 §4.2.2). + statuses: const [BoardPostStatus.open, BoardPostStatus.planned], ); final ai = BoardAi.instance; if (posts.isNotEmpty && c.signedIn && await ai.jevAvailable(session)) { diff --git a/wonky_server/lib/src/platform/board/board_search.dart b/wonky_server/lib/src/platform/board/board_search.dart index 5ebbb9a6..57eff86b 100644 --- a/wonky_server/lib/src/platform/board/board_search.dart +++ b/wonky_server/lib/src/platform/board/board_search.dart @@ -109,6 +109,11 @@ abstract final class BoardSearch { BoardPostKind? kind, int limit = 10, int? excludeId, + List statuses = const [ + BoardPostStatus.open, + BoardPostStatus.planned, + BoardPostStatus.done, + ], }) async { final ids = await similarIds( session, @@ -116,6 +121,7 @@ abstract final class BoardSearch { kind: kind, limit: limit, excludeId: excludeId, + statuses: statuses, ); return byIds(session, ids); } diff --git a/wonky_server/lib/src/platform/board/board_service.dart b/wonky_server/lib/src/platform/board/board_service.dart index ab5a6de3..04ae7194 100644 --- a/wonky_server/lib/src/platform/board/board_service.dart +++ b/wonky_server/lib/src/platform/board/board_service.dart @@ -1,8 +1,10 @@ import 'package:serverpod/serverpod.dart'; import '../common/models.dart'; +import '../notifications/notification_service.dart'; import 'board_comments.dart'; import 'board_live_streams.dart'; +import 'board_markdown.dart'; import 'board_moderation.dart'; import 'board_posts.dart'; import 'board_search.dart'; @@ -48,6 +50,14 @@ abstract final class BoardService { }) => BoardPosts.similar(session, title: title, body: body, kind: kind); static Future getScreenshotUrl(Session session, int number) => BoardPosts.getScreenshotUrl(session, number); + + /// Issue #[number] as Markdown (public content only), or null. + static Future postMarkdown(Session session, int number) => + BoardMarkdown.post( + session, + number, + webOrigin: NotificationService.webOrigin(), + ); static Future listTasks( Session session, List statuses, @@ -195,8 +205,16 @@ abstract final class BoardService { List postNumbers, String title, BoardArea area, - BoardSize size, - ) => BoardTasks.create(session, postNumbers, title, area, size); + BoardSize size, { + List excludedComments = const [], + }) => BoardTasks.create( + session, + postNumbers, + title, + area, + size, + excludedComments: excludedComments, + ); static Future updateTask( Session session, int number, diff --git a/wonky_server/lib/src/platform/board/board_task_claims.dart b/wonky_server/lib/src/platform/board/board_task_claims.dart index 1702c07a..ffa6afde 100644 --- a/wonky_server/lib/src/platform/board/board_task_claims.dart +++ b/wonky_server/lib/src/platform/board/board_task_claims.dart @@ -12,6 +12,34 @@ import 'board_views.dart'; import 'board_tasks.dart'; +/// Why a user may not claim tasks for a while (specs/16 §8.4). +enum BoardClaimBlockReason { expired, invalid } + +/// A claim block: no claims until [until], after [count] events of +/// [reason]. +class BoardClaimBlock { + const BoardClaimBlock({ + required this.until, + required this.reason, + required this.count, + }); + + final DateTime until; + final BoardClaimBlockReason reason; + final int count; + + /// The explanation shown to the user (the claim error, `BoardMe`). + String get message { + final why = switch (reason) { + BoardClaimBlockReason.expired => + '$count of your claims expired without a pull request or an unclaim', + BoardClaimBlockReason.invalid => + 'a moderator removed $count of your issues', + }; + return "You can't claim tasks until ${BoardText.day(until)}: $why."; + } +} + /// Claims of board tasks (specs/16 §13.7): claim with a code, release, /// expiry and the expiry warning. abstract final class BoardTaskClaims { @@ -38,6 +66,10 @@ abstract final class BoardTaskClaims { if (status != BoardTaskStatus.published) { throw Errors.conflict('Only published tasks can be claimed.'); } + if (!c.isAdmin) { + final block = await claimBlock(session, c.id, now: now); + if (block != null) throw Errors.forbidden(block.message); + } final active = await BoardTask.db.count( session, where: (t) => @@ -252,6 +284,57 @@ abstract final class BoardTaskClaims { return tasks.length; } + /// Whether user [userId] may not claim tasks at [now] (specs/16 §8.4), + /// computed from the record, so an undone removal lifts its block: every + /// `expiredClaimsToBlock` expired claims, or `invalidPostsToBlock` issues + /// removed by a moderator, block for `claimBlockDays` from the last of + /// them. Each block starts the count of its kind again. + static Future claimBlock( + Session session, + int userId, { + DateTime? now, + }) async { + final config = BoardConfig.current; + final expired = await BoardComment.db.find( + session, + where: (t) => + t.authorId.equals(userId) & + t.taskId.notEquals(null) & + t.systemEvent.equals('expired'), + ); + final invalid = await BoardPost.db.find( + session, + where: (t) => + t.authorId.equals(userId) & + t.moderation.equals(BoardModeration.removed) & + t.removedAt.notEquals(null), + ); + final events = <(DateTime, BoardClaimBlockReason)>[ + for (final c in expired) (c.createdAt, BoardClaimBlockReason.expired), + for (final p in invalid) (p.removedAt!, BoardClaimBlockReason.invalid), + ]..sort((a, b) => a.$1.compareTo(b.$1)); + final counts = {for (final r in BoardClaimBlockReason.values) r: 0}; + BoardClaimBlock? block; + for (final (at, reason) in events) { + final n = counts[reason]! + 1; + final limit = switch (reason) { + BoardClaimBlockReason.expired => config.expiredClaimsToBlock, + BoardClaimBlockReason.invalid => config.invalidPostsToBlock, + }; + if (limit <= 0 || n < limit) { + counts[reason] = n; + continue; + } + counts[reason] = 0; + final until = at.add(config.claimBlockDuration); + if (block == null || until.isAfter(block.until)) { + block = BoardClaimBlock(until: until, reason: reason, count: limit); + } + } + if (block == null || !block.until.isAfter(now ?? nowUtc())) return null; + return block; + } + /// Sweep: one reminder per claim with `claimWarnHours` or less left. static Future warnClaims(Session session) async { final now = nowUtc(); diff --git a/wonky_server/lib/src/platform/board/board_tasks.dart b/wonky_server/lib/src/platform/board/board_tasks.dart index a5474abc..ec5a09da 100644 --- a/wonky_server/lib/src/platform/board/board_tasks.dart +++ b/wonky_server/lib/src/platform/board/board_tasks.dart @@ -241,19 +241,29 @@ abstract final class BoardTasks { return _postsOf(session, taskId); } + /// The comments of [posts] the prompt's context includes: visible + /// comments people wrote, without the ones the admin left out + /// ([BoardTask.promptExcludedCommentIds], specs/16 §9.3), at most + /// [maxCommentsPerPost] per post. static Future>> _commentsFor( Session session, - List posts, - ) async { + List posts, { + List? excluded, + }) async { + final skip = {...?excluded}; final result = >{}; for (final p in posts) { result[p.id!] = await BoardComment.db.find( session, - where: (t) => - t.postId.equals(p.id!) & - t.moderation.equals(BoardModeration.visible) & - t.deletedAt.equals(null) & - t.systemEvent.equals(null), + where: (t) { + var w = + t.postId.equals(p.id!) & + t.moderation.equals(BoardModeration.visible) & + t.deletedAt.equals(null) & + t.systemEvent.equals(null); + if (skip.isNotEmpty) w = w & t.id.notInSet(skip); + return w; + }, orderBy: (t) => t.id, limit: maxCommentsPerPost, ); @@ -261,6 +271,28 @@ abstract final class BoardTasks { return result; } + /// The ids of the comments [uuids] of [posts]; comments of other posts + /// are an `invalidArgument`. + static Future> _commentIds( + Session session, + List posts, + List uuids, + ) async { + if (uuids.isEmpty) return const []; + final postIds = {for (final p in posts) p.id!}; + final rows = await BoardComment.db.find( + session, + where: (t) => t.uuid.inSet(uuids.toSet()), + ); + if (rows.length != uuids.toSet().length || + rows.any((c) => !postIds.contains(c.postId))) { + throw Errors.invalid( + 'Only comments of the selected issues can be left out.', + ); + } + return [for (final c in rows) c.id!]..sort(); + } + /// How long a scheduled prompt may take before the task stops showing /// it as pending (a lost future call must not block publishing). static const promptTimeout = Duration(minutes: 10); @@ -381,7 +413,11 @@ abstract final class BoardTasks { session, task: task, posts: posts, - comments: await _commentsFor(session, posts), + comments: await _commentsFor( + session, + posts, + excluded: task.promptExcludedCommentIds, + ), webOrigin: NotificationService.webOrigin(), ); body = text.trim().isEmpty ? null : text.trim(); @@ -488,11 +524,13 @@ abstract final class BoardTasks { List postNumbers, String title, BoardArea area, - BoardSize size, - ) async { + BoardSize size, { + List excludedComments = const [], + }) async { final c = await BoardAccess.requireAdmin(session); final clean = _title(title); final posts = await _postsFor(session, postNumbers); + final excluded = await _commentIds(session, posts, excludedComments); final now = nowUtc(); var task = await session.db.transaction((tx) async { final task = await BoardTask.db.insertRow( @@ -503,6 +541,7 @@ abstract final class BoardTasks { size: size, status: BoardTaskStatus.draft, promptBody: TaskPromptTemplate.blankBody, + promptExcludedCommentIds: excluded.isEmpty ? null : excluded, createdById: c.id, createdAt: now, ), @@ -539,7 +578,11 @@ abstract final class BoardTasks { action: 'createTask', targetKind: BoardTargetKind.task, targetId: task.id!, - after: {...snapshot(task), 'postIds': ids.toList()}, + after: { + ...snapshot(task), + 'postIds': ids.toList(), + if (excluded.isNotEmpty) 'excludedCommentIds': excluded, + }, ); for (final p in posts) { await BoardLive.post(session, p.id!); @@ -726,10 +769,20 @@ abstract final class BoardTasks { transaction: tx, ); } + // The comments left out of each task's prompt stay out (the ids of + // comments whose issues leave again on unmerge no longer match). + final excluded = { + for (final t in tasks) ...?t.promptExcludedCommentIds, + }.toList()..sort(); await BoardTask.db.updateRow( session, - target.copyWith(title: clean, area: area, size: size), - columns: (t) => [t.title, t.area, t.size], + target.copyWith( + title: clean, + area: area, + size: size, + promptExcludedCommentIds: excluded.isEmpty ? null : excluded, + ), + columns: (t) => [t.title, t.area, t.size, t.promptExcludedCommentIds], transaction: tx, ); await BoardComments.systemRow( diff --git a/wonky_server/lib/src/platform/board/models/board_me.spy.yaml b/wonky_server/lib/src/platform/board/models/board_me.spy.yaml index ef9d5f24..4ff27e15 100644 --- a/wonky_server/lib/src/platform/board/models/board_me.spy.yaml +++ b/wonky_server/lib/src/platform/board/models/board_me.spy.yaml @@ -13,3 +13,8 @@ fields: repository: String securityContact: String claimHours: int + ### Claims the caller may hold at a time (`maxActiveClaimsPerUser`). + maxActiveClaims: int, default=3 + ### Set while the caller may not claim tasks (specs/16 §8.4). + claimBlockedUntil: DateTime? + claimBlockedReason: String? diff --git a/wonky_server/lib/src/platform/board/models/board_task.spy.yaml b/wonky_server/lib/src/platform/board/models/board_task.spy.yaml index 7976c44a..89388e3c 100644 --- a/wonky_server/lib/src/platform/board/models/board_task.spy.yaml +++ b/wonky_server/lib/src/platform/board/models/board_task.spy.yaml @@ -16,6 +16,9 @@ fields: ### Why the last AI writing pass left the prompt as it was (budget used ### up, provider error); shown to admins. promptNote: String? + ### Comments of the task's issues the admin left out of the prompt's + ### context (specs/16 §9.3); every other visible comment is included. + promptExcludedCommentIds: List? promptEditedById: int? promptEditedAt: DateTime? createdById: int diff --git a/wonky_server/lib/src/web/routes/improvements_redirect_route.dart b/wonky_server/lib/src/web/routes/improvements_redirect_route.dart index e38cbf24..ee1303c7 100644 --- a/wonky_server/lib/src/web/routes/improvements_redirect_route.dart +++ b/wonky_server/lib/src/web/routes/improvements_redirect_route.dart @@ -7,6 +7,10 @@ import '../../platform/common/models.dart'; typedef BoardScreenshotUrl = Future Function(Session session, int postNumber); +/// Signature of the Markdown lookup of a post (tests replace it). +typedef BoardPostMarkdown = + Future Function(Session session, int postNumber); + /// `/improvements` and `/improvements/**` (specs/16 §4.3): links in emails, /// PRs and task prompts point at the site; they open in Wonky Drive, /// `/drive/improvements/…`, keeping the rest of the path and the query. @@ -15,33 +19,60 @@ typedef BoardScreenshotUrl = /// task prompts (specs/16 §10.1): it redirects to a fresh signed URL of the /// post's screenshot, or answers 404 when the post has none or isn't /// public. +/// +/// `/improvements/p/.md` is the post as Markdown (`text/markdown`: the +/// body, details and comments), the link task prompts give coding agents; +/// 404 when the post isn't public. class ImprovementsRedirectRoute extends Route { - ImprovementsRedirectRoute({BoardScreenshotUrl? screenshotUrl}) - : _screenshotUrl = screenshotUrl ?? BoardService.getScreenshotUrl; + ImprovementsRedirectRoute({ + BoardScreenshotUrl? screenshotUrl, + BoardPostMarkdown? markdown, + }) : _screenshotUrl = screenshotUrl ?? BoardService.getScreenshotUrl, + _markdown = markdown ?? BoardService.postMarkdown; final BoardScreenshotUrl _screenshotUrl; + final BoardPostMarkdown _markdown; - static final _screenshot = RegExp(r'^/improvements/p/(\d+)/screenshot/?$'); + static final _screenshot = RegExp( + r'^/improvements/p/(\d{1,9})/screenshot/?$', + ); + static final _markdownPath = RegExp(r'^/improvements/p/(\d{1,9})\.md$'); + + static final markdownType = MimeType('text', 'markdown'); @override Future handleCall(Session session, Request request) async { final path = request.url.path; final shot = _screenshot.firstMatch(path); if (shot != null) { - final number = int.tryParse(shot[1]!); - String? url; - if (number != null) { - try { - url = await _screenshotUrl(session, number); - } on WonkyException { - url = null; - } - } + final url = await _lookup(() => _screenshotUrl(session, _n(shot))); if (url == null) return Response.notFound(); return Response.found(Uri.parse(url)); } + final md = _markdownPath.firstMatch(path); + if (md != null) { + final text = await _lookup(() => _markdown(session, _n(md))); + if (text == null) return Response.notFound(); + return Response.ok( + body: Body.fromString(text, mimeType: markdownType), + // Votes and comments change: always fetch the current version. + headers: Headers.build((h) => h['cache-control'] = ['no-cache']), + ); + } return Response.found(Uri.parse(improvementsTarget(request.url))); } + + static int _n(RegExpMatch m) => int.parse(m[1]!); + + /// [lookup]'s result, null when it fails with a [WonkyException] (not + /// found, not public). + static Future _lookup(Future Function() lookup) async { + try { + return await lookup(); + } on WonkyException { + return null; + } + } } /// `/improvements/p/12?x=1` → `/drive/improvements/p/12?x=1`. diff --git a/wonky_server/migrations/20261019202955634-board-claim-limits/definition.json b/wonky_server/migrations/20261019202955634-board-claim-limits/definition.json new file mode 100644 index 00000000..5a451139 --- /dev/null +++ b/wonky_server/migrations/20261019202955634-board-claim-limits/definition.json @@ -0,0 +1,18568 @@ +{ + "__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?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "comment_fk_0", + "columns": [ + "threadId" + ], + "referenceTable": "comment_thread", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "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?" + } + ], + "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 + } + ], + "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": "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": "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": "20261019202955634-board-claim-limits" + }, + { + "__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/20261019202955634-board-claim-limits/definition.sql b/wonky_server/migrations/20261019202955634-board-claim-limits/definition.sql new file mode 100644 index 00000000..1d173efd --- /dev/null +++ b/wonky_server/migrations/20261019202955634-board-claim-limits/definition.sql @@ -0,0 +1,4015 @@ +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 +); + +-- 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 +); + +-- 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 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 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; + +-- +-- 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; + +-- +-- 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 "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 "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', '20261019202955634-board-claim-limits', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20261019202955634-board-claim-limits', "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/20261019202955634-board-claim-limits/definition_project.json b/wonky_server/migrations/20261019202955634-board-claim-limits/definition_project.json new file mode 100644 index 00000000..89631dbb --- /dev/null +++ b/wonky_server/migrations/20261019202955634-board-claim-limits/definition_project.json @@ -0,0 +1,15361 @@ +{ + "__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?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "comment_fk_0", + "columns": [ + "threadId" + ], + "referenceTable": "comment_thread", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "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?" + } + ], + "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 + } + ], + "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": "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": "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/20261019202955634-board-claim-limits/migration.json b/wonky_server/migrations/20261019202955634-board-claim-limits/migration.json new file mode 100644 index 00000000..7c4fff99 --- /dev/null +++ b/wonky_server/migrations/20261019202955634-board-claim-limits/migration.json @@ -0,0 +1,33 @@ +{ + "__className__": "serverpod.DatabaseMigration", + "actions": [ + { + "__className__": "serverpod.DatabaseMigrationAction", + "type": "alterTable", + "alterTable": { + "__className__": "serverpod.TableMigration", + "name": "board_task", + "schema": "public", + "addColumns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "promptExcludedCommentIds", + "fieldName": "promptExcludedCommentIds", + "columnType": 8, + "isNullable": true, + "dartType": "List?" + } + ], + "deleteColumns": [], + "modifyColumns": [], + "addIndexes": [], + "deleteIndexes": [], + "addForeignKeys": [], + "deleteForeignKeys": [], + "warnings": [] + } + } + ], + "warnings": [], + "migrationApiVersion": 1 +} \ No newline at end of file diff --git a/wonky_server/migrations/20261019202955634-board-claim-limits/migration.sql b/wonky_server/migrations/20261019202955634-board-claim-limits/migration.sql new file mode 100644 index 00000000..0a91e000 --- /dev/null +++ b/wonky_server/migrations/20261019202955634-board-claim-limits/migration.sql @@ -0,0 +1,41 @@ +BEGIN; + +-- +-- ACTION ALTER TABLE +-- +ALTER TABLE "board_task" ADD COLUMN "promptExcludedCommentIds" json; + +-- +-- MIGRATION VERSION FOR wonky +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('wonky', '20261019202955634-board-claim-limits', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20261019202955634-board-claim-limits', "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 bd689644..83178021 100644 --- a/wonky_server/migrations/migration_registry.txt +++ b/wonky_server/migrations/migration_registry.txt @@ -28,3 +28,4 @@ 20261018113026742-revlog-r8-remove-crdt 20261018123013739-quality-wave1-server 20261018144655713-neutral-record-names +20261019202955634-board-claim-limits diff --git a/wonky_server/test/integration/platform/board/board_claim_limits_test.dart b/wonky_server/test/integration/platform/board/board_claim_limits_test.dart new file mode 100644 index 00000000..be98f447 --- /dev/null +++ b/wonky_server/test/integration/platform/board/board_claim_limits_test.dart @@ -0,0 +1,168 @@ +@Tags(['integration']) +library; + +import 'package:clock/clock.dart'; +import 'package:test/test.dart'; +import 'package:wonky_server/src/platform/board/board_sweep.dart'; +import 'package:wonky_server/src/platform/common/models.dart'; + +import '../../../support/board/board_harness.dart'; +import '../../../support/test_users.dart'; +import '../../../support/wonky_serverpod.dart'; + +Matcher _code(WonkyErrorCode code) => + throwsA(isA().having((e) => e.code, 'code', code)); + +/// Claim limits and claim blocks (specs/16 §8.1, §8.4). +void main() { + withWonkyServerpod('Given four published tasks', (sessionBuilder, endpoints) { + late BoardHarness h; + late TestUser anna; + late TestUser bo; + late TestUser admin; + late List tasks; + setUp(() async { + h = BoardHarness.install(); + h.ai.jev = false; + anna = await TestUsers.create(sessionBuilder, name: 'Anna'); + bo = await TestUsers.create(sessionBuilder, name: 'Bo'); + admin = await BoardHarness.admin(sessionBuilder); + tasks = [ + for (var i = 0; i < 4; i++) + await BoardHarness.publishedTask(endpoints, admin, [ + (await BoardHarness.post(endpoints, anna)).number, + ], title: 'Task number $i'), + ]; + }); + tearDown(() => h.uninstall()); + + Future claim(TestUser who, int i) => + endpoints.board.claimTask(who.endpointSession, tasks[i].number); + + test('when claiming three tasks then the server accepts them and ' + 'refuses a fourth', () async { + for (var i = 0; i < 3; i++) { + expect((await claim(bo, i)).claimedBy?.id, bo.id); + } + + await expectLater(claim(bo, 3), _code(WonkyErrorCode.limitExceeded)); + final me = await endpoints.board.me(bo.endpointSession); + expect(me.activeClaims, hasLength(3)); + expect(me.maxActiveClaims, 3); + expect(me.claimBlockedUntil, isNull); + }); + + test('when three claims expire then the claimant cannot claim for two ' + 'weeks', () async { + final start = clock.now().toUtc(); + await withClock(Clock.fixed(start), () async { + for (var i = 0; i < 3; i++) { + await claim(bo, i); + } + }); + final expiredAt = start.add(const Duration(hours: 49)); + await withClock( + Clock.fixed(expiredAt), + () => BoardSweep.run(sessionBuilder.build()), + ); + + await withClock( + Clock.fixed(expiredAt.add(const Duration(hours: 1))), + () async { + await expectLater(claim(bo, 3), _code(WonkyErrorCode.forbidden)); + final me = await endpoints.board.me(bo.endpointSession); + expect(me.claimBlockedUntil, expiredAt.add(const Duration(days: 14))); + expect(me.claimBlockedReason, contains('3 of your claims expired')); + // Others are not affected. + expect((await claim(anna, 3)).claimedBy?.id, anna.id); + }, + ); + await withClock( + Clock.fixed(expiredAt.add(const Duration(days: 14, minutes: 1))), + () async { + expect((await claim(bo, 0)).claimedBy?.id, bo.id); + final me = await endpoints.board.me(bo.endpointSession); + expect(me.claimBlockedUntil, isNull); + }, + ); + }); + + test('when two claims expire or a claim is released then claiming ' + 'still works', () async { + final start = clock.now().toUtc(); + await withClock(Clock.fixed(start), () async { + await claim(bo, 0); + await claim(bo, 1); + await claim(bo, 2); + await endpoints.board.releaseTask(bo.endpointSession, tasks[2].number); + }); + final later = start.add(const Duration(hours: 49)); + await withClock( + Clock.fixed(later), + () => BoardSweep.run(sessionBuilder.build()), + ); + + await withClock( + Clock.fixed(later.add(const Duration(hours: 1))), + () async => expect((await claim(bo, 3)).claimedBy?.id, bo.id), + ); + }); + + group('when a moderator removes issues by the claimant', () { + Future removed(TestUser author) async { + final p = await BoardHarness.post(endpoints, author); + return endpoints.board.moderatePost( + admin.endpointSession, + p.number, + BoardModerationAction.remove, + 'spam', + ); + } + + test('then one removed issue does not block claiming', () async { + await removed(bo); + + expect((await claim(bo, 0)).claimedBy?.id, bo.id); + }); + + test('then two removed issues block claiming for two weeks, and ' + 'restoring one lifts the block', () async { + final start = clock.now().toUtc(); + late BoardPostView second; + await withClock(Clock.fixed(start), () async { + await removed(bo); + second = await removed(bo); + }); + + await expectLater(claim(bo, 0), _code(WonkyErrorCode.forbidden)); + final me = await endpoints.board.me(bo.endpointSession); + expect( + me.claimBlockedUntil!.difference(start), + const Duration(days: 14), + ); + expect(me.claimBlockedReason, contains('removed 2 of your issues')); + + await endpoints.board.moderatePost( + admin.endpointSession, + second.number, + BoardModerationAction.restore, + null, + ); + expect((await claim(bo, 0)).claimedBy?.id, bo.id); + }); + + test('then the block ends after two weeks', () async { + final start = clock.now().toUtc(); + await withClock(Clock.fixed(start), () async { + await removed(bo); + await removed(bo); + }); + + await withClock( + Clock.fixed(start.add(const Duration(days: 14, minutes: 1))), + () async => expect((await claim(bo, 0)).claimedBy?.id, bo.id), + ); + }); + }); + }); +} diff --git a/wonky_server/test/integration/platform/board/board_task_context_test.dart b/wonky_server/test/integration/platform/board/board_task_context_test.dart new file mode 100644 index 00000000..00815f8f --- /dev/null +++ b/wonky_server/test/integration/platform/board/board_task_context_test.dart @@ -0,0 +1,237 @@ +@Tags(['integration']) +library; + +import 'package:serverpod/serverpod.dart' show Uuid; +import 'package:test/test.dart'; +import 'package:wonky_server/src/platform/board/board_markdown.dart'; +import 'package:wonky_server/src/platform/board/board_tasks.dart'; +import 'package:wonky_server/src/platform/common/models.dart'; + +import '../../../support/board/board_harness.dart'; +import '../../../support/test_users.dart'; +import '../../../support/wonky_serverpod.dart'; + +Matcher _code(WonkyErrorCode code) => + throwsA(isA().having((e) => e.code, 'code', code)); + +/// What a task prompt is written from and links to (specs/16 §9.3, §10.1): +/// the comments the admin selected and the issues' Markdown version. +void main() { + withWonkyServerpod('Given an issue with comments', ( + sessionBuilder, + endpoints, + ) { + late BoardHarness h; + late TestUser anna; + late TestUser bo; + late TestUser admin; + late BoardPostView post; + late BoardPostView other; + late List comments; + final origin = Uri.parse('https://wonky.work'); + setUp(() async { + h = BoardHarness.install(); + h.ai.jev = false; + h.ai.gemini = true; + anna = await TestUsers.create(sessionBuilder, name: 'Anna'); + bo = await TestUsers.create(sessionBuilder, name: 'Bo'); + admin = await BoardHarness.admin(sessionBuilder); + post = await BoardHarness.post( + endpoints, + anna, + title: 'Paste into merged cells drops styles', + body: '## What happened\nThe bold is gone.', + ); + other = await BoardHarness.post(endpoints, anna); + comments = [ + for (final (who, body) in [ + (anna, 'It happens with **italic** too.'), + (bo, 'Off topic: I like the new theme.'), + (bo, 'Only in Chrome for me.'), + ]) + await endpoints.board.addComment( + who.endpointSession, + const Uuid().v4obj(), + post.number, + null, + body, + ), + ]; + }); + tearDown(() => h.uninstall()); + + Future> promptCommentsOf(BoardTaskView task) async { + await BoardTasks.writePrompt(sessionBuilder.build(), task.number); + return [ + for (final c in h.ai.promptComments![post.number]!) c.body, + ]; + } + + test('when the admin leaves a comment out then the prompt is written ' + 'from the selected comments only', () async { + final task = await endpoints.board.createTask( + admin.endpointSession, + [post.number], + 'Keep styles when pasting', + BoardArea.sheets, + BoardSize.small, + excludedComments: [comments[1].uuid], + ); + + expect(await promptCommentsOf(task), [ + 'It happens with **italic** too.', + 'Only in Chrome for me.', + ]); + }); + + test('when the admin selects every comment then all of them are ' + 'included', () async { + final task = await endpoints.board.createTask( + admin.endpointSession, + [post.number], + 'Keep styles when pasting', + BoardArea.sheets, + BoardSize.small, + ); + + expect(await promptCommentsOf(task), hasLength(3)); + }); + + test('when a left-out comment belongs to another issue then it is ' + 'refused', () async { + final foreign = await endpoints.board.addComment( + bo.endpointSession, + const Uuid().v4obj(), + other.number, + null, + 'A comment elsewhere', + ); + + await expectLater( + endpoints.board.createTask( + admin.endpointSession, + [post.number], + 'Keep styles when pasting', + BoardArea.sheets, + BoardSize.small, + excludedComments: [foreign.uuid], + ), + _code(WonkyErrorCode.invalidArgument), + ); + }); + + test('when tasks are merged then the comments left out stay out', () async { + final a = await endpoints.board.createTask( + admin.endpointSession, + [post.number], + 'Keep styles when pasting', + BoardArea.sheets, + BoardSize.small, + excludedComments: [comments[2].uuid], + ); + final b = await endpoints.board.createTask( + admin.endpointSession, + [other.number], + 'Other thing', + BoardArea.sheets, + BoardSize.small, + ); + await BoardTasks.writePrompt(sessionBuilder.build(), a.number); + await BoardTasks.writePrompt(sessionBuilder.build(), b.number); + + final merged = await endpoints.board.mergeTasks( + admin.endpointSession, + [a.number, b.number], + 'Both', + BoardArea.sheets, + BoardSize.small, + ); + + expect(await promptCommentsOf(merged), [ + 'It happens with **italic** too.', + 'Off topic: I like the new theme.', + ]); + }); + + test( + 'when the prompt is shown then it links the issues as Markdown', + () async { + final task = await endpoints.board.createTask( + admin.endpointSession, + [post.number], + 'Keep styles when pasting', + BoardArea.sheets, + BoardSize.small, + ); + + expect(task.prompt, contains('/improvements/p/${post.number}.md ')); + }, + ); + + group('when reading the issue as Markdown', () { + test('then it has the title, facts, body and comments', () async { + final md = await BoardMarkdown.post( + sessionBuilder.build(), + post.number, + webOrigin: origin, + ); + + expect( + md, + startsWith( + '# #${post.number} Paste into merged cells drops styles\n', + ), + ); + expect(md, contains('- Kind: Bug\n')); + expect(md, contains('- Status: open\n')); + expect(md, contains('- Votes: 1\n')); + expect( + md, + contains('- Page: https://wonky.work/improvements/p/${post.number}'), + ); + expect(md, contains('## What happened\nThe bold is gone.')); + expect(md, contains('## Comments (3)')); + expect(md, contains('### Anna')); + expect(md, contains('It happens with **italic** too.')); + expect(md, contains('Only in Chrome for me.')); + }); + + test('then removed comments are left out', () async { + await endpoints.board.moderateComment( + admin.endpointSession, + comments[1].uuid, + BoardModerationAction.remove, + 'spam', + ); + + final md = await BoardMarkdown.post( + sessionBuilder.build(), + post.number, + webOrigin: origin, + ); + + expect(md, contains('## Comments (2)')); + expect(md, isNot(contains('Off topic'))); + }); + + test('then a held or missing issue has none', () async { + await endpoints.board.moderatePost( + admin.endpointSession, + post.number, + BoardModerationAction.hold, + null, + ); + final session = sessionBuilder.build(); + + expect( + await BoardMarkdown.post(session, post.number, webOrigin: origin), + isNull, + ); + expect( + await BoardMarkdown.post(session, 999999, webOrigin: origin), + isNull, + ); + }); + }); + }); +} 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 d979ec33..a15c21fd 100644 --- a/wonky_server/test/integration/test_tools/serverpod_test_tools.dart +++ b/wonky_server/test/integration/test_tools/serverpod_test_tools.dart @@ -3004,8 +3004,9 @@ class _BoardEndpoint { List postNumbers, String title, _i2y7swbd.BoardArea area, - _ikq67o57.BoardSize size, - ) async { + _ikq67o57.BoardSize size, { + List<_is.UuidValue>? excludedComments, + }) async { return _ist.callAwaitableFunctionAndHandleExceptions(() async { var _localUniqueSession = (sessionBuilder as _ist.InternalTestSessionBuilder).internalBuild( @@ -3022,6 +3023,7 @@ class _BoardEndpoint { 'title': title, 'area': area, 'size': size, + 'excludedComments': excludedComments, }), serializationManager: _serializationManager, ); diff --git a/wonky_server/test/support/board/fake_board_ai.dart b/wonky_server/test/support/board/fake_board_ai.dart index 0d9d58a7..222a7eaa 100644 --- a/wonky_server/test/support/board/fake_board_ai.dart +++ b/wonky_server/test/support/board/fake_board_ai.dart @@ -45,6 +45,9 @@ class FakeBoardAi implements BoardAi { /// errors). Object? promptError; + /// The comments the last [writeTaskPrompt] was given, by post id. + Map>? promptComments; + List Function(List posts)? onBundles; final calls = []; @@ -148,6 +151,7 @@ class FakeBoardAi implements BoardAi { required Uri webOrigin, }) async { calls.add('prompt'); + promptComments = comments; final error = promptError; if (error != null) throw error; return prompt; diff --git a/wonky_server/test/unit/board/ai/task_prompt_template_test.dart b/wonky_server/test/unit/board/ai/task_prompt_template_test.dart index 19ccc7f7..7386b847 100644 --- a/wonky_server/test/unit/board/ai/task_prompt_template_test.dart +++ b/wonky_server/test/unit/board/ai/task_prompt_template_test.dart @@ -19,7 +19,8 @@ void main() { expect(prompt, startsWith('# Wonky task T-12: Keep styles')); expect(prompt, contains('## Goal\nKeep styles.')); - expect(prompt, contains('https://wonky.work/improvements/p/412')); + // The issues are linked as Markdown, which agents read directly. + expect(prompt, contains('https://wonky.work/improvements/p/412.md ')); expect( prompt, endsWith( diff --git a/wonky_server/test/unit/web/improvements_redirect_route_test.dart b/wonky_server/test/unit/web/improvements_redirect_route_test.dart index 651e1b52..9dc38e34 100644 --- a/wonky_server/test/unit/web/improvements_redirect_route_test.dart +++ b/wonky_server/test/unit/web/improvements_redirect_route_test.dart @@ -1,3 +1,4 @@ +import 'dart:convert'; import 'dart:io'; import 'package:serverpod/serverpod.dart'; @@ -28,6 +29,8 @@ void main() { ? 'https://storage.example.test/s/412.png?sig=1' : null; }, + markdown: (session, n) async => + n == 14 ? '# #14 Improvements to the board\n' : null, ); final app = RelicApp() ..get('/improvements', (req) => route.handleCall(_NoSession(), req)) @@ -97,6 +100,31 @@ void main() { expect(r.statusCode, HttpStatus.notFound); }); + + test('when GET a post with .md then it answers its Markdown', () async { + final request = await client.get( + 'localhost', + server.port, + '/improvements/p/14.md', + ); + request.followRedirects = false; + final r = await request.close(); + final body = await r.transform(utf8.decoder).join(); + + expect(r.statusCode, HttpStatus.ok); + expect(r.headers.contentType?.mimeType, 'text/markdown'); + expect(r.headers.value(HttpHeaders.cacheControlHeader), 'no-cache'); + expect(body, '# #14 Improvements to the board\n'); + }); + + test( + 'when the post is not public then the .md link answers 404', + () async { + final r = await get('/improvements/p/7.md'); + + expect(r.statusCode, HttpStatus.notFound); + }, + ); }, );