style(13-03): apply Prettier formatting across repo
Mechanical reformat — no logic changes. 398 files changed, 19125 insertions(+), 16457 deletions(-). Prettier 3.8.4 with .prettierrc (singleQuote:true, semi:true, tabWidth:2, trailingComma:all, printWidth:100). Isolated per D-13-08 for reviewability.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
// Source: https://orm.drizzle.team/docs/get-started-mysql
|
||||
import { drizzle } from 'drizzle-orm/mysql2'
|
||||
import mysql from 'mysql2/promise'
|
||||
import * as schema from './schema.js'
|
||||
import { drizzle } from 'drizzle-orm/mysql2';
|
||||
import mysql from 'mysql2/promise';
|
||||
import * as schema from './schema.js';
|
||||
|
||||
const pool = mysql.createPool({
|
||||
host: process.env.DB_HOST ?? 'localhost',
|
||||
@@ -11,6 +11,6 @@ const pool = mysql.createPool({
|
||||
database: process.env.DB_NAME ?? 'familysync',
|
||||
waitForConnections: true,
|
||||
connectionLimit: 10,
|
||||
})
|
||||
});
|
||||
|
||||
export const db = drizzle({ client: pool, schema, mode: 'default' })
|
||||
export const db = drizzle({ client: pool, schema, mode: 'default' });
|
||||
|
||||
+11
-11
@@ -11,7 +11,7 @@ import {
|
||||
index,
|
||||
unique,
|
||||
customType,
|
||||
} from 'drizzle-orm/mysql-core'
|
||||
} from 'drizzle-orm/mysql-core';
|
||||
|
||||
// Custom varchar type with explicit binary collation.
|
||||
// Drizzle 0.45.x does not expose a first-class collation option on varchar,
|
||||
@@ -22,7 +22,7 @@ import {
|
||||
const varcharBin = (name: string) =>
|
||||
customType<{ data: string; driverData: string }>({
|
||||
dataType: () => 'varchar(255) COLLATE utf8mb4_bin',
|
||||
})(name)
|
||||
})(name);
|
||||
|
||||
// ── Phase 4: List tables ───────────────────────────────────────────────────
|
||||
// Imported by test/setup.ts for afterEach cleanup — keep exports consistent.
|
||||
@@ -45,7 +45,7 @@ export const users = mysqlTable(
|
||||
// Composite unique key — identity is iss+sub, never email (D-10)
|
||||
unique('uniq_oidc_identity').on(t.oidcIss, t.oidcSub),
|
||||
],
|
||||
)
|
||||
);
|
||||
|
||||
/**
|
||||
* Encrypted Fastmail app-password credentials per member (D-04).
|
||||
@@ -66,7 +66,7 @@ export const memberCredentials = mysqlTable(
|
||||
updatedAt: timestamp('updated_at').defaultNow().onUpdateNow(),
|
||||
},
|
||||
(t) => [index('idx_member_credentials_user_id').on(t.userId)],
|
||||
)
|
||||
);
|
||||
|
||||
/**
|
||||
* Calendar collections discovered via CalDAV PROPFIND.
|
||||
@@ -98,7 +98,7 @@ export const calendars = mysqlTable(
|
||||
// calendarId. Keying on (userId, url) makes the upsert idempotent per member.
|
||||
unique('uniq_calendar_user_url').on(t.userId, t.url),
|
||||
],
|
||||
)
|
||||
);
|
||||
|
||||
/**
|
||||
* Calendar event cache — raw VEVENT blob + indexed dtstart fields.
|
||||
@@ -138,7 +138,7 @@ export const calendarEvents = mysqlTable(
|
||||
// uid is unique per calendar (idempotency key for broker upsert)
|
||||
unique('uniq_calendar_uid').on(t.calendarId, t.uid),
|
||||
],
|
||||
)
|
||||
);
|
||||
|
||||
/**
|
||||
* Transactional outbox for CalDAV write-back (D-05).
|
||||
@@ -178,7 +178,7 @@ export const calendarOutbox = mysqlTable(
|
||||
index('idx_outbox_next_attempt').on(t.nextAttemptAt, t.status),
|
||||
index('idx_outbox_uid').on(t.uid),
|
||||
],
|
||||
)
|
||||
);
|
||||
|
||||
/**
|
||||
* App-owned named lists — stored in MariaDB, NOT CalDAV (Phase 4).
|
||||
@@ -200,7 +200,7 @@ export const lists = mysqlTable(
|
||||
updatedAt: timestamp('updated_at').defaultNow().onUpdateNow(),
|
||||
},
|
||||
(t) => [index('idx_lists_owner_id').on(t.ownerId)],
|
||||
)
|
||||
);
|
||||
|
||||
/**
|
||||
* List sharing join table (D-02, member-count-agnostic).
|
||||
@@ -224,7 +224,7 @@ export const listShares = mysqlTable(
|
||||
unique('uniq_list_share').on(t.listId, t.userId),
|
||||
index('idx_list_shares_user_id').on(t.userId),
|
||||
],
|
||||
)
|
||||
);
|
||||
|
||||
/**
|
||||
* Push notification subscriptions (Phase 5 — Web Push).
|
||||
@@ -254,7 +254,7 @@ export const pushSubscriptions = mysqlTable(
|
||||
unique('uniq_push_endpoint').on(t.endpoint),
|
||||
index('idx_push_subscriptions_user_id').on(t.userId),
|
||||
],
|
||||
)
|
||||
);
|
||||
|
||||
/**
|
||||
* Items within a list.
|
||||
@@ -283,4 +283,4 @@ export const listItems = mysqlTable(
|
||||
// Secondary index for checked/unchecked split queries
|
||||
index('idx_list_items_list_id_checked').on(t.listId, t.checked),
|
||||
],
|
||||
)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user