Skip to content

armgit / mimik

Public Imported from GitHub
0

🎬 A browser extension and desktop app that turns your clicks into step-by-step guides with annotated screenshots πŸ“–

feat: add starred and deletedAt fields to Guide model with v3 migration

Luis Ortizcb85b9d3f1e4
diff --git a/entrypoints/background.ts b/entrypoints/background.ts
index 6eebc06..676b434 100644
--- a/entrypoints/background.ts
+++ b/entrypoints/background.ts
@@ -154,6 +154,8 @@ export default defineBackground(() => {
createdAt: Date.now(),
updatedAt: Date.now(),
stepIds: [],
+ starred: false,
+ deletedAt: null,
});
await broadcastStartCapture(guideId);
diff --git a/src/shared/db-schema.ts b/src/shared/db-schema.ts
index c5fc11d..abf8193 100644
--- a/src/shared/db-schema.ts
+++ b/src/shared/db-schema.ts
@@ -20,6 +20,17 @@ export class MimikDB extends Dexie {
screenshots: 'id, stepId',
rrwebEvents: 'id, guideId, timestamp',
});
+ this.version(3).stores({
+ guides: 'id, createdAt, updatedAt, starred, deletedAt',
+ steps: 'id, guideId, index',
+ screenshots: 'id, stepId',
+ rrwebEvents: 'id, guideId, timestamp',
+ }).upgrade(tx => {
+ return tx.table('guides').toCollection().modify(guide => {
+ if (guide.starred === undefined) guide.starred = false;
+ if (guide.deletedAt === undefined) guide.deletedAt = null;
+ });
+ });
}
}
diff --git a/src/shared/types.ts b/src/shared/types.ts
index 16edbc4..27697a5 100644
--- a/src/shared/types.ts
+++ b/src/shared/types.ts
@@ -4,6 +4,8 @@ export interface Guide {
createdAt: number;
updatedAt: number;
stepIds: string[];
+ starred: boolean;
+ deletedAt: number | null;
}
export interface Step {