Skip to content

Commit

Permalink
feat!: update @mapeo/schema to latest version (#715)
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
EvanHahn and Tomás Ciccola authored Aug 27, 2024
1 parent ef555c7 commit 0564480
Show file tree
Hide file tree
Showing 19 changed files with 394 additions and 1,473 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,17 @@ CREATE TABLE `projectKeys` (
CREATE TABLE `projectSettings` (
`docId` text PRIMARY KEY NOT NULL,
`versionId` text NOT NULL,
`originalVersionId` text NOT NULL,
`schemaName` text NOT NULL,
`createdAt` text NOT NULL,
`createdBy` text NOT NULL,
`updatedAt` text NOT NULL,
`links` text NOT NULL,
`deleted` integer NOT NULL,
`name` text,
`defaultPresets` text,
`configMetadata` text,
`isInitialProject` integer NOT NULL,
`forks` text NOT NULL
);
--> statement-breakpoint
CREATE UNIQUE INDEX `localDeviceInfo_deviceId_unique` ON `localDeviceInfo` (`deviceId`);
CREATE UNIQUE INDEX `localDeviceInfo_deviceId_unique` ON `localDeviceInfo` (`deviceId`);
23 changes: 15 additions & 8 deletions drizzle/client/meta/0000_snapshot.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": "5",
"dialect": "sqlite",
"id": "c4f2efaa-b40a-4148-9b5f-b1a4fd9f7f8e",
"id": "aea2dc34-6de1-4de7-86d5-0fbe93b682ff",
"prevId": "00000000-0000-0000-0000-000000000000",
"tables": {
"localDeviceInfo": {
Expand Down Expand Up @@ -113,22 +113,22 @@
"notNull": true,
"autoincrement": false
},
"schemaName": {
"name": "schemaName",
"originalVersionId": {
"name": "originalVersionId",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"createdAt": {
"name": "createdAt",
"schemaName": {
"name": "schemaName",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"createdBy": {
"name": "createdBy",
"createdAt": {
"name": "createdAt",
"type": "text",
"primaryKey": false,
"notNull": true,
Expand Down Expand Up @@ -176,6 +176,13 @@
"notNull": false,
"autoincrement": false
},
"isInitialProject": {
"name": "isInitialProject",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"forks": {
"name": "forks",
"type": "text",
Expand All @@ -196,4 +203,4 @@
"tables": {},
"columns": {}
}
}
}
6 changes: 3 additions & 3 deletions drizzle/client/meta/_journal.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
{
"idx": 0,
"version": "5",
"when": 1722877616350,
"tag": "0000_organic_bloodstrike",
"when": 1724690323632,
"tag": "0000_kind_imperial_guard",
"breakpoints": true
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ CREATE TABLE `coreOwnership_backlink` (
CREATE TABLE `coreOwnership` (
`docId` text PRIMARY KEY NOT NULL,
`versionId` text NOT NULL,
`originalVersionId` text NOT NULL,
`schemaName` text NOT NULL,
`createdAt` text NOT NULL,
`createdBy` text NOT NULL,
`updatedAt` text NOT NULL,
`links` text NOT NULL,
`deleted` integer NOT NULL,
Expand All @@ -31,9 +31,9 @@ CREATE TABLE `deviceInfo_backlink` (
CREATE TABLE `deviceInfo` (
`docId` text PRIMARY KEY NOT NULL,
`versionId` text NOT NULL,
`originalVersionId` text NOT NULL,
`schemaName` text NOT NULL,
`createdAt` text NOT NULL,
`createdBy` text NOT NULL,
`updatedAt` text NOT NULL,
`links` text NOT NULL,
`deleted` integer NOT NULL,
Expand All @@ -49,9 +49,9 @@ CREATE TABLE `field_backlink` (
CREATE TABLE `field` (
`docId` text PRIMARY KEY NOT NULL,
`versionId` text NOT NULL,
`originalVersionId` text NOT NULL,
`schemaName` text NOT NULL,
`createdAt` text NOT NULL,
`createdBy` text NOT NULL,
`updatedAt` text NOT NULL,
`links` text NOT NULL,
`deleted` integer NOT NULL,
Expand All @@ -61,7 +61,7 @@ CREATE TABLE `field` (
`appearance` text,
`snakeCase` integer,
`options` text,
`universal` integer,
`universal` integer DEFAULT false NOT NULL,
`placeholder` text,
`helperText` text,
`forks` text NOT NULL
Expand All @@ -74,9 +74,9 @@ CREATE TABLE `icon_backlink` (
CREATE TABLE `icon` (
`docId` text PRIMARY KEY NOT NULL,
`versionId` text NOT NULL,
`originalVersionId` text NOT NULL,
`schemaName` text NOT NULL,
`createdAt` text NOT NULL,
`createdBy` text NOT NULL,
`updatedAt` text NOT NULL,
`links` text NOT NULL,
`deleted` integer NOT NULL,
Expand All @@ -92,17 +92,17 @@ CREATE TABLE `observation_backlink` (
CREATE TABLE `observation` (
`docId` text PRIMARY KEY NOT NULL,
`versionId` text NOT NULL,
`originalVersionId` text NOT NULL,
`schemaName` text NOT NULL,
`createdAt` text NOT NULL,
`createdBy` text NOT NULL,
`updatedAt` text NOT NULL,
`links` text NOT NULL,
`deleted` integer NOT NULL,
`lat` real,
`lon` real,
`lat` real NOT NULL,
`lon` real NOT NULL,
`attachments` text NOT NULL,
`tags` text NOT NULL,
`metadata` text NOT NULL,
`metadata` text,
`presetRef` text,
`forks` text NOT NULL
);
Expand All @@ -114,9 +114,9 @@ CREATE TABLE `preset_backlink` (
CREATE TABLE `preset` (
`docId` text PRIMARY KEY NOT NULL,
`versionId` text NOT NULL,
`originalVersionId` text NOT NULL,
`schemaName` text NOT NULL,
`createdAt` text NOT NULL,
`createdBy` text NOT NULL,
`updatedAt` text NOT NULL,
`links` text NOT NULL,
`deleted` integer NOT NULL,
Expand All @@ -126,7 +126,7 @@ CREATE TABLE `preset` (
`addTags` text NOT NULL,
`removeTags` text NOT NULL,
`fieldRefs` text NOT NULL,
`iconRef` text,
`iconRef` text NOT NULL,
`terms` text NOT NULL,
`color` text NOT NULL,
`forks` text NOT NULL
Expand All @@ -139,9 +139,9 @@ CREATE TABLE `role_backlink` (
CREATE TABLE `role` (
`docId` text PRIMARY KEY NOT NULL,
`versionId` text NOT NULL,
`originalVersionId` text NOT NULL,
`schemaName` text NOT NULL,
`createdAt` text NOT NULL,
`createdBy` text NOT NULL,
`updatedAt` text NOT NULL,
`links` text NOT NULL,
`deleted` integer NOT NULL,
Expand All @@ -157,9 +157,9 @@ CREATE TABLE `track_backlink` (
CREATE TABLE `track` (
`docId` text PRIMARY KEY NOT NULL,
`versionId` text NOT NULL,
`originalVersionId` text NOT NULL,
`schemaName` text NOT NULL,
`createdAt` text NOT NULL,
`createdBy` text NOT NULL,
`updatedAt` text NOT NULL,
`links` text NOT NULL,
`deleted` integer NOT NULL,
Expand All @@ -177,9 +177,9 @@ CREATE TABLE `translation_backlink` (
CREATE TABLE `translation` (
`docId` text PRIMARY KEY NOT NULL,
`versionId` text NOT NULL,
`originalVersionId` text NOT NULL,
`schemaName` text NOT NULL,
`createdAt` text NOT NULL,
`createdBy` text NOT NULL,
`updatedAt` text NOT NULL,
`links` text NOT NULL,
`deleted` integer NOT NULL,
Expand Down
Loading

0 comments on commit 0564480

Please sign in to comment.