-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add setIsArchiveDevice() method (#932)
* feat: Add setIsArchiveDevice() method Does not change sync at this time, but does persist setting. * migrate deviceInfo column to nullable * test migration of deviceInfo * rename table in migration * revert changes to mapeo manager * Apply suggestions from code review Co-authored-by: Evan Hahn <[email protected]> * address PR review comments * address one missing comment * fix types test --------- Co-authored-by: Evan Hahn <[email protected]>
- Loading branch information
1 parent
f3d62c0
commit 5975e03
Showing
11 changed files
with
491 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* | ||
Manually generated migration because SQLITE and Drizzle do not support | ||
altering a column to be nullable. | ||
*/ | ||
ALTER TABLE `localDeviceInfo` RENAME TO `deviceSettings`;--> statement-breakpoint | ||
DROP INDEX IF EXISTS `localDeviceInfo_deviceId_unique`;--> statement-breakpoint | ||
ALTER TABLE deviceSettings ADD `isArchiveDevice` integer;--> statement-breakpoint | ||
ALTER TABLE deviceSettings RENAME COLUMN `deviceInfo` TO `deviceInfoOld`;--> statement-breakpoint | ||
ALTER TABLE deviceSettings ADD `deviceInfo` text;--> statement-breakpoint | ||
UPDATE deviceSettings SET `deviceInfo` = `deviceInfoOld`;--> statement-breakpoint | ||
ALTER TABLE deviceSettings DROP COLUMN `deviceInfoOld`;--> statement-breakpoint | ||
CREATE UNIQUE INDEX `deviceSettings_deviceId_unique` ON `deviceSettings` (`deviceId`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,208 @@ | ||
{ | ||
"version": "5", | ||
"dialect": "sqlite", | ||
"id": "a80440f2-1097-40a6-ab81-3295f0a8c5c1", | ||
"prevId": "e75103ab-bbcb-4ca9-a0c4-2d9095b63add", | ||
"tables": { | ||
"deviceSettings": { | ||
"name": "deviceSettings", | ||
"columns": { | ||
"deviceId": { | ||
"name": "deviceId", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true, | ||
"autoincrement": false | ||
}, | ||
"deviceInfo": { | ||
"name": "deviceInfo", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": false, | ||
"autoincrement": false | ||
}, | ||
"isArchiveDevice": { | ||
"name": "isArchiveDevice", | ||
"type": "integer", | ||
"primaryKey": false, | ||
"notNull": false, | ||
"autoincrement": false | ||
} | ||
}, | ||
"indexes": { | ||
"deviceSettings_deviceId_unique": { | ||
"name": "deviceSettings_deviceId_unique", | ||
"columns": [ | ||
"deviceId" | ||
], | ||
"isUnique": true | ||
} | ||
}, | ||
"foreignKeys": {}, | ||
"compositePrimaryKeys": {}, | ||
"uniqueConstraints": {} | ||
}, | ||
"projectSettings_backlink": { | ||
"name": "projectSettings_backlink", | ||
"columns": { | ||
"versionId": { | ||
"name": "versionId", | ||
"type": "text", | ||
"primaryKey": true, | ||
"notNull": true, | ||
"autoincrement": false | ||
} | ||
}, | ||
"indexes": {}, | ||
"foreignKeys": {}, | ||
"compositePrimaryKeys": {}, | ||
"uniqueConstraints": {} | ||
}, | ||
"projectKeys": { | ||
"name": "projectKeys", | ||
"columns": { | ||
"projectId": { | ||
"name": "projectId", | ||
"type": "text", | ||
"primaryKey": true, | ||
"notNull": true, | ||
"autoincrement": false | ||
}, | ||
"projectPublicId": { | ||
"name": "projectPublicId", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true, | ||
"autoincrement": false | ||
}, | ||
"projectInviteId": { | ||
"name": "projectInviteId", | ||
"type": "blob", | ||
"primaryKey": false, | ||
"notNull": true, | ||
"autoincrement": false | ||
}, | ||
"keysCipher": { | ||
"name": "keysCipher", | ||
"type": "blob", | ||
"primaryKey": false, | ||
"notNull": true, | ||
"autoincrement": false | ||
}, | ||
"projectInfo": { | ||
"name": "projectInfo", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true, | ||
"autoincrement": false, | ||
"default": "'{}'" | ||
} | ||
}, | ||
"indexes": {}, | ||
"foreignKeys": {}, | ||
"compositePrimaryKeys": {}, | ||
"uniqueConstraints": {} | ||
}, | ||
"projectSettings": { | ||
"name": "projectSettings", | ||
"columns": { | ||
"docId": { | ||
"name": "docId", | ||
"type": "text", | ||
"primaryKey": true, | ||
"notNull": true, | ||
"autoincrement": false | ||
}, | ||
"versionId": { | ||
"name": "versionId", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true, | ||
"autoincrement": false | ||
}, | ||
"originalVersionId": { | ||
"name": "originalVersionId", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true, | ||
"autoincrement": false | ||
}, | ||
"schemaName": { | ||
"name": "schemaName", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true, | ||
"autoincrement": false | ||
}, | ||
"createdAt": { | ||
"name": "createdAt", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true, | ||
"autoincrement": false | ||
}, | ||
"updatedAt": { | ||
"name": "updatedAt", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true, | ||
"autoincrement": false | ||
}, | ||
"links": { | ||
"name": "links", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true, | ||
"autoincrement": false | ||
}, | ||
"deleted": { | ||
"name": "deleted", | ||
"type": "integer", | ||
"primaryKey": false, | ||
"notNull": true, | ||
"autoincrement": false | ||
}, | ||
"name": { | ||
"name": "name", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": false, | ||
"autoincrement": false | ||
}, | ||
"defaultPresets": { | ||
"name": "defaultPresets", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": false, | ||
"autoincrement": false | ||
}, | ||
"configMetadata": { | ||
"name": "configMetadata", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": false, | ||
"autoincrement": false | ||
}, | ||
"forks": { | ||
"name": "forks", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true, | ||
"autoincrement": false | ||
} | ||
}, | ||
"indexes": {}, | ||
"foreignKeys": {}, | ||
"compositePrimaryKeys": {}, | ||
"uniqueConstraints": {} | ||
} | ||
}, | ||
"enums": {}, | ||
"_meta": { | ||
"schemas": {}, | ||
"tables": { | ||
"\"localDeviceInfo\"": "\"deviceSettings\"" | ||
}, | ||
"columns": {} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -108,6 +108,7 @@ | |
"homepage": "https://github.com/digidem/comapeo-core#readme", | ||
"devDependencies": { | ||
"@bufbuild/buf": "^1.26.1", | ||
"@comapeo/core2.0.1": "npm:@comapeo/[email protected]", | ||
"@mapeo/default-config": "5.0.0", | ||
"@mapeo/mock-data": "2.0.0", | ||
"@sinonjs/fake-timers": "^10.0.2", | ||
|
Oops, something went wrong.