serverpod-offline-sync/packages/serverpod_offline_sync_server/migrations/20260914143806119/migration.json

670 lines
20 KiB
JSON
Raw Normal View History

{
"__className__": "serverpod.DatabaseMigration",
"actions": [
{
"__className__": "serverpod.DatabaseMigrationAction",
"type": "deleteTable",
"deleteTable": "crdt_sync_integrity_violations"
},
{
"__className__": "serverpod.DatabaseMigrationAction",
"type": "deleteTable",
"deleteTable": "crdt_scopes"
},
{
"__className__": "serverpod.DatabaseMigrationAction",
"type": "deleteTable",
"deleteTable": "crdt_scope_nodes"
},
{
"__className__": "serverpod.DatabaseMigrationAction",
"type": "deleteTable",
"deleteTable": "crdt_scope_members"
},
{
"__className__": "serverpod.DatabaseMigrationAction",
"type": "deleteTable",
"deleteTable": "crdt_data_rows"
},
{
"__className__": "serverpod.DatabaseMigrationAction",
"type": "createTable",
"createTable": {
"__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.DatabaseMigrationAction",
"type": "createTable",
"createTable": {
"__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.DatabaseMigrationAction",
"type": "createTable",
"createTable": {
"__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.DatabaseMigrationAction",
"type": "createTable",
"createTable": {
"__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.DatabaseMigrationAction",
"type": "createTable",
"createTable": {
"__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
}
}
],
"warnings": [
{
"__className__": "serverpod.DatabaseMigrationWarning",
"type": "tableDropped",
"message": "Table \"crdt_sync_integrity_violations\" will be dropped.",
"table": "crdt_sync_integrity_violations",
"columns": [],
"destrucive": true
},
{
"__className__": "serverpod.DatabaseMigrationWarning",
"type": "tableDropped",
"message": "Table \"crdt_scopes\" will be dropped.",
"table": "crdt_scopes",
"columns": [],
"destrucive": true
},
{
"__className__": "serverpod.DatabaseMigrationWarning",
"type": "tableDropped",
"message": "Table \"crdt_scope_nodes\" will be dropped.",
"table": "crdt_scope_nodes",
"columns": [],
"destrucive": true
},
{
"__className__": "serverpod.DatabaseMigrationWarning",
"type": "tableDropped",
"message": "Table \"crdt_scope_members\" will be dropped.",
"table": "crdt_scope_members",
"columns": [],
"destrucive": true
},
{
"__className__": "serverpod.DatabaseMigrationWarning",
"type": "columnDropped",
"message": "Column \"scopeId\" of table \"crdt_data_rows\" will be dropped.",
"table": "crdt_data_rows",
"columns": [
"scopeId"
],
"destrucive": true
},
{
"__className__": "serverpod.DatabaseMigrationWarning",
"type": "uniqueIndexCreated",
"message": "Unique index \"crdt_data_rows_space_tbl_row_idx\" is added to table \"crdt_data_rows\". If there are existing rows with duplicate values, this migration will fail.",
"table": "crdt_data_rows",
"columns": [
"spaceId",
"tblId",
"uuidRowId"
],
"destrucive": false
},
{
"__className__": "serverpod.DatabaseMigrationWarning",
"type": "tableDropped",
"message": "One or more columns are added to table \"crdt_data_rows\" which cannot be added in a table migration. The complete table will be deleted and recreated.",
"table": "crdt_data_rows",
"columns": [
"spaceId"
],
"destrucive": true
}
],
"migrationApiVersion": 1
}