Skip to content

Commit 0564480

Browse files
EvanHahnTomás Ciccola
andauthored
feat!: update @mapeo/schema to latest version (#715)
This patch: - Removes `createdBy` from documents. Removes `MapeoProject.prototype.$createdByToDeviceId` as a side-effect. - Returns `originalVersionId` on all documents. - Updates `@mapeo/schema` to the latest version, which requires a bunch of other changes. Closes [#371](#371). See <https://github.com/digidem/mapeo-schema/pull/191> and <digidem/mapeo-mock-data#7>. Co-Authored-By: Tomás Ciccola <[email protected]>
1 parent ef555c7 commit 0564480

19 files changed

+394
-1473
lines changed

drizzle/client/0000_organic_bloodstrike.sql renamed to drizzle/client/0000_kind_imperial_guard.sql

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,17 @@ CREATE TABLE `projectKeys` (
1818
CREATE TABLE `projectSettings` (
1919
`docId` text PRIMARY KEY NOT NULL,
2020
`versionId` text NOT NULL,
21+
`originalVersionId` text NOT NULL,
2122
`schemaName` text NOT NULL,
2223
`createdAt` text NOT NULL,
23-
`createdBy` text NOT NULL,
2424
`updatedAt` text NOT NULL,
2525
`links` text NOT NULL,
2626
`deleted` integer NOT NULL,
2727
`name` text,
2828
`defaultPresets` text,
2929
`configMetadata` text,
30+
`isInitialProject` integer NOT NULL,
3031
`forks` text NOT NULL
3132
);
3233
--> statement-breakpoint
33-
CREATE UNIQUE INDEX `localDeviceInfo_deviceId_unique` ON `localDeviceInfo` (`deviceId`);
34+
CREATE UNIQUE INDEX `localDeviceInfo_deviceId_unique` ON `localDeviceInfo` (`deviceId`);

drizzle/client/meta/0000_snapshot.json

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"version": "5",
33
"dialect": "sqlite",
4-
"id": "c4f2efaa-b40a-4148-9b5f-b1a4fd9f7f8e",
4+
"id": "aea2dc34-6de1-4de7-86d5-0fbe93b682ff",
55
"prevId": "00000000-0000-0000-0000-000000000000",
66
"tables": {
77
"localDeviceInfo": {
@@ -113,22 +113,22 @@
113113
"notNull": true,
114114
"autoincrement": false
115115
},
116-
"schemaName": {
117-
"name": "schemaName",
116+
"originalVersionId": {
117+
"name": "originalVersionId",
118118
"type": "text",
119119
"primaryKey": false,
120120
"notNull": true,
121121
"autoincrement": false
122122
},
123-
"createdAt": {
124-
"name": "createdAt",
123+
"schemaName": {
124+
"name": "schemaName",
125125
"type": "text",
126126
"primaryKey": false,
127127
"notNull": true,
128128
"autoincrement": false
129129
},
130-
"createdBy": {
131-
"name": "createdBy",
130+
"createdAt": {
131+
"name": "createdAt",
132132
"type": "text",
133133
"primaryKey": false,
134134
"notNull": true,
@@ -176,6 +176,13 @@
176176
"notNull": false,
177177
"autoincrement": false
178178
},
179+
"isInitialProject": {
180+
"name": "isInitialProject",
181+
"type": "integer",
182+
"primaryKey": false,
183+
"notNull": true,
184+
"autoincrement": false
185+
},
179186
"forks": {
180187
"name": "forks",
181188
"type": "text",
@@ -196,4 +203,4 @@
196203
"tables": {},
197204
"columns": {}
198205
}
199-
}
206+
}

drizzle/client/meta/_journal.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
{
66
"idx": 0,
77
"version": "5",
8-
"when": 1722877616350,
9-
"tag": "0000_organic_bloodstrike",
8+
"when": 1724690323632,
9+
"tag": "0000_kind_imperial_guard",
1010
"breakpoints": true
1111
}
1212
]
13-
}
13+
}

drizzle/project/0000_striped_roland_deschain.sql renamed to drizzle/project/0000_harsh_bloodstrike.sql

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ CREATE TABLE `coreOwnership_backlink` (
55
CREATE TABLE `coreOwnership` (
66
`docId` text PRIMARY KEY NOT NULL,
77
`versionId` text NOT NULL,
8+
`originalVersionId` text NOT NULL,
89
`schemaName` text NOT NULL,
910
`createdAt` text NOT NULL,
10-
`createdBy` text NOT NULL,
1111
`updatedAt` text NOT NULL,
1212
`links` text NOT NULL,
1313
`deleted` integer NOT NULL,
@@ -31,9 +31,9 @@ CREATE TABLE `deviceInfo_backlink` (
3131
CREATE TABLE `deviceInfo` (
3232
`docId` text PRIMARY KEY NOT NULL,
3333
`versionId` text NOT NULL,
34+
`originalVersionId` text NOT NULL,
3435
`schemaName` text NOT NULL,
3536
`createdAt` text NOT NULL,
36-
`createdBy` text NOT NULL,
3737
`updatedAt` text NOT NULL,
3838
`links` text NOT NULL,
3939
`deleted` integer NOT NULL,
@@ -49,9 +49,9 @@ CREATE TABLE `field_backlink` (
4949
CREATE TABLE `field` (
5050
`docId` text PRIMARY KEY NOT NULL,
5151
`versionId` text NOT NULL,
52+
`originalVersionId` text NOT NULL,
5253
`schemaName` text NOT NULL,
5354
`createdAt` text NOT NULL,
54-
`createdBy` text NOT NULL,
5555
`updatedAt` text NOT NULL,
5656
`links` text NOT NULL,
5757
`deleted` integer NOT NULL,
@@ -61,7 +61,7 @@ CREATE TABLE `field` (
6161
`appearance` text,
6262
`snakeCase` integer,
6363
`options` text,
64-
`universal` integer,
64+
`universal` integer DEFAULT false NOT NULL,
6565
`placeholder` text,
6666
`helperText` text,
6767
`forks` text NOT NULL
@@ -74,9 +74,9 @@ CREATE TABLE `icon_backlink` (
7474
CREATE TABLE `icon` (
7575
`docId` text PRIMARY KEY NOT NULL,
7676
`versionId` text NOT NULL,
77+
`originalVersionId` text NOT NULL,
7778
`schemaName` text NOT NULL,
7879
`createdAt` text NOT NULL,
79-
`createdBy` text NOT NULL,
8080
`updatedAt` text NOT NULL,
8181
`links` text NOT NULL,
8282
`deleted` integer NOT NULL,
@@ -92,17 +92,17 @@ CREATE TABLE `observation_backlink` (
9292
CREATE TABLE `observation` (
9393
`docId` text PRIMARY KEY NOT NULL,
9494
`versionId` text NOT NULL,
95+
`originalVersionId` text NOT NULL,
9596
`schemaName` text NOT NULL,
9697
`createdAt` text NOT NULL,
97-
`createdBy` text NOT NULL,
9898
`updatedAt` text NOT NULL,
9999
`links` text NOT NULL,
100100
`deleted` integer NOT NULL,
101-
`lat` real,
102-
`lon` real,
101+
`lat` real NOT NULL,
102+
`lon` real NOT NULL,
103103
`attachments` text NOT NULL,
104104
`tags` text NOT NULL,
105-
`metadata` text NOT NULL,
105+
`metadata` text,
106106
`presetRef` text,
107107
`forks` text NOT NULL
108108
);
@@ -114,9 +114,9 @@ CREATE TABLE `preset_backlink` (
114114
CREATE TABLE `preset` (
115115
`docId` text PRIMARY KEY NOT NULL,
116116
`versionId` text NOT NULL,
117+
`originalVersionId` text NOT NULL,
117118
`schemaName` text NOT NULL,
118119
`createdAt` text NOT NULL,
119-
`createdBy` text NOT NULL,
120120
`updatedAt` text NOT NULL,
121121
`links` text NOT NULL,
122122
`deleted` integer NOT NULL,
@@ -126,7 +126,7 @@ CREATE TABLE `preset` (
126126
`addTags` text NOT NULL,
127127
`removeTags` text NOT NULL,
128128
`fieldRefs` text NOT NULL,
129-
`iconRef` text,
129+
`iconRef` text NOT NULL,
130130
`terms` text NOT NULL,
131131
`color` text NOT NULL,
132132
`forks` text NOT NULL
@@ -139,9 +139,9 @@ CREATE TABLE `role_backlink` (
139139
CREATE TABLE `role` (
140140
`docId` text PRIMARY KEY NOT NULL,
141141
`versionId` text NOT NULL,
142+
`originalVersionId` text NOT NULL,
142143
`schemaName` text NOT NULL,
143144
`createdAt` text NOT NULL,
144-
`createdBy` text NOT NULL,
145145
`updatedAt` text NOT NULL,
146146
`links` text NOT NULL,
147147
`deleted` integer NOT NULL,
@@ -157,9 +157,9 @@ CREATE TABLE `track_backlink` (
157157
CREATE TABLE `track` (
158158
`docId` text PRIMARY KEY NOT NULL,
159159
`versionId` text NOT NULL,
160+
`originalVersionId` text NOT NULL,
160161
`schemaName` text NOT NULL,
161162
`createdAt` text NOT NULL,
162-
`createdBy` text NOT NULL,
163163
`updatedAt` text NOT NULL,
164164
`links` text NOT NULL,
165165
`deleted` integer NOT NULL,
@@ -177,9 +177,9 @@ CREATE TABLE `translation_backlink` (
177177
CREATE TABLE `translation` (
178178
`docId` text PRIMARY KEY NOT NULL,
179179
`versionId` text NOT NULL,
180+
`originalVersionId` text NOT NULL,
180181
`schemaName` text NOT NULL,
181182
`createdAt` text NOT NULL,
182-
`createdBy` text NOT NULL,
183183
`updatedAt` text NOT NULL,
184184
`links` text NOT NULL,
185185
`deleted` integer NOT NULL,

0 commit comments

Comments
 (0)