From 65bcfb72d7c76ffec79b603702f48b0a34f47131 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcelo=20Mendon=C3=A7a=20Soares?= Date: Wed, 30 Sep 2026 16:07:43 -0300 Subject: [PATCH] chore: Bump version to 0.0.9 and update CHANGELOG (#154) --- CHANGELOG.md | 6 + README.md | 6 +- benchmark/pubspec.yaml | 2 +- example/offline_sync_demo/pubspec.yaml | 2 +- legacy/drift_offline_sync/pubspec.yaml | 2 +- packages/serverpod_offline_sync/pubspec.yaml | 6 +- .../pubspec.yaml | 8 +- .../pubspec.yaml | 12 +- .../test_tools/serverpod_test_tools.dart | 5 + pubspec.yaml | 2 +- .../20260930185557154/definition.json | 6126 +++++++++++++++++ .../20260930185557154/definition_project.json | 3050 ++++++++ .../20260930185557154/migration.dart | 1475 ++++ .../20260930185557154/migration.json | 42 + .../lib/migrations/migration_registry.dart | 2 + .../pubspec.yaml | 6 +- .../20260930185557154/definition.json | 6126 +++++++++++++++++ .../20260930185557154/definition.sql | 1248 ++++ .../20260930185557154/definition_project.json | 3050 ++++++++ .../20260930185557154/migration.json | 42 + .../20260930185557154/migration.sql | 210 + .../migrations/migration_registry.txt | 1 + .../pubspec.yaml | 8 +- .../test_tools/serverpod_test_tools.dart | 5 + .../pubspec.yaml | 4 +- 25 files changed, 21417 insertions(+), 29 deletions(-) create mode 100644 test/serverpod_offline_sync_test_client/lib/migrations/20260930185557154/definition.json create mode 100644 test/serverpod_offline_sync_test_client/lib/migrations/20260930185557154/definition_project.json create mode 100644 test/serverpod_offline_sync_test_client/lib/migrations/20260930185557154/migration.dart create mode 100644 test/serverpod_offline_sync_test_client/lib/migrations/20260930185557154/migration.json create mode 100644 test/serverpod_offline_sync_test_server/migrations/20260930185557154/definition.json create mode 100644 test/serverpod_offline_sync_test_server/migrations/20260930185557154/definition.sql create mode 100644 test/serverpod_offline_sync_test_server/migrations/20260930185557154/definition_project.json create mode 100644 test/serverpod_offline_sync_test_server/migrations/20260930185557154/migration.json create mode 100644 test/serverpod_offline_sync_test_server/migrations/20260930185557154/migration.sql diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e9c8a9..ef969a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 0.0.9 + +- fix: Refreshes node clocks across sync wrappers. +- fix: Repairs foreign keys on columns that also carry a unique claim. +- chore: Release the Serverpod dependency version to `^4.0.0`. + ## 0.0.8 - fix: BREAKING. Reject unique-text values ending in `__conflict__`, diff --git a/README.md b/README.md index 27253b8..b31d0c5 100644 --- a/README.md +++ b/README.md @@ -101,17 +101,17 @@ Add the packages to the server and client `pubspec.yaml` files. ```yaml # your_project_client/pubspec.yaml dependencies: - serverpod_offline_sync_client: 0.0.8 + serverpod_offline_sync_client: 0.0.9 ``` ```yaml # your_project_server/pubspec.yaml dependencies: - serverpod_offline_sync_server: 0.0.8 + serverpod_offline_sync_server: 0.0.9 ``` > [!NOTE] -> Version `0.0.8` requires Serverpod `4.0.0`. +> Version `0.0.9` requires Serverpod `^4.0.0`. After adding the dependencies, list the `serverpod_offline_sync` module on the `generator.yaml` file and enable the experimental `database: sync` option: diff --git a/benchmark/pubspec.yaml b/benchmark/pubspec.yaml index 59a448d..8ac15bf 100644 --- a/benchmark/pubspec.yaml +++ b/benchmark/pubspec.yaml @@ -11,7 +11,7 @@ dependencies: benchmark_harness: ^2.4.0 intl: ^0.20.2 path: ^1.9.1 - serverpod_database: 4.0.0 + serverpod_database: ^4.0.0 serverpod_offline_sync: path: ../packages/serverpod_offline_sync serverpod_offline_sync_server: diff --git a/example/offline_sync_demo/pubspec.yaml b/example/offline_sync_demo/pubspec.yaml index 215c0c6..25d1be5 100644 --- a/example/offline_sync_demo/pubspec.yaml +++ b/example/offline_sync_demo/pubspec.yaml @@ -16,7 +16,7 @@ dependencies: http: ^1.5.0 path: ^1.9.1 path_provider: ^2.1.5 - serverpod_database: 4.0.0 + serverpod_database: ^4.0.0 serverpod_offline_sync_client: path: ../../packages/serverpod_offline_sync_client serverpod_offline_sync_test_client: diff --git a/legacy/drift_offline_sync/pubspec.yaml b/legacy/drift_offline_sync/pubspec.yaml index 53d8ab1..49fc3bb 100644 --- a/legacy/drift_offline_sync/pubspec.yaml +++ b/legacy/drift_offline_sync/pubspec.yaml @@ -1,6 +1,6 @@ name: drift_offline_sync description: A Drift plugin to build offline-first applications with CRDT support. -version: 4.0.0-beta.1 +version: 0.0.1 repository: https://github.com/marcelomendoncasoares/drift_offline_sync environment: diff --git a/packages/serverpod_offline_sync/pubspec.yaml b/packages/serverpod_offline_sync/pubspec.yaml index 8e37ea0..0d8791b 100644 --- a/packages/serverpod_offline_sync/pubspec.yaml +++ b/packages/serverpod_offline_sync/pubspec.yaml @@ -1,5 +1,5 @@ name: serverpod_offline_sync -version: 0.0.8 +version: 0.0.9 description: Shared package for the Serverpod Offline Sync project. homepage: https://github.com/marcelomendoncasoares/serverpod_offline_sync @@ -11,8 +11,8 @@ resolution: workspace dependencies: clock: ^1.1.2 meta: ^1.18.0 - serverpod_database: 4.0.0 - serverpod_serialization: 4.0.0 + serverpod_database: ^4.0.0 + serverpod_serialization: ^4.0.0 uuid: ^4.5.3 dev_dependencies: diff --git a/packages/serverpod_offline_sync_client/pubspec.yaml b/packages/serverpod_offline_sync_client/pubspec.yaml index 4553f5a..e8d3d59 100644 --- a/packages/serverpod_offline_sync_client/pubspec.yaml +++ b/packages/serverpod_offline_sync_client/pubspec.yaml @@ -1,5 +1,5 @@ name: serverpod_offline_sync_client -version: 0.0.8 +version: 0.0.9 description: Client transport adapter for the Serverpod Offline Sync project. homepage: https://github.com/marcelomendoncasoares/serverpod_offline_sync @@ -9,9 +9,9 @@ environment: resolution: workspace dependencies: - serverpod_client: 4.0.0 - serverpod_database: 4.0.0 - serverpod_offline_sync: 0.0.8 + serverpod_client: ^4.0.0 + serverpod_database: ^4.0.0 + serverpod_offline_sync: 0.0.9 dev_dependencies: lints: '>=3.0.0 <7.0.0' diff --git a/packages/serverpod_offline_sync_server/pubspec.yaml b/packages/serverpod_offline_sync_server/pubspec.yaml index 9b5d1d7..3a721ca 100644 --- a/packages/serverpod_offline_sync_server/pubspec.yaml +++ b/packages/serverpod_offline_sync_server/pubspec.yaml @@ -1,5 +1,5 @@ name: serverpod_offline_sync_server -version: 0.0.8 +version: 0.0.9 description: Server module for the Serverpod Offline Sync project. homepage: https://github.com/marcelomendoncasoares/serverpod_offline_sync @@ -10,12 +10,12 @@ resolution: workspace dependencies: meta: ^1.16.0 - serverpod: 4.0.0 - serverpod_database: 4.0.0 - serverpod_offline_sync: 0.0.8 + serverpod: ^4.0.0 + serverpod_database: ^4.0.0 + serverpod_offline_sync: 0.0.9 dev_dependencies: lints: '>=3.0.0 <7.0.0' - serverpod_cli: 4.0.0 - serverpod_test: 4.0.0 + serverpod_cli: ^4.0.0 + serverpod_test: ^4.0.0 test: ^1.25.5 diff --git a/packages/serverpod_offline_sync_server/test/integration/test_tools/serverpod_test_tools.dart b/packages/serverpod_offline_sync_server/test/integration/test_tools/serverpod_test_tools.dart index 1084276..4ef1efb 100644 --- a/packages/serverpod_offline_sync_server/test/integration/test_tools/serverpod_test_tools.dart +++ b/packages/serverpod_offline_sync_server/test/integration/test_tools/serverpod_test_tools.dart @@ -39,6 +39,9 @@ export 'package:serverpod_test/serverpod_test_public_exports.dart'; /// /// [enableSessionLogging] Whether session logging should be enabled. Defaults to `false` /// +/// [ephemeralDatabase] Whether this group gets its own empty database, created when the group starts and dropped when it finishes. Defaults to `true`. +/// Set this to `false` to use the database configured for [runMode], including a previously seeded database. [configOverride] can still replace that database. The configured database is not created or dropped, so groups that share it cannot run in parallel. [rollbackDatabase] still controls whether writes inside the group are rolled back. +/// /// [rollbackDatabase] Options for when to rollback the database during the test lifecycle. /// By default `withServerpod` does all database operations inside a transaction that is rolled back after each `test` case. /// Just like the following enum describes, the behavior of the automatic rollbacks can be configured: @@ -108,6 +111,7 @@ void withServerpod( _is.ServerpodConfig Function(_is.ServerpodConfig)? configOverride, _is.DatabaseInterceptor? databaseInterceptor, bool? enableSessionLogging, + bool? ephemeralDatabase, _is.ExperimentalFeatures? experimentalFeatures, _ist.RollbackDatabase? rollbackDatabase, String? runMode, @@ -126,6 +130,7 @@ void withServerpod( serializationManager: Protocol(), runMode: runMode, applyMigrations: applyMigrations, + ephemeralDatabase: ephemeralDatabase, isDatabaseEnabled: true, serverpodLoggingMode: serverpodLoggingMode, testServerOutputMode: testServerOutputMode, diff --git a/pubspec.yaml b/pubspec.yaml index e546b4e..e3a4d0b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -15,7 +15,7 @@ workspace: dev_dependencies: melos: ^7.5.1 - serverpod_cli: 4.0.0 + serverpod_cli: ^4.0.0 # dependency_overrides: # serverpod: diff --git a/test/serverpod_offline_sync_test_client/lib/migrations/20260930185557154/definition.json b/test/serverpod_offline_sync_test_client/lib/migrations/20260930185557154/definition.json new file mode 100644 index 0000000..3f4bd8a --- /dev/null +++ b/test/serverpod_offline_sync_test_client/lib/migrations/20260930185557154/definition.json @@ -0,0 +1,6126 @@ +{ + "__className__": "serverpod.DatabaseDefinition", + "schemaVersion": 2, + "moduleName": "serverpod_offline_sync_test", + "tables": [ + { + "__className__": "serverpod.TableDefinition", + "name": "address", + "dartName": "Address", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "street", + "fieldName": "street", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "inhabitantId", + "fieldName": "inhabitantId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "address_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "address_fk_1", + "columns": [ + "inhabitantId" + ], + "referenceTable": "person", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 3 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "address__inhabitantId__unique_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "inhabitantId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "city", + "dartName": "City", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "city_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "company", + "dartName": "Company", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "townId", + "fieldName": "townId", + "columnType": 7, + "isNullable": false, + "columnDefault": "'550e8400-e29b-41d4-a716-446655440000'", + "dartType": "UuidValue" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "company_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "company_fk_1", + "columns": [ + "townId" + ], + "referenceTable": "town", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 1, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "fk_chain_cascade_middle", + "dartName": "FkChainCascadeMiddle", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rootId", + "fieldName": "rootId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_cascade_middle_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_cascade_middle_fk_1", + "columns": [ + "rootId" + ], + "referenceTable": "fk_chain_root", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "fk_chain_middle_cascade_child", + "dartName": "FkChainMiddleCascadeChild", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "restrictBlockerId", + "fieldName": "restrictBlockerId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_middle_cascade_child_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_middle_cascade_child_fk_1", + "columns": [ + "restrictBlockerId" + ], + "referenceTable": "fk_chain_restrict_blocker", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "fk_chain_middle_set_null_child", + "dartName": "FkChainMiddleSetNullChild", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "restrictBlockerId", + "fieldName": "restrictBlockerId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_middle_set_null_child_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_middle_set_null_child_fk_1", + "columns": [ + "restrictBlockerId" + ], + "referenceTable": "fk_chain_restrict_blocker", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "fk_chain_restrict_blocker", + "dartName": "FkChainRestrictBlocker", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "cascadeMiddleId", + "fieldName": "cascadeMiddleId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_restrict_blocker_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_restrict_blocker_fk_1", + "columns": [ + "cascadeMiddleId" + ], + "referenceTable": "fk_chain_cascade_middle", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 3, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "fk_chain_root", + "dartName": "FkChainRoot", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_root_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "fk_chain_set_null_cascade_child", + "dartName": "FkChainSetNullCascadeChild", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "setNullMiddleId", + "fieldName": "setNullMiddleId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_set_null_cascade_child_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_set_null_cascade_child_fk_1", + "columns": [ + "setNullMiddleId" + ], + "referenceTable": "fk_chain_set_null_middle", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "fk_chain_set_null_middle", + "dartName": "FkChainSetNullMiddle", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "cascadeMiddleId", + "fieldName": "cascadeMiddleId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_set_null_middle_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_set_null_middle_fk_1", + "columns": [ + "cascadeMiddleId" + ], + "referenceTable": "fk_chain_cascade_middle", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "fk_chain_set_null_restrict_child", + "dartName": "FkChainSetNullRestrictChild", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "setNullMiddleId", + "fieldName": "setNullMiddleId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_set_null_restrict_child_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_set_null_restrict_child_fk_1", + "columns": [ + "setNullMiddleId" + ], + "referenceTable": "fk_chain_set_null_middle", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 3, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "fk_chain_set_null_set_null_child", + "dartName": "FkChainSetNullSetNullChild", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "setNullMiddleId", + "fieldName": "setNullMiddleId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_set_null_set_null_child_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_set_null_set_null_child_fk_1", + "columns": [ + "setNullMiddleId" + ], + "referenceTable": "fk_chain_set_null_middle", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "nullable_set_default_child", + "dartName": "NullableSetDefaultChild", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "parentId", + "fieldName": "parentId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "nullable_set_default_child_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "nullable_set_default_child_fk_1", + "columns": [ + "parentId" + ], + "referenceTable": "person", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 1, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "organization", + "dartName": "Organization", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "cityId", + "fieldName": "cityId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "organization_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "organization_fk_1", + "columns": [ + "cityId" + ], + "referenceTable": "city", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "person", + "dartName": "Person", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "surname", + "fieldName": "surname", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "organizationId", + "fieldName": "organizationId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "oldCompanyId", + "fieldName": "oldCompanyId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "cityId", + "fieldName": "cityId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "person_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "person_fk_1", + "columns": [ + "organizationId" + ], + "referenceTable": "organization", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "person_fk_2", + "columns": [ + "oldCompanyId" + ], + "referenceTable": "company", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 3 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "person_fk_3", + "columns": [ + "cityId" + ], + "referenceTable": "city", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 3, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "required_cascade_child", + "dartName": "RequiredCascadeChild", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "parentId", + "fieldName": "parentId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "required_cascade_child_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "required_cascade_child_fk_1", + "columns": [ + "parentId" + ], + "referenceTable": "person", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "required_no_action_child", + "dartName": "RequiredNoActionChild", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "parentId", + "fieldName": "parentId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "required_no_action_child_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "required_no_action_child_fk_1", + "columns": [ + "parentId" + ], + "referenceTable": "person", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 3, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "required_set_null_child", + "dartName": "RequiredSetNullChild", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "parentId", + "fieldName": "parentId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "required_set_null_child_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "required_set_null_child_fk_1", + "columns": [ + "parentId" + ], + "referenceTable": "person", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "restrict_child", + "dartName": "RestrictChild", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "parentId", + "fieldName": "parentId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "restrict_child_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "restrict_child_fk_1", + "columns": [ + "parentId" + ], + "referenceTable": "person", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 3, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "shared_child", + "dartName": "SharedChild", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "flavor", + "fieldName": "flavor", + "columnType": 0, + "isNullable": false, + "columnDefault": "'plain'", + "dartType": "serverpod_offline_sync_test_shared:SharedFlavor" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "parentId", + "fieldName": "parentId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "shared_child_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "shared_child_fk_1", + "columns": [ + "parentId" + ], + "referenceTable": "shared_parent", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "shared_parent", + "dartName": "SharedParent", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "shared_parent_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "town", + "dartName": "Town", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "cityId", + "fieldName": "cityId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "mayorId", + "fieldName": "mayorId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "town_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "town_fk_1", + "columns": [ + "cityId" + ], + "referenceTable": "city", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "town_fk_2", + "columns": [ + "mayorId" + ], + "referenceTable": "person", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "types", + "dartName": "Types", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "aBool", + "fieldName": "aBool", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "aDateTime", + "fieldName": "aDateTime", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "aText", + "fieldName": "aText", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "anInt", + "fieldName": "anInt", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "anInt64", + "fieldName": "anInt64", + "columnType": 0, + "isNullable": false, + "dartType": "BigInt" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "aReal", + "fieldName": "aReal", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "aBlob", + "fieldName": "aBlob", + "columnType": 5, + "isNullable": false, + "dartType": "dart:typed_data:ByteData" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "anEnum", + "fieldName": "anEnum", + "columnType": 6, + "isNullable": true, + "dartType": "protocol:TypesEnum?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "optionalText", + "fieldName": "optionalText", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "optionalUuid", + "fieldName": "optionalUuid", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "parentId", + "fieldName": "parentId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "jsonDocument", + "fieldName": "jsonDocument", + "columnType": 8, + "isNullable": true, + "dartType": "protocol:SyncDocument?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "jsonbDocument", + "fieldName": "jsonbDocument", + "columnType": 14, + "isNullable": true, + "dartType": "protocol:SyncDocument?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "jsonbNumbers", + "fieldName": "jsonbNumbers", + "columnType": 14, + "isNullable": true, + "dartType": "List?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "types_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "types_fk_1", + "columns": [ + "parentId" + ], + "referenceTable": "types", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 3 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "types_a_text_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "aText" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "unique", + "dartName": "Unique", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "unique__spaceId__name__unique_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "spaceId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "name" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "unique_cascade_child", + "dartName": "UniqueCascadeChild", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "parentId", + "fieldName": "parentId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_cascade_child_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_cascade_child_fk_1", + "columns": [ + "parentId" + ], + "referenceTable": "person", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "unique_cascade_child__spaceId__name__unique_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "spaceId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "name" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "unique_cascade_reference", + "dartName": "UniqueCascadeReference", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "parentId", + "fieldName": "parentId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_cascade_reference_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_cascade_reference_fk_1", + "columns": [ + "parentId" + ], + "referenceTable": "person", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "unique_cascade_reference__parentId__unique_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "parentId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "unique_composite", + "dartName": "UniqueComposite", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "scope", + "fieldName": "scope", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "value", + "fieldName": "value", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_composite_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "unique_composite__spaceId__scope__value__unique_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "spaceId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "scope" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "value" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "unique_discriminator", + "dartName": "UniqueDiscriminator", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "categoryId", + "fieldName": "categoryId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_discriminator_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "unique_discriminator__spaceId__categoryId__name__unique_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "spaceId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "categoryId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "name" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "unique_fk_pair", + "dartName": "UniqueFkPair", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "leftId", + "fieldName": "leftId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rightId", + "fieldName": "rightId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_fk_pair_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_fk_pair_fk_1", + "columns": [ + "leftId" + ], + "referenceTable": "person", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 3, + "deferrable": "initiallyDeferred" + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_fk_pair_fk_2", + "columns": [ + "rightId" + ], + "referenceTable": "person", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "unique_fk_pair_parents", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "leftId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "rightId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "unique_mixed_fk", + "dartName": "UniqueMixedFk", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "parentId", + "fieldName": "parentId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_mixed_fk_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_mixed_fk_fk_1", + "columns": [ + "parentId" + ], + "referenceTable": "person", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "unique_mixed_fk_name_parent", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "spaceId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "name" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "parentId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "unique_no_release", + "dartName": "UniqueNoRelease", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "categoryId", + "fieldName": "categoryId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_no_release_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "unique_no_release__spaceId__categoryId__unique_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "spaceId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "categoryId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "unique_nullable", + "dartName": "UniqueNullable", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "value", + "fieldName": "value", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_nullable_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "unique_nullable__spaceId__value__unique_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "spaceId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "value" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "unique_overlapping", + "dartName": "UniqueOverlapping", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "first", + "fieldName": "first", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "second", + "fieldName": "second", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "third", + "fieldName": "third", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_overlapping_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "unique_overlapping_first_second", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "spaceId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "first" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "second" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "unique_overlapping_second_third", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "spaceId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "second" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "third" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "unique_set_default_child", + "dartName": "UniqueSetDefaultChild", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "parentId", + "fieldName": "parentId", + "columnType": 7, + "isNullable": true, + "columnDefault": "'550e8400-e29b-41d4-a716-446655440000'", + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_set_default_child_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_set_default_child_fk_1", + "columns": [ + "parentId" + ], + "referenceTable": "town", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 1, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "unique_set_default_child__parentId__unique_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "parentId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "unique_set_null_child", + "dartName": "UniqueSetNullChild", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "parentId", + "fieldName": "parentId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_set_null_child_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_set_null_child_fk_1", + "columns": [ + "parentId" + ], + "referenceTable": "person", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "unique_set_null_child__parentId__unique_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "parentId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "unique_uuid", + "dartName": "UniqueUuid", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "value", + "fieldName": "value", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_uuid_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "unique_uuid__spaceId__value__unique_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "spaceId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "value" + } + ], + "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_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 + }, + { + "__className__": "serverpod.TableDefinition", + "name": "crdt_data_attempted_value", + "dartName": "CrdtDataAttemptedValue", + "module": "serverpod_offline_sync", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fieldId", + "fieldName": "fieldId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "value", + "fieldName": "value", + "columnType": 14, + "isNullable": false, + "dartType": "dynamic" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "projectionReason", + "fieldName": "projectionReason", + "columnType": 6, + "isNullable": false, + "dartType": "serverpod_offline_sync:CrdtProjectionReason" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "crdt_data_attempted_value_fk_0", + "columns": [ + "fieldId" + ], + "referenceTable": "crdt_data_fields", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "crdt_data_attempted_value__fieldId__unique_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fieldId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "crdt_data_fields", + "dartName": "CrdtDataField", + "module": "serverpod_offline_sync", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "hlcDatetime", + "fieldName": "hlcDatetime", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "hlcCounter", + "fieldName": "hlcCounter", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rowId", + "fieldName": "rowId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "columnId", + "fieldName": "columnId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "nodeId", + "fieldName": "nodeId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "crdt_data_fields_fk_0", + "columns": [ + "rowId" + ], + "referenceTable": "crdt_data_rows", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "crdt_data_fields_fk_1", + "columns": [ + "columnId" + ], + "referenceTable": "crdt_schema_columns", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "crdt_data_fields_fk_2", + "columns": [ + "nodeId" + ], + "referenceTable": "crdt_nodes", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 3 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "crdt_data_fields_row_column_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "rowId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "columnId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "crdt_data_rows", + "dartName": "CrdtDataRow", + "module": "serverpod_offline_sync", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "hlcDatetime", + "fieldName": "hlcDatetime", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "hlcCounter", + "fieldName": "hlcCounter", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "tblId", + "fieldName": "tblId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "uuidRowId", + "fieldName": "uuidRowId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "nodeId", + "fieldName": "nodeId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "visibility", + "fieldName": "visibility", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "serverpod_offline_sync:CrdtDataRowVisibility" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "crdt_data_rows_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "crdt_data_rows_fk_1", + "columns": [ + "tblId" + ], + "referenceTable": "crdt_schema_tables", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "crdt_data_rows_fk_2", + "columns": [ + "nodeId" + ], + "referenceTable": "crdt_nodes", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 3 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "crdt_data_rows_space_tbl_row_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "spaceId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "tblId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "uuidRowId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "crdt_data_tombstone", + "dartName": "CrdtDataDeleted", + "module": "serverpod_offline_sync", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "hlcDatetime", + "fieldName": "hlcDatetime", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "hlcCounter", + "fieldName": "hlcCounter", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rowId", + "fieldName": "rowId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "nodeId", + "fieldName": "nodeId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "clFlag", + "fieldName": "clFlag", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "reason", + "fieldName": "reason", + "columnType": 6, + "isNullable": false, + "dartType": "serverpod_offline_sync:CrdtDataDeletedReason" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "crdt_data_tombstone_fk_0", + "columns": [ + "rowId" + ], + "referenceTable": "crdt_data_rows", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "crdt_data_tombstone_fk_1", + "columns": [ + "nodeId" + ], + "referenceTable": "crdt_nodes", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 3 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "crdt_data_tombstone_row_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "rowId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "crdt_nodes", + "dartName": "CrdtNode", + "module": "serverpod_offline_sync", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "uuidNodeId", + "fieldName": "uuidNodeId", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastHlc", + "fieldName": "lastHlc", + "columnType": 14, + "isNullable": true, + "dartType": "package:serverpod_offline_sync/serverpod_offline_sync.dart:Hlc?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "crdt_nodes__uuidNodeId__unique_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "uuidNodeId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "crdt_schema_columns", + "dartName": "CrdtSchemaColumn", + "module": "serverpod_offline_sync", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "tblId", + "fieldName": "tblId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "columnType", + "fieldName": "columnType", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "dartType", + "fieldName": "dartType", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "isNullable", + "fieldName": "isNullable", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "crdt_schema_columns_fk_0", + "columns": [ + "tblId" + ], + "referenceTable": "crdt_schema_tables", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "crdt_schema_columns_table_column_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "tblId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "name" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "crdt_schema_tables", + "dartName": "CrdtSchemaTable", + "module": "serverpod_offline_sync", + "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" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "crdt_schema_tables__name__unique_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "name" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "offline_sync_integrity_violations", + "dartName": "OfflineSyncIntegrityViolation", + "module": "serverpod_offline_sync", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "type", + "fieldName": "type", + "columnType": 0, + "isNullable": false, + "dartType": "serverpod_offline_sync:OfflineSyncViolationType" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "domainTableName", + "fieldName": "domainTableName", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "uuidRowId", + "fieldName": "uuidRowId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "ownerSpaceUuid", + "fieldName": "ownerSpaceUuid", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "incomingSpaceUuid", + "fieldName": "incomingSpaceUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "operation", + "fieldName": "operation", + "columnType": 0, + "isNullable": false, + "dartType": "serverpod_offline_sync:OfflineSyncViolationOperation" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "uuidNodeId", + "fieldName": "uuidNodeId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "crdtDataRowId", + "fieldName": "crdtDataRowId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "hlcDatetime", + "fieldName": "hlcDatetime", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "hlcCounter", + "fieldName": "hlcCounter", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "firstSeenAt", + "fieldName": "firstSeenAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastSeenAt", + "fieldName": "lastSeenAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "occurrences", + "fieldName": "occurrences", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "offline_sync_integrity_violations_key_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "type" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "operation" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "domainTableName" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "uuidRowId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "ownerSpaceUuid" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "incomingSpaceUuid" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "offline_sync_space_members", + "dartName": "OfflineSyncSpaceMember", + "module": "serverpod_offline_sync", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userUuid", + "fieldName": "userUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "role", + "fieldName": "role", + "columnType": 0, + "isNullable": false, + "dartType": "serverpod_offline_sync:OfflineSyncSpaceRole" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "offline_sync_space_members_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "offline_sync_space_member_unique_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userUuid" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "spaceId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "offline_sync_space_nodes", + "dartName": "OfflineSyncSpaceNode", + "module": "serverpod_offline_sync", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "nodeId", + "fieldName": "nodeId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastReceivedHlc", + "fieldName": "lastReceivedHlc", + "columnType": 14, + "isNullable": true, + "dartType": "package:serverpod_offline_sync/serverpod_offline_sync.dart:Hlc?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "offline_sync_space_nodes_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "offline_sync_space_nodes_fk_1", + "columns": [ + "nodeId" + ], + "referenceTable": "crdt_nodes", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "offline_sync_space_node_unique_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "spaceId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "nodeId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "offline_sync_spaces", + "dartName": "OfflineSyncSpace", + "module": "serverpod_offline_sync", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "uuidSpaceId", + "fieldName": "uuidSpaceId", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "currentNodeId", + "fieldName": "currentNodeId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "offline_sync_spaces_fk_0", + "columns": [ + "currentNodeId" + ], + "referenceTable": "crdt_nodes", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 3 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "offline_sync_spaces__uuidSpaceId__unique_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "uuidSpaceId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + } + ], + "installedModules": [ + { + "__className__": "serverpod.DatabaseMigrationVersionModel", + "module": "serverpod_offline_sync_test", + "version": "20260930185557154" + }, + { + "__className__": "serverpod.DatabaseMigrationVersion", + "module": "serverpod", + "version": "20260824182259319" + }, + { + "__className__": "serverpod.DatabaseMigrationVersion", + "module": "serverpod_auth_core", + "version": "20260924105232991" + }, + { + "__className__": "serverpod.DatabaseMigrationVersion", + "module": "serverpod_offline_sync", + "version": "20260914143806119" + } + ], + "migrationApiVersion": 1 +} \ No newline at end of file diff --git a/test/serverpod_offline_sync_test_client/lib/migrations/20260930185557154/definition_project.json b/test/serverpod_offline_sync_test_client/lib/migrations/20260930185557154/definition_project.json new file mode 100644 index 0000000..a4e3690 --- /dev/null +++ b/test/serverpod_offline_sync_test_client/lib/migrations/20260930185557154/definition_project.json @@ -0,0 +1,3050 @@ +{ + "__className__": "serverpod.DatabaseDefinition", + "schemaVersion": 2, + "moduleName": "serverpod_offline_sync_test", + "tables": [ + { + "__className__": "serverpod.TableDefinition", + "name": "address", + "dartName": "Address", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "street", + "fieldName": "street", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "inhabitantId", + "fieldName": "inhabitantId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "address_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "address_fk_1", + "columns": [ + "inhabitantId" + ], + "referenceTable": "person", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 3 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "address__inhabitantId__unique_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "inhabitantId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "city", + "dartName": "City", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "city_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "company", + "dartName": "Company", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "townId", + "fieldName": "townId", + "columnType": 7, + "isNullable": false, + "columnDefault": "'550e8400-e29b-41d4-a716-446655440000'", + "dartType": "UuidValue" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "company_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "company_fk_1", + "columns": [ + "townId" + ], + "referenceTable": "town", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 1, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "fk_chain_cascade_middle", + "dartName": "FkChainCascadeMiddle", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rootId", + "fieldName": "rootId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_cascade_middle_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_cascade_middle_fk_1", + "columns": [ + "rootId" + ], + "referenceTable": "fk_chain_root", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "fk_chain_middle_cascade_child", + "dartName": "FkChainMiddleCascadeChild", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "restrictBlockerId", + "fieldName": "restrictBlockerId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_middle_cascade_child_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_middle_cascade_child_fk_1", + "columns": [ + "restrictBlockerId" + ], + "referenceTable": "fk_chain_restrict_blocker", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "fk_chain_middle_set_null_child", + "dartName": "FkChainMiddleSetNullChild", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "restrictBlockerId", + "fieldName": "restrictBlockerId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_middle_set_null_child_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_middle_set_null_child_fk_1", + "columns": [ + "restrictBlockerId" + ], + "referenceTable": "fk_chain_restrict_blocker", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "fk_chain_restrict_blocker", + "dartName": "FkChainRestrictBlocker", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "cascadeMiddleId", + "fieldName": "cascadeMiddleId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_restrict_blocker_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_restrict_blocker_fk_1", + "columns": [ + "cascadeMiddleId" + ], + "referenceTable": "fk_chain_cascade_middle", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 3, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "fk_chain_root", + "dartName": "FkChainRoot", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_root_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "fk_chain_set_null_cascade_child", + "dartName": "FkChainSetNullCascadeChild", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "setNullMiddleId", + "fieldName": "setNullMiddleId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_set_null_cascade_child_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_set_null_cascade_child_fk_1", + "columns": [ + "setNullMiddleId" + ], + "referenceTable": "fk_chain_set_null_middle", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "fk_chain_set_null_middle", + "dartName": "FkChainSetNullMiddle", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "cascadeMiddleId", + "fieldName": "cascadeMiddleId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_set_null_middle_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_set_null_middle_fk_1", + "columns": [ + "cascadeMiddleId" + ], + "referenceTable": "fk_chain_cascade_middle", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "fk_chain_set_null_restrict_child", + "dartName": "FkChainSetNullRestrictChild", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "setNullMiddleId", + "fieldName": "setNullMiddleId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_set_null_restrict_child_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_set_null_restrict_child_fk_1", + "columns": [ + "setNullMiddleId" + ], + "referenceTable": "fk_chain_set_null_middle", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 3, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "fk_chain_set_null_set_null_child", + "dartName": "FkChainSetNullSetNullChild", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "setNullMiddleId", + "fieldName": "setNullMiddleId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_set_null_set_null_child_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_set_null_set_null_child_fk_1", + "columns": [ + "setNullMiddleId" + ], + "referenceTable": "fk_chain_set_null_middle", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "nullable_set_default_child", + "dartName": "NullableSetDefaultChild", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "parentId", + "fieldName": "parentId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "nullable_set_default_child_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "nullable_set_default_child_fk_1", + "columns": [ + "parentId" + ], + "referenceTable": "person", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 1, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "organization", + "dartName": "Organization", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "cityId", + "fieldName": "cityId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "organization_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "organization_fk_1", + "columns": [ + "cityId" + ], + "referenceTable": "city", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "person", + "dartName": "Person", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "surname", + "fieldName": "surname", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "organizationId", + "fieldName": "organizationId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "oldCompanyId", + "fieldName": "oldCompanyId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "cityId", + "fieldName": "cityId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "person_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "person_fk_1", + "columns": [ + "organizationId" + ], + "referenceTable": "organization", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "person_fk_2", + "columns": [ + "oldCompanyId" + ], + "referenceTable": "company", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 3 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "person_fk_3", + "columns": [ + "cityId" + ], + "referenceTable": "city", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 3, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "required_cascade_child", + "dartName": "RequiredCascadeChild", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "parentId", + "fieldName": "parentId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "required_cascade_child_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "required_cascade_child_fk_1", + "columns": [ + "parentId" + ], + "referenceTable": "person", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "required_no_action_child", + "dartName": "RequiredNoActionChild", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "parentId", + "fieldName": "parentId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "required_no_action_child_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "required_no_action_child_fk_1", + "columns": [ + "parentId" + ], + "referenceTable": "person", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 3, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "required_set_null_child", + "dartName": "RequiredSetNullChild", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "parentId", + "fieldName": "parentId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "required_set_null_child_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "required_set_null_child_fk_1", + "columns": [ + "parentId" + ], + "referenceTable": "person", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "restrict_child", + "dartName": "RestrictChild", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "parentId", + "fieldName": "parentId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "restrict_child_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "restrict_child_fk_1", + "columns": [ + "parentId" + ], + "referenceTable": "person", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 3, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "shared_child", + "dartName": "SharedChild", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "flavor", + "fieldName": "flavor", + "columnType": 0, + "isNullable": false, + "columnDefault": "'plain'", + "dartType": "serverpod_offline_sync_test_shared:SharedFlavor" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "parentId", + "fieldName": "parentId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "shared_child_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "shared_child_fk_1", + "columns": [ + "parentId" + ], + "referenceTable": "shared_parent", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "shared_parent", + "dartName": "SharedParent", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "shared_parent_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "town", + "dartName": "Town", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "cityId", + "fieldName": "cityId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "mayorId", + "fieldName": "mayorId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "town_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "town_fk_1", + "columns": [ + "cityId" + ], + "referenceTable": "city", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "town_fk_2", + "columns": [ + "mayorId" + ], + "referenceTable": "person", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "types", + "dartName": "Types", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "aBool", + "fieldName": "aBool", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "aDateTime", + "fieldName": "aDateTime", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "aText", + "fieldName": "aText", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "anInt", + "fieldName": "anInt", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "anInt64", + "fieldName": "anInt64", + "columnType": 0, + "isNullable": false, + "dartType": "BigInt" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "aReal", + "fieldName": "aReal", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "aBlob", + "fieldName": "aBlob", + "columnType": 5, + "isNullable": false, + "dartType": "dart:typed_data:ByteData" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "anEnum", + "fieldName": "anEnum", + "columnType": 6, + "isNullable": true, + "dartType": "protocol:TypesEnum?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "optionalText", + "fieldName": "optionalText", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "optionalUuid", + "fieldName": "optionalUuid", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "parentId", + "fieldName": "parentId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "jsonDocument", + "fieldName": "jsonDocument", + "columnType": 8, + "isNullable": true, + "dartType": "protocol:SyncDocument?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "jsonbDocument", + "fieldName": "jsonbDocument", + "columnType": 14, + "isNullable": true, + "dartType": "protocol:SyncDocument?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "jsonbNumbers", + "fieldName": "jsonbNumbers", + "columnType": 14, + "isNullable": true, + "dartType": "List?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "types_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "types_fk_1", + "columns": [ + "parentId" + ], + "referenceTable": "types", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 3 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "types_a_text_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "aText" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "unique", + "dartName": "Unique", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "unique__spaceId__name__unique_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "spaceId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "name" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "unique_cascade_child", + "dartName": "UniqueCascadeChild", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "parentId", + "fieldName": "parentId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_cascade_child_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_cascade_child_fk_1", + "columns": [ + "parentId" + ], + "referenceTable": "person", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "unique_cascade_child__spaceId__name__unique_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "spaceId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "name" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "unique_cascade_reference", + "dartName": "UniqueCascadeReference", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "parentId", + "fieldName": "parentId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_cascade_reference_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_cascade_reference_fk_1", + "columns": [ + "parentId" + ], + "referenceTable": "person", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "unique_cascade_reference__parentId__unique_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "parentId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "unique_composite", + "dartName": "UniqueComposite", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "scope", + "fieldName": "scope", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "value", + "fieldName": "value", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_composite_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "unique_composite__spaceId__scope__value__unique_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "spaceId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "scope" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "value" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "unique_discriminator", + "dartName": "UniqueDiscriminator", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "categoryId", + "fieldName": "categoryId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_discriminator_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "unique_discriminator__spaceId__categoryId__name__unique_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "spaceId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "categoryId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "name" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "unique_fk_pair", + "dartName": "UniqueFkPair", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "leftId", + "fieldName": "leftId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rightId", + "fieldName": "rightId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_fk_pair_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_fk_pair_fk_1", + "columns": [ + "leftId" + ], + "referenceTable": "person", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 3, + "deferrable": "initiallyDeferred" + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_fk_pair_fk_2", + "columns": [ + "rightId" + ], + "referenceTable": "person", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "unique_fk_pair_parents", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "leftId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "rightId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "unique_mixed_fk", + "dartName": "UniqueMixedFk", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "parentId", + "fieldName": "parentId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_mixed_fk_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_mixed_fk_fk_1", + "columns": [ + "parentId" + ], + "referenceTable": "person", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "unique_mixed_fk_name_parent", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "spaceId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "name" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "parentId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "unique_no_release", + "dartName": "UniqueNoRelease", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "categoryId", + "fieldName": "categoryId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_no_release_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "unique_no_release__spaceId__categoryId__unique_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "spaceId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "categoryId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "unique_nullable", + "dartName": "UniqueNullable", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "value", + "fieldName": "value", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_nullable_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "unique_nullable__spaceId__value__unique_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "spaceId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "value" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "unique_overlapping", + "dartName": "UniqueOverlapping", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "first", + "fieldName": "first", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "second", + "fieldName": "second", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "third", + "fieldName": "third", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_overlapping_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "unique_overlapping_first_second", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "spaceId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "first" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "second" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "unique_overlapping_second_third", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "spaceId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "second" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "third" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "unique_set_default_child", + "dartName": "UniqueSetDefaultChild", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "parentId", + "fieldName": "parentId", + "columnType": 7, + "isNullable": true, + "columnDefault": "'550e8400-e29b-41d4-a716-446655440000'", + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_set_default_child_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_set_default_child_fk_1", + "columns": [ + "parentId" + ], + "referenceTable": "town", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 1, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "unique_set_default_child__parentId__unique_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "parentId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "unique_set_null_child", + "dartName": "UniqueSetNullChild", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "parentId", + "fieldName": "parentId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_set_null_child_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_set_null_child_fk_1", + "columns": [ + "parentId" + ], + "referenceTable": "person", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "unique_set_null_child__parentId__unique_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "parentId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "unique_uuid", + "dartName": "UniqueUuid", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "value", + "fieldName": "value", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_uuid_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "unique_uuid__spaceId__value__unique_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "spaceId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "value" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + } + ], + "installedModules": [ + { + "__className__": "serverpod.DatabaseMigrationVersion", + "module": "serverpod", + "version": "20260824182259319" + }, + { + "__className__": "serverpod.DatabaseMigrationVersion", + "module": "serverpod_auth_core", + "version": "20260924105232991" + }, + { + "__className__": "serverpod.DatabaseMigrationVersion", + "module": "serverpod_offline_sync", + "version": "20260914143806119" + } + ], + "migrationApiVersion": 1 +} \ No newline at end of file diff --git a/test/serverpod_offline_sync_test_client/lib/migrations/20260930185557154/migration.dart b/test/serverpod_offline_sync_test_client/lib/migrations/20260930185557154/migration.dart new file mode 100644 index 0000000..4f6f2ec --- /dev/null +++ b/test/serverpod_offline_sync_test_client/lib/migrations/20260930185557154/migration.dart @@ -0,0 +1,1475 @@ +/// AUTOGENERATED BY SERVERPOD create-migration - DO NOT EDIT BY HAND +/// Merging: resolve registry conflicts the same as migration_registry.txt. +part of '../migration_registry.dart'; + +class _Migration20260930185557154 implements MigrationVersionSql { + @override + String get version => '20260930185557154'; + + @override + String get moduleName => 'serverpod_offline_sync_test'; + + @override + String get migrationSql => '''BEGIN; + +-- +-- ACTION ALTER TABLE +-- +CREATE TABLE "new_serverpod_auth_core_profile" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "authUserId" BLOB NOT NULL, + "userName" TEXT, + "fullName" TEXT, + "email" TEXT, + "createdAt" INTEGER NOT NULL DEFAULT (CAST(unixepoch('subsecond') * 1000 AS INTEGER)), + "imageId" BLOB, + CONSTRAINT "serverpod_auth_core_profile_fk_0" FOREIGN KEY ("authUserId") REFERENCES "serverpod_auth_core_user" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "serverpod_auth_core_profile_fk_1" FOREIGN KEY ("imageId") REFERENCES "serverpod_auth_core_profile_image" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED +) STRICT; + +INSERT INTO "new_serverpod_auth_core_profile" ("id", "authUserId", "userName", "fullName", "email", "createdAt", "imageId") SELECT "id", "authUserId", "userName", "fullName", "email", "createdAt", "imageId" FROM "serverpod_auth_core_profile"; +DROP TABLE "serverpod_auth_core_profile"; +ALTER TABLE "new_serverpod_auth_core_profile" RENAME TO "serverpod_auth_core_profile"; + +-- Indexes +CREATE UNIQUE INDEX "serverpod_auth_profile_user_profile_email_auth_user_id" ON "serverpod_auth_core_profile" ("authUserId"); + +-- +-- STORE COLUMN TYPES FOR MIGRATIONS +-- +DROP TABLE IF EXISTS "serverpod_sqlite_schema"; + +CREATE TABLE "serverpod_sqlite_schema" ( + "table_name" TEXT NOT NULL, + "column_name" TEXT NOT NULL, + "column_type" TEXT NOT NULL, + "column_vector_dimension" INTEGER, + PRIMARY KEY ("table_name", "column_name") +); + +INSERT INTO "serverpod_sqlite_schema" VALUES + ('address', 'id', 'uuid', NULL), + ('address', 'inhabitantId', 'uuid', NULL), + ('city', 'id', 'uuid', NULL), + ('company', 'id', 'uuid', NULL), + ('company', 'townId', 'uuid', NULL), + ('fk_chain_cascade_middle', 'id', 'uuid', NULL), + ('fk_chain_cascade_middle', 'rootId', 'uuid', NULL), + ('fk_chain_middle_cascade_child', 'id', 'uuid', NULL), + ('fk_chain_middle_cascade_child', 'restrictBlockerId', 'uuid', NULL), + ('fk_chain_middle_set_null_child', 'id', 'uuid', NULL), + ('fk_chain_middle_set_null_child', 'restrictBlockerId', 'uuid', NULL), + ('fk_chain_restrict_blocker', 'id', 'uuid', NULL), + ('fk_chain_restrict_blocker', 'cascadeMiddleId', 'uuid', NULL), + ('fk_chain_root', 'id', 'uuid', NULL), + ('fk_chain_set_null_cascade_child', 'id', 'uuid', NULL), + ('fk_chain_set_null_cascade_child', 'setNullMiddleId', 'uuid', NULL), + ('fk_chain_set_null_middle', 'id', 'uuid', NULL), + ('fk_chain_set_null_middle', 'cascadeMiddleId', 'uuid', NULL), + ('fk_chain_set_null_restrict_child', 'id', 'uuid', NULL), + ('fk_chain_set_null_restrict_child', 'setNullMiddleId', 'uuid', NULL), + ('fk_chain_set_null_set_null_child', 'id', 'uuid', NULL), + ('fk_chain_set_null_set_null_child', 'setNullMiddleId', 'uuid', NULL), + ('nullable_set_default_child', 'id', 'uuid', NULL), + ('nullable_set_default_child', 'parentId', 'uuid', NULL), + ('organization', 'id', 'uuid', NULL), + ('organization', 'cityId', 'uuid', NULL), + ('person', 'id', 'uuid', NULL), + ('person', 'organizationId', 'uuid', NULL), + ('person', 'oldCompanyId', 'uuid', NULL), + ('person', 'cityId', 'uuid', NULL), + ('required_cascade_child', 'id', 'uuid', NULL), + ('required_cascade_child', 'parentId', 'uuid', NULL), + ('required_no_action_child', 'id', 'uuid', NULL), + ('required_no_action_child', 'parentId', 'uuid', NULL), + ('required_set_null_child', 'id', 'uuid', NULL), + ('required_set_null_child', 'parentId', 'uuid', NULL), + ('restrict_child', 'id', 'uuid', NULL), + ('restrict_child', 'parentId', 'uuid', NULL), + ('shared_child', 'id', 'uuid', NULL), + ('shared_child', 'parentId', 'uuid', NULL), + ('shared_parent', 'id', 'uuid', NULL), + ('town', 'id', 'uuid', NULL), + ('town', 'cityId', 'uuid', NULL), + ('town', 'mayorId', 'uuid', NULL), + ('types', 'id', 'uuid', NULL), + ('types', 'aBool', 'boolean', NULL), + ('types', 'aDateTime', 'timestampWithoutTimeZone', NULL), + ('types', 'optionalUuid', 'uuid', NULL), + ('types', 'parentId', 'uuid', NULL), + ('types', 'jsonDocument', 'json', NULL), + ('types', 'jsonbDocument', 'jsonb', NULL), + ('types', 'jsonbNumbers', 'jsonb', NULL), + ('unique', 'id', 'uuid', NULL), + ('unique_cascade_child', 'id', 'uuid', NULL), + ('unique_cascade_child', 'parentId', 'uuid', NULL), + ('unique_cascade_reference', 'id', 'uuid', NULL), + ('unique_cascade_reference', 'parentId', 'uuid', NULL), + ('unique_composite', 'id', 'uuid', NULL), + ('unique_discriminator', 'id', 'uuid', NULL), + ('unique_fk_pair', 'id', 'uuid', NULL), + ('unique_fk_pair', 'leftId', 'uuid', NULL), + ('unique_fk_pair', 'rightId', 'uuid', NULL), + ('unique_mixed_fk', 'id', 'uuid', NULL), + ('unique_mixed_fk', 'parentId', 'uuid', NULL), + ('unique_no_release', 'id', 'uuid', NULL), + ('unique_nullable', 'id', 'uuid', NULL), + ('unique_overlapping', 'id', 'uuid', NULL), + ('unique_set_default_child', 'id', 'uuid', NULL), + ('unique_set_default_child', 'parentId', 'uuid', NULL), + ('unique_set_null_child', 'id', 'uuid', NULL), + ('unique_set_null_child', 'parentId', 'uuid', NULL), + ('unique_uuid', 'id', 'uuid', NULL), + ('unique_uuid', 'value', 'uuid', NULL), + ('serverpod_cloud_storage', 'addedTime', 'timestampWithoutTimeZone', NULL), + ('serverpod_cloud_storage', 'expiration', 'timestampWithoutTimeZone', NULL), + ('serverpod_cloud_storage', 'verified', 'boolean', NULL), + ('serverpod_cloud_storage_direct_download', 'expiration', 'timestampWithoutTimeZone', NULL), + ('serverpod_cloud_storage_direct_upload', 'expiration', 'timestampWithoutTimeZone', NULL), + ('serverpod_cloud_storage_direct_upload', 'preventOverwrite', 'boolean', NULL), + ('serverpod_future_call', 'time', 'timestampWithoutTimeZone', NULL), + ('serverpod_future_call', 'scheduling', 'json', NULL), + ('serverpod_future_call_claim', 'lastHeartbeatTime', 'timestampWithoutTimeZone', NULL), + ('serverpod_health_connection_info', 'timestamp', 'timestampWithoutTimeZone', NULL), + ('serverpod_health_metric', 'timestamp', 'timestampWithoutTimeZone', NULL), + ('serverpod_health_metric', 'isHealthy', 'boolean', NULL), + ('serverpod_log', 'time', 'timestampWithoutTimeZone', NULL), + ('serverpod_message_log', 'slow', 'boolean', NULL), + ('serverpod_migrations', 'timestamp', 'timestampWithoutTimeZone', NULL), + ('serverpod_query_log', 'slow', 'boolean', NULL), + ('serverpod_runtime_settings', 'logSettings', 'json', NULL), + ('serverpod_runtime_settings', 'logSettingsOverrides', 'json', NULL), + ('serverpod_runtime_settings', 'logServiceCalls', 'boolean', NULL), + ('serverpod_runtime_settings', 'logMalformedCalls', 'boolean', NULL), + ('serverpod_session_log', 'time', 'timestampWithoutTimeZone', NULL), + ('serverpod_session_log', 'slow', 'boolean', NULL), + ('serverpod_session_log', 'isOpen', 'boolean', NULL), + ('serverpod_session_log', 'touched', 'timestampWithoutTimeZone', NULL), + ('serverpod_auth_core_jwt_refresh_token', 'id', 'uuid', NULL), + ('serverpod_auth_core_jwt_refresh_token', 'authUserId', 'uuid', NULL), + ('serverpod_auth_core_jwt_refresh_token', 'scopeNames', 'json', NULL), + ('serverpod_auth_core_jwt_refresh_token', 'lastUpdatedAt', 'timestampWithoutTimeZone', NULL), + ('serverpod_auth_core_jwt_refresh_token', 'createdAt', 'timestampWithoutTimeZone', NULL), + ('serverpod_auth_core_profile', 'id', 'uuid', NULL), + ('serverpod_auth_core_profile', 'authUserId', 'uuid', NULL), + ('serverpod_auth_core_profile', 'createdAt', 'timestampWithoutTimeZone', NULL), + ('serverpod_auth_core_profile', 'imageId', 'uuid', NULL), + ('serverpod_auth_core_profile_image', 'id', 'uuid', NULL), + ('serverpod_auth_core_profile_image', 'userProfileId', 'uuid', NULL), + ('serverpod_auth_core_profile_image', 'createdAt', 'timestampWithoutTimeZone', NULL), + ('serverpod_auth_core_session', 'id', 'uuid', NULL), + ('serverpod_auth_core_session', 'authUserId', 'uuid', NULL), + ('serverpod_auth_core_session', 'scopeNames', 'json', NULL), + ('serverpod_auth_core_session', 'createdAt', 'timestampWithoutTimeZone', NULL), + ('serverpod_auth_core_session', 'lastUsedAt', 'timestampWithoutTimeZone', NULL), + ('serverpod_auth_core_session', 'expiresAt', 'timestampWithoutTimeZone', NULL), + ('serverpod_auth_core_user', 'id', 'uuid', NULL), + ('serverpod_auth_core_user', 'createdAt', 'timestampWithoutTimeZone', NULL), + ('serverpod_auth_core_user', 'scopeNames', 'json', NULL), + ('serverpod_auth_core_user', 'blocked', 'boolean', NULL), + ('crdt_data_attempted_value', 'value', 'jsonb', NULL), + ('crdt_data_fields', 'hlcDatetime', 'timestampWithoutTimeZone', NULL), + ('crdt_data_rows', 'hlcDatetime', 'timestampWithoutTimeZone', NULL), + ('crdt_data_rows', 'uuidRowId', 'uuid', NULL), + ('crdt_data_tombstone', 'hlcDatetime', 'timestampWithoutTimeZone', NULL), + ('crdt_nodes', 'uuidNodeId', 'uuid', NULL), + ('crdt_nodes', 'lastHlc', 'jsonb', NULL), + ('crdt_schema_columns', 'isNullable', 'boolean', NULL), + ('offline_sync_integrity_violations', 'uuidRowId', 'uuid', NULL), + ('offline_sync_integrity_violations', 'ownerSpaceUuid', 'uuid', NULL), + ('offline_sync_integrity_violations', 'incomingSpaceUuid', 'uuid', NULL), + ('offline_sync_integrity_violations', 'uuidNodeId', 'uuid', NULL), + ('offline_sync_integrity_violations', 'hlcDatetime', 'timestampWithoutTimeZone', NULL), + ('offline_sync_integrity_violations', 'firstSeenAt', 'timestampWithoutTimeZone', NULL), + ('offline_sync_integrity_violations', 'lastSeenAt', 'timestampWithoutTimeZone', NULL), + ('offline_sync_space_members', 'userUuid', 'uuid', NULL), + ('offline_sync_space_nodes', 'lastReceivedHlc', 'jsonb', NULL), + ('offline_sync_spaces', 'uuidSpaceId', 'uuid', NULL); + +-- +-- MIGRATION VERSION FOR serverpod_offline_sync_test +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod_offline_sync_test', '20260930185557154', (unixepoch('now', 'subsecond') * 1000)) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20260930185557154', "timestamp" = (unixepoch('now', 'subsecond') * 1000); + +-- +-- MIGRATION VERSION FOR serverpod +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod', '20260824182259319', (unixepoch('now', 'subsecond') * 1000)) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20260824182259319', "timestamp" = (unixepoch('now', 'subsecond') * 1000); + +-- +-- MIGRATION VERSION FOR serverpod_auth_core +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod_auth_core', '20260924105232991', (unixepoch('now', 'subsecond') * 1000)) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20260924105232991', "timestamp" = (unixepoch('now', 'subsecond') * 1000); + +-- +-- MIGRATION VERSION FOR serverpod_offline_sync +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod_offline_sync', '20260914143806119', (unixepoch('now', 'subsecond') * 1000)) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20260914143806119', "timestamp" = (unixepoch('now', 'subsecond') * 1000); + + +COMMIT; +'''; + + @override + String get definitionSql => '''BEGIN; + +-- +-- Class Address as table address +-- +CREATE TABLE "address" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "street" TEXT NOT NULL, + "inhabitantId" BLOB, + CONSTRAINT "address_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "address_fk_1" FOREIGN KEY ("inhabitantId") REFERENCES "person" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "address__inhabitantId__unique_idx" ON "address" ("inhabitantId"); + + +-- +-- Class City as table city +-- +CREATE TABLE "city" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "name" TEXT NOT NULL, + CONSTRAINT "city_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION +) STRICT; + + +-- +-- Class Company as table company +-- +CREATE TABLE "company" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "name" TEXT NOT NULL, + "townId" BLOB NOT NULL DEFAULT (X'550e8400e29b41d4a716446655440000'), + CONSTRAINT "company_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "company_fk_1" FOREIGN KEY ("townId") REFERENCES "town" ("id") ON DELETE SET DEFAULT ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED +) STRICT; + + +-- +-- Class FkChainCascadeMiddle as table fk_chain_cascade_middle +-- +CREATE TABLE "fk_chain_cascade_middle" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "name" TEXT NOT NULL, + "rootId" BLOB, + CONSTRAINT "fk_chain_cascade_middle_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "fk_chain_cascade_middle_fk_1" FOREIGN KEY ("rootId") REFERENCES "fk_chain_root" ("id") ON DELETE CASCADE ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED +) STRICT; + + +-- +-- Class FkChainMiddleCascadeChild as table fk_chain_middle_cascade_child +-- +CREATE TABLE "fk_chain_middle_cascade_child" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "name" TEXT NOT NULL, + "restrictBlockerId" BLOB, + CONSTRAINT "fk_chain_middle_cascade_child_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "fk_chain_middle_cascade_child_fk_1" FOREIGN KEY ("restrictBlockerId") REFERENCES "fk_chain_restrict_blocker" ("id") ON DELETE CASCADE ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED +) STRICT; + + +-- +-- Class FkChainMiddleSetNullChild as table fk_chain_middle_set_null_child +-- +CREATE TABLE "fk_chain_middle_set_null_child" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "name" TEXT NOT NULL, + "restrictBlockerId" BLOB, + CONSTRAINT "fk_chain_middle_set_null_child_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "fk_chain_middle_set_null_child_fk_1" FOREIGN KEY ("restrictBlockerId") REFERENCES "fk_chain_restrict_blocker" ("id") ON DELETE SET NULL ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED +) STRICT; + + +-- +-- Class FkChainRestrictBlocker as table fk_chain_restrict_blocker +-- +CREATE TABLE "fk_chain_restrict_blocker" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "name" TEXT NOT NULL, + "cascadeMiddleId" BLOB, + CONSTRAINT "fk_chain_restrict_blocker_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "fk_chain_restrict_blocker_fk_1" FOREIGN KEY ("cascadeMiddleId") REFERENCES "fk_chain_cascade_middle" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED +) STRICT; + + +-- +-- Class FkChainRoot as table fk_chain_root +-- +CREATE TABLE "fk_chain_root" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "name" TEXT NOT NULL, + CONSTRAINT "fk_chain_root_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION +) STRICT; + + +-- +-- Class FkChainSetNullCascadeChild as table fk_chain_set_null_cascade_child +-- +CREATE TABLE "fk_chain_set_null_cascade_child" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "name" TEXT NOT NULL, + "setNullMiddleId" BLOB, + CONSTRAINT "fk_chain_set_null_cascade_child_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "fk_chain_set_null_cascade_child_fk_1" FOREIGN KEY ("setNullMiddleId") REFERENCES "fk_chain_set_null_middle" ("id") ON DELETE CASCADE ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED +) STRICT; + + +-- +-- Class FkChainSetNullMiddle as table fk_chain_set_null_middle +-- +CREATE TABLE "fk_chain_set_null_middle" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "name" TEXT NOT NULL, + "cascadeMiddleId" BLOB, + CONSTRAINT "fk_chain_set_null_middle_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "fk_chain_set_null_middle_fk_1" FOREIGN KEY ("cascadeMiddleId") REFERENCES "fk_chain_cascade_middle" ("id") ON DELETE SET NULL ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED +) STRICT; + + +-- +-- Class FkChainSetNullRestrictChild as table fk_chain_set_null_restrict_child +-- +CREATE TABLE "fk_chain_set_null_restrict_child" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "name" TEXT NOT NULL, + "setNullMiddleId" BLOB, + CONSTRAINT "fk_chain_set_null_restrict_child_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "fk_chain_set_null_restrict_child_fk_1" FOREIGN KEY ("setNullMiddleId") REFERENCES "fk_chain_set_null_middle" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED +) STRICT; + + +-- +-- Class FkChainSetNullSetNullChild as table fk_chain_set_null_set_null_child +-- +CREATE TABLE "fk_chain_set_null_set_null_child" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "name" TEXT NOT NULL, + "setNullMiddleId" BLOB, + CONSTRAINT "fk_chain_set_null_set_null_child_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "fk_chain_set_null_set_null_child_fk_1" FOREIGN KEY ("setNullMiddleId") REFERENCES "fk_chain_set_null_middle" ("id") ON DELETE SET NULL ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED +) STRICT; + + +-- +-- Class NullableSetDefaultChild as table nullable_set_default_child +-- +CREATE TABLE "nullable_set_default_child" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "name" TEXT NOT NULL, + "parentId" BLOB, + CONSTRAINT "nullable_set_default_child_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "nullable_set_default_child_fk_1" FOREIGN KEY ("parentId") REFERENCES "person" ("id") ON DELETE SET DEFAULT ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED +) STRICT; + + +-- +-- Class Organization as table organization +-- +CREATE TABLE "organization" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "name" TEXT NOT NULL, + "cityId" BLOB, + CONSTRAINT "organization_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "organization_fk_1" FOREIGN KEY ("cityId") REFERENCES "city" ("id") ON DELETE CASCADE ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED +) STRICT; + + +-- +-- Class Person as table person +-- +CREATE TABLE "person" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "name" TEXT NOT NULL, + "surname" TEXT, + "organizationId" BLOB, + "oldCompanyId" BLOB, + "cityId" BLOB, + CONSTRAINT "person_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "person_fk_1" FOREIGN KEY ("organizationId") REFERENCES "organization" ("id") ON DELETE CASCADE ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED, + CONSTRAINT "person_fk_2" FOREIGN KEY ("oldCompanyId") REFERENCES "company" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION, + CONSTRAINT "person_fk_3" FOREIGN KEY ("cityId") REFERENCES "city" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED +) STRICT; + + +-- +-- Class RequiredCascadeChild as table required_cascade_child +-- +CREATE TABLE "required_cascade_child" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "name" TEXT NOT NULL, + "parentId" BLOB NOT NULL, + CONSTRAINT "required_cascade_child_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "required_cascade_child_fk_1" FOREIGN KEY ("parentId") REFERENCES "person" ("id") ON DELETE CASCADE ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED +) STRICT; + + +-- +-- Class RequiredNoActionChild as table required_no_action_child +-- +CREATE TABLE "required_no_action_child" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "name" TEXT NOT NULL, + "parentId" BLOB NOT NULL, + CONSTRAINT "required_no_action_child_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "required_no_action_child_fk_1" FOREIGN KEY ("parentId") REFERENCES "person" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED +) STRICT; + + +-- +-- Class RequiredSetNullChild as table required_set_null_child +-- +CREATE TABLE "required_set_null_child" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "name" TEXT NOT NULL, + "parentId" BLOB NOT NULL, + CONSTRAINT "required_set_null_child_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "required_set_null_child_fk_1" FOREIGN KEY ("parentId") REFERENCES "person" ("id") ON DELETE SET NULL ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED +) STRICT; + + +-- +-- Class RestrictChild as table restrict_child +-- +CREATE TABLE "restrict_child" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "name" TEXT NOT NULL, + "parentId" BLOB, + CONSTRAINT "restrict_child_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "restrict_child_fk_1" FOREIGN KEY ("parentId") REFERENCES "person" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED +) STRICT; + + +-- +-- Class SharedChild as table shared_child +-- +CREATE TABLE "shared_child" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "name" TEXT NOT NULL, + "flavor" TEXT NOT NULL DEFAULT ('plain'), + "parentId" BLOB, + CONSTRAINT "shared_child_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "shared_child_fk_1" FOREIGN KEY ("parentId") REFERENCES "shared_parent" ("id") ON DELETE SET NULL ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED +) STRICT; + + +-- +-- Class SharedParent as table shared_parent +-- +CREATE TABLE "shared_parent" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "name" TEXT NOT NULL, + CONSTRAINT "shared_parent_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION +) STRICT; + + +-- +-- Class Town as table town +-- +CREATE TABLE "town" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "name" TEXT NOT NULL, + "cityId" BLOB, + "mayorId" BLOB, + CONSTRAINT "town_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "town_fk_1" FOREIGN KEY ("cityId") REFERENCES "city" ("id") ON DELETE CASCADE ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED, + CONSTRAINT "town_fk_2" FOREIGN KEY ("mayorId") REFERENCES "person" ("id") ON DELETE SET NULL ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED +) STRICT; + + +-- +-- Class Types as table types +-- +CREATE TABLE "types" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "aBool" INTEGER NOT NULL, + "aDateTime" INTEGER NOT NULL, + "aText" TEXT NOT NULL, + "anInt" INTEGER NOT NULL, + "anInt64" TEXT NOT NULL, + "aReal" REAL NOT NULL, + "aBlob" BLOB NOT NULL, + "anEnum" INTEGER, + "optionalText" TEXT, + "optionalUuid" BLOB, + "parentId" BLOB, + "jsonDocument" TEXT, + "jsonbDocument" BLOB, + "jsonbNumbers" BLOB, + CONSTRAINT "types_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "types_fk_1" FOREIGN KEY ("parentId") REFERENCES "types" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION +) STRICT; + +-- Indexes +CREATE INDEX "types_a_text_idx" ON "types" ("aText"); + + +-- +-- Class Unique as table unique +-- +CREATE TABLE "unique" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "name" TEXT NOT NULL, + CONSTRAINT "unique_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "unique__spaceId__name__unique_idx" ON "unique" ("spaceId", "name"); + + +-- +-- Class UniqueCascadeChild as table unique_cascade_child +-- +CREATE TABLE "unique_cascade_child" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "name" TEXT NOT NULL, + "parentId" BLOB, + CONSTRAINT "unique_cascade_child_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "unique_cascade_child_fk_1" FOREIGN KEY ("parentId") REFERENCES "person" ("id") ON DELETE CASCADE ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "unique_cascade_child__spaceId__name__unique_idx" ON "unique_cascade_child" ("spaceId", "name"); + + +-- +-- Class UniqueCascadeReference as table unique_cascade_reference +-- +CREATE TABLE "unique_cascade_reference" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "name" TEXT NOT NULL, + "parentId" BLOB, + CONSTRAINT "unique_cascade_reference_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "unique_cascade_reference_fk_1" FOREIGN KEY ("parentId") REFERENCES "person" ("id") ON DELETE CASCADE ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "unique_cascade_reference__parentId__unique_idx" ON "unique_cascade_reference" ("parentId"); + + +-- +-- Class UniqueComposite as table unique_composite +-- +CREATE TABLE "unique_composite" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "scope" TEXT NOT NULL, + "value" TEXT NOT NULL, + CONSTRAINT "unique_composite_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "unique_composite__spaceId__scope__value__unique_idx" ON "unique_composite" ("spaceId", "scope", "value"); + + +-- +-- Class UniqueDiscriminator as table unique_discriminator +-- +CREATE TABLE "unique_discriminator" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "categoryId" INTEGER NOT NULL, + "name" TEXT NOT NULL, + CONSTRAINT "unique_discriminator_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "unique_discriminator__spaceId__categoryId__name__unique_idx" ON "unique_discriminator" ("spaceId", "categoryId", "name"); + + +-- +-- Class UniqueFkPair as table unique_fk_pair +-- +CREATE TABLE "unique_fk_pair" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "name" TEXT NOT NULL, + "leftId" BLOB, + "rightId" BLOB, + CONSTRAINT "unique_fk_pair_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "unique_fk_pair_fk_1" FOREIGN KEY ("leftId") REFERENCES "person" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED, + CONSTRAINT "unique_fk_pair_fk_2" FOREIGN KEY ("rightId") REFERENCES "person" ("id") ON DELETE SET NULL ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "unique_fk_pair_parents" ON "unique_fk_pair" ("leftId", "rightId"); + + +-- +-- Class UniqueMixedFk as table unique_mixed_fk +-- +CREATE TABLE "unique_mixed_fk" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "name" TEXT NOT NULL, + "parentId" BLOB, + CONSTRAINT "unique_mixed_fk_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "unique_mixed_fk_fk_1" FOREIGN KEY ("parentId") REFERENCES "person" ("id") ON DELETE CASCADE ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "unique_mixed_fk_name_parent" ON "unique_mixed_fk" ("spaceId", "name", "parentId"); + + +-- +-- Class UniqueNoRelease as table unique_no_release +-- +CREATE TABLE "unique_no_release" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "categoryId" INTEGER NOT NULL, + CONSTRAINT "unique_no_release_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "unique_no_release__spaceId__categoryId__unique_idx" ON "unique_no_release" ("spaceId", "categoryId"); + + +-- +-- Class UniqueNullable as table unique_nullable +-- +CREATE TABLE "unique_nullable" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "value" INTEGER, + CONSTRAINT "unique_nullable_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "unique_nullable__spaceId__value__unique_idx" ON "unique_nullable" ("spaceId", "value"); + + +-- +-- Class UniqueOverlapping as table unique_overlapping +-- +CREATE TABLE "unique_overlapping" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "first" TEXT NOT NULL, + "second" TEXT NOT NULL, + "third" TEXT NOT NULL, + CONSTRAINT "unique_overlapping_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "unique_overlapping_first_second" ON "unique_overlapping" ("spaceId", "first", "second"); +CREATE UNIQUE INDEX "unique_overlapping_second_third" ON "unique_overlapping" ("spaceId", "second", "third"); + + +-- +-- Class UniqueSetDefaultChild as table unique_set_default_child +-- +CREATE TABLE "unique_set_default_child" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "name" TEXT NOT NULL, + "parentId" BLOB DEFAULT (X'550e8400e29b41d4a716446655440000'), + CONSTRAINT "unique_set_default_child_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "unique_set_default_child_fk_1" FOREIGN KEY ("parentId") REFERENCES "town" ("id") ON DELETE SET DEFAULT ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "unique_set_default_child__parentId__unique_idx" ON "unique_set_default_child" ("parentId"); + + +-- +-- Class UniqueSetNullChild as table unique_set_null_child +-- +CREATE TABLE "unique_set_null_child" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "name" TEXT NOT NULL, + "parentId" BLOB, + CONSTRAINT "unique_set_null_child_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "unique_set_null_child_fk_1" FOREIGN KEY ("parentId") REFERENCES "person" ("id") ON DELETE SET NULL ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "unique_set_null_child__parentId__unique_idx" ON "unique_set_null_child" ("parentId"); + + +-- +-- Class UniqueUuid as table unique_uuid +-- +CREATE TABLE "unique_uuid" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "value" BLOB NOT NULL, + CONSTRAINT "unique_uuid_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "unique_uuid__spaceId__value__unique_idx" ON "unique_uuid" ("spaceId", "value"); + + +-- +-- Class CloudStorageEntry as table serverpod_cloud_storage +-- +CREATE TABLE "serverpod_cloud_storage" ( + "id" INTEGER PRIMARY KEY, + "storageId" TEXT NOT NULL, + "path" TEXT NOT NULL, + "addedTime" INTEGER NOT NULL, + "expiration" INTEGER, + "byteData" BLOB NOT NULL, + "verified" INTEGER NOT NULL, + "contentType" TEXT, + "cacheControl" TEXT, + "contentDisposition" TEXT, + "contentEncoding" TEXT, + "customMetadata" TEXT +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "serverpod_cloud_storage_path_idx" ON "serverpod_cloud_storage" ("storageId", "path"); +CREATE INDEX "serverpod_cloud_storage_expiration" ON "serverpod_cloud_storage" ("expiration"); + + +-- +-- Class CloudStorageDirectDownloadEntry as table serverpod_cloud_storage_direct_download +-- +CREATE TABLE "serverpod_cloud_storage_direct_download" ( + "id" INTEGER PRIMARY KEY, + "storageId" TEXT NOT NULL, + "path" TEXT NOT NULL, + "expiration" INTEGER NOT NULL, + "authKey" TEXT NOT NULL, + "downloadFileName" TEXT, + "contentType" TEXT +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "serverpod_cloud_storage_direct_download_auth_key" ON "serverpod_cloud_storage_direct_download" ("authKey"); +CREATE INDEX "serverpod_cloud_storage_direct_download_expiration" ON "serverpod_cloud_storage_direct_download" ("expiration"); + + +-- +-- Class CloudStorageDirectUploadEntry as table serverpod_cloud_storage_direct_upload +-- +CREATE TABLE "serverpod_cloud_storage_direct_upload" ( + "id" INTEGER PRIMARY KEY, + "storageId" TEXT NOT NULL, + "path" TEXT NOT NULL, + "expiration" INTEGER NOT NULL, + "authKey" TEXT NOT NULL, + "maxFileSize" INTEGER NOT NULL DEFAULT (10485760), + "contentLength" INTEGER, + "preventOverwrite" INTEGER NOT NULL DEFAULT (0), + "contentType" TEXT, + "cacheControl" TEXT, + "contentDisposition" TEXT, + "contentEncoding" TEXT, + "customMetadata" TEXT +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "serverpod_cloud_storage_direct_upload_storage_path" ON "serverpod_cloud_storage_direct_upload" ("storageId", "path"); + + +-- +-- Class FutureCallEntry as table serverpod_future_call +-- +CREATE TABLE "serverpod_future_call" ( + "id" INTEGER PRIMARY KEY, + "name" TEXT NOT NULL, + "time" INTEGER NOT NULL, + "serializedObject" TEXT, + "serverId" TEXT NOT NULL, + "identifier" TEXT, + "scheduling" TEXT +) STRICT; + +-- Indexes +CREATE INDEX "serverpod_future_call_time_idx" ON "serverpod_future_call" ("time"); +CREATE INDEX "serverpod_future_call_serverId_idx" ON "serverpod_future_call" ("serverId"); +CREATE INDEX "serverpod_future_call_identifier_idx" ON "serverpod_future_call" ("identifier"); + + +-- +-- Class FutureCallClaimEntry as table serverpod_future_call_claim +-- +CREATE TABLE "serverpod_future_call_claim" ( + "id" INTEGER PRIMARY KEY, + "futureCallId" INTEGER, + "lastHeartbeatTime" INTEGER NOT NULL, + CONSTRAINT "serverpod_future_call_claim_fk_0" FOREIGN KEY ("futureCallId") REFERENCES "serverpod_future_call" ("id") ON DELETE CASCADE ON UPDATE NO ACTION +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "future_call_unique_idx" ON "serverpod_future_call_claim" ("futureCallId"); + + +-- +-- Class ServerHealthConnectionInfo as table serverpod_health_connection_info +-- +CREATE TABLE "serverpod_health_connection_info" ( + "id" INTEGER PRIMARY KEY, + "serverId" TEXT NOT NULL, + "timestamp" INTEGER NOT NULL, + "active" INTEGER NOT NULL, + "closing" INTEGER NOT NULL, + "idle" INTEGER NOT NULL, + "granularity" INTEGER NOT NULL +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "serverpod_health_connection_info_timestamp_idx" ON "serverpod_health_connection_info" ("timestamp", "serverId", "granularity"); + + +-- +-- Class ServerHealthMetric as table serverpod_health_metric +-- +CREATE TABLE "serverpod_health_metric" ( + "id" INTEGER PRIMARY KEY, + "name" TEXT NOT NULL, + "serverId" TEXT NOT NULL, + "timestamp" INTEGER NOT NULL, + "isHealthy" INTEGER NOT NULL, + "value" REAL NOT NULL, + "granularity" INTEGER NOT NULL +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "serverpod_health_metric_timestamp_idx" ON "serverpod_health_metric" ("timestamp", "serverId", "name", "granularity"); + + +-- +-- Class LogEntry as table serverpod_log +-- +CREATE TABLE "serverpod_log" ( + "id" INTEGER PRIMARY KEY, + "sessionLogId" INTEGER NOT NULL, + "messageId" INTEGER, + "reference" TEXT, + "serverId" TEXT NOT NULL, + "time" INTEGER NOT NULL, + "logLevel" INTEGER NOT NULL, + "message" TEXT NOT NULL, + "error" TEXT, + "stackTrace" TEXT, + "order" INTEGER NOT NULL, + CONSTRAINT "serverpod_log_fk_0" FOREIGN KEY ("sessionLogId") REFERENCES "serverpod_session_log" ("id") ON DELETE CASCADE ON UPDATE NO ACTION +) STRICT; + +-- Indexes +CREATE INDEX "serverpod_log_sessionLogId_idx" ON "serverpod_log" ("sessionLogId", "order"); + + +-- +-- Class MessageLogEntry as table serverpod_message_log +-- +CREATE TABLE "serverpod_message_log" ( + "id" INTEGER PRIMARY KEY, + "sessionLogId" INTEGER NOT NULL, + "serverId" TEXT NOT NULL, + "messageId" INTEGER NOT NULL, + "endpoint" TEXT NOT NULL, + "messageName" TEXT NOT NULL, + "duration" REAL NOT NULL, + "error" TEXT, + "stackTrace" TEXT, + "slow" INTEGER NOT NULL, + "order" INTEGER NOT NULL, + CONSTRAINT "serverpod_message_log_fk_0" FOREIGN KEY ("sessionLogId") REFERENCES "serverpod_session_log" ("id") ON DELETE CASCADE ON UPDATE NO ACTION +) STRICT; + +-- Indexes +CREATE INDEX "serverpod_message_log_sessionLogId_idx" ON "serverpod_message_log" ("sessionLogId", "order"); + + +-- +-- Class MethodInfo as table serverpod_method +-- +CREATE TABLE "serverpod_method" ( + "id" INTEGER PRIMARY KEY, + "endpoint" TEXT NOT NULL, + "method" TEXT NOT NULL +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "serverpod_method_endpoint_method_idx" ON "serverpod_method" ("endpoint", "method"); + + +-- +-- Class DatabaseMigrationVersion as table serverpod_migrations +-- +CREATE TABLE "serverpod_migrations" ( + "id" INTEGER PRIMARY KEY, + "module" TEXT NOT NULL, + "version" TEXT NOT NULL, + "timestamp" INTEGER +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "serverpod_migrations_ids" ON "serverpod_migrations" ("module"); + + +-- +-- Class QueryLogEntry as table serverpod_query_log +-- +CREATE TABLE "serverpod_query_log" ( + "id" INTEGER PRIMARY KEY, + "serverId" TEXT NOT NULL, + "sessionLogId" INTEGER NOT NULL, + "messageId" INTEGER, + "query" TEXT NOT NULL, + "duration" REAL NOT NULL, + "numRows" INTEGER, + "error" TEXT, + "stackTrace" TEXT, + "slow" INTEGER NOT NULL, + "order" INTEGER NOT NULL, + CONSTRAINT "serverpod_query_log_fk_0" FOREIGN KEY ("sessionLogId") REFERENCES "serverpod_session_log" ("id") ON DELETE CASCADE ON UPDATE NO ACTION +) STRICT; + +-- Indexes +CREATE INDEX "serverpod_query_log_sessionLogId_idx" ON "serverpod_query_log" ("sessionLogId", "order"); + + +-- +-- Class ReadWriteTestEntry as table serverpod_readwrite_test +-- +CREATE TABLE "serverpod_readwrite_test" ( + "id" INTEGER PRIMARY KEY, + "number" INTEGER NOT NULL +) STRICT; + + +-- +-- Class RuntimeSettings as table serverpod_runtime_settings +-- +CREATE TABLE "serverpod_runtime_settings" ( + "id" INTEGER PRIMARY KEY, + "logSettings" TEXT NOT NULL, + "logSettingsOverrides" TEXT NOT NULL, + "logServiceCalls" INTEGER NOT NULL, + "logMalformedCalls" INTEGER NOT NULL +) STRICT; + + +-- +-- Class SessionLogEntry as table serverpod_session_log +-- +CREATE TABLE "serverpod_session_log" ( + "id" INTEGER PRIMARY KEY, + "serverId" TEXT NOT NULL, + "time" INTEGER NOT NULL, + "module" TEXT, + "endpoint" TEXT, + "method" TEXT, + "duration" REAL, + "numQueries" INTEGER, + "slow" INTEGER, + "error" TEXT, + "stackTrace" TEXT, + "authenticatedUserId" INTEGER, + "userId" TEXT, + "isOpen" INTEGER, + "touched" INTEGER NOT NULL +) STRICT; + +-- Indexes +CREATE INDEX "serverpod_session_log_serverid_idx" ON "serverpod_session_log" ("serverId"); +CREATE INDEX "serverpod_session_log_time_idx" ON "serverpod_session_log" ("time"); +CREATE INDEX "serverpod_session_log_touched_idx" ON "serverpod_session_log" ("touched"); +CREATE INDEX "serverpod_session_log_isopen_idx" ON "serverpod_session_log" ("isOpen"); + + +-- +-- Class RefreshToken as table serverpod_auth_core_jwt_refresh_token +-- +CREATE TABLE "serverpod_auth_core_jwt_refresh_token" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "authUserId" BLOB NOT NULL, + "scopeNames" TEXT NOT NULL, + "extraClaims" TEXT, + "method" TEXT NOT NULL, + "fixedSecret" BLOB NOT NULL, + "rotatingSecretHash" TEXT NOT NULL, + "lastUpdatedAt" INTEGER NOT NULL DEFAULT (CAST(unixepoch('subsecond') * 1000 AS INTEGER)), + "createdAt" INTEGER NOT NULL DEFAULT (CAST(unixepoch('subsecond') * 1000 AS INTEGER)), + CONSTRAINT "serverpod_auth_core_jwt_refresh_token_fk_0" FOREIGN KEY ("authUserId") REFERENCES "serverpod_auth_core_user" ("id") ON DELETE CASCADE ON UPDATE NO ACTION +) STRICT; + +-- Indexes +CREATE INDEX "serverpod_auth_core_jwt_refresh_token_last_updated_at" ON "serverpod_auth_core_jwt_refresh_token" ("lastUpdatedAt"); + + +-- +-- Class UserProfile as table serverpod_auth_core_profile +-- +CREATE TABLE "serverpod_auth_core_profile" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "authUserId" BLOB NOT NULL, + "userName" TEXT, + "fullName" TEXT, + "email" TEXT, + "createdAt" INTEGER NOT NULL DEFAULT (CAST(unixepoch('subsecond') * 1000 AS INTEGER)), + "imageId" BLOB, + CONSTRAINT "serverpod_auth_core_profile_fk_0" FOREIGN KEY ("authUserId") REFERENCES "serverpod_auth_core_user" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "serverpod_auth_core_profile_fk_1" FOREIGN KEY ("imageId") REFERENCES "serverpod_auth_core_profile_image" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "serverpod_auth_profile_user_profile_email_auth_user_id" ON "serverpod_auth_core_profile" ("authUserId"); + + +-- +-- Class UserProfileImage as table serverpod_auth_core_profile_image +-- +CREATE TABLE "serverpod_auth_core_profile_image" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "userProfileId" BLOB NOT NULL, + "createdAt" INTEGER NOT NULL DEFAULT (CAST(unixepoch('subsecond') * 1000 AS INTEGER)), + "storageId" TEXT NOT NULL, + "path" TEXT NOT NULL, + "url" TEXT NOT NULL, + CONSTRAINT "serverpod_auth_core_profile_image_fk_0" FOREIGN KEY ("userProfileId") REFERENCES "serverpod_auth_core_profile" ("id") ON DELETE CASCADE ON UPDATE NO ACTION +) STRICT; + + +-- +-- Class ServerSideSession as table serverpod_auth_core_session +-- +CREATE TABLE "serverpod_auth_core_session" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "authUserId" BLOB NOT NULL, + "scopeNames" TEXT NOT NULL, + "createdAt" INTEGER NOT NULL DEFAULT (CAST(unixepoch('subsecond') * 1000 AS INTEGER)), + "lastUsedAt" INTEGER NOT NULL DEFAULT (CAST(unixepoch('subsecond') * 1000 AS INTEGER)), + "expiresAt" INTEGER, + "expireAfterUnusedFor" INTEGER, + "sessionKeyHash" BLOB NOT NULL, + "sessionKeySalt" BLOB NOT NULL, + "method" TEXT NOT NULL, + CONSTRAINT "serverpod_auth_core_session_fk_0" FOREIGN KEY ("authUserId") REFERENCES "serverpod_auth_core_user" ("id") ON DELETE CASCADE ON UPDATE NO ACTION +) STRICT; + + +-- +-- Class AuthUser as table serverpod_auth_core_user +-- +CREATE TABLE "serverpod_auth_core_user" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "createdAt" INTEGER NOT NULL, + "scopeNames" TEXT NOT NULL, + "blocked" INTEGER NOT NULL +) STRICT; + + +-- +-- Class CrdtDataAttemptedValue as table crdt_data_attempted_value +-- +CREATE TABLE "crdt_data_attempted_value" ( + "id" INTEGER PRIMARY KEY, + "fieldId" INTEGER NOT NULL, + "value" BLOB NOT NULL, + "projectionReason" INTEGER NOT NULL, + CONSTRAINT "crdt_data_attempted_value_fk_0" FOREIGN KEY ("fieldId") REFERENCES "crdt_data_fields" ("id") ON DELETE CASCADE ON UPDATE NO ACTION +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "crdt_data_attempted_value__fieldId__unique_idx" ON "crdt_data_attempted_value" ("fieldId"); + + +-- +-- Class CrdtDataField as table crdt_data_fields +-- +CREATE TABLE "crdt_data_fields" ( + "id" INTEGER PRIMARY KEY, + "hlcDatetime" INTEGER NOT NULL, + "hlcCounter" INTEGER NOT NULL, + "rowId" INTEGER NOT NULL, + "columnId" INTEGER NOT NULL, + "nodeId" INTEGER NOT NULL, + CONSTRAINT "crdt_data_fields_fk_0" FOREIGN KEY ("rowId") REFERENCES "crdt_data_rows" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "crdt_data_fields_fk_1" FOREIGN KEY ("columnId") REFERENCES "crdt_schema_columns" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "crdt_data_fields_fk_2" FOREIGN KEY ("nodeId") REFERENCES "crdt_nodes" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "crdt_data_fields_row_column_idx" ON "crdt_data_fields" ("rowId", "columnId"); + + +-- +-- Class CrdtDataRow as table crdt_data_rows +-- +CREATE TABLE "crdt_data_rows" ( + "id" INTEGER PRIMARY KEY, + "hlcDatetime" INTEGER NOT NULL, + "hlcCounter" INTEGER NOT NULL, + "spaceId" INTEGER NOT NULL, + "tblId" INTEGER NOT NULL, + "uuidRowId" BLOB NOT NULL, + "nodeId" INTEGER NOT NULL, + "visibility" INTEGER NOT NULL DEFAULT (0), + CONSTRAINT "crdt_data_rows_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "crdt_data_rows_fk_1" FOREIGN KEY ("tblId") REFERENCES "crdt_schema_tables" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "crdt_data_rows_fk_2" FOREIGN KEY ("nodeId") REFERENCES "crdt_nodes" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "crdt_data_rows_space_tbl_row_idx" ON "crdt_data_rows" ("spaceId", "tblId", "uuidRowId"); + + +-- +-- Class CrdtDataDeleted as table crdt_data_tombstone +-- +CREATE TABLE "crdt_data_tombstone" ( + "id" INTEGER PRIMARY KEY, + "hlcDatetime" INTEGER NOT NULL, + "hlcCounter" INTEGER NOT NULL, + "rowId" INTEGER NOT NULL, + "nodeId" INTEGER NOT NULL, + "clFlag" INTEGER NOT NULL, + "reason" INTEGER NOT NULL, + CONSTRAINT "crdt_data_tombstone_fk_0" FOREIGN KEY ("rowId") REFERENCES "crdt_data_rows" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "crdt_data_tombstone_fk_1" FOREIGN KEY ("nodeId") REFERENCES "crdt_nodes" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "crdt_data_tombstone_row_idx" ON "crdt_data_tombstone" ("rowId"); + + +-- +-- Class CrdtNode as table crdt_nodes +-- +CREATE TABLE "crdt_nodes" ( + "id" INTEGER PRIMARY KEY, + "uuidNodeId" BLOB NOT NULL DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "lastHlc" BLOB +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "crdt_nodes__uuidNodeId__unique_idx" ON "crdt_nodes" ("uuidNodeId"); + + +-- +-- Class CrdtSchemaColumn as table crdt_schema_columns +-- +CREATE TABLE "crdt_schema_columns" ( + "id" INTEGER PRIMARY KEY, + "tblId" INTEGER NOT NULL, + "name" TEXT NOT NULL, + "columnType" TEXT NOT NULL, + "dartType" TEXT NOT NULL, + "isNullable" INTEGER NOT NULL, + CONSTRAINT "crdt_schema_columns_fk_0" FOREIGN KEY ("tblId") REFERENCES "crdt_schema_tables" ("id") ON DELETE CASCADE ON UPDATE NO ACTION +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "crdt_schema_columns_table_column_idx" ON "crdt_schema_columns" ("tblId", "name"); + + +-- +-- Class CrdtSchemaTable as table crdt_schema_tables +-- +CREATE TABLE "crdt_schema_tables" ( + "id" INTEGER PRIMARY KEY, + "name" TEXT NOT NULL +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "crdt_schema_tables__name__unique_idx" ON "crdt_schema_tables" ("name"); + + +-- +-- Class OfflineSyncIntegrityViolation as table offline_sync_integrity_violations +-- +CREATE TABLE "offline_sync_integrity_violations" ( + "id" INTEGER PRIMARY KEY, + "type" TEXT NOT NULL, + "domainTableName" TEXT NOT NULL, + "uuidRowId" BLOB NOT NULL, + "ownerSpaceUuid" BLOB, + "incomingSpaceUuid" BLOB NOT NULL, + "operation" TEXT NOT NULL, + "uuidNodeId" BLOB, + "crdtDataRowId" INTEGER, + "hlcDatetime" INTEGER, + "hlcCounter" INTEGER, + "firstSeenAt" INTEGER NOT NULL, + "lastSeenAt" INTEGER NOT NULL, + "occurrences" INTEGER NOT NULL +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "offline_sync_integrity_violations_key_idx" ON "offline_sync_integrity_violations" ("type", "operation", "domainTableName", "uuidRowId", "ownerSpaceUuid", "incomingSpaceUuid"); + + +-- +-- Class OfflineSyncSpaceMember as table offline_sync_space_members +-- +CREATE TABLE "offline_sync_space_members" ( + "id" INTEGER PRIMARY KEY, + "spaceId" INTEGER NOT NULL, + "userUuid" BLOB NOT NULL, + "role" TEXT NOT NULL, + CONSTRAINT "offline_sync_space_members_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "offline_sync_space_member_unique_idx" ON "offline_sync_space_members" ("userUuid", "spaceId"); + + +-- +-- Class OfflineSyncSpaceNode as table offline_sync_space_nodes +-- +CREATE TABLE "offline_sync_space_nodes" ( + "id" INTEGER PRIMARY KEY, + "spaceId" INTEGER NOT NULL, + "nodeId" INTEGER NOT NULL, + "lastReceivedHlc" BLOB, + CONSTRAINT "offline_sync_space_nodes_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "offline_sync_space_nodes_fk_1" FOREIGN KEY ("nodeId") REFERENCES "crdt_nodes" ("id") ON DELETE CASCADE ON UPDATE NO ACTION +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "offline_sync_space_node_unique_idx" ON "offline_sync_space_nodes" ("spaceId", "nodeId"); + + +-- +-- Class OfflineSyncSpace as table offline_sync_spaces +-- +CREATE TABLE "offline_sync_spaces" ( + "id" INTEGER PRIMARY KEY, + "uuidSpaceId" BLOB NOT NULL DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "currentNodeId" INTEGER, + CONSTRAINT "offline_sync_spaces_fk_0" FOREIGN KEY ("currentNodeId") REFERENCES "crdt_nodes" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "offline_sync_spaces__uuidSpaceId__unique_idx" ON "offline_sync_spaces" ("uuidSpaceId"); + + +-- +-- STORE COLUMN TYPES FOR MIGRATIONS +-- +DROP TABLE IF EXISTS "serverpod_sqlite_schema"; + +CREATE TABLE "serverpod_sqlite_schema" ( + "table_name" TEXT NOT NULL, + "column_name" TEXT NOT NULL, + "column_type" TEXT NOT NULL, + "column_vector_dimension" INTEGER, + PRIMARY KEY ("table_name", "column_name") +); + +INSERT INTO "serverpod_sqlite_schema" VALUES + ('address', 'id', 'uuid', NULL), + ('address', 'inhabitantId', 'uuid', NULL), + ('city', 'id', 'uuid', NULL), + ('company', 'id', 'uuid', NULL), + ('company', 'townId', 'uuid', NULL), + ('fk_chain_cascade_middle', 'id', 'uuid', NULL), + ('fk_chain_cascade_middle', 'rootId', 'uuid', NULL), + ('fk_chain_middle_cascade_child', 'id', 'uuid', NULL), + ('fk_chain_middle_cascade_child', 'restrictBlockerId', 'uuid', NULL), + ('fk_chain_middle_set_null_child', 'id', 'uuid', NULL), + ('fk_chain_middle_set_null_child', 'restrictBlockerId', 'uuid', NULL), + ('fk_chain_restrict_blocker', 'id', 'uuid', NULL), + ('fk_chain_restrict_blocker', 'cascadeMiddleId', 'uuid', NULL), + ('fk_chain_root', 'id', 'uuid', NULL), + ('fk_chain_set_null_cascade_child', 'id', 'uuid', NULL), + ('fk_chain_set_null_cascade_child', 'setNullMiddleId', 'uuid', NULL), + ('fk_chain_set_null_middle', 'id', 'uuid', NULL), + ('fk_chain_set_null_middle', 'cascadeMiddleId', 'uuid', NULL), + ('fk_chain_set_null_restrict_child', 'id', 'uuid', NULL), + ('fk_chain_set_null_restrict_child', 'setNullMiddleId', 'uuid', NULL), + ('fk_chain_set_null_set_null_child', 'id', 'uuid', NULL), + ('fk_chain_set_null_set_null_child', 'setNullMiddleId', 'uuid', NULL), + ('nullable_set_default_child', 'id', 'uuid', NULL), + ('nullable_set_default_child', 'parentId', 'uuid', NULL), + ('organization', 'id', 'uuid', NULL), + ('organization', 'cityId', 'uuid', NULL), + ('person', 'id', 'uuid', NULL), + ('person', 'organizationId', 'uuid', NULL), + ('person', 'oldCompanyId', 'uuid', NULL), + ('person', 'cityId', 'uuid', NULL), + ('required_cascade_child', 'id', 'uuid', NULL), + ('required_cascade_child', 'parentId', 'uuid', NULL), + ('required_no_action_child', 'id', 'uuid', NULL), + ('required_no_action_child', 'parentId', 'uuid', NULL), + ('required_set_null_child', 'id', 'uuid', NULL), + ('required_set_null_child', 'parentId', 'uuid', NULL), + ('restrict_child', 'id', 'uuid', NULL), + ('restrict_child', 'parentId', 'uuid', NULL), + ('shared_child', 'id', 'uuid', NULL), + ('shared_child', 'parentId', 'uuid', NULL), + ('shared_parent', 'id', 'uuid', NULL), + ('town', 'id', 'uuid', NULL), + ('town', 'cityId', 'uuid', NULL), + ('town', 'mayorId', 'uuid', NULL), + ('types', 'id', 'uuid', NULL), + ('types', 'aBool', 'boolean', NULL), + ('types', 'aDateTime', 'timestampWithoutTimeZone', NULL), + ('types', 'optionalUuid', 'uuid', NULL), + ('types', 'parentId', 'uuid', NULL), + ('types', 'jsonDocument', 'json', NULL), + ('types', 'jsonbDocument', 'jsonb', NULL), + ('types', 'jsonbNumbers', 'jsonb', NULL), + ('unique', 'id', 'uuid', NULL), + ('unique_cascade_child', 'id', 'uuid', NULL), + ('unique_cascade_child', 'parentId', 'uuid', NULL), + ('unique_cascade_reference', 'id', 'uuid', NULL), + ('unique_cascade_reference', 'parentId', 'uuid', NULL), + ('unique_composite', 'id', 'uuid', NULL), + ('unique_discriminator', 'id', 'uuid', NULL), + ('unique_fk_pair', 'id', 'uuid', NULL), + ('unique_fk_pair', 'leftId', 'uuid', NULL), + ('unique_fk_pair', 'rightId', 'uuid', NULL), + ('unique_mixed_fk', 'id', 'uuid', NULL), + ('unique_mixed_fk', 'parentId', 'uuid', NULL), + ('unique_no_release', 'id', 'uuid', NULL), + ('unique_nullable', 'id', 'uuid', NULL), + ('unique_overlapping', 'id', 'uuid', NULL), + ('unique_set_default_child', 'id', 'uuid', NULL), + ('unique_set_default_child', 'parentId', 'uuid', NULL), + ('unique_set_null_child', 'id', 'uuid', NULL), + ('unique_set_null_child', 'parentId', 'uuid', NULL), + ('unique_uuid', 'id', 'uuid', NULL), + ('unique_uuid', 'value', 'uuid', NULL), + ('serverpod_cloud_storage', 'addedTime', 'timestampWithoutTimeZone', NULL), + ('serverpod_cloud_storage', 'expiration', 'timestampWithoutTimeZone', NULL), + ('serverpod_cloud_storage', 'verified', 'boolean', NULL), + ('serverpod_cloud_storage_direct_download', 'expiration', 'timestampWithoutTimeZone', NULL), + ('serverpod_cloud_storage_direct_upload', 'expiration', 'timestampWithoutTimeZone', NULL), + ('serverpod_cloud_storage_direct_upload', 'preventOverwrite', 'boolean', NULL), + ('serverpod_future_call', 'time', 'timestampWithoutTimeZone', NULL), + ('serverpod_future_call', 'scheduling', 'json', NULL), + ('serverpod_future_call_claim', 'lastHeartbeatTime', 'timestampWithoutTimeZone', NULL), + ('serverpod_health_connection_info', 'timestamp', 'timestampWithoutTimeZone', NULL), + ('serverpod_health_metric', 'timestamp', 'timestampWithoutTimeZone', NULL), + ('serverpod_health_metric', 'isHealthy', 'boolean', NULL), + ('serverpod_log', 'time', 'timestampWithoutTimeZone', NULL), + ('serverpod_message_log', 'slow', 'boolean', NULL), + ('serverpod_migrations', 'timestamp', 'timestampWithoutTimeZone', NULL), + ('serverpod_query_log', 'slow', 'boolean', NULL), + ('serverpod_runtime_settings', 'logSettings', 'json', NULL), + ('serverpod_runtime_settings', 'logSettingsOverrides', 'json', NULL), + ('serverpod_runtime_settings', 'logServiceCalls', 'boolean', NULL), + ('serverpod_runtime_settings', 'logMalformedCalls', 'boolean', NULL), + ('serverpod_session_log', 'time', 'timestampWithoutTimeZone', NULL), + ('serverpod_session_log', 'slow', 'boolean', NULL), + ('serverpod_session_log', 'isOpen', 'boolean', NULL), + ('serverpod_session_log', 'touched', 'timestampWithoutTimeZone', NULL), + ('serverpod_auth_core_jwt_refresh_token', 'id', 'uuid', NULL), + ('serverpod_auth_core_jwt_refresh_token', 'authUserId', 'uuid', NULL), + ('serverpod_auth_core_jwt_refresh_token', 'scopeNames', 'json', NULL), + ('serverpod_auth_core_jwt_refresh_token', 'lastUpdatedAt', 'timestampWithoutTimeZone', NULL), + ('serverpod_auth_core_jwt_refresh_token', 'createdAt', 'timestampWithoutTimeZone', NULL), + ('serverpod_auth_core_profile', 'id', 'uuid', NULL), + ('serverpod_auth_core_profile', 'authUserId', 'uuid', NULL), + ('serverpod_auth_core_profile', 'createdAt', 'timestampWithoutTimeZone', NULL), + ('serverpod_auth_core_profile', 'imageId', 'uuid', NULL), + ('serverpod_auth_core_profile_image', 'id', 'uuid', NULL), + ('serverpod_auth_core_profile_image', 'userProfileId', 'uuid', NULL), + ('serverpod_auth_core_profile_image', 'createdAt', 'timestampWithoutTimeZone', NULL), + ('serverpod_auth_core_session', 'id', 'uuid', NULL), + ('serverpod_auth_core_session', 'authUserId', 'uuid', NULL), + ('serverpod_auth_core_session', 'scopeNames', 'json', NULL), + ('serverpod_auth_core_session', 'createdAt', 'timestampWithoutTimeZone', NULL), + ('serverpod_auth_core_session', 'lastUsedAt', 'timestampWithoutTimeZone', NULL), + ('serverpod_auth_core_session', 'expiresAt', 'timestampWithoutTimeZone', NULL), + ('serverpod_auth_core_user', 'id', 'uuid', NULL), + ('serverpod_auth_core_user', 'createdAt', 'timestampWithoutTimeZone', NULL), + ('serverpod_auth_core_user', 'scopeNames', 'json', NULL), + ('serverpod_auth_core_user', 'blocked', 'boolean', NULL), + ('crdt_data_attempted_value', 'value', 'jsonb', NULL), + ('crdt_data_fields', 'hlcDatetime', 'timestampWithoutTimeZone', NULL), + ('crdt_data_rows', 'hlcDatetime', 'timestampWithoutTimeZone', NULL), + ('crdt_data_rows', 'uuidRowId', 'uuid', NULL), + ('crdt_data_tombstone', 'hlcDatetime', 'timestampWithoutTimeZone', NULL), + ('crdt_nodes', 'uuidNodeId', 'uuid', NULL), + ('crdt_nodes', 'lastHlc', 'jsonb', NULL), + ('crdt_schema_columns', 'isNullable', 'boolean', NULL), + ('offline_sync_integrity_violations', 'uuidRowId', 'uuid', NULL), + ('offline_sync_integrity_violations', 'ownerSpaceUuid', 'uuid', NULL), + ('offline_sync_integrity_violations', 'incomingSpaceUuid', 'uuid', NULL), + ('offline_sync_integrity_violations', 'uuidNodeId', 'uuid', NULL), + ('offline_sync_integrity_violations', 'hlcDatetime', 'timestampWithoutTimeZone', NULL), + ('offline_sync_integrity_violations', 'firstSeenAt', 'timestampWithoutTimeZone', NULL), + ('offline_sync_integrity_violations', 'lastSeenAt', 'timestampWithoutTimeZone', NULL), + ('offline_sync_space_members', 'userUuid', 'uuid', NULL), + ('offline_sync_space_nodes', 'lastReceivedHlc', 'jsonb', NULL), + ('offline_sync_spaces', 'uuidSpaceId', 'uuid', NULL); + +-- +-- MIGRATION VERSION FOR serverpod_offline_sync_test +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod_offline_sync_test', '20260930185557154', (unixepoch('now', 'subsecond') * 1000)) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20260930185557154', "timestamp" = (unixepoch('now', 'subsecond') * 1000); + +-- +-- MIGRATION VERSION FOR serverpod +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod', '20260824182259319', (unixepoch('now', 'subsecond') * 1000)) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20260824182259319', "timestamp" = (unixepoch('now', 'subsecond') * 1000); + +-- +-- MIGRATION VERSION FOR serverpod_auth_core +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod_auth_core', '20260924105232991', (unixepoch('now', 'subsecond') * 1000)) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20260924105232991', "timestamp" = (unixepoch('now', 'subsecond') * 1000); + +-- +-- MIGRATION VERSION FOR serverpod_offline_sync +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod_offline_sync', '20260914143806119', (unixepoch('now', 'subsecond') * 1000)) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20260914143806119', "timestamp" = (unixepoch('now', 'subsecond') * 1000); + + +COMMIT; +'''; +} diff --git a/test/serverpod_offline_sync_test_client/lib/migrations/20260930185557154/migration.json b/test/serverpod_offline_sync_test_client/lib/migrations/20260930185557154/migration.json new file mode 100644 index 0000000..869b49a --- /dev/null +++ b/test/serverpod_offline_sync_test_client/lib/migrations/20260930185557154/migration.json @@ -0,0 +1,42 @@ +{ + "__className__": "serverpod.DatabaseMigration", + "actions": [ + { + "__className__": "serverpod.DatabaseMigrationAction", + "type": "alterTable", + "alterTable": { + "__className__": "serverpod.TableMigration", + "name": "serverpod_auth_core_profile", + "schema": "public", + "addColumns": [], + "deleteColumns": [], + "modifyColumns": [], + "addIndexes": [], + "deleteIndexes": [], + "addForeignKeys": [ + { + "__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" + } + ], + "deleteForeignKeys": [ + "serverpod_auth_core_profile_fk_1" + ], + "warnings": [] + } + } + ], + "warnings": [], + "migrationApiVersion": 1 +} \ No newline at end of file diff --git a/test/serverpod_offline_sync_test_client/lib/migrations/migration_registry.dart b/test/serverpod_offline_sync_test_client/lib/migrations/migration_registry.dart index 13ca60a..c93a415 100644 --- a/test/serverpod_offline_sync_test_client/lib/migrations/migration_registry.dart +++ b/test/serverpod_offline_sync_test_client/lib/migrations/migration_registry.dart @@ -14,6 +14,7 @@ part '20260907165715131/migration.dart'; part '20260907170602693/migration.dart'; part '20260914144112288/migration.dart'; part '20260914165608984/migration.dart'; +part '20260930185557154/migration.dart'; /// Migration registry for the client-side database. class MigrationRegistry { @@ -30,6 +31,7 @@ class MigrationRegistry { _Migration20260907170602693(), _Migration20260914144112288(), _Migration20260914165608984(), + _Migration20260930185557154(), ]; /// List of all client-side database migration versions. diff --git a/test/serverpod_offline_sync_test_client/pubspec.yaml b/test/serverpod_offline_sync_test_client/pubspec.yaml index 9801977..5483891 100644 --- a/test/serverpod_offline_sync_test_client/pubspec.yaml +++ b/test/serverpod_offline_sync_test_client/pubspec.yaml @@ -8,9 +8,9 @@ environment: resolution: workspace dependencies: - serverpod_auth_core_client: 4.0.0 - serverpod_client: 4.0.0 - serverpod_database: 4.0.0 + serverpod_auth_core_client: ^4.0.0 + serverpod_client: ^4.0.0 + serverpod_database: ^4.0.0 serverpod_offline_sync_client: path: ../../packages/serverpod_offline_sync_client serverpod_offline_sync_test_shared: diff --git a/test/serverpod_offline_sync_test_server/migrations/20260930185557154/definition.json b/test/serverpod_offline_sync_test_server/migrations/20260930185557154/definition.json new file mode 100644 index 0000000..3f4bd8a --- /dev/null +++ b/test/serverpod_offline_sync_test_server/migrations/20260930185557154/definition.json @@ -0,0 +1,6126 @@ +{ + "__className__": "serverpod.DatabaseDefinition", + "schemaVersion": 2, + "moduleName": "serverpod_offline_sync_test", + "tables": [ + { + "__className__": "serverpod.TableDefinition", + "name": "address", + "dartName": "Address", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "street", + "fieldName": "street", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "inhabitantId", + "fieldName": "inhabitantId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "address_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "address_fk_1", + "columns": [ + "inhabitantId" + ], + "referenceTable": "person", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 3 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "address__inhabitantId__unique_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "inhabitantId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "city", + "dartName": "City", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "city_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "company", + "dartName": "Company", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "townId", + "fieldName": "townId", + "columnType": 7, + "isNullable": false, + "columnDefault": "'550e8400-e29b-41d4-a716-446655440000'", + "dartType": "UuidValue" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "company_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "company_fk_1", + "columns": [ + "townId" + ], + "referenceTable": "town", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 1, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "fk_chain_cascade_middle", + "dartName": "FkChainCascadeMiddle", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rootId", + "fieldName": "rootId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_cascade_middle_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_cascade_middle_fk_1", + "columns": [ + "rootId" + ], + "referenceTable": "fk_chain_root", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "fk_chain_middle_cascade_child", + "dartName": "FkChainMiddleCascadeChild", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "restrictBlockerId", + "fieldName": "restrictBlockerId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_middle_cascade_child_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_middle_cascade_child_fk_1", + "columns": [ + "restrictBlockerId" + ], + "referenceTable": "fk_chain_restrict_blocker", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "fk_chain_middle_set_null_child", + "dartName": "FkChainMiddleSetNullChild", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "restrictBlockerId", + "fieldName": "restrictBlockerId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_middle_set_null_child_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_middle_set_null_child_fk_1", + "columns": [ + "restrictBlockerId" + ], + "referenceTable": "fk_chain_restrict_blocker", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "fk_chain_restrict_blocker", + "dartName": "FkChainRestrictBlocker", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "cascadeMiddleId", + "fieldName": "cascadeMiddleId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_restrict_blocker_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_restrict_blocker_fk_1", + "columns": [ + "cascadeMiddleId" + ], + "referenceTable": "fk_chain_cascade_middle", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 3, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "fk_chain_root", + "dartName": "FkChainRoot", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_root_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "fk_chain_set_null_cascade_child", + "dartName": "FkChainSetNullCascadeChild", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "setNullMiddleId", + "fieldName": "setNullMiddleId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_set_null_cascade_child_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_set_null_cascade_child_fk_1", + "columns": [ + "setNullMiddleId" + ], + "referenceTable": "fk_chain_set_null_middle", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "fk_chain_set_null_middle", + "dartName": "FkChainSetNullMiddle", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "cascadeMiddleId", + "fieldName": "cascadeMiddleId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_set_null_middle_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_set_null_middle_fk_1", + "columns": [ + "cascadeMiddleId" + ], + "referenceTable": "fk_chain_cascade_middle", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "fk_chain_set_null_restrict_child", + "dartName": "FkChainSetNullRestrictChild", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "setNullMiddleId", + "fieldName": "setNullMiddleId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_set_null_restrict_child_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_set_null_restrict_child_fk_1", + "columns": [ + "setNullMiddleId" + ], + "referenceTable": "fk_chain_set_null_middle", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 3, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "fk_chain_set_null_set_null_child", + "dartName": "FkChainSetNullSetNullChild", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "setNullMiddleId", + "fieldName": "setNullMiddleId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_set_null_set_null_child_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_set_null_set_null_child_fk_1", + "columns": [ + "setNullMiddleId" + ], + "referenceTable": "fk_chain_set_null_middle", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "nullable_set_default_child", + "dartName": "NullableSetDefaultChild", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "parentId", + "fieldName": "parentId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "nullable_set_default_child_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "nullable_set_default_child_fk_1", + "columns": [ + "parentId" + ], + "referenceTable": "person", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 1, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "organization", + "dartName": "Organization", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "cityId", + "fieldName": "cityId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "organization_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "organization_fk_1", + "columns": [ + "cityId" + ], + "referenceTable": "city", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "person", + "dartName": "Person", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "surname", + "fieldName": "surname", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "organizationId", + "fieldName": "organizationId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "oldCompanyId", + "fieldName": "oldCompanyId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "cityId", + "fieldName": "cityId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "person_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "person_fk_1", + "columns": [ + "organizationId" + ], + "referenceTable": "organization", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "person_fk_2", + "columns": [ + "oldCompanyId" + ], + "referenceTable": "company", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 3 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "person_fk_3", + "columns": [ + "cityId" + ], + "referenceTable": "city", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 3, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "required_cascade_child", + "dartName": "RequiredCascadeChild", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "parentId", + "fieldName": "parentId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "required_cascade_child_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "required_cascade_child_fk_1", + "columns": [ + "parentId" + ], + "referenceTable": "person", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "required_no_action_child", + "dartName": "RequiredNoActionChild", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "parentId", + "fieldName": "parentId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "required_no_action_child_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "required_no_action_child_fk_1", + "columns": [ + "parentId" + ], + "referenceTable": "person", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 3, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "required_set_null_child", + "dartName": "RequiredSetNullChild", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "parentId", + "fieldName": "parentId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "required_set_null_child_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "required_set_null_child_fk_1", + "columns": [ + "parentId" + ], + "referenceTable": "person", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "restrict_child", + "dartName": "RestrictChild", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "parentId", + "fieldName": "parentId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "restrict_child_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "restrict_child_fk_1", + "columns": [ + "parentId" + ], + "referenceTable": "person", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 3, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "shared_child", + "dartName": "SharedChild", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "flavor", + "fieldName": "flavor", + "columnType": 0, + "isNullable": false, + "columnDefault": "'plain'", + "dartType": "serverpod_offline_sync_test_shared:SharedFlavor" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "parentId", + "fieldName": "parentId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "shared_child_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "shared_child_fk_1", + "columns": [ + "parentId" + ], + "referenceTable": "shared_parent", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "shared_parent", + "dartName": "SharedParent", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "shared_parent_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "town", + "dartName": "Town", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "cityId", + "fieldName": "cityId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "mayorId", + "fieldName": "mayorId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "town_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "town_fk_1", + "columns": [ + "cityId" + ], + "referenceTable": "city", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "town_fk_2", + "columns": [ + "mayorId" + ], + "referenceTable": "person", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "types", + "dartName": "Types", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "aBool", + "fieldName": "aBool", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "aDateTime", + "fieldName": "aDateTime", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "aText", + "fieldName": "aText", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "anInt", + "fieldName": "anInt", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "anInt64", + "fieldName": "anInt64", + "columnType": 0, + "isNullable": false, + "dartType": "BigInt" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "aReal", + "fieldName": "aReal", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "aBlob", + "fieldName": "aBlob", + "columnType": 5, + "isNullable": false, + "dartType": "dart:typed_data:ByteData" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "anEnum", + "fieldName": "anEnum", + "columnType": 6, + "isNullable": true, + "dartType": "protocol:TypesEnum?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "optionalText", + "fieldName": "optionalText", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "optionalUuid", + "fieldName": "optionalUuid", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "parentId", + "fieldName": "parentId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "jsonDocument", + "fieldName": "jsonDocument", + "columnType": 8, + "isNullable": true, + "dartType": "protocol:SyncDocument?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "jsonbDocument", + "fieldName": "jsonbDocument", + "columnType": 14, + "isNullable": true, + "dartType": "protocol:SyncDocument?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "jsonbNumbers", + "fieldName": "jsonbNumbers", + "columnType": 14, + "isNullable": true, + "dartType": "List?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "types_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "types_fk_1", + "columns": [ + "parentId" + ], + "referenceTable": "types", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 3 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "types_a_text_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "aText" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "unique", + "dartName": "Unique", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "unique__spaceId__name__unique_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "spaceId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "name" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "unique_cascade_child", + "dartName": "UniqueCascadeChild", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "parentId", + "fieldName": "parentId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_cascade_child_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_cascade_child_fk_1", + "columns": [ + "parentId" + ], + "referenceTable": "person", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "unique_cascade_child__spaceId__name__unique_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "spaceId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "name" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "unique_cascade_reference", + "dartName": "UniqueCascadeReference", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "parentId", + "fieldName": "parentId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_cascade_reference_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_cascade_reference_fk_1", + "columns": [ + "parentId" + ], + "referenceTable": "person", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "unique_cascade_reference__parentId__unique_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "parentId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "unique_composite", + "dartName": "UniqueComposite", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "scope", + "fieldName": "scope", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "value", + "fieldName": "value", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_composite_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "unique_composite__spaceId__scope__value__unique_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "spaceId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "scope" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "value" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "unique_discriminator", + "dartName": "UniqueDiscriminator", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "categoryId", + "fieldName": "categoryId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_discriminator_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "unique_discriminator__spaceId__categoryId__name__unique_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "spaceId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "categoryId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "name" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "unique_fk_pair", + "dartName": "UniqueFkPair", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "leftId", + "fieldName": "leftId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rightId", + "fieldName": "rightId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_fk_pair_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_fk_pair_fk_1", + "columns": [ + "leftId" + ], + "referenceTable": "person", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 3, + "deferrable": "initiallyDeferred" + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_fk_pair_fk_2", + "columns": [ + "rightId" + ], + "referenceTable": "person", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "unique_fk_pair_parents", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "leftId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "rightId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "unique_mixed_fk", + "dartName": "UniqueMixedFk", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "parentId", + "fieldName": "parentId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_mixed_fk_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_mixed_fk_fk_1", + "columns": [ + "parentId" + ], + "referenceTable": "person", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "unique_mixed_fk_name_parent", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "spaceId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "name" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "parentId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "unique_no_release", + "dartName": "UniqueNoRelease", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "categoryId", + "fieldName": "categoryId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_no_release_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "unique_no_release__spaceId__categoryId__unique_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "spaceId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "categoryId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "unique_nullable", + "dartName": "UniqueNullable", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "value", + "fieldName": "value", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_nullable_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "unique_nullable__spaceId__value__unique_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "spaceId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "value" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "unique_overlapping", + "dartName": "UniqueOverlapping", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "first", + "fieldName": "first", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "second", + "fieldName": "second", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "third", + "fieldName": "third", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_overlapping_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "unique_overlapping_first_second", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "spaceId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "first" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "second" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "unique_overlapping_second_third", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "spaceId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "second" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "third" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "unique_set_default_child", + "dartName": "UniqueSetDefaultChild", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "parentId", + "fieldName": "parentId", + "columnType": 7, + "isNullable": true, + "columnDefault": "'550e8400-e29b-41d4-a716-446655440000'", + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_set_default_child_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_set_default_child_fk_1", + "columns": [ + "parentId" + ], + "referenceTable": "town", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 1, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "unique_set_default_child__parentId__unique_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "parentId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "unique_set_null_child", + "dartName": "UniqueSetNullChild", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "parentId", + "fieldName": "parentId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_set_null_child_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_set_null_child_fk_1", + "columns": [ + "parentId" + ], + "referenceTable": "person", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "unique_set_null_child__parentId__unique_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "parentId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "unique_uuid", + "dartName": "UniqueUuid", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "value", + "fieldName": "value", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_uuid_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "unique_uuid__spaceId__value__unique_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "spaceId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "value" + } + ], + "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_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 + }, + { + "__className__": "serverpod.TableDefinition", + "name": "crdt_data_attempted_value", + "dartName": "CrdtDataAttemptedValue", + "module": "serverpod_offline_sync", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "fieldId", + "fieldName": "fieldId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "value", + "fieldName": "value", + "columnType": 14, + "isNullable": false, + "dartType": "dynamic" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "projectionReason", + "fieldName": "projectionReason", + "columnType": 6, + "isNullable": false, + "dartType": "serverpod_offline_sync:CrdtProjectionReason" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "crdt_data_attempted_value_fk_0", + "columns": [ + "fieldId" + ], + "referenceTable": "crdt_data_fields", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "crdt_data_attempted_value__fieldId__unique_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "fieldId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "crdt_data_fields", + "dartName": "CrdtDataField", + "module": "serverpod_offline_sync", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "hlcDatetime", + "fieldName": "hlcDatetime", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "hlcCounter", + "fieldName": "hlcCounter", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rowId", + "fieldName": "rowId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "columnId", + "fieldName": "columnId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "nodeId", + "fieldName": "nodeId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "crdt_data_fields_fk_0", + "columns": [ + "rowId" + ], + "referenceTable": "crdt_data_rows", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "crdt_data_fields_fk_1", + "columns": [ + "columnId" + ], + "referenceTable": "crdt_schema_columns", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "crdt_data_fields_fk_2", + "columns": [ + "nodeId" + ], + "referenceTable": "crdt_nodes", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 3 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "crdt_data_fields_row_column_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "rowId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "columnId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "crdt_data_rows", + "dartName": "CrdtDataRow", + "module": "serverpod_offline_sync", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "hlcDatetime", + "fieldName": "hlcDatetime", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "hlcCounter", + "fieldName": "hlcCounter", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "tblId", + "fieldName": "tblId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "uuidRowId", + "fieldName": "uuidRowId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "nodeId", + "fieldName": "nodeId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "visibility", + "fieldName": "visibility", + "columnType": 6, + "isNullable": false, + "columnDefault": "0", + "dartType": "serverpod_offline_sync:CrdtDataRowVisibility" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "crdt_data_rows_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "crdt_data_rows_fk_1", + "columns": [ + "tblId" + ], + "referenceTable": "crdt_schema_tables", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "crdt_data_rows_fk_2", + "columns": [ + "nodeId" + ], + "referenceTable": "crdt_nodes", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 3 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "crdt_data_rows_space_tbl_row_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "spaceId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "tblId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "uuidRowId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "crdt_data_tombstone", + "dartName": "CrdtDataDeleted", + "module": "serverpod_offline_sync", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "hlcDatetime", + "fieldName": "hlcDatetime", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "hlcCounter", + "fieldName": "hlcCounter", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rowId", + "fieldName": "rowId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "nodeId", + "fieldName": "nodeId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "clFlag", + "fieldName": "clFlag", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "reason", + "fieldName": "reason", + "columnType": 6, + "isNullable": false, + "dartType": "serverpod_offline_sync:CrdtDataDeletedReason" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "crdt_data_tombstone_fk_0", + "columns": [ + "rowId" + ], + "referenceTable": "crdt_data_rows", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "crdt_data_tombstone_fk_1", + "columns": [ + "nodeId" + ], + "referenceTable": "crdt_nodes", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 3 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "crdt_data_tombstone_row_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "rowId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "crdt_nodes", + "dartName": "CrdtNode", + "module": "serverpod_offline_sync", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "uuidNodeId", + "fieldName": "uuidNodeId", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastHlc", + "fieldName": "lastHlc", + "columnType": 14, + "isNullable": true, + "dartType": "package:serverpod_offline_sync/serverpod_offline_sync.dart:Hlc?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "crdt_nodes__uuidNodeId__unique_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "uuidNodeId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "crdt_schema_columns", + "dartName": "CrdtSchemaColumn", + "module": "serverpod_offline_sync", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "tblId", + "fieldName": "tblId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "columnType", + "fieldName": "columnType", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "dartType", + "fieldName": "dartType", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "isNullable", + "fieldName": "isNullable", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "crdt_schema_columns_fk_0", + "columns": [ + "tblId" + ], + "referenceTable": "crdt_schema_tables", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "crdt_schema_columns_table_column_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "tblId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "name" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "crdt_schema_tables", + "dartName": "CrdtSchemaTable", + "module": "serverpod_offline_sync", + "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" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "crdt_schema_tables__name__unique_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "name" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "offline_sync_integrity_violations", + "dartName": "OfflineSyncIntegrityViolation", + "module": "serverpod_offline_sync", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "type", + "fieldName": "type", + "columnType": 0, + "isNullable": false, + "dartType": "serverpod_offline_sync:OfflineSyncViolationType" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "domainTableName", + "fieldName": "domainTableName", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "uuidRowId", + "fieldName": "uuidRowId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "ownerSpaceUuid", + "fieldName": "ownerSpaceUuid", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "incomingSpaceUuid", + "fieldName": "incomingSpaceUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "operation", + "fieldName": "operation", + "columnType": 0, + "isNullable": false, + "dartType": "serverpod_offline_sync:OfflineSyncViolationOperation" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "uuidNodeId", + "fieldName": "uuidNodeId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "crdtDataRowId", + "fieldName": "crdtDataRowId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "hlcDatetime", + "fieldName": "hlcDatetime", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "hlcCounter", + "fieldName": "hlcCounter", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "firstSeenAt", + "fieldName": "firstSeenAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastSeenAt", + "fieldName": "lastSeenAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "occurrences", + "fieldName": "occurrences", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "offline_sync_integrity_violations_key_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "type" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "operation" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "domainTableName" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "uuidRowId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "ownerSpaceUuid" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "incomingSpaceUuid" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "offline_sync_space_members", + "dartName": "OfflineSyncSpaceMember", + "module": "serverpod_offline_sync", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "userUuid", + "fieldName": "userUuid", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "role", + "fieldName": "role", + "columnType": 0, + "isNullable": false, + "dartType": "serverpod_offline_sync:OfflineSyncSpaceRole" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "offline_sync_space_members_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "offline_sync_space_member_unique_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "userUuid" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "spaceId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "offline_sync_space_nodes", + "dartName": "OfflineSyncSpaceNode", + "module": "serverpod_offline_sync", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "nodeId", + "fieldName": "nodeId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "lastReceivedHlc", + "fieldName": "lastReceivedHlc", + "columnType": 14, + "isNullable": true, + "dartType": "package:serverpod_offline_sync/serverpod_offline_sync.dart:Hlc?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "offline_sync_space_nodes_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "offline_sync_space_nodes_fk_1", + "columns": [ + "nodeId" + ], + "referenceTable": "crdt_nodes", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "offline_sync_space_node_unique_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "spaceId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "nodeId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "offline_sync_spaces", + "dartName": "OfflineSyncSpace", + "module": "serverpod_offline_sync", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "serial", + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "uuidSpaceId", + "fieldName": "uuidSpaceId", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "currentNodeId", + "fieldName": "currentNodeId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "offline_sync_spaces_fk_0", + "columns": [ + "currentNodeId" + ], + "referenceTable": "crdt_nodes", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 3 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "offline_sync_spaces__uuidSpaceId__unique_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "uuidSpaceId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + } + ], + "installedModules": [ + { + "__className__": "serverpod.DatabaseMigrationVersionModel", + "module": "serverpod_offline_sync_test", + "version": "20260930185557154" + }, + { + "__className__": "serverpod.DatabaseMigrationVersion", + "module": "serverpod", + "version": "20260824182259319" + }, + { + "__className__": "serverpod.DatabaseMigrationVersion", + "module": "serverpod_auth_core", + "version": "20260924105232991" + }, + { + "__className__": "serverpod.DatabaseMigrationVersion", + "module": "serverpod_offline_sync", + "version": "20260914143806119" + } + ], + "migrationApiVersion": 1 +} \ No newline at end of file diff --git a/test/serverpod_offline_sync_test_server/migrations/20260930185557154/definition.sql b/test/serverpod_offline_sync_test_server/migrations/20260930185557154/definition.sql new file mode 100644 index 0000000..5505145 --- /dev/null +++ b/test/serverpod_offline_sync_test_server/migrations/20260930185557154/definition.sql @@ -0,0 +1,1248 @@ +BEGIN; + +-- +-- Class Address as table address +-- +CREATE TABLE "address" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "street" TEXT NOT NULL, + "inhabitantId" BLOB, + CONSTRAINT "address_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "address_fk_1" FOREIGN KEY ("inhabitantId") REFERENCES "person" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "address__inhabitantId__unique_idx" ON "address" ("inhabitantId"); + + +-- +-- Class City as table city +-- +CREATE TABLE "city" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "name" TEXT NOT NULL, + CONSTRAINT "city_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION +) STRICT; + + +-- +-- Class Company as table company +-- +CREATE TABLE "company" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "name" TEXT NOT NULL, + "townId" BLOB NOT NULL DEFAULT (X'550e8400e29b41d4a716446655440000'), + CONSTRAINT "company_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "company_fk_1" FOREIGN KEY ("townId") REFERENCES "town" ("id") ON DELETE SET DEFAULT ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED +) STRICT; + + +-- +-- Class FkChainCascadeMiddle as table fk_chain_cascade_middle +-- +CREATE TABLE "fk_chain_cascade_middle" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "name" TEXT NOT NULL, + "rootId" BLOB, + CONSTRAINT "fk_chain_cascade_middle_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "fk_chain_cascade_middle_fk_1" FOREIGN KEY ("rootId") REFERENCES "fk_chain_root" ("id") ON DELETE CASCADE ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED +) STRICT; + + +-- +-- Class FkChainMiddleCascadeChild as table fk_chain_middle_cascade_child +-- +CREATE TABLE "fk_chain_middle_cascade_child" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "name" TEXT NOT NULL, + "restrictBlockerId" BLOB, + CONSTRAINT "fk_chain_middle_cascade_child_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "fk_chain_middle_cascade_child_fk_1" FOREIGN KEY ("restrictBlockerId") REFERENCES "fk_chain_restrict_blocker" ("id") ON DELETE CASCADE ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED +) STRICT; + + +-- +-- Class FkChainMiddleSetNullChild as table fk_chain_middle_set_null_child +-- +CREATE TABLE "fk_chain_middle_set_null_child" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "name" TEXT NOT NULL, + "restrictBlockerId" BLOB, + CONSTRAINT "fk_chain_middle_set_null_child_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "fk_chain_middle_set_null_child_fk_1" FOREIGN KEY ("restrictBlockerId") REFERENCES "fk_chain_restrict_blocker" ("id") ON DELETE SET NULL ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED +) STRICT; + + +-- +-- Class FkChainRestrictBlocker as table fk_chain_restrict_blocker +-- +CREATE TABLE "fk_chain_restrict_blocker" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "name" TEXT NOT NULL, + "cascadeMiddleId" BLOB, + CONSTRAINT "fk_chain_restrict_blocker_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "fk_chain_restrict_blocker_fk_1" FOREIGN KEY ("cascadeMiddleId") REFERENCES "fk_chain_cascade_middle" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED +) STRICT; + + +-- +-- Class FkChainRoot as table fk_chain_root +-- +CREATE TABLE "fk_chain_root" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "name" TEXT NOT NULL, + CONSTRAINT "fk_chain_root_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION +) STRICT; + + +-- +-- Class FkChainSetNullCascadeChild as table fk_chain_set_null_cascade_child +-- +CREATE TABLE "fk_chain_set_null_cascade_child" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "name" TEXT NOT NULL, + "setNullMiddleId" BLOB, + CONSTRAINT "fk_chain_set_null_cascade_child_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "fk_chain_set_null_cascade_child_fk_1" FOREIGN KEY ("setNullMiddleId") REFERENCES "fk_chain_set_null_middle" ("id") ON DELETE CASCADE ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED +) STRICT; + + +-- +-- Class FkChainSetNullMiddle as table fk_chain_set_null_middle +-- +CREATE TABLE "fk_chain_set_null_middle" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "name" TEXT NOT NULL, + "cascadeMiddleId" BLOB, + CONSTRAINT "fk_chain_set_null_middle_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "fk_chain_set_null_middle_fk_1" FOREIGN KEY ("cascadeMiddleId") REFERENCES "fk_chain_cascade_middle" ("id") ON DELETE SET NULL ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED +) STRICT; + + +-- +-- Class FkChainSetNullRestrictChild as table fk_chain_set_null_restrict_child +-- +CREATE TABLE "fk_chain_set_null_restrict_child" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "name" TEXT NOT NULL, + "setNullMiddleId" BLOB, + CONSTRAINT "fk_chain_set_null_restrict_child_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "fk_chain_set_null_restrict_child_fk_1" FOREIGN KEY ("setNullMiddleId") REFERENCES "fk_chain_set_null_middle" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED +) STRICT; + + +-- +-- Class FkChainSetNullSetNullChild as table fk_chain_set_null_set_null_child +-- +CREATE TABLE "fk_chain_set_null_set_null_child" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "name" TEXT NOT NULL, + "setNullMiddleId" BLOB, + CONSTRAINT "fk_chain_set_null_set_null_child_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "fk_chain_set_null_set_null_child_fk_1" FOREIGN KEY ("setNullMiddleId") REFERENCES "fk_chain_set_null_middle" ("id") ON DELETE SET NULL ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED +) STRICT; + + +-- +-- Class NullableSetDefaultChild as table nullable_set_default_child +-- +CREATE TABLE "nullable_set_default_child" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "name" TEXT NOT NULL, + "parentId" BLOB, + CONSTRAINT "nullable_set_default_child_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "nullable_set_default_child_fk_1" FOREIGN KEY ("parentId") REFERENCES "person" ("id") ON DELETE SET DEFAULT ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED +) STRICT; + + +-- +-- Class Organization as table organization +-- +CREATE TABLE "organization" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "name" TEXT NOT NULL, + "cityId" BLOB, + CONSTRAINT "organization_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "organization_fk_1" FOREIGN KEY ("cityId") REFERENCES "city" ("id") ON DELETE CASCADE ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED +) STRICT; + + +-- +-- Class Person as table person +-- +CREATE TABLE "person" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "name" TEXT NOT NULL, + "surname" TEXT, + "organizationId" BLOB, + "oldCompanyId" BLOB, + "cityId" BLOB, + CONSTRAINT "person_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "person_fk_1" FOREIGN KEY ("organizationId") REFERENCES "organization" ("id") ON DELETE CASCADE ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED, + CONSTRAINT "person_fk_2" FOREIGN KEY ("oldCompanyId") REFERENCES "company" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION, + CONSTRAINT "person_fk_3" FOREIGN KEY ("cityId") REFERENCES "city" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED +) STRICT; + + +-- +-- Class RequiredCascadeChild as table required_cascade_child +-- +CREATE TABLE "required_cascade_child" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "name" TEXT NOT NULL, + "parentId" BLOB NOT NULL, + CONSTRAINT "required_cascade_child_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "required_cascade_child_fk_1" FOREIGN KEY ("parentId") REFERENCES "person" ("id") ON DELETE CASCADE ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED +) STRICT; + + +-- +-- Class RequiredNoActionChild as table required_no_action_child +-- +CREATE TABLE "required_no_action_child" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "name" TEXT NOT NULL, + "parentId" BLOB NOT NULL, + CONSTRAINT "required_no_action_child_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "required_no_action_child_fk_1" FOREIGN KEY ("parentId") REFERENCES "person" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED +) STRICT; + + +-- +-- Class RequiredSetNullChild as table required_set_null_child +-- +CREATE TABLE "required_set_null_child" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "name" TEXT NOT NULL, + "parentId" BLOB NOT NULL, + CONSTRAINT "required_set_null_child_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "required_set_null_child_fk_1" FOREIGN KEY ("parentId") REFERENCES "person" ("id") ON DELETE SET NULL ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED +) STRICT; + + +-- +-- Class RestrictChild as table restrict_child +-- +CREATE TABLE "restrict_child" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "name" TEXT NOT NULL, + "parentId" BLOB, + CONSTRAINT "restrict_child_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "restrict_child_fk_1" FOREIGN KEY ("parentId") REFERENCES "person" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED +) STRICT; + + +-- +-- Class SharedChild as table shared_child +-- +CREATE TABLE "shared_child" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "name" TEXT NOT NULL, + "flavor" TEXT NOT NULL DEFAULT ('plain'), + "parentId" BLOB, + CONSTRAINT "shared_child_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "shared_child_fk_1" FOREIGN KEY ("parentId") REFERENCES "shared_parent" ("id") ON DELETE SET NULL ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED +) STRICT; + + +-- +-- Class SharedParent as table shared_parent +-- +CREATE TABLE "shared_parent" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "name" TEXT NOT NULL, + CONSTRAINT "shared_parent_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION +) STRICT; + + +-- +-- Class Town as table town +-- +CREATE TABLE "town" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "name" TEXT NOT NULL, + "cityId" BLOB, + "mayorId" BLOB, + CONSTRAINT "town_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "town_fk_1" FOREIGN KEY ("cityId") REFERENCES "city" ("id") ON DELETE CASCADE ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED, + CONSTRAINT "town_fk_2" FOREIGN KEY ("mayorId") REFERENCES "person" ("id") ON DELETE SET NULL ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED +) STRICT; + + +-- +-- Class Types as table types +-- +CREATE TABLE "types" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "aBool" INTEGER NOT NULL, + "aDateTime" INTEGER NOT NULL, + "aText" TEXT NOT NULL, + "anInt" INTEGER NOT NULL, + "anInt64" TEXT NOT NULL, + "aReal" REAL NOT NULL, + "aBlob" BLOB NOT NULL, + "anEnum" INTEGER, + "optionalText" TEXT, + "optionalUuid" BLOB, + "parentId" BLOB, + "jsonDocument" TEXT, + "jsonbDocument" BLOB, + "jsonbNumbers" BLOB, + CONSTRAINT "types_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "types_fk_1" FOREIGN KEY ("parentId") REFERENCES "types" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION +) STRICT; + +-- Indexes +CREATE INDEX "types_a_text_idx" ON "types" ("aText"); + + +-- +-- Class Unique as table unique +-- +CREATE TABLE "unique" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "name" TEXT NOT NULL, + CONSTRAINT "unique_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "unique__spaceId__name__unique_idx" ON "unique" ("spaceId", "name"); + + +-- +-- Class UniqueCascadeChild as table unique_cascade_child +-- +CREATE TABLE "unique_cascade_child" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "name" TEXT NOT NULL, + "parentId" BLOB, + CONSTRAINT "unique_cascade_child_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "unique_cascade_child_fk_1" FOREIGN KEY ("parentId") REFERENCES "person" ("id") ON DELETE CASCADE ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "unique_cascade_child__spaceId__name__unique_idx" ON "unique_cascade_child" ("spaceId", "name"); + + +-- +-- Class UniqueCascadeReference as table unique_cascade_reference +-- +CREATE TABLE "unique_cascade_reference" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "name" TEXT NOT NULL, + "parentId" BLOB, + CONSTRAINT "unique_cascade_reference_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "unique_cascade_reference_fk_1" FOREIGN KEY ("parentId") REFERENCES "person" ("id") ON DELETE CASCADE ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "unique_cascade_reference__parentId__unique_idx" ON "unique_cascade_reference" ("parentId"); + + +-- +-- Class UniqueComposite as table unique_composite +-- +CREATE TABLE "unique_composite" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "scope" TEXT NOT NULL, + "value" TEXT NOT NULL, + CONSTRAINT "unique_composite_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "unique_composite__spaceId__scope__value__unique_idx" ON "unique_composite" ("spaceId", "scope", "value"); + + +-- +-- Class UniqueDiscriminator as table unique_discriminator +-- +CREATE TABLE "unique_discriminator" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "categoryId" INTEGER NOT NULL, + "name" TEXT NOT NULL, + CONSTRAINT "unique_discriminator_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "unique_discriminator__spaceId__categoryId__name__unique_idx" ON "unique_discriminator" ("spaceId", "categoryId", "name"); + + +-- +-- Class UniqueFkPair as table unique_fk_pair +-- +CREATE TABLE "unique_fk_pair" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "name" TEXT NOT NULL, + "leftId" BLOB, + "rightId" BLOB, + CONSTRAINT "unique_fk_pair_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "unique_fk_pair_fk_1" FOREIGN KEY ("leftId") REFERENCES "person" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED, + CONSTRAINT "unique_fk_pair_fk_2" FOREIGN KEY ("rightId") REFERENCES "person" ("id") ON DELETE SET NULL ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "unique_fk_pair_parents" ON "unique_fk_pair" ("leftId", "rightId"); + + +-- +-- Class UniqueMixedFk as table unique_mixed_fk +-- +CREATE TABLE "unique_mixed_fk" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "name" TEXT NOT NULL, + "parentId" BLOB, + CONSTRAINT "unique_mixed_fk_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "unique_mixed_fk_fk_1" FOREIGN KEY ("parentId") REFERENCES "person" ("id") ON DELETE CASCADE ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "unique_mixed_fk_name_parent" ON "unique_mixed_fk" ("spaceId", "name", "parentId"); + + +-- +-- Class UniqueNoRelease as table unique_no_release +-- +CREATE TABLE "unique_no_release" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "categoryId" INTEGER NOT NULL, + CONSTRAINT "unique_no_release_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "unique_no_release__spaceId__categoryId__unique_idx" ON "unique_no_release" ("spaceId", "categoryId"); + + +-- +-- Class UniqueNullable as table unique_nullable +-- +CREATE TABLE "unique_nullable" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "value" INTEGER, + CONSTRAINT "unique_nullable_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "unique_nullable__spaceId__value__unique_idx" ON "unique_nullable" ("spaceId", "value"); + + +-- +-- Class UniqueOverlapping as table unique_overlapping +-- +CREATE TABLE "unique_overlapping" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "first" TEXT NOT NULL, + "second" TEXT NOT NULL, + "third" TEXT NOT NULL, + CONSTRAINT "unique_overlapping_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "unique_overlapping_first_second" ON "unique_overlapping" ("spaceId", "first", "second"); +CREATE UNIQUE INDEX "unique_overlapping_second_third" ON "unique_overlapping" ("spaceId", "second", "third"); + + +-- +-- Class UniqueSetDefaultChild as table unique_set_default_child +-- +CREATE TABLE "unique_set_default_child" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "name" TEXT NOT NULL, + "parentId" BLOB DEFAULT (X'550e8400e29b41d4a716446655440000'), + CONSTRAINT "unique_set_default_child_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "unique_set_default_child_fk_1" FOREIGN KEY ("parentId") REFERENCES "town" ("id") ON DELETE SET DEFAULT ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "unique_set_default_child__parentId__unique_idx" ON "unique_set_default_child" ("parentId"); + + +-- +-- Class UniqueSetNullChild as table unique_set_null_child +-- +CREATE TABLE "unique_set_null_child" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "name" TEXT NOT NULL, + "parentId" BLOB, + CONSTRAINT "unique_set_null_child_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "unique_set_null_child_fk_1" FOREIGN KEY ("parentId") REFERENCES "person" ("id") ON DELETE SET NULL ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "unique_set_null_child__parentId__unique_idx" ON "unique_set_null_child" ("parentId"); + + +-- +-- Class UniqueUuid as table unique_uuid +-- +CREATE TABLE "unique_uuid" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "spaceId" INTEGER, + "value" BLOB NOT NULL, + CONSTRAINT "unique_uuid_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "unique_uuid__spaceId__value__unique_idx" ON "unique_uuid" ("spaceId", "value"); + + +-- +-- Class CloudStorageEntry as table serverpod_cloud_storage +-- +CREATE TABLE "serverpod_cloud_storage" ( + "id" INTEGER PRIMARY KEY, + "storageId" TEXT NOT NULL, + "path" TEXT NOT NULL, + "addedTime" INTEGER NOT NULL, + "expiration" INTEGER, + "byteData" BLOB NOT NULL, + "verified" INTEGER NOT NULL, + "contentType" TEXT, + "cacheControl" TEXT, + "contentDisposition" TEXT, + "contentEncoding" TEXT, + "customMetadata" TEXT +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "serverpod_cloud_storage_path_idx" ON "serverpod_cloud_storage" ("storageId", "path"); +CREATE INDEX "serverpod_cloud_storage_expiration" ON "serverpod_cloud_storage" ("expiration"); + + +-- +-- Class CloudStorageDirectDownloadEntry as table serverpod_cloud_storage_direct_download +-- +CREATE TABLE "serverpod_cloud_storage_direct_download" ( + "id" INTEGER PRIMARY KEY, + "storageId" TEXT NOT NULL, + "path" TEXT NOT NULL, + "expiration" INTEGER NOT NULL, + "authKey" TEXT NOT NULL, + "downloadFileName" TEXT, + "contentType" TEXT +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "serverpod_cloud_storage_direct_download_auth_key" ON "serverpod_cloud_storage_direct_download" ("authKey"); +CREATE INDEX "serverpod_cloud_storage_direct_download_expiration" ON "serverpod_cloud_storage_direct_download" ("expiration"); + + +-- +-- Class CloudStorageDirectUploadEntry as table serverpod_cloud_storage_direct_upload +-- +CREATE TABLE "serverpod_cloud_storage_direct_upload" ( + "id" INTEGER PRIMARY KEY, + "storageId" TEXT NOT NULL, + "path" TEXT NOT NULL, + "expiration" INTEGER NOT NULL, + "authKey" TEXT NOT NULL, + "maxFileSize" INTEGER NOT NULL DEFAULT (10485760), + "contentLength" INTEGER, + "preventOverwrite" INTEGER NOT NULL DEFAULT (0), + "contentType" TEXT, + "cacheControl" TEXT, + "contentDisposition" TEXT, + "contentEncoding" TEXT, + "customMetadata" TEXT +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "serverpod_cloud_storage_direct_upload_storage_path" ON "serverpod_cloud_storage_direct_upload" ("storageId", "path"); + + +-- +-- Class FutureCallEntry as table serverpod_future_call +-- +CREATE TABLE "serverpod_future_call" ( + "id" INTEGER PRIMARY KEY, + "name" TEXT NOT NULL, + "time" INTEGER NOT NULL, + "serializedObject" TEXT, + "serverId" TEXT NOT NULL, + "identifier" TEXT, + "scheduling" TEXT +) STRICT; + +-- Indexes +CREATE INDEX "serverpod_future_call_time_idx" ON "serverpod_future_call" ("time"); +CREATE INDEX "serverpod_future_call_serverId_idx" ON "serverpod_future_call" ("serverId"); +CREATE INDEX "serverpod_future_call_identifier_idx" ON "serverpod_future_call" ("identifier"); + + +-- +-- Class FutureCallClaimEntry as table serverpod_future_call_claim +-- +CREATE TABLE "serverpod_future_call_claim" ( + "id" INTEGER PRIMARY KEY, + "futureCallId" INTEGER, + "lastHeartbeatTime" INTEGER NOT NULL, + CONSTRAINT "serverpod_future_call_claim_fk_0" FOREIGN KEY ("futureCallId") REFERENCES "serverpod_future_call" ("id") ON DELETE CASCADE ON UPDATE NO ACTION +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "future_call_unique_idx" ON "serverpod_future_call_claim" ("futureCallId"); + + +-- +-- Class ServerHealthConnectionInfo as table serverpod_health_connection_info +-- +CREATE TABLE "serverpod_health_connection_info" ( + "id" INTEGER PRIMARY KEY, + "serverId" TEXT NOT NULL, + "timestamp" INTEGER NOT NULL, + "active" INTEGER NOT NULL, + "closing" INTEGER NOT NULL, + "idle" INTEGER NOT NULL, + "granularity" INTEGER NOT NULL +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "serverpod_health_connection_info_timestamp_idx" ON "serverpod_health_connection_info" ("timestamp", "serverId", "granularity"); + + +-- +-- Class ServerHealthMetric as table serverpod_health_metric +-- +CREATE TABLE "serverpod_health_metric" ( + "id" INTEGER PRIMARY KEY, + "name" TEXT NOT NULL, + "serverId" TEXT NOT NULL, + "timestamp" INTEGER NOT NULL, + "isHealthy" INTEGER NOT NULL, + "value" REAL NOT NULL, + "granularity" INTEGER NOT NULL +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "serverpod_health_metric_timestamp_idx" ON "serverpod_health_metric" ("timestamp", "serverId", "name", "granularity"); + + +-- +-- Class LogEntry as table serverpod_log +-- +CREATE TABLE "serverpod_log" ( + "id" INTEGER PRIMARY KEY, + "sessionLogId" INTEGER NOT NULL, + "messageId" INTEGER, + "reference" TEXT, + "serverId" TEXT NOT NULL, + "time" INTEGER NOT NULL, + "logLevel" INTEGER NOT NULL, + "message" TEXT NOT NULL, + "error" TEXT, + "stackTrace" TEXT, + "order" INTEGER NOT NULL, + CONSTRAINT "serverpod_log_fk_0" FOREIGN KEY ("sessionLogId") REFERENCES "serverpod_session_log" ("id") ON DELETE CASCADE ON UPDATE NO ACTION +) STRICT; + +-- Indexes +CREATE INDEX "serverpod_log_sessionLogId_idx" ON "serverpod_log" ("sessionLogId", "order"); + + +-- +-- Class MessageLogEntry as table serverpod_message_log +-- +CREATE TABLE "serverpod_message_log" ( + "id" INTEGER PRIMARY KEY, + "sessionLogId" INTEGER NOT NULL, + "serverId" TEXT NOT NULL, + "messageId" INTEGER NOT NULL, + "endpoint" TEXT NOT NULL, + "messageName" TEXT NOT NULL, + "duration" REAL NOT NULL, + "error" TEXT, + "stackTrace" TEXT, + "slow" INTEGER NOT NULL, + "order" INTEGER NOT NULL, + CONSTRAINT "serverpod_message_log_fk_0" FOREIGN KEY ("sessionLogId") REFERENCES "serverpod_session_log" ("id") ON DELETE CASCADE ON UPDATE NO ACTION +) STRICT; + +-- Indexes +CREATE INDEX "serverpod_message_log_sessionLogId_idx" ON "serverpod_message_log" ("sessionLogId", "order"); + + +-- +-- Class MethodInfo as table serverpod_method +-- +CREATE TABLE "serverpod_method" ( + "id" INTEGER PRIMARY KEY, + "endpoint" TEXT NOT NULL, + "method" TEXT NOT NULL +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "serverpod_method_endpoint_method_idx" ON "serverpod_method" ("endpoint", "method"); + + +-- +-- Class DatabaseMigrationVersion as table serverpod_migrations +-- +CREATE TABLE "serverpod_migrations" ( + "id" INTEGER PRIMARY KEY, + "module" TEXT NOT NULL, + "version" TEXT NOT NULL, + "timestamp" INTEGER +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "serverpod_migrations_ids" ON "serverpod_migrations" ("module"); + + +-- +-- Class QueryLogEntry as table serverpod_query_log +-- +CREATE TABLE "serverpod_query_log" ( + "id" INTEGER PRIMARY KEY, + "serverId" TEXT NOT NULL, + "sessionLogId" INTEGER NOT NULL, + "messageId" INTEGER, + "query" TEXT NOT NULL, + "duration" REAL NOT NULL, + "numRows" INTEGER, + "error" TEXT, + "stackTrace" TEXT, + "slow" INTEGER NOT NULL, + "order" INTEGER NOT NULL, + CONSTRAINT "serverpod_query_log_fk_0" FOREIGN KEY ("sessionLogId") REFERENCES "serverpod_session_log" ("id") ON DELETE CASCADE ON UPDATE NO ACTION +) STRICT; + +-- Indexes +CREATE INDEX "serverpod_query_log_sessionLogId_idx" ON "serverpod_query_log" ("sessionLogId", "order"); + + +-- +-- Class ReadWriteTestEntry as table serverpod_readwrite_test +-- +CREATE TABLE "serverpod_readwrite_test" ( + "id" INTEGER PRIMARY KEY, + "number" INTEGER NOT NULL +) STRICT; + + +-- +-- Class RuntimeSettings as table serverpod_runtime_settings +-- +CREATE TABLE "serverpod_runtime_settings" ( + "id" INTEGER PRIMARY KEY, + "logSettings" TEXT NOT NULL, + "logSettingsOverrides" TEXT NOT NULL, + "logServiceCalls" INTEGER NOT NULL, + "logMalformedCalls" INTEGER NOT NULL +) STRICT; + + +-- +-- Class SessionLogEntry as table serverpod_session_log +-- +CREATE TABLE "serverpod_session_log" ( + "id" INTEGER PRIMARY KEY, + "serverId" TEXT NOT NULL, + "time" INTEGER NOT NULL, + "module" TEXT, + "endpoint" TEXT, + "method" TEXT, + "duration" REAL, + "numQueries" INTEGER, + "slow" INTEGER, + "error" TEXT, + "stackTrace" TEXT, + "authenticatedUserId" INTEGER, + "userId" TEXT, + "isOpen" INTEGER, + "touched" INTEGER NOT NULL +) STRICT; + +-- Indexes +CREATE INDEX "serverpod_session_log_serverid_idx" ON "serverpod_session_log" ("serverId"); +CREATE INDEX "serverpod_session_log_time_idx" ON "serverpod_session_log" ("time"); +CREATE INDEX "serverpod_session_log_touched_idx" ON "serverpod_session_log" ("touched"); +CREATE INDEX "serverpod_session_log_isopen_idx" ON "serverpod_session_log" ("isOpen"); + + +-- +-- Class RefreshToken as table serverpod_auth_core_jwt_refresh_token +-- +CREATE TABLE "serverpod_auth_core_jwt_refresh_token" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "authUserId" BLOB NOT NULL, + "scopeNames" TEXT NOT NULL, + "extraClaims" TEXT, + "method" TEXT NOT NULL, + "fixedSecret" BLOB NOT NULL, + "rotatingSecretHash" TEXT NOT NULL, + "lastUpdatedAt" INTEGER NOT NULL DEFAULT (CAST(unixepoch('subsecond') * 1000 AS INTEGER)), + "createdAt" INTEGER NOT NULL DEFAULT (CAST(unixepoch('subsecond') * 1000 AS INTEGER)), + CONSTRAINT "serverpod_auth_core_jwt_refresh_token_fk_0" FOREIGN KEY ("authUserId") REFERENCES "serverpod_auth_core_user" ("id") ON DELETE CASCADE ON UPDATE NO ACTION +) STRICT; + +-- Indexes +CREATE INDEX "serverpod_auth_core_jwt_refresh_token_last_updated_at" ON "serverpod_auth_core_jwt_refresh_token" ("lastUpdatedAt"); + + +-- +-- Class UserProfile as table serverpod_auth_core_profile +-- +CREATE TABLE "serverpod_auth_core_profile" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "authUserId" BLOB NOT NULL, + "userName" TEXT, + "fullName" TEXT, + "email" TEXT, + "createdAt" INTEGER NOT NULL DEFAULT (CAST(unixepoch('subsecond') * 1000 AS INTEGER)), + "imageId" BLOB, + CONSTRAINT "serverpod_auth_core_profile_fk_0" FOREIGN KEY ("authUserId") REFERENCES "serverpod_auth_core_user" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "serverpod_auth_core_profile_fk_1" FOREIGN KEY ("imageId") REFERENCES "serverpod_auth_core_profile_image" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "serverpod_auth_profile_user_profile_email_auth_user_id" ON "serverpod_auth_core_profile" ("authUserId"); + + +-- +-- Class UserProfileImage as table serverpod_auth_core_profile_image +-- +CREATE TABLE "serverpod_auth_core_profile_image" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "userProfileId" BLOB NOT NULL, + "createdAt" INTEGER NOT NULL DEFAULT (CAST(unixepoch('subsecond') * 1000 AS INTEGER)), + "storageId" TEXT NOT NULL, + "path" TEXT NOT NULL, + "url" TEXT NOT NULL, + CONSTRAINT "serverpod_auth_core_profile_image_fk_0" FOREIGN KEY ("userProfileId") REFERENCES "serverpod_auth_core_profile" ("id") ON DELETE CASCADE ON UPDATE NO ACTION +) STRICT; + + +-- +-- Class ServerSideSession as table serverpod_auth_core_session +-- +CREATE TABLE "serverpod_auth_core_session" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "authUserId" BLOB NOT NULL, + "scopeNames" TEXT NOT NULL, + "createdAt" INTEGER NOT NULL DEFAULT (CAST(unixepoch('subsecond') * 1000 AS INTEGER)), + "lastUsedAt" INTEGER NOT NULL DEFAULT (CAST(unixepoch('subsecond') * 1000 AS INTEGER)), + "expiresAt" INTEGER, + "expireAfterUnusedFor" INTEGER, + "sessionKeyHash" BLOB NOT NULL, + "sessionKeySalt" BLOB NOT NULL, + "method" TEXT NOT NULL, + CONSTRAINT "serverpod_auth_core_session_fk_0" FOREIGN KEY ("authUserId") REFERENCES "serverpod_auth_core_user" ("id") ON DELETE CASCADE ON UPDATE NO ACTION +) STRICT; + + +-- +-- Class AuthUser as table serverpod_auth_core_user +-- +CREATE TABLE "serverpod_auth_core_user" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "createdAt" INTEGER NOT NULL, + "scopeNames" TEXT NOT NULL, + "blocked" INTEGER NOT NULL +) STRICT; + + +-- +-- Class CrdtDataAttemptedValue as table crdt_data_attempted_value +-- +CREATE TABLE "crdt_data_attempted_value" ( + "id" INTEGER PRIMARY KEY, + "fieldId" INTEGER NOT NULL, + "value" BLOB NOT NULL, + "projectionReason" INTEGER NOT NULL, + CONSTRAINT "crdt_data_attempted_value_fk_0" FOREIGN KEY ("fieldId") REFERENCES "crdt_data_fields" ("id") ON DELETE CASCADE ON UPDATE NO ACTION +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "crdt_data_attempted_value__fieldId__unique_idx" ON "crdt_data_attempted_value" ("fieldId"); + + +-- +-- Class CrdtDataField as table crdt_data_fields +-- +CREATE TABLE "crdt_data_fields" ( + "id" INTEGER PRIMARY KEY, + "hlcDatetime" INTEGER NOT NULL, + "hlcCounter" INTEGER NOT NULL, + "rowId" INTEGER NOT NULL, + "columnId" INTEGER NOT NULL, + "nodeId" INTEGER NOT NULL, + CONSTRAINT "crdt_data_fields_fk_0" FOREIGN KEY ("rowId") REFERENCES "crdt_data_rows" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "crdt_data_fields_fk_1" FOREIGN KEY ("columnId") REFERENCES "crdt_schema_columns" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "crdt_data_fields_fk_2" FOREIGN KEY ("nodeId") REFERENCES "crdt_nodes" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "crdt_data_fields_row_column_idx" ON "crdt_data_fields" ("rowId", "columnId"); + + +-- +-- Class CrdtDataRow as table crdt_data_rows +-- +CREATE TABLE "crdt_data_rows" ( + "id" INTEGER PRIMARY KEY, + "hlcDatetime" INTEGER NOT NULL, + "hlcCounter" INTEGER NOT NULL, + "spaceId" INTEGER NOT NULL, + "tblId" INTEGER NOT NULL, + "uuidRowId" BLOB NOT NULL, + "nodeId" INTEGER NOT NULL, + "visibility" INTEGER NOT NULL DEFAULT (0), + CONSTRAINT "crdt_data_rows_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "crdt_data_rows_fk_1" FOREIGN KEY ("tblId") REFERENCES "crdt_schema_tables" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "crdt_data_rows_fk_2" FOREIGN KEY ("nodeId") REFERENCES "crdt_nodes" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "crdt_data_rows_space_tbl_row_idx" ON "crdt_data_rows" ("spaceId", "tblId", "uuidRowId"); + + +-- +-- Class CrdtDataDeleted as table crdt_data_tombstone +-- +CREATE TABLE "crdt_data_tombstone" ( + "id" INTEGER PRIMARY KEY, + "hlcDatetime" INTEGER NOT NULL, + "hlcCounter" INTEGER NOT NULL, + "rowId" INTEGER NOT NULL, + "nodeId" INTEGER NOT NULL, + "clFlag" INTEGER NOT NULL, + "reason" INTEGER NOT NULL, + CONSTRAINT "crdt_data_tombstone_fk_0" FOREIGN KEY ("rowId") REFERENCES "crdt_data_rows" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "crdt_data_tombstone_fk_1" FOREIGN KEY ("nodeId") REFERENCES "crdt_nodes" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "crdt_data_tombstone_row_idx" ON "crdt_data_tombstone" ("rowId"); + + +-- +-- Class CrdtNode as table crdt_nodes +-- +CREATE TABLE "crdt_nodes" ( + "id" INTEGER PRIMARY KEY, + "uuidNodeId" BLOB NOT NULL DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "lastHlc" BLOB +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "crdt_nodes__uuidNodeId__unique_idx" ON "crdt_nodes" ("uuidNodeId"); + + +-- +-- Class CrdtSchemaColumn as table crdt_schema_columns +-- +CREATE TABLE "crdt_schema_columns" ( + "id" INTEGER PRIMARY KEY, + "tblId" INTEGER NOT NULL, + "name" TEXT NOT NULL, + "columnType" TEXT NOT NULL, + "dartType" TEXT NOT NULL, + "isNullable" INTEGER NOT NULL, + CONSTRAINT "crdt_schema_columns_fk_0" FOREIGN KEY ("tblId") REFERENCES "crdt_schema_tables" ("id") ON DELETE CASCADE ON UPDATE NO ACTION +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "crdt_schema_columns_table_column_idx" ON "crdt_schema_columns" ("tblId", "name"); + + +-- +-- Class CrdtSchemaTable as table crdt_schema_tables +-- +CREATE TABLE "crdt_schema_tables" ( + "id" INTEGER PRIMARY KEY, + "name" TEXT NOT NULL +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "crdt_schema_tables__name__unique_idx" ON "crdt_schema_tables" ("name"); + + +-- +-- Class OfflineSyncIntegrityViolation as table offline_sync_integrity_violations +-- +CREATE TABLE "offline_sync_integrity_violations" ( + "id" INTEGER PRIMARY KEY, + "type" TEXT NOT NULL, + "domainTableName" TEXT NOT NULL, + "uuidRowId" BLOB NOT NULL, + "ownerSpaceUuid" BLOB, + "incomingSpaceUuid" BLOB NOT NULL, + "operation" TEXT NOT NULL, + "uuidNodeId" BLOB, + "crdtDataRowId" INTEGER, + "hlcDatetime" INTEGER, + "hlcCounter" INTEGER, + "firstSeenAt" INTEGER NOT NULL, + "lastSeenAt" INTEGER NOT NULL, + "occurrences" INTEGER NOT NULL +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "offline_sync_integrity_violations_key_idx" ON "offline_sync_integrity_violations" ("type", "operation", "domainTableName", "uuidRowId", "ownerSpaceUuid", "incomingSpaceUuid"); + + +-- +-- Class OfflineSyncSpaceMember as table offline_sync_space_members +-- +CREATE TABLE "offline_sync_space_members" ( + "id" INTEGER PRIMARY KEY, + "spaceId" INTEGER NOT NULL, + "userUuid" BLOB NOT NULL, + "role" TEXT NOT NULL, + CONSTRAINT "offline_sync_space_members_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "offline_sync_space_member_unique_idx" ON "offline_sync_space_members" ("userUuid", "spaceId"); + + +-- +-- Class OfflineSyncSpaceNode as table offline_sync_space_nodes +-- +CREATE TABLE "offline_sync_space_nodes" ( + "id" INTEGER PRIMARY KEY, + "spaceId" INTEGER NOT NULL, + "nodeId" INTEGER NOT NULL, + "lastReceivedHlc" BLOB, + CONSTRAINT "offline_sync_space_nodes_fk_0" FOREIGN KEY ("spaceId") REFERENCES "offline_sync_spaces" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "offline_sync_space_nodes_fk_1" FOREIGN KEY ("nodeId") REFERENCES "crdt_nodes" ("id") ON DELETE CASCADE ON UPDATE NO ACTION +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "offline_sync_space_node_unique_idx" ON "offline_sync_space_nodes" ("spaceId", "nodeId"); + + +-- +-- Class OfflineSyncSpace as table offline_sync_spaces +-- +CREATE TABLE "offline_sync_spaces" ( + "id" INTEGER PRIMARY KEY, + "uuidSpaceId" BLOB NOT NULL DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "currentNodeId" INTEGER, + CONSTRAINT "offline_sync_spaces_fk_0" FOREIGN KEY ("currentNodeId") REFERENCES "crdt_nodes" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION +) STRICT; + +-- Indexes +CREATE UNIQUE INDEX "offline_sync_spaces__uuidSpaceId__unique_idx" ON "offline_sync_spaces" ("uuidSpaceId"); + + +-- +-- STORE COLUMN TYPES FOR MIGRATIONS +-- +DROP TABLE IF EXISTS "serverpod_sqlite_schema"; + +CREATE TABLE "serverpod_sqlite_schema" ( + "table_name" TEXT NOT NULL, + "column_name" TEXT NOT NULL, + "column_type" TEXT NOT NULL, + "column_vector_dimension" INTEGER, + PRIMARY KEY ("table_name", "column_name") +); + +INSERT INTO "serverpod_sqlite_schema" VALUES + ('address', 'id', 'uuid', NULL), + ('address', 'inhabitantId', 'uuid', NULL), + ('city', 'id', 'uuid', NULL), + ('company', 'id', 'uuid', NULL), + ('company', 'townId', 'uuid', NULL), + ('fk_chain_cascade_middle', 'id', 'uuid', NULL), + ('fk_chain_cascade_middle', 'rootId', 'uuid', NULL), + ('fk_chain_middle_cascade_child', 'id', 'uuid', NULL), + ('fk_chain_middle_cascade_child', 'restrictBlockerId', 'uuid', NULL), + ('fk_chain_middle_set_null_child', 'id', 'uuid', NULL), + ('fk_chain_middle_set_null_child', 'restrictBlockerId', 'uuid', NULL), + ('fk_chain_restrict_blocker', 'id', 'uuid', NULL), + ('fk_chain_restrict_blocker', 'cascadeMiddleId', 'uuid', NULL), + ('fk_chain_root', 'id', 'uuid', NULL), + ('fk_chain_set_null_cascade_child', 'id', 'uuid', NULL), + ('fk_chain_set_null_cascade_child', 'setNullMiddleId', 'uuid', NULL), + ('fk_chain_set_null_middle', 'id', 'uuid', NULL), + ('fk_chain_set_null_middle', 'cascadeMiddleId', 'uuid', NULL), + ('fk_chain_set_null_restrict_child', 'id', 'uuid', NULL), + ('fk_chain_set_null_restrict_child', 'setNullMiddleId', 'uuid', NULL), + ('fk_chain_set_null_set_null_child', 'id', 'uuid', NULL), + ('fk_chain_set_null_set_null_child', 'setNullMiddleId', 'uuid', NULL), + ('nullable_set_default_child', 'id', 'uuid', NULL), + ('nullable_set_default_child', 'parentId', 'uuid', NULL), + ('organization', 'id', 'uuid', NULL), + ('organization', 'cityId', 'uuid', NULL), + ('person', 'id', 'uuid', NULL), + ('person', 'organizationId', 'uuid', NULL), + ('person', 'oldCompanyId', 'uuid', NULL), + ('person', 'cityId', 'uuid', NULL), + ('required_cascade_child', 'id', 'uuid', NULL), + ('required_cascade_child', 'parentId', 'uuid', NULL), + ('required_no_action_child', 'id', 'uuid', NULL), + ('required_no_action_child', 'parentId', 'uuid', NULL), + ('required_set_null_child', 'id', 'uuid', NULL), + ('required_set_null_child', 'parentId', 'uuid', NULL), + ('restrict_child', 'id', 'uuid', NULL), + ('restrict_child', 'parentId', 'uuid', NULL), + ('shared_child', 'id', 'uuid', NULL), + ('shared_child', 'parentId', 'uuid', NULL), + ('shared_parent', 'id', 'uuid', NULL), + ('town', 'id', 'uuid', NULL), + ('town', 'cityId', 'uuid', NULL), + ('town', 'mayorId', 'uuid', NULL), + ('types', 'id', 'uuid', NULL), + ('types', 'aBool', 'boolean', NULL), + ('types', 'aDateTime', 'timestampWithoutTimeZone', NULL), + ('types', 'optionalUuid', 'uuid', NULL), + ('types', 'parentId', 'uuid', NULL), + ('types', 'jsonDocument', 'json', NULL), + ('types', 'jsonbDocument', 'jsonb', NULL), + ('types', 'jsonbNumbers', 'jsonb', NULL), + ('unique', 'id', 'uuid', NULL), + ('unique_cascade_child', 'id', 'uuid', NULL), + ('unique_cascade_child', 'parentId', 'uuid', NULL), + ('unique_cascade_reference', 'id', 'uuid', NULL), + ('unique_cascade_reference', 'parentId', 'uuid', NULL), + ('unique_composite', 'id', 'uuid', NULL), + ('unique_discriminator', 'id', 'uuid', NULL), + ('unique_fk_pair', 'id', 'uuid', NULL), + ('unique_fk_pair', 'leftId', 'uuid', NULL), + ('unique_fk_pair', 'rightId', 'uuid', NULL), + ('unique_mixed_fk', 'id', 'uuid', NULL), + ('unique_mixed_fk', 'parentId', 'uuid', NULL), + ('unique_no_release', 'id', 'uuid', NULL), + ('unique_nullable', 'id', 'uuid', NULL), + ('unique_overlapping', 'id', 'uuid', NULL), + ('unique_set_default_child', 'id', 'uuid', NULL), + ('unique_set_default_child', 'parentId', 'uuid', NULL), + ('unique_set_null_child', 'id', 'uuid', NULL), + ('unique_set_null_child', 'parentId', 'uuid', NULL), + ('unique_uuid', 'id', 'uuid', NULL), + ('unique_uuid', 'value', 'uuid', NULL), + ('serverpod_cloud_storage', 'addedTime', 'timestampWithoutTimeZone', NULL), + ('serverpod_cloud_storage', 'expiration', 'timestampWithoutTimeZone', NULL), + ('serverpod_cloud_storage', 'verified', 'boolean', NULL), + ('serverpod_cloud_storage_direct_download', 'expiration', 'timestampWithoutTimeZone', NULL), + ('serverpod_cloud_storage_direct_upload', 'expiration', 'timestampWithoutTimeZone', NULL), + ('serverpod_cloud_storage_direct_upload', 'preventOverwrite', 'boolean', NULL), + ('serverpod_future_call', 'time', 'timestampWithoutTimeZone', NULL), + ('serverpod_future_call', 'scheduling', 'json', NULL), + ('serverpod_future_call_claim', 'lastHeartbeatTime', 'timestampWithoutTimeZone', NULL), + ('serverpod_health_connection_info', 'timestamp', 'timestampWithoutTimeZone', NULL), + ('serverpod_health_metric', 'timestamp', 'timestampWithoutTimeZone', NULL), + ('serverpod_health_metric', 'isHealthy', 'boolean', NULL), + ('serverpod_log', 'time', 'timestampWithoutTimeZone', NULL), + ('serverpod_message_log', 'slow', 'boolean', NULL), + ('serverpod_migrations', 'timestamp', 'timestampWithoutTimeZone', NULL), + ('serverpod_query_log', 'slow', 'boolean', NULL), + ('serverpod_runtime_settings', 'logSettings', 'json', NULL), + ('serverpod_runtime_settings', 'logSettingsOverrides', 'json', NULL), + ('serverpod_runtime_settings', 'logServiceCalls', 'boolean', NULL), + ('serverpod_runtime_settings', 'logMalformedCalls', 'boolean', NULL), + ('serverpod_session_log', 'time', 'timestampWithoutTimeZone', NULL), + ('serverpod_session_log', 'slow', 'boolean', NULL), + ('serverpod_session_log', 'isOpen', 'boolean', NULL), + ('serverpod_session_log', 'touched', 'timestampWithoutTimeZone', NULL), + ('serverpod_auth_core_jwt_refresh_token', 'id', 'uuid', NULL), + ('serverpod_auth_core_jwt_refresh_token', 'authUserId', 'uuid', NULL), + ('serverpod_auth_core_jwt_refresh_token', 'scopeNames', 'json', NULL), + ('serverpod_auth_core_jwt_refresh_token', 'lastUpdatedAt', 'timestampWithoutTimeZone', NULL), + ('serverpod_auth_core_jwt_refresh_token', 'createdAt', 'timestampWithoutTimeZone', NULL), + ('serverpod_auth_core_profile', 'id', 'uuid', NULL), + ('serverpod_auth_core_profile', 'authUserId', 'uuid', NULL), + ('serverpod_auth_core_profile', 'createdAt', 'timestampWithoutTimeZone', NULL), + ('serverpod_auth_core_profile', 'imageId', 'uuid', NULL), + ('serverpod_auth_core_profile_image', 'id', 'uuid', NULL), + ('serverpod_auth_core_profile_image', 'userProfileId', 'uuid', NULL), + ('serverpod_auth_core_profile_image', 'createdAt', 'timestampWithoutTimeZone', NULL), + ('serverpod_auth_core_session', 'id', 'uuid', NULL), + ('serverpod_auth_core_session', 'authUserId', 'uuid', NULL), + ('serverpod_auth_core_session', 'scopeNames', 'json', NULL), + ('serverpod_auth_core_session', 'createdAt', 'timestampWithoutTimeZone', NULL), + ('serverpod_auth_core_session', 'lastUsedAt', 'timestampWithoutTimeZone', NULL), + ('serverpod_auth_core_session', 'expiresAt', 'timestampWithoutTimeZone', NULL), + ('serverpod_auth_core_user', 'id', 'uuid', NULL), + ('serverpod_auth_core_user', 'createdAt', 'timestampWithoutTimeZone', NULL), + ('serverpod_auth_core_user', 'scopeNames', 'json', NULL), + ('serverpod_auth_core_user', 'blocked', 'boolean', NULL), + ('crdt_data_attempted_value', 'value', 'jsonb', NULL), + ('crdt_data_fields', 'hlcDatetime', 'timestampWithoutTimeZone', NULL), + ('crdt_data_rows', 'hlcDatetime', 'timestampWithoutTimeZone', NULL), + ('crdt_data_rows', 'uuidRowId', 'uuid', NULL), + ('crdt_data_tombstone', 'hlcDatetime', 'timestampWithoutTimeZone', NULL), + ('crdt_nodes', 'uuidNodeId', 'uuid', NULL), + ('crdt_nodes', 'lastHlc', 'jsonb', NULL), + ('crdt_schema_columns', 'isNullable', 'boolean', NULL), + ('offline_sync_integrity_violations', 'uuidRowId', 'uuid', NULL), + ('offline_sync_integrity_violations', 'ownerSpaceUuid', 'uuid', NULL), + ('offline_sync_integrity_violations', 'incomingSpaceUuid', 'uuid', NULL), + ('offline_sync_integrity_violations', 'uuidNodeId', 'uuid', NULL), + ('offline_sync_integrity_violations', 'hlcDatetime', 'timestampWithoutTimeZone', NULL), + ('offline_sync_integrity_violations', 'firstSeenAt', 'timestampWithoutTimeZone', NULL), + ('offline_sync_integrity_violations', 'lastSeenAt', 'timestampWithoutTimeZone', NULL), + ('offline_sync_space_members', 'userUuid', 'uuid', NULL), + ('offline_sync_space_nodes', 'lastReceivedHlc', 'jsonb', NULL), + ('offline_sync_spaces', 'uuidSpaceId', 'uuid', NULL); + +-- +-- MIGRATION VERSION FOR serverpod_offline_sync_test +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod_offline_sync_test', '20260930185557154', (unixepoch('now', 'subsecond') * 1000)) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20260930185557154', "timestamp" = (unixepoch('now', 'subsecond') * 1000); + +-- +-- MIGRATION VERSION FOR serverpod +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod', '20260824182259319', (unixepoch('now', 'subsecond') * 1000)) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20260824182259319', "timestamp" = (unixepoch('now', 'subsecond') * 1000); + +-- +-- MIGRATION VERSION FOR serverpod_auth_core +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod_auth_core', '20260924105232991', (unixepoch('now', 'subsecond') * 1000)) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20260924105232991', "timestamp" = (unixepoch('now', 'subsecond') * 1000); + +-- +-- MIGRATION VERSION FOR serverpod_offline_sync +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod_offline_sync', '20260914143806119', (unixepoch('now', 'subsecond') * 1000)) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20260914143806119', "timestamp" = (unixepoch('now', 'subsecond') * 1000); + + +COMMIT; diff --git a/test/serverpod_offline_sync_test_server/migrations/20260930185557154/definition_project.json b/test/serverpod_offline_sync_test_server/migrations/20260930185557154/definition_project.json new file mode 100644 index 0000000..a4e3690 --- /dev/null +++ b/test/serverpod_offline_sync_test_server/migrations/20260930185557154/definition_project.json @@ -0,0 +1,3050 @@ +{ + "__className__": "serverpod.DatabaseDefinition", + "schemaVersion": 2, + "moduleName": "serverpod_offline_sync_test", + "tables": [ + { + "__className__": "serverpod.TableDefinition", + "name": "address", + "dartName": "Address", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "street", + "fieldName": "street", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "inhabitantId", + "fieldName": "inhabitantId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "address_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "address_fk_1", + "columns": [ + "inhabitantId" + ], + "referenceTable": "person", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 3 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "address__inhabitantId__unique_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "inhabitantId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "city", + "dartName": "City", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "city_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "company", + "dartName": "Company", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "townId", + "fieldName": "townId", + "columnType": 7, + "isNullable": false, + "columnDefault": "'550e8400-e29b-41d4-a716-446655440000'", + "dartType": "UuidValue" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "company_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "company_fk_1", + "columns": [ + "townId" + ], + "referenceTable": "town", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 1, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "fk_chain_cascade_middle", + "dartName": "FkChainCascadeMiddle", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rootId", + "fieldName": "rootId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_cascade_middle_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_cascade_middle_fk_1", + "columns": [ + "rootId" + ], + "referenceTable": "fk_chain_root", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "fk_chain_middle_cascade_child", + "dartName": "FkChainMiddleCascadeChild", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "restrictBlockerId", + "fieldName": "restrictBlockerId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_middle_cascade_child_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_middle_cascade_child_fk_1", + "columns": [ + "restrictBlockerId" + ], + "referenceTable": "fk_chain_restrict_blocker", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "fk_chain_middle_set_null_child", + "dartName": "FkChainMiddleSetNullChild", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "restrictBlockerId", + "fieldName": "restrictBlockerId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_middle_set_null_child_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_middle_set_null_child_fk_1", + "columns": [ + "restrictBlockerId" + ], + "referenceTable": "fk_chain_restrict_blocker", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "fk_chain_restrict_blocker", + "dartName": "FkChainRestrictBlocker", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "cascadeMiddleId", + "fieldName": "cascadeMiddleId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_restrict_blocker_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_restrict_blocker_fk_1", + "columns": [ + "cascadeMiddleId" + ], + "referenceTable": "fk_chain_cascade_middle", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 3, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "fk_chain_root", + "dartName": "FkChainRoot", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_root_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "fk_chain_set_null_cascade_child", + "dartName": "FkChainSetNullCascadeChild", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "setNullMiddleId", + "fieldName": "setNullMiddleId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_set_null_cascade_child_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_set_null_cascade_child_fk_1", + "columns": [ + "setNullMiddleId" + ], + "referenceTable": "fk_chain_set_null_middle", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "fk_chain_set_null_middle", + "dartName": "FkChainSetNullMiddle", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "cascadeMiddleId", + "fieldName": "cascadeMiddleId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_set_null_middle_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_set_null_middle_fk_1", + "columns": [ + "cascadeMiddleId" + ], + "referenceTable": "fk_chain_cascade_middle", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "fk_chain_set_null_restrict_child", + "dartName": "FkChainSetNullRestrictChild", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "setNullMiddleId", + "fieldName": "setNullMiddleId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_set_null_restrict_child_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_set_null_restrict_child_fk_1", + "columns": [ + "setNullMiddleId" + ], + "referenceTable": "fk_chain_set_null_middle", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 3, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "fk_chain_set_null_set_null_child", + "dartName": "FkChainSetNullSetNullChild", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "setNullMiddleId", + "fieldName": "setNullMiddleId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_set_null_set_null_child_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "fk_chain_set_null_set_null_child_fk_1", + "columns": [ + "setNullMiddleId" + ], + "referenceTable": "fk_chain_set_null_middle", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "nullable_set_default_child", + "dartName": "NullableSetDefaultChild", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "parentId", + "fieldName": "parentId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "nullable_set_default_child_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "nullable_set_default_child_fk_1", + "columns": [ + "parentId" + ], + "referenceTable": "person", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 1, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "organization", + "dartName": "Organization", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "cityId", + "fieldName": "cityId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "organization_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "organization_fk_1", + "columns": [ + "cityId" + ], + "referenceTable": "city", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "person", + "dartName": "Person", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "surname", + "fieldName": "surname", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "organizationId", + "fieldName": "organizationId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "oldCompanyId", + "fieldName": "oldCompanyId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "cityId", + "fieldName": "cityId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "person_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "person_fk_1", + "columns": [ + "organizationId" + ], + "referenceTable": "organization", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "person_fk_2", + "columns": [ + "oldCompanyId" + ], + "referenceTable": "company", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 3 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "person_fk_3", + "columns": [ + "cityId" + ], + "referenceTable": "city", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 3, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "required_cascade_child", + "dartName": "RequiredCascadeChild", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "parentId", + "fieldName": "parentId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "required_cascade_child_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "required_cascade_child_fk_1", + "columns": [ + "parentId" + ], + "referenceTable": "person", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "required_no_action_child", + "dartName": "RequiredNoActionChild", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "parentId", + "fieldName": "parentId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "required_no_action_child_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "required_no_action_child_fk_1", + "columns": [ + "parentId" + ], + "referenceTable": "person", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 3, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "required_set_null_child", + "dartName": "RequiredSetNullChild", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "parentId", + "fieldName": "parentId", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "required_set_null_child_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "required_set_null_child_fk_1", + "columns": [ + "parentId" + ], + "referenceTable": "person", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "restrict_child", + "dartName": "RestrictChild", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "parentId", + "fieldName": "parentId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "restrict_child_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "restrict_child_fk_1", + "columns": [ + "parentId" + ], + "referenceTable": "person", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 3, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "shared_child", + "dartName": "SharedChild", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "flavor", + "fieldName": "flavor", + "columnType": 0, + "isNullable": false, + "columnDefault": "'plain'", + "dartType": "serverpod_offline_sync_test_shared:SharedFlavor" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "parentId", + "fieldName": "parentId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "shared_child_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "shared_child_fk_1", + "columns": [ + "parentId" + ], + "referenceTable": "shared_parent", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "shared_parent", + "dartName": "SharedParent", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "shared_parent_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "town", + "dartName": "Town", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "cityId", + "fieldName": "cityId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "mayorId", + "fieldName": "mayorId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "town_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "town_fk_1", + "columns": [ + "cityId" + ], + "referenceTable": "city", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "town_fk_2", + "columns": [ + "mayorId" + ], + "referenceTable": "person", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "types", + "dartName": "Types", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "aBool", + "fieldName": "aBool", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "aDateTime", + "fieldName": "aDateTime", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "aText", + "fieldName": "aText", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "anInt", + "fieldName": "anInt", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "anInt64", + "fieldName": "anInt64", + "columnType": 0, + "isNullable": false, + "dartType": "BigInt" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "aReal", + "fieldName": "aReal", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "aBlob", + "fieldName": "aBlob", + "columnType": 5, + "isNullable": false, + "dartType": "dart:typed_data:ByteData" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "anEnum", + "fieldName": "anEnum", + "columnType": 6, + "isNullable": true, + "dartType": "protocol:TypesEnum?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "optionalText", + "fieldName": "optionalText", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "optionalUuid", + "fieldName": "optionalUuid", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "parentId", + "fieldName": "parentId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "jsonDocument", + "fieldName": "jsonDocument", + "columnType": 8, + "isNullable": true, + "dartType": "protocol:SyncDocument?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "jsonbDocument", + "fieldName": "jsonbDocument", + "columnType": 14, + "isNullable": true, + "dartType": "protocol:SyncDocument?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "jsonbNumbers", + "fieldName": "jsonbNumbers", + "columnType": 14, + "isNullable": true, + "dartType": "List?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "types_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "types_fk_1", + "columns": [ + "parentId" + ], + "referenceTable": "types", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 3 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "types_a_text_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "aText" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "unique", + "dartName": "Unique", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "unique__spaceId__name__unique_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "spaceId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "name" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "unique_cascade_child", + "dartName": "UniqueCascadeChild", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "parentId", + "fieldName": "parentId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_cascade_child_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_cascade_child_fk_1", + "columns": [ + "parentId" + ], + "referenceTable": "person", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "unique_cascade_child__spaceId__name__unique_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "spaceId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "name" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "unique_cascade_reference", + "dartName": "UniqueCascadeReference", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "parentId", + "fieldName": "parentId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_cascade_reference_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_cascade_reference_fk_1", + "columns": [ + "parentId" + ], + "referenceTable": "person", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "unique_cascade_reference__parentId__unique_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "parentId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "unique_composite", + "dartName": "UniqueComposite", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "scope", + "fieldName": "scope", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "value", + "fieldName": "value", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_composite_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "unique_composite__spaceId__scope__value__unique_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "spaceId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "scope" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "value" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "unique_discriminator", + "dartName": "UniqueDiscriminator", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "categoryId", + "fieldName": "categoryId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_discriminator_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "unique_discriminator__spaceId__categoryId__name__unique_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "spaceId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "categoryId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "name" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "unique_fk_pair", + "dartName": "UniqueFkPair", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "leftId", + "fieldName": "leftId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "rightId", + "fieldName": "rightId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_fk_pair_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_fk_pair_fk_1", + "columns": [ + "leftId" + ], + "referenceTable": "person", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 3, + "deferrable": "initiallyDeferred" + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_fk_pair_fk_2", + "columns": [ + "rightId" + ], + "referenceTable": "person", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "unique_fk_pair_parents", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "leftId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "rightId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "unique_mixed_fk", + "dartName": "UniqueMixedFk", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "parentId", + "fieldName": "parentId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_mixed_fk_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_mixed_fk_fk_1", + "columns": [ + "parentId" + ], + "referenceTable": "person", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "unique_mixed_fk_name_parent", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "spaceId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "name" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "parentId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "unique_no_release", + "dartName": "UniqueNoRelease", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "categoryId", + "fieldName": "categoryId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_no_release_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "unique_no_release__spaceId__categoryId__unique_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "spaceId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "categoryId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "unique_nullable", + "dartName": "UniqueNullable", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "value", + "fieldName": "value", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_nullable_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "unique_nullable__spaceId__value__unique_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "spaceId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "value" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "unique_overlapping", + "dartName": "UniqueOverlapping", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "first", + "fieldName": "first", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "second", + "fieldName": "second", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "third", + "fieldName": "third", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_overlapping_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "unique_overlapping_first_second", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "spaceId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "first" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "second" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "__className__": "serverpod.IndexDefinition", + "indexName": "unique_overlapping_second_third", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "spaceId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "second" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "third" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "unique_set_default_child", + "dartName": "UniqueSetDefaultChild", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "parentId", + "fieldName": "parentId", + "columnType": 7, + "isNullable": true, + "columnDefault": "'550e8400-e29b-41d4-a716-446655440000'", + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_set_default_child_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_set_default_child_fk_1", + "columns": [ + "parentId" + ], + "referenceTable": "town", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 1, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "unique_set_default_child__parentId__unique_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "parentId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "unique_set_null_child", + "dartName": "UniqueSetNullChild", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "name", + "fieldName": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "parentId", + "fieldName": "parentId", + "columnType": 7, + "isNullable": true, + "dartType": "UuidValue?" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_set_null_child_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + }, + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_set_null_child_fk_1", + "columns": [ + "parentId" + ], + "referenceTable": "person", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 0, + "deferrable": "initiallyDeferred" + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "unique_set_null_child__parentId__unique_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "parentId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "__className__": "serverpod.TableDefinition", + "name": "unique_uuid", + "dartName": "UniqueUuid", + "module": "serverpod_offline_sync_test", + "schema": "public", + "columns": [ + { + "__className__": "serverpod.ColumnDefinition", + "name": "id", + "fieldName": "id", + "columnType": 7, + "isNullable": false, + "columnDefault": "random_v7", + "dartType": "UuidValue?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "spaceId", + "fieldName": "spaceId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "__className__": "serverpod.ColumnDefinition", + "name": "value", + "fieldName": "value", + "columnType": 7, + "isNullable": false, + "dartType": "UuidValue" + } + ], + "foreignKeys": [ + { + "__className__": "serverpod.ForeignKeyDefinition", + "constraintName": "unique_uuid_fk_0", + "columns": [ + "spaceId" + ], + "referenceTable": "offline_sync_spaces", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "__className__": "serverpod.IndexDefinition", + "indexName": "unique_uuid__spaceId__value__unique_idx", + "elements": [ + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "spaceId" + }, + { + "__className__": "serverpod.IndexElementDefinition", + "type": 0, + "definition": "value" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + } + ], + "installedModules": [ + { + "__className__": "serverpod.DatabaseMigrationVersion", + "module": "serverpod", + "version": "20260824182259319" + }, + { + "__className__": "serverpod.DatabaseMigrationVersion", + "module": "serverpod_auth_core", + "version": "20260924105232991" + }, + { + "__className__": "serverpod.DatabaseMigrationVersion", + "module": "serverpod_offline_sync", + "version": "20260914143806119" + } + ], + "migrationApiVersion": 1 +} \ No newline at end of file diff --git a/test/serverpod_offline_sync_test_server/migrations/20260930185557154/migration.json b/test/serverpod_offline_sync_test_server/migrations/20260930185557154/migration.json new file mode 100644 index 0000000..869b49a --- /dev/null +++ b/test/serverpod_offline_sync_test_server/migrations/20260930185557154/migration.json @@ -0,0 +1,42 @@ +{ + "__className__": "serverpod.DatabaseMigration", + "actions": [ + { + "__className__": "serverpod.DatabaseMigrationAction", + "type": "alterTable", + "alterTable": { + "__className__": "serverpod.TableMigration", + "name": "serverpod_auth_core_profile", + "schema": "public", + "addColumns": [], + "deleteColumns": [], + "modifyColumns": [], + "addIndexes": [], + "deleteIndexes": [], + "addForeignKeys": [ + { + "__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" + } + ], + "deleteForeignKeys": [ + "serverpod_auth_core_profile_fk_1" + ], + "warnings": [] + } + } + ], + "warnings": [], + "migrationApiVersion": 1 +} \ No newline at end of file diff --git a/test/serverpod_offline_sync_test_server/migrations/20260930185557154/migration.sql b/test/serverpod_offline_sync_test_server/migrations/20260930185557154/migration.sql new file mode 100644 index 0000000..350e47a --- /dev/null +++ b/test/serverpod_offline_sync_test_server/migrations/20260930185557154/migration.sql @@ -0,0 +1,210 @@ +BEGIN; + +-- +-- ACTION ALTER TABLE +-- +CREATE TABLE "new_serverpod_auth_core_profile" ( + "id" BLOB PRIMARY KEY DEFAULT (unhex(printf('%012x', CAST(unixepoch('now', 'subsecond') * 1000 AS INTEGER)) || '7' || substr(hex(randomblob(2)), 2, 3) || substr('89AB', 1 + (abs(random()) % 4), 1) || substr(hex(randomblob(8)), 2, 15))), + "authUserId" BLOB NOT NULL, + "userName" TEXT, + "fullName" TEXT, + "email" TEXT, + "createdAt" INTEGER NOT NULL DEFAULT (CAST(unixepoch('subsecond') * 1000 AS INTEGER)), + "imageId" BLOB, + CONSTRAINT "serverpod_auth_core_profile_fk_0" FOREIGN KEY ("authUserId") REFERENCES "serverpod_auth_core_user" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT "serverpod_auth_core_profile_fk_1" FOREIGN KEY ("imageId") REFERENCES "serverpod_auth_core_profile_image" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED +) STRICT; + +INSERT INTO "new_serverpod_auth_core_profile" ("id", "authUserId", "userName", "fullName", "email", "createdAt", "imageId") SELECT "id", "authUserId", "userName", "fullName", "email", "createdAt", "imageId" FROM "serverpod_auth_core_profile"; +DROP TABLE "serverpod_auth_core_profile"; +ALTER TABLE "new_serverpod_auth_core_profile" RENAME TO "serverpod_auth_core_profile"; + +-- Indexes +CREATE UNIQUE INDEX "serverpod_auth_profile_user_profile_email_auth_user_id" ON "serverpod_auth_core_profile" ("authUserId"); + +-- +-- STORE COLUMN TYPES FOR MIGRATIONS +-- +DROP TABLE IF EXISTS "serverpod_sqlite_schema"; + +CREATE TABLE "serverpod_sqlite_schema" ( + "table_name" TEXT NOT NULL, + "column_name" TEXT NOT NULL, + "column_type" TEXT NOT NULL, + "column_vector_dimension" INTEGER, + PRIMARY KEY ("table_name", "column_name") +); + +INSERT INTO "serverpod_sqlite_schema" VALUES + ('address', 'id', 'uuid', NULL), + ('address', 'inhabitantId', 'uuid', NULL), + ('city', 'id', 'uuid', NULL), + ('company', 'id', 'uuid', NULL), + ('company', 'townId', 'uuid', NULL), + ('fk_chain_cascade_middle', 'id', 'uuid', NULL), + ('fk_chain_cascade_middle', 'rootId', 'uuid', NULL), + ('fk_chain_middle_cascade_child', 'id', 'uuid', NULL), + ('fk_chain_middle_cascade_child', 'restrictBlockerId', 'uuid', NULL), + ('fk_chain_middle_set_null_child', 'id', 'uuid', NULL), + ('fk_chain_middle_set_null_child', 'restrictBlockerId', 'uuid', NULL), + ('fk_chain_restrict_blocker', 'id', 'uuid', NULL), + ('fk_chain_restrict_blocker', 'cascadeMiddleId', 'uuid', NULL), + ('fk_chain_root', 'id', 'uuid', NULL), + ('fk_chain_set_null_cascade_child', 'id', 'uuid', NULL), + ('fk_chain_set_null_cascade_child', 'setNullMiddleId', 'uuid', NULL), + ('fk_chain_set_null_middle', 'id', 'uuid', NULL), + ('fk_chain_set_null_middle', 'cascadeMiddleId', 'uuid', NULL), + ('fk_chain_set_null_restrict_child', 'id', 'uuid', NULL), + ('fk_chain_set_null_restrict_child', 'setNullMiddleId', 'uuid', NULL), + ('fk_chain_set_null_set_null_child', 'id', 'uuid', NULL), + ('fk_chain_set_null_set_null_child', 'setNullMiddleId', 'uuid', NULL), + ('nullable_set_default_child', 'id', 'uuid', NULL), + ('nullable_set_default_child', 'parentId', 'uuid', NULL), + ('organization', 'id', 'uuid', NULL), + ('organization', 'cityId', 'uuid', NULL), + ('person', 'id', 'uuid', NULL), + ('person', 'organizationId', 'uuid', NULL), + ('person', 'oldCompanyId', 'uuid', NULL), + ('person', 'cityId', 'uuid', NULL), + ('required_cascade_child', 'id', 'uuid', NULL), + ('required_cascade_child', 'parentId', 'uuid', NULL), + ('required_no_action_child', 'id', 'uuid', NULL), + ('required_no_action_child', 'parentId', 'uuid', NULL), + ('required_set_null_child', 'id', 'uuid', NULL), + ('required_set_null_child', 'parentId', 'uuid', NULL), + ('restrict_child', 'id', 'uuid', NULL), + ('restrict_child', 'parentId', 'uuid', NULL), + ('shared_child', 'id', 'uuid', NULL), + ('shared_child', 'parentId', 'uuid', NULL), + ('shared_parent', 'id', 'uuid', NULL), + ('town', 'id', 'uuid', NULL), + ('town', 'cityId', 'uuid', NULL), + ('town', 'mayorId', 'uuid', NULL), + ('types', 'id', 'uuid', NULL), + ('types', 'aBool', 'boolean', NULL), + ('types', 'aDateTime', 'timestampWithoutTimeZone', NULL), + ('types', 'optionalUuid', 'uuid', NULL), + ('types', 'parentId', 'uuid', NULL), + ('types', 'jsonDocument', 'json', NULL), + ('types', 'jsonbDocument', 'jsonb', NULL), + ('types', 'jsonbNumbers', 'jsonb', NULL), + ('unique', 'id', 'uuid', NULL), + ('unique_cascade_child', 'id', 'uuid', NULL), + ('unique_cascade_child', 'parentId', 'uuid', NULL), + ('unique_cascade_reference', 'id', 'uuid', NULL), + ('unique_cascade_reference', 'parentId', 'uuid', NULL), + ('unique_composite', 'id', 'uuid', NULL), + ('unique_discriminator', 'id', 'uuid', NULL), + ('unique_fk_pair', 'id', 'uuid', NULL), + ('unique_fk_pair', 'leftId', 'uuid', NULL), + ('unique_fk_pair', 'rightId', 'uuid', NULL), + ('unique_mixed_fk', 'id', 'uuid', NULL), + ('unique_mixed_fk', 'parentId', 'uuid', NULL), + ('unique_no_release', 'id', 'uuid', NULL), + ('unique_nullable', 'id', 'uuid', NULL), + ('unique_overlapping', 'id', 'uuid', NULL), + ('unique_set_default_child', 'id', 'uuid', NULL), + ('unique_set_default_child', 'parentId', 'uuid', NULL), + ('unique_set_null_child', 'id', 'uuid', NULL), + ('unique_set_null_child', 'parentId', 'uuid', NULL), + ('unique_uuid', 'id', 'uuid', NULL), + ('unique_uuid', 'value', 'uuid', NULL), + ('serverpod_cloud_storage', 'addedTime', 'timestampWithoutTimeZone', NULL), + ('serverpod_cloud_storage', 'expiration', 'timestampWithoutTimeZone', NULL), + ('serverpod_cloud_storage', 'verified', 'boolean', NULL), + ('serverpod_cloud_storage_direct_download', 'expiration', 'timestampWithoutTimeZone', NULL), + ('serverpod_cloud_storage_direct_upload', 'expiration', 'timestampWithoutTimeZone', NULL), + ('serverpod_cloud_storage_direct_upload', 'preventOverwrite', 'boolean', NULL), + ('serverpod_future_call', 'time', 'timestampWithoutTimeZone', NULL), + ('serverpod_future_call', 'scheduling', 'json', NULL), + ('serverpod_future_call_claim', 'lastHeartbeatTime', 'timestampWithoutTimeZone', NULL), + ('serverpod_health_connection_info', 'timestamp', 'timestampWithoutTimeZone', NULL), + ('serverpod_health_metric', 'timestamp', 'timestampWithoutTimeZone', NULL), + ('serverpod_health_metric', 'isHealthy', 'boolean', NULL), + ('serverpod_log', 'time', 'timestampWithoutTimeZone', NULL), + ('serverpod_message_log', 'slow', 'boolean', NULL), + ('serverpod_migrations', 'timestamp', 'timestampWithoutTimeZone', NULL), + ('serverpod_query_log', 'slow', 'boolean', NULL), + ('serverpod_runtime_settings', 'logSettings', 'json', NULL), + ('serverpod_runtime_settings', 'logSettingsOverrides', 'json', NULL), + ('serverpod_runtime_settings', 'logServiceCalls', 'boolean', NULL), + ('serverpod_runtime_settings', 'logMalformedCalls', 'boolean', NULL), + ('serverpod_session_log', 'time', 'timestampWithoutTimeZone', NULL), + ('serverpod_session_log', 'slow', 'boolean', NULL), + ('serverpod_session_log', 'isOpen', 'boolean', NULL), + ('serverpod_session_log', 'touched', 'timestampWithoutTimeZone', NULL), + ('serverpod_auth_core_jwt_refresh_token', 'id', 'uuid', NULL), + ('serverpod_auth_core_jwt_refresh_token', 'authUserId', 'uuid', NULL), + ('serverpod_auth_core_jwt_refresh_token', 'scopeNames', 'json', NULL), + ('serverpod_auth_core_jwt_refresh_token', 'lastUpdatedAt', 'timestampWithoutTimeZone', NULL), + ('serverpod_auth_core_jwt_refresh_token', 'createdAt', 'timestampWithoutTimeZone', NULL), + ('serverpod_auth_core_profile', 'id', 'uuid', NULL), + ('serverpod_auth_core_profile', 'authUserId', 'uuid', NULL), + ('serverpod_auth_core_profile', 'createdAt', 'timestampWithoutTimeZone', NULL), + ('serverpod_auth_core_profile', 'imageId', 'uuid', NULL), + ('serverpod_auth_core_profile_image', 'id', 'uuid', NULL), + ('serverpod_auth_core_profile_image', 'userProfileId', 'uuid', NULL), + ('serverpod_auth_core_profile_image', 'createdAt', 'timestampWithoutTimeZone', NULL), + ('serverpod_auth_core_session', 'id', 'uuid', NULL), + ('serverpod_auth_core_session', 'authUserId', 'uuid', NULL), + ('serverpod_auth_core_session', 'scopeNames', 'json', NULL), + ('serverpod_auth_core_session', 'createdAt', 'timestampWithoutTimeZone', NULL), + ('serverpod_auth_core_session', 'lastUsedAt', 'timestampWithoutTimeZone', NULL), + ('serverpod_auth_core_session', 'expiresAt', 'timestampWithoutTimeZone', NULL), + ('serverpod_auth_core_user', 'id', 'uuid', NULL), + ('serverpod_auth_core_user', 'createdAt', 'timestampWithoutTimeZone', NULL), + ('serverpod_auth_core_user', 'scopeNames', 'json', NULL), + ('serverpod_auth_core_user', 'blocked', 'boolean', NULL), + ('crdt_data_attempted_value', 'value', 'jsonb', NULL), + ('crdt_data_fields', 'hlcDatetime', 'timestampWithoutTimeZone', NULL), + ('crdt_data_rows', 'hlcDatetime', 'timestampWithoutTimeZone', NULL), + ('crdt_data_rows', 'uuidRowId', 'uuid', NULL), + ('crdt_data_tombstone', 'hlcDatetime', 'timestampWithoutTimeZone', NULL), + ('crdt_nodes', 'uuidNodeId', 'uuid', NULL), + ('crdt_nodes', 'lastHlc', 'jsonb', NULL), + ('crdt_schema_columns', 'isNullable', 'boolean', NULL), + ('offline_sync_integrity_violations', 'uuidRowId', 'uuid', NULL), + ('offline_sync_integrity_violations', 'ownerSpaceUuid', 'uuid', NULL), + ('offline_sync_integrity_violations', 'incomingSpaceUuid', 'uuid', NULL), + ('offline_sync_integrity_violations', 'uuidNodeId', 'uuid', NULL), + ('offline_sync_integrity_violations', 'hlcDatetime', 'timestampWithoutTimeZone', NULL), + ('offline_sync_integrity_violations', 'firstSeenAt', 'timestampWithoutTimeZone', NULL), + ('offline_sync_integrity_violations', 'lastSeenAt', 'timestampWithoutTimeZone', NULL), + ('offline_sync_space_members', 'userUuid', 'uuid', NULL), + ('offline_sync_space_nodes', 'lastReceivedHlc', 'jsonb', NULL), + ('offline_sync_spaces', 'uuidSpaceId', 'uuid', NULL); + +-- +-- MIGRATION VERSION FOR serverpod_offline_sync_test +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod_offline_sync_test', '20260930185557154', (unixepoch('now', 'subsecond') * 1000)) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20260930185557154', "timestamp" = (unixepoch('now', 'subsecond') * 1000); + +-- +-- MIGRATION VERSION FOR serverpod +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod', '20260824182259319', (unixepoch('now', 'subsecond') * 1000)) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20260824182259319', "timestamp" = (unixepoch('now', 'subsecond') * 1000); + +-- +-- MIGRATION VERSION FOR serverpod_auth_core +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod_auth_core', '20260924105232991', (unixepoch('now', 'subsecond') * 1000)) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20260924105232991', "timestamp" = (unixepoch('now', 'subsecond') * 1000); + +-- +-- MIGRATION VERSION FOR serverpod_offline_sync +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod_offline_sync', '20260914143806119', (unixepoch('now', 'subsecond') * 1000)) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20260914143806119', "timestamp" = (unixepoch('now', 'subsecond') * 1000); + + +COMMIT; diff --git a/test/serverpod_offline_sync_test_server/migrations/migration_registry.txt b/test/serverpod_offline_sync_test_server/migrations/migration_registry.txt index 8e138d8..4681ffc 100644 --- a/test/serverpod_offline_sync_test_server/migrations/migration_registry.txt +++ b/test/serverpod_offline_sync_test_server/migrations/migration_registry.txt @@ -14,3 +14,4 @@ 20260907170602693 20260914144112288 20260914165608984 +20260930185557154 diff --git a/test/serverpod_offline_sync_test_server/pubspec.yaml b/test/serverpod_offline_sync_test_server/pubspec.yaml index d24a81f..6e66900 100644 --- a/test/serverpod_offline_sync_test_server/pubspec.yaml +++ b/test/serverpod_offline_sync_test_server/pubspec.yaml @@ -8,8 +8,8 @@ environment: resolution: workspace dependencies: - serverpod: 4.0.0 - serverpod_auth_core_server: 4.0.0 + serverpod: ^4.0.0 + serverpod_auth_core_server: ^4.0.0 serverpod_offline_sync: path: ../../packages/serverpod_offline_sync serverpod_offline_sync_server: @@ -21,12 +21,12 @@ dev_dependencies: clock: ^1.1.2 lints: '>=3.0.0 <7.0.0' path: ^1.9.1 - serverpod_database: 4.0.0 + serverpod_database: ^4.0.0 serverpod_offline_sync_client: path: ../../packages/serverpod_offline_sync_client serverpod_offline_sync_test_client: path: ../serverpod_offline_sync_test_client - serverpod_test: 4.0.0 + serverpod_test: ^4.0.0 test: ^1.25.5 uuid: ^4.5.3 diff --git a/test/serverpod_offline_sync_test_server/test/integration/test_tools/serverpod_test_tools.dart b/test/serverpod_offline_sync_test_server/test/integration/test_tools/serverpod_test_tools.dart index c7b4b7d..007251b 100644 --- a/test/serverpod_offline_sync_test_server/test/integration/test_tools/serverpod_test_tools.dart +++ b/test/serverpod_offline_sync_test_server/test/integration/test_tools/serverpod_test_tools.dart @@ -38,6 +38,9 @@ export 'package:serverpod_test/serverpod_test_public_exports.dart'; /// /// [enableSessionLogging] Whether session logging should be enabled. Defaults to `false` /// +/// [ephemeralDatabase] Whether this group gets its own empty database, created when the group starts and dropped when it finishes. Defaults to `true`. +/// Set this to `false` to use the database configured for [runMode], including a previously seeded database. [configOverride] can still replace that database. The configured database is not created or dropped, so groups that share it cannot run in parallel. [rollbackDatabase] still controls whether writes inside the group are rolled back. +/// /// [rollbackDatabase] Options for when to rollback the database during the test lifecycle. /// By default `withServerpod` does all database operations inside a transaction that is rolled back after each `test` case. /// Just like the following enum describes, the behavior of the automatic rollbacks can be configured: @@ -107,6 +110,7 @@ void withServerpod( _is.ServerpodConfig Function(_is.ServerpodConfig)? configOverride, _is.DatabaseInterceptor? databaseInterceptor, bool? enableSessionLogging, + bool? ephemeralDatabase, _is.ExperimentalFeatures? experimentalFeatures, _ist.RollbackDatabase? rollbackDatabase, String? runMode, @@ -125,6 +129,7 @@ void withServerpod( serializationManager: Protocol(), runMode: runMode, applyMigrations: applyMigrations, + ephemeralDatabase: ephemeralDatabase, isDatabaseEnabled: true, serverpodLoggingMode: serverpodLoggingMode, testServerOutputMode: testServerOutputMode, diff --git a/test/serverpod_offline_sync_test_shared/pubspec.yaml b/test/serverpod_offline_sync_test_shared/pubspec.yaml index 13a9ce6..b151da7 100644 --- a/test/serverpod_offline_sync_test_shared/pubspec.yaml +++ b/test/serverpod_offline_sync_test_shared/pubspec.yaml @@ -8,10 +8,10 @@ environment: resolution: workspace dependencies: - serverpod_database: 4.0.0 + serverpod_database: ^4.0.0 serverpod_offline_sync: path: ../../packages/serverpod_offline_sync - serverpod_serialization: 4.0.0 + serverpod_serialization: ^4.0.0 dev_dependencies: lints: '>=3.0.0 <7.0.0'