{
"$schema": "https://syncular.dev/schemas/syncular.schema.v1.json",
"contractVersion": 1,
"appSchemaVersion": 8,
"clientSchemaSupport": {
"current": 8,
"minSupported": 6,
"supported": [
6,
7,
8
]
},
"historicalClientSchemas": [
{
"schemaVersion": 6,
"tables": [
{
"name": "comments",
"primaryKeyColumn": "id",
"serverVersionColumn": "server_version",
"softDeleteColumn": "deleted",
"columns": [
{
"name": "id",
"sqlType": "TEXT",
"typeFamily": "text",
"appType": "string",
"nullable": false,
"notnullRequired": false,
"primaryKey": true,
"hasDefault": false,
"defaultSql": null,
"serverVersion": false,
"softDelete": false,
"blobRef": false,
"scope": null
},
{
"name": "task_id",
"sqlType": "TEXT",
"typeFamily": "text",
"appType": "string",
"nullable": false,
"notnullRequired": true,
"primaryKey": false,
"hasDefault": false,
"defaultSql": null,
"serverVersion": false,
"softDelete": false,
"blobRef": false,
"scope": null
},
{
"name": "project_id",
"sqlType": "TEXT",
"typeFamily": "text",
"appType": "string",
"nullable": true,
"notnullRequired": false,
"primaryKey": false,
"hasDefault": false,
"defaultSql": null,
"serverVersion": false,
"softDelete": false,
"blobRef": false,
"scope": "project_id"
},
{
"name": "body",
"sqlType": "TEXT",
"typeFamily": "text",
"appType": "string",
"nullable": false,
"notnullRequired": true,
"primaryKey": false,
"hasDefault": false,
"defaultSql": null,
"serverVersion": false,
"softDelete": false,
"blobRef": false,
"scope": null
},
{
"name": "author_id",
"sqlType": "TEXT",
"typeFamily": "text",
"appType": "string",
"nullable": false,
"notnullRequired": true,
"primaryKey": false,
"hasDefault": false,
"defaultSql": null,
"serverVersion": false,
"softDelete": false,
"blobRef": false,
"scope": "user_id"
},
{
"name": "deleted",
"sqlType": "INTEGER",
"typeFamily": "integer",
"appType": "integer",
"nullable": false,
"notnullRequired": true,
"primaryKey": false,
"hasDefault": true,
"defaultSql": "0",
"serverVersion": false,
"softDelete": true,
"blobRef": false,
"scope": null
},
{
"name": "server_version",
"sqlType": "BIGINT",
"typeFamily": "integer",
"appType": "integer",
"nullable": false,
"notnullRequired": true,
"primaryKey": false,
"hasDefault": true,
"defaultSql": "0",
"serverVersion": true,
"softDelete": false,
"blobRef": false,
"scope": null
}
],
"blobColumns": [],
"crdtYjsFields": [],
"encryptedFields": [],
"scopes": [
{
"name": "user_id",
"column": "author_id",
"source": "actorId",
"required": true
},
{
"name": "project_id",
"column": "project_id",
"source": "projectId",
"required": false
}
],
"subscription": {
"id": "sub-comments",
"params": {}
},
"sqliteWithoutRowid": true
},
{
"name": "projects",
"primaryKeyColumn": "id",
"serverVersionColumn": "server_version",
"softDeleteColumn": null,
"columns": [
{
"name": "id",
"sqlType": "TEXT",
"typeFamily": "text",
"appType": "string",
"nullable": false,
"notnullRequired": false,
"primaryKey": true,
"hasDefault": false,
"defaultSql": null,
"serverVersion": false,
"softDelete": false,
"blobRef": false,
"scope": null
},
{
"name": "name",
"sqlType": "TEXT",
"typeFamily": "text",
"appType": "string",
"nullable": false,
"notnullRequired": true,
"primaryKey": false,
"hasDefault": false,
"defaultSql": null,
"serverVersion": false,
"softDelete": false,
"blobRef": false,
"scope": null
},
{
"name": "owner_id",
"sqlType": "TEXT",
"typeFamily": "text",
"appType": "string",
"nullable": false,
"notnullRequired": true,
"primaryKey": false,
"hasDefault": false,
"defaultSql": null,
"serverVersion": false,
"softDelete": false,
"blobRef": false,
"scope": "user_id"
},
{
"name": "archived",
"sqlType": "INTEGER",
"typeFamily": "integer",
"appType": "integer",
"nullable": false,
"notnullRequired": true,
"primaryKey": false,
"hasDefault": true,
"defaultSql": "0",
"serverVersion": false,
"softDelete": false,
"blobRef": false,
"scope": null
},
{
"name": "server_version",
"sqlType": "BIGINT",
"typeFamily": "integer",
"appType": "integer",
"nullable": false,
"notnullRequired": true,
"primaryKey": false,
"hasDefault": true,
"defaultSql": "0",
"serverVersion": true,
"softDelete": false,
"blobRef": false,
"scope": null
}
],
"blobColumns": [],
"crdtYjsFields": [],
"encryptedFields": [],
"scopes": [
{
"name": "user_id",
"column": "owner_id",
"source": "actorId",
"required": true
}
],
"subscription": {
"id": "sub-projects",
"params": {}
},
"sqliteWithoutRowid": true
},
{
"name": "tasks",
"primaryKeyColumn": "id",
"serverVersionColumn": "server_version",
"softDeleteColumn": null,
"columns": [
{
"name": "id",
"sqlType": "TEXT",
"typeFamily": "text",
"appType": "string",
"nullable": false,
"notnullRequired": false,
"primaryKey": true,
"hasDefault": false,
"defaultSql": null,
"serverVersion": false,
"softDelete": false,
"blobRef": false,
"scope": null
},
{
"name": "title",
"sqlType": "TEXT",
"typeFamily": "text",
"appType": "string",
"nullable": false,
"notnullRequired": true,
"primaryKey": false,
"hasDefault": false,
"defaultSql": null,
"serverVersion": false,
"softDelete": false,
"blobRef": false,
"scope": null
},
{
"name": "completed",
"sqlType": "INTEGER",
"typeFamily": "integer",
"appType": "integer",
"nullable": false,
"notnullRequired": true,
"primaryKey": false,
"hasDefault": true,
"defaultSql": "0",
"serverVersion": false,
"softDelete": false,
"blobRef": false,
"scope": null
},
{
"name": "user_id",
"sqlType": "TEXT",
"typeFamily": "text",
"appType": "string",
"nullable": false,
"notnullRequired": true,
"primaryKey": false,
"hasDefault": false,
"defaultSql": null,
"serverVersion": false,
"softDelete": false,
"blobRef": false,
"scope": "user_id"
},
{
"name": "project_id",
"sqlType": "TEXT",
"typeFamily": "text",
"appType": "string",
"nullable": true,
"notnullRequired": false,
"primaryKey": false,
"hasDefault": false,
"defaultSql": null,
"serverVersion": false,
"softDelete": false,
"blobRef": false,
"scope": "project_id"
},
{
"name": "server_version",
"sqlType": "BIGINT",
"typeFamily": "integer",
"appType": "integer",
"nullable": false,
"notnullRequired": true,
"primaryKey": false,
"hasDefault": true,
"defaultSql": "0",
"serverVersion": true,
"softDelete": false,
"blobRef": false,
"scope": null
},
{
"name": "image",
"sqlType": "TEXT",
"typeFamily": "text",
"appType": "blobRef",
"nullable": true,
"notnullRequired": false,
"primaryKey": false,
"hasDefault": false,
"defaultSql": null,
"serverVersion": false,
"softDelete": false,
"blobRef": true,
"scope": null
},
{
"name": "title_yjs_state",
"sqlType": "TEXT",
"typeFamily": "text",
"appType": "string",
"nullable": true,
"notnullRequired": false,
"primaryKey": false,
"hasDefault": false,
"defaultSql": null,
"serverVersion": false,
"softDelete": false,
"blobRef": false,
"scope": null
}
],
"blobColumns": [
"image"
],
"crdtYjsFields": [
{
"field": "title",
"stateColumn": "title_yjs_state",
"containerKey": "title",
"rowIdField": "id",
"kind": "text",
"syncMode": "server-merge"
}
],
"encryptedFields": [],
"scopes": [
{
"name": "user_id",
"column": "user_id",
"source": "actorId",
"required": true
},
{
"name": "project_id",
"column": "project_id",
"source": "projectId",
"required": false
}
],
"subscription": {
"id": "sub-tasks",
"params": {}
},
"sqliteWithoutRowid": true
}
],
"localBaseSchema": {
"tableSetupSql": [
"CREATE TABLE IF NOT EXISTS \"comments\" (\n \"id\" TEXT PRIMARY KEY,\n \"task_id\" TEXT NOT NULL,\n \"project_id\" TEXT,\n \"body\" TEXT NOT NULL,\n \"author_id\" TEXT NOT NULL,\n \"deleted\" INTEGER NOT NULL DEFAULT 0,\n \"server_version\" INTEGER NOT NULL DEFAULT 0\n) WITHOUT ROWID",
"CREATE TABLE IF NOT EXISTS \"projects\" (\n \"id\" TEXT PRIMARY KEY,\n \"name\" TEXT NOT NULL,\n \"owner_id\" TEXT NOT NULL,\n \"archived\" INTEGER NOT NULL DEFAULT 0,\n \"server_version\" INTEGER NOT NULL DEFAULT 0\n) WITHOUT ROWID",
"CREATE TABLE IF NOT EXISTS \"tasks\" (\n \"id\" TEXT PRIMARY KEY,\n \"title\" TEXT NOT NULL,\n \"completed\" INTEGER NOT NULL DEFAULT 0,\n \"user_id\" TEXT NOT NULL,\n \"project_id\" TEXT,\n \"server_version\" INTEGER NOT NULL DEFAULT 0,\n \"image\" TEXT,\n \"title_yjs_state\" TEXT\n) WITHOUT ROWID"
]
}
},
{
"schemaVersion": 7,
"tables": [
{
"name": "comments",
"primaryKeyColumn": "id",
"serverVersionColumn": "server_version",
"softDeleteColumn": "deleted",
"columns": [
{
"name": "id",
"sqlType": "TEXT",
"typeFamily": "text",
"appType": "string",
"nullable": false,
"notnullRequired": false,
"primaryKey": true,
"hasDefault": false,
"defaultSql": null,
"serverVersion": false,
"softDelete": false,
"blobRef": false,
"scope": null
},
{
"name": "task_id",
"sqlType": "TEXT",
"typeFamily": "text",
"appType": "string",
"nullable": false,
"notnullRequired": true,
"primaryKey": false,
"hasDefault": false,
"defaultSql": null,
"serverVersion": false,
"softDelete": false,
"blobRef": false,
"scope": null
},
{
"name": "project_id",
"sqlType": "TEXT",
"typeFamily": "text",
"appType": "string",
"nullable": true,
"notnullRequired": false,
"primaryKey": false,
"hasDefault": false,
"defaultSql": null,
"serverVersion": false,
"softDelete": false,
"blobRef": false,
"scope": "project_id"
},
{
"name": "body",
"sqlType": "TEXT",
"typeFamily": "text",
"appType": "string",
"nullable": false,
"notnullRequired": true,
"primaryKey": false,
"hasDefault": false,
"defaultSql": null,
"serverVersion": false,
"softDelete": false,
"blobRef": false,
"scope": null
},
{
"name": "author_id",
"sqlType": "TEXT",
"typeFamily": "text",
"appType": "string",
"nullable": false,
"notnullRequired": true,
"primaryKey": false,
"hasDefault": false,
"defaultSql": null,
"serverVersion": false,
"softDelete": false,
"blobRef": false,
"scope": "user_id"
},
{
"name": "deleted",
"sqlType": "INTEGER",
"typeFamily": "integer",
"appType": "integer",
"nullable": false,
"notnullRequired": true,
"primaryKey": false,
"hasDefault": true,
"defaultSql": "0",
"serverVersion": false,
"softDelete": true,
"blobRef": false,
"scope": null
},
{
"name": "server_version",
"sqlType": "BIGINT",
"typeFamily": "integer",
"appType": "integer",
"nullable": false,
"notnullRequired": true,
"primaryKey": false,
"hasDefault": true,
"defaultSql": "0",
"serverVersion": true,
"softDelete": false,
"blobRef": false,
"scope": null
}
],
"blobColumns": [],
"crdtYjsFields": [],
"encryptedFields": [],
"scopes": [
{
"name": "user_id",
"column": "author_id",
"source": "actorId",
"required": true
},
{
"name": "project_id",
"column": "project_id",
"source": "projectId",
"required": false
}
],
"subscription": {
"id": "sub-comments",
"params": {}
},
"sqliteWithoutRowid": true
},
{
"name": "projects",
"primaryKeyColumn": "id",
"serverVersionColumn": "server_version",
"softDeleteColumn": null,
"columns": [
{
"name": "id",
"sqlType": "TEXT",
"typeFamily": "text",
"appType": "string",
"nullable": false,
"notnullRequired": false,
"primaryKey": true,
"hasDefault": false,
"defaultSql": null,
"serverVersion": false,
"softDelete": false,
"blobRef": false,
"scope": null
},
{
"name": "name",
"sqlType": "TEXT",
"typeFamily": "text",
"appType": "string",
"nullable": false,
"notnullRequired": true,
"primaryKey": false,
"hasDefault": false,
"defaultSql": null,
"serverVersion": false,
"softDelete": false,
"blobRef": false,
"scope": null
},
{
"name": "owner_id",
"sqlType": "TEXT",
"typeFamily": "text",
"appType": "string",
"nullable": false,
"notnullRequired": true,
"primaryKey": false,
"hasDefault": false,
"defaultSql": null,
"serverVersion": false,
"softDelete": false,
"blobRef": false,
"scope": "user_id"
},
{
"name": "archived",
"sqlType": "INTEGER",
"typeFamily": "integer",
"appType": "integer",
"nullable": false,
"notnullRequired": true,
"primaryKey": false,
"hasDefault": true,
"defaultSql": "0",
"serverVersion": false,
"softDelete": false,
"blobRef": false,
"scope": null
},
{
"name": "server_version",
"sqlType": "BIGINT",
"typeFamily": "integer",
"appType": "integer",
"nullable": false,
"notnullRequired": true,
"primaryKey": false,
"hasDefault": true,
"defaultSql": "0",
"serverVersion": true,
"softDelete": false,
"blobRef": false,
"scope": null
}
],
"blobColumns": [],
"crdtYjsFields": [],
"encryptedFields": [],
"scopes": [
{
"name": "user_id",
"column": "owner_id",
"source": "actorId",
"required": true
}
],
"subscription": {
"id": "sub-projects",
"params": {}
},
"sqliteWithoutRowid": true
},
{
"name": "tasks",
"primaryKeyColumn": "id",
"serverVersionColumn": "server_version",
"softDeleteColumn": null,
"columns": [
{
"name": "id",
"sqlType": "TEXT",
"typeFamily": "text",
"appType": "string",
"nullable": false,
"notnullRequired": false,
"primaryKey": true,
"hasDefault": false,
"defaultSql": null,
"serverVersion": false,
"softDelete": false,
"blobRef": false,
"scope": null
},
{
"name": "title",
"sqlType": "TEXT",
"typeFamily": "text",
"appType": "string",
"nullable": false,
"notnullRequired": true,
"primaryKey": false,
"hasDefault": false,
"defaultSql": null,
"serverVersion": false,
"softDelete": false,
"blobRef": false,
"scope": null
},
{
"name": "completed",
"sqlType": "INTEGER",
"typeFamily": "integer",
"appType": "integer",
"nullable": false,
"notnullRequired": true,
"primaryKey": false,
"hasDefault": true,
"defaultSql": "0",
"serverVersion": false,
"softDelete": false,
"blobRef": false,
"scope": null
},
{
"name": "user_id",
"sqlType": "TEXT",
"typeFamily": "text",
"appType": "string",
"nullable": false,
"notnullRequired": true,
"primaryKey": false,
"hasDefault": false,
"defaultSql": null,
"serverVersion": false,
"softDelete": false,
"blobRef": false,
"scope": "user_id"
},
{
"name": "project_id",
"sqlType": "TEXT",
"typeFamily": "text",
"appType": "string",
"nullable": true,
"notnullRequired": false,
"primaryKey": false,
"hasDefault": false,
"defaultSql": null,
"serverVersion": false,
"softDelete": false,
"blobRef": false,
"scope": "project_id"
},
{
"name": "server_version",
"sqlType": "BIGINT",
"typeFamily": "integer",
"appType": "integer",
"nullable": false,
"notnullRequired": true,
"primaryKey": false,
"hasDefault": true,
"defaultSql": "0",
"serverVersion": true,
"softDelete": false,
"blobRef": false,
"scope": null
},
{
"name": "image",
"sqlType": "TEXT",
"typeFamily": "text",
"appType": "blobRef",
"nullable": true,
"notnullRequired": false,
"primaryKey": false,
"hasDefault": false,
"defaultSql": null,
"serverVersion": false,
"softDelete": false,
"blobRef": true,
"scope": null
},
{
"name": "title_yjs_state",
"sqlType": "TEXT",
"typeFamily": "text",
"appType": "string",
"nullable": true,
"notnullRequired": false,
"primaryKey": false,
"hasDefault": false,
"defaultSql": null,
"serverVersion": false,
"softDelete": false,
"blobRef": false,
"scope": null
}
],
"blobColumns": [
"image"
],
"crdtYjsFields": [
{
"field": "title",
"stateColumn": "title_yjs_state",
"containerKey": "title",
"rowIdField": "id",
"kind": "text",
"syncMode": "server-merge"
}
],
"encryptedFields": [],
"scopes": [
{
"name": "user_id",
"column": "user_id",
"source": "actorId",
"required": true
},
{
"name": "project_id",
"column": "project_id",
"source": "projectId",
"required": false
}
],
"subscription": {
"id": "sub-tasks",
"params": {}
},
"sqliteWithoutRowid": true
}
],
"localBaseSchema": {
"tableSetupSql": [
"CREATE TABLE IF NOT EXISTS \"comments\" (\n \"id\" TEXT PRIMARY KEY,\n \"task_id\" TEXT NOT NULL,\n \"project_id\" TEXT,\n \"body\" TEXT NOT NULL,\n \"author_id\" TEXT NOT NULL,\n \"deleted\" INTEGER NOT NULL DEFAULT 0,\n \"server_version\" INTEGER NOT NULL DEFAULT 0\n) WITHOUT ROWID",
"CREATE TABLE IF NOT EXISTS \"projects\" (\n \"id\" TEXT PRIMARY KEY,\n \"name\" TEXT NOT NULL,\n \"owner_id\" TEXT NOT NULL,\n \"archived\" INTEGER NOT NULL DEFAULT 0,\n \"server_version\" INTEGER NOT NULL DEFAULT 0\n) WITHOUT ROWID",
"CREATE TABLE IF NOT EXISTS \"tasks\" (\n \"id\" TEXT PRIMARY KEY,\n \"title\" TEXT NOT NULL,\n \"completed\" INTEGER NOT NULL DEFAULT 0,\n \"user_id\" TEXT NOT NULL,\n \"project_id\" TEXT,\n \"server_version\" INTEGER NOT NULL DEFAULT 0,\n \"image\" TEXT,\n \"title_yjs_state\" TEXT\n) WITHOUT ROWID"
]
}
}
],
"migrations": [
{
"version": "0001",
"schemaVersion": 1,
"name": "initial"
},
{
"version": "0002",
"schemaVersion": 2,
"name": "blob_client_tables"
},
{
"version": "0003",
"schemaVersion": 3,
"name": "retry_backoff"
},
{
"version": "0004",
"schemaVersion": 4,
"name": "encrypted_crdt_tables"
},
{
"version": "0005",
"schemaVersion": 5,
"name": "encrypted_crdt_server_seq"
},
{
"version": "0006",
"schemaVersion": 6,
"name": "crdt_document_persistence"
},
{
"version": "0007",
"schemaVersion": 7,
"name": "verified_roots"
},
{
"version": "0008",
"schemaVersion": 8,
"name": "add_task_descriptions"
}
],
"tables": [
{
"name": "comments",
"primaryKeyColumn": "id",
"serverVersionColumn": "server_version",
"softDeleteColumn": "deleted",
"columns": [
{
"name": "id",
"sqlType": "TEXT",
"typeFamily": "text",
"appType": "string",
"nullable": false,
"notnullRequired": false,
"primaryKey": true,
"hasDefault": false,
"defaultSql": null,
"serverVersion": false,
"softDelete": false,
"blobRef": false,
"scope": null
},
{
"name": "task_id",
"sqlType": "TEXT",
"typeFamily": "text",
"appType": "string",
"nullable": false,
"notnullRequired": true,
"primaryKey": false,
"hasDefault": false,
"defaultSql": null,
"serverVersion": false,
"softDelete": false,
"blobRef": false,
"scope": null
},
{
"name": "project_id",
"sqlType": "TEXT",
"typeFamily": "text",
"appType": "string",
"nullable": true,
"notnullRequired": false,
"primaryKey": false,
"hasDefault": false,
"defaultSql": null,
"serverVersion": false,
"softDelete": false,
"blobRef": false,
"scope": "project_id"
},
{
"name": "body",
"sqlType": "TEXT",
"typeFamily": "text",
"appType": "string",
"nullable": false,
"notnullRequired": true,
"primaryKey": false,
"hasDefault": false,
"defaultSql": null,
"serverVersion": false,
"softDelete": false,
"blobRef": false,
"scope": null
},
{
"name": "author_id",
"sqlType": "TEXT",
"typeFamily": "text",
"appType": "string",
"nullable": false,
"notnullRequired": true,
"primaryKey": false,
"hasDefault": false,
"defaultSql": null,
"serverVersion": false,
"softDelete": false,
"blobRef": false,
"scope": "user_id"
},
{
"name": "deleted",
"sqlType": "INTEGER",
"typeFamily": "integer",
"appType": "integer",
"nullable": false,
"notnullRequired": true,
"primaryKey": false,
"hasDefault": true,
"defaultSql": "0",
"serverVersion": false,
"softDelete": true,
"blobRef": false,
"scope": null
},
{
"name": "server_version",
"sqlType": "BIGINT",
"typeFamily": "integer",
"appType": "integer",
"nullable": false,
"notnullRequired": true,
"primaryKey": false,
"hasDefault": true,
"defaultSql": "0",
"serverVersion": true,
"softDelete": false,
"blobRef": false,
"scope": null
}
],
"blobColumns": [],
"crdtYjsFields": [],
"encryptedFields": [],
"scopes": [
{
"name": "user_id",
"column": "author_id",
"source": "actorId",
"required": true
},
{
"name": "project_id",
"column": "project_id",
"source": "projectId",
"required": false
}
],
"subscription": {
"id": "sub-comments",
"params": {}
},
"sqliteWithoutRowid": true
},
{
"name": "projects",
"primaryKeyColumn": "id",
"serverVersionColumn": "server_version",
"softDeleteColumn": null,
"columns": [
{
"name": "id",
"sqlType": "TEXT",
"typeFamily": "text",
"appType": "string",
"nullable": false,
"notnullRequired": false,
"primaryKey": true,
"hasDefault": false,
"defaultSql": null,
"serverVersion": false,
"softDelete": false,
"blobRef": false,
"scope": null
},
{
"name": "name",
"sqlType": "TEXT",
"typeFamily": "text",
"appType": "string",
"nullable": false,
"notnullRequired": true,
"primaryKey": false,
"hasDefault": false,
"defaultSql": null,
"serverVersion": false,
"softDelete": false,
"blobRef": false,
"scope": null
},
{
"name": "owner_id",
"sqlType": "TEXT",
"typeFamily": "text",
"appType": "string",
"nullable": false,
"notnullRequired": true,
"primaryKey": false,
"hasDefault": false,
"defaultSql": null,
"serverVersion": false,
"softDelete": false,
"blobRef": false,
"scope": "user_id"
},
{
"name": "archived",
"sqlType": "INTEGER",
"typeFamily": "integer",
"appType": "integer",
"nullable": false,
"notnullRequired": true,
"primaryKey": false,
"hasDefault": true,
"defaultSql": "0",
"serverVersion": false,
"softDelete": false,
"blobRef": false,
"scope": null
},
{
"name": "server_version",
"sqlType": "BIGINT",
"typeFamily": "integer",
"appType": "integer",
"nullable": false,
"notnullRequired": true,
"primaryKey": false,
"hasDefault": true,
"defaultSql": "0",
"serverVersion": true,
"softDelete": false,
"blobRef": false,
"scope": null
}
],
"blobColumns": [],
"crdtYjsFields": [],
"encryptedFields": [],
"scopes": [
{
"name": "user_id",
"column": "owner_id",
"source": "actorId",
"required": true
}
],
"subscription": {
"id": "sub-projects",
"params": {}
},
"sqliteWithoutRowid": true
},
{
"name": "tasks",
"primaryKeyColumn": "id",
"serverVersionColumn": "server_version",
"softDeleteColumn": null,
"columns": [
{
"name": "id",
"sqlType": "TEXT",
"typeFamily": "text",
"appType": "string",
"nullable": false,
"notnullRequired": false,
"primaryKey": true,
"hasDefault": false,
"defaultSql": null,
"serverVersion": false,
"softDelete": false,
"blobRef": false,
"scope": null
},
{
"name": "title",
"sqlType": "TEXT",
"typeFamily": "text",
"appType": "string",
"nullable": false,
"notnullRequired": true,
"primaryKey": false,
"hasDefault": false,
"defaultSql": null,
"serverVersion": false,
"softDelete": false,
"blobRef": false,
"scope": null
},
{
"name": "completed",
"sqlType": "INTEGER",
"typeFamily": "integer",
"appType": "integer",
"nullable": false,
"notnullRequired": true,
"primaryKey": false,
"hasDefault": true,
"defaultSql": "0",
"serverVersion": false,
"softDelete": false,
"blobRef": false,
"scope": null
},
{
"name": "user_id",
"sqlType": "TEXT",
"typeFamily": "text",
"appType": "string",
"nullable": false,
"notnullRequired": true,
"primaryKey": false,
"hasDefault": false,
"defaultSql": null,
"serverVersion": false,
"softDelete": false,
"blobRef": false,
"scope": "user_id"
},
{
"name": "project_id",
"sqlType": "TEXT",
"typeFamily": "text",
"appType": "string",
"nullable": true,
"notnullRequired": false,
"primaryKey": false,
"hasDefault": false,
"defaultSql": null,
"serverVersion": false,
"softDelete": false,
"blobRef": false,
"scope": "project_id"
},
{
"name": "server_version",
"sqlType": "BIGINT",
"typeFamily": "integer",
"appType": "integer",
"nullable": false,
"notnullRequired": true,
"primaryKey": false,
"hasDefault": true,
"defaultSql": "0",
"serverVersion": true,
"softDelete": false,
"blobRef": false,
"scope": null
},
{
"name": "image",
"sqlType": "TEXT",
"typeFamily": "text",
"appType": "blobRef",
"nullable": true,
"notnullRequired": false,
"primaryKey": false,
"hasDefault": false,
"defaultSql": null,
"serverVersion": false,
"softDelete": false,
"blobRef": true,
"scope": null
},
{
"name": "title_yjs_state",
"sqlType": "TEXT",
"typeFamily": "text",
"appType": "string",
"nullable": true,
"notnullRequired": false,
"primaryKey": false,
"hasDefault": false,
"defaultSql": null,
"serverVersion": false,
"softDelete": false,
"blobRef": false,
"scope": null
},
{
"name": "description",
"sqlType": "TEXT",
"typeFamily": "text",
"appType": "string",
"nullable": true,
"notnullRequired": false,
"primaryKey": false,
"hasDefault": false,
"defaultSql": null,
"serverVersion": false,
"softDelete": false,
"blobRef": false,
"scope": null
}
],
"blobColumns": [
"image"
],
"crdtYjsFields": [
{
"field": "title",
"stateColumn": "title_yjs_state",
"containerKey": "title",
"rowIdField": "id",
"kind": "text",
"syncMode": "server-merge"
}
],
"encryptedFields": [
{
"field": "description",
"scope": "tasks",
"rowIdField": "id"
}
],
"scopes": [
{
"name": "user_id",
"column": "user_id",
"source": "actorId",
"required": true
},
{
"name": "project_id",
"column": "project_id",
"source": "projectId",
"required": false
}
],
"subscription": {
"id": "sub-tasks",
"params": {}
},
"sqliteWithoutRowid": true
}
],
"localBaseSchema": {
"tableSetupSql": [
"CREATE TABLE IF NOT EXISTS \"comments\" (\n \"id\" TEXT PRIMARY KEY,\n \"task_id\" TEXT NOT NULL,\n \"project_id\" TEXT,\n \"body\" TEXT NOT NULL,\n \"author_id\" TEXT NOT NULL,\n \"deleted\" INTEGER NOT NULL DEFAULT 0,\n \"server_version\" INTEGER NOT NULL DEFAULT 0\n) WITHOUT ROWID",
"CREATE TABLE IF NOT EXISTS \"local_preferences\" (\n \"id\" TEXT PRIMARY KEY,\n \"key\" TEXT NOT NULL,\n \"value\" TEXT NOT NULL\n)",
"CREATE TABLE IF NOT EXISTS \"projects\" (\n \"id\" TEXT PRIMARY KEY,\n \"name\" TEXT NOT NULL,\n \"owner_id\" TEXT NOT NULL,\n \"archived\" INTEGER NOT NULL DEFAULT 0,\n \"server_version\" INTEGER NOT NULL DEFAULT 0\n) WITHOUT ROWID",
"CREATE TABLE IF NOT EXISTS \"tasks\" (\n \"id\" TEXT PRIMARY KEY,\n \"title\" TEXT NOT NULL,\n \"completed\" INTEGER NOT NULL DEFAULT 0,\n \"user_id\" TEXT NOT NULL,\n \"project_id\" TEXT,\n \"server_version\" INTEGER NOT NULL DEFAULT 0,\n \"image\" TEXT,\n \"title_yjs_state\" TEXT,\n \"description\" TEXT\n) WITHOUT ROWID"
]
},
"localReadModels": [
{
"name": "taskCountsByUserCompletion",
"kind": "countBy",
"sourceTable": "tasks",
"outputTable": "syncular_task_counts",
"dimensions": [
"user_id",
"completed"
],
"countColumn": "task_count",
"setupSql": [
"CREATE TABLE IF NOT EXISTS \"syncular_task_counts\" (\n \"user_id\" TEXT NOT NULL,\n \"completed\" INTEGER NOT NULL,\n \"task_count\" INTEGER NOT NULL DEFAULT 0,\n PRIMARY KEY (\"user_id\", \"completed\")\n) WITHOUT ROWID",
"CREATE TRIGGER IF NOT EXISTS \"syncular_rm_taskCountsByUserCompletion_insert\"\nAFTER INSERT ON \"tasks\"\nBEGIN\n INSERT INTO \"syncular_task_counts\" (\"user_id\", \"completed\", \"task_count\")\n VALUES (new.\"user_id\", new.\"completed\", 1)\n ON CONFLICT(\"user_id\", \"completed\") DO UPDATE SET\n \"task_count\" = \"task_count\" + 1;\nEND",
"CREATE TRIGGER IF NOT EXISTS \"syncular_rm_taskCountsByUserCompletion_delete\"\nAFTER DELETE ON \"tasks\"\nBEGIN\n UPDATE \"syncular_task_counts\"\n SET \"task_count\" = \"task_count\" - 1\n WHERE \"user_id\" = old.\"user_id\"\n AND \"completed\" = old.\"completed\";\n DELETE FROM \"syncular_task_counts\" WHERE \"task_count\" <= 0;\nEND",
"CREATE TRIGGER IF NOT EXISTS \"syncular_rm_taskCountsByUserCompletion_update_group\"\nAFTER UPDATE OF \"user_id\", \"completed\" ON \"tasks\"\nWHEN old.\"user_id\" IS NOT new.\"user_id\"\n OR old.\"completed\" IS NOT new.\"completed\"\nBEGIN\n UPDATE \"syncular_task_counts\"\n SET \"task_count\" = \"task_count\" - 1\n WHERE \"user_id\" = old.\"user_id\"\n AND \"completed\" = old.\"completed\";\n DELETE FROM \"syncular_task_counts\" WHERE \"task_count\" <= 0;\n INSERT INTO \"syncular_task_counts\" (\"user_id\", \"completed\", \"task_count\")\n VALUES (new.\"user_id\", new.\"completed\", 1)\n ON CONFLICT(\"user_id\", \"completed\") DO UPDATE SET\n \"task_count\" = \"task_count\" + 1;\nEND"
],
"rebuildSql": [
"DELETE FROM \"syncular_task_counts\"",
"INSERT INTO \"syncular_task_counts\" (\"user_id\", \"completed\", \"task_count\")\nSELECT \"user_id\", \"completed\", count(*)\nFROM \"tasks\"\nGROUP BY \"user_id\", \"completed\""
]
}
],
"localDerivedSchema": {
"indexes": [],
"readModelSetupSql": [
"CREATE TABLE IF NOT EXISTS \"syncular_task_counts\" (\n \"user_id\" TEXT NOT NULL,\n \"completed\" INTEGER NOT NULL,\n \"task_count\" INTEGER NOT NULL DEFAULT 0,\n PRIMARY KEY (\"user_id\", \"completed\")\n) WITHOUT ROWID",
"CREATE TRIGGER IF NOT EXISTS \"syncular_rm_taskCountsByUserCompletion_insert\"\nAFTER INSERT ON \"tasks\"\nBEGIN\n INSERT INTO \"syncular_task_counts\" (\"user_id\", \"completed\", \"task_count\")\n VALUES (new.\"user_id\", new.\"completed\", 1)\n ON CONFLICT(\"user_id\", \"completed\") DO UPDATE SET\n \"task_count\" = \"task_count\" + 1;\nEND",
"CREATE TRIGGER IF NOT EXISTS \"syncular_rm_taskCountsByUserCompletion_delete\"\nAFTER DELETE ON \"tasks\"\nBEGIN\n UPDATE \"syncular_task_counts\"\n SET \"task_count\" = \"task_count\" - 1\n WHERE \"user_id\" = old.\"user_id\"\n AND \"completed\" = old.\"completed\";\n DELETE FROM \"syncular_task_counts\" WHERE \"task_count\" <= 0;\nEND",
"CREATE TRIGGER IF NOT EXISTS \"syncular_rm_taskCountsByUserCompletion_update_group\"\nAFTER UPDATE OF \"user_id\", \"completed\" ON \"tasks\"\nWHEN old.\"user_id\" IS NOT new.\"user_id\"\n OR old.\"completed\" IS NOT new.\"completed\"\nBEGIN\n UPDATE \"syncular_task_counts\"\n SET \"task_count\" = \"task_count\" - 1\n WHERE \"user_id\" = old.\"user_id\"\n AND \"completed\" = old.\"completed\";\n DELETE FROM \"syncular_task_counts\" WHERE \"task_count\" <= 0;\n INSERT INTO \"syncular_task_counts\" (\"user_id\", \"completed\", \"task_count\")\n VALUES (new.\"user_id\", new.\"completed\", 1)\n ON CONFLICT(\"user_id\", \"completed\") DO UPDATE SET\n \"task_count\" = \"task_count\" + 1;\nEND"
],
"readModelRebuildSql": [
"DELETE FROM \"syncular_task_counts\"",
"INSERT INTO \"syncular_task_counts\" (\"user_id\", \"completed\", \"task_count\")\nSELECT \"user_id\", \"completed\", count(*)\nFROM \"tasks\"\nGROUP BY \"user_id\", \"completed\""
]
}
}