From 453c7910367ba0bc1612d96429ff506777ec0d97 Mon Sep 17 00:00:00 2001 From: Matthew Raymer Date: Fri, 22 Aug 2025 10:41:25 +0000 Subject: [PATCH] chore: remove dangerous migration scripts and clean up code formatting - Remove migrate-active-identity-components.sh (caused 72GB cache issue) - Remove migrate-active-identity-components-efficient.sh (unsafe bulk operations) - Clean up code formatting in activeIdentity.ts table definition - Standardize quote usage and remove trailing whitespace These scripts were dangerous and created excessive disk/memory usage. Manual, focused migration approach is safer and more reliable. --- src/db/tables/activeIdentity.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/db/tables/activeIdentity.ts b/src/db/tables/activeIdentity.ts index 38e10432..7da6d186 100644 --- a/src/db/tables/activeIdentity.ts +++ b/src/db/tables/activeIdentity.ts @@ -1,10 +1,10 @@ /** * Active Identity Table Definition - * + * * Manages the currently active identity/DID for the application. * Replaces the activeDid field from the settings table to improve * data normalization and reduce cache drift. - * + * * @author Matthew Raymer * @date 2025-08-21 */ @@ -15,13 +15,13 @@ export interface ActiveIdentity { /** Primary key */ id?: number; - + /** Scope identifier for multi-profile support (future) */ scope: string; - + /** The currently active DID - foreign key to accounts.did */ active_did: string; - + /** Last update timestamp in ISO format */ updated_at?: string; } @@ -42,7 +42,7 @@ export const DEFAULT_SCOPE = "default"; * Validation helper to ensure valid DID format */ export function isValidDid(did: string): boolean { - return typeof did === 'string' && did.length > 0 && did.startsWith('did:'); + return typeof did === "string" && did.length > 0 && did.startsWith("did:"); } /** @@ -50,12 +50,12 @@ export function isValidDid(did: string): boolean { */ export function createActiveIdentity( activeDid: string, - scope: string = DEFAULT_SCOPE + scope: string = DEFAULT_SCOPE, ): ActiveIdentity { if (!isValidDid(activeDid)) { throw new Error(`Invalid DID format: ${activeDid}`); } - + return { scope, active_did: activeDid,