refactor: migrate legacy wire namespace to wrn
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* Migration runner. Migrations are `.sql` files in `app/db/migrations`, each
|
||||
* split into `-- +up` and `-- +down` sections. Applied migrations are recorded
|
||||
* in a `_wire_migrations` table so they run exactly once, newest-last.
|
||||
* in a `_wrn_migrations` table so they run exactly once, newest-last.
|
||||
*
|
||||
* `scaffoldMigration(..., models)` writes an initial migration straight from the
|
||||
* TS models — the source of truth — so you don't hand-write the first schema.
|
||||
@@ -19,8 +19,8 @@ export interface Migration {
|
||||
down: string;
|
||||
}
|
||||
|
||||
const MIGRATIONS_TABLE = "_wire_migrations";
|
||||
const MIGRATION_LOCKS_TABLE = "_wire_migration_locks";
|
||||
const MIGRATIONS_TABLE = "_wrn_migrations";
|
||||
const MIGRATION_LOCKS_TABLE = "_wrn_migration_locks";
|
||||
|
||||
export interface MigrationRunOptions {
|
||||
/** Return pending migration names without executing their SQL. */
|
||||
|
||||
@@ -55,7 +55,7 @@ export async function paginate<T = Row>(
|
||||
const perPage = Math.min(maxPerPage, Math.max(1, Math.floor(opts.perPage ?? 20)));
|
||||
const offset = (page - 1) * perPage;
|
||||
|
||||
const countSql = query.countSql ?? `SELECT COUNT(*) AS n FROM (${query.sql}) AS __wire_sub`;
|
||||
const countSql = query.countSql ?? `SELECT COUNT(*) AS n FROM (${query.sql}) AS __wrn_sub`;
|
||||
const countRow = await db.one<{ n: number | string }>(countSql, params);
|
||||
const total = Number(countRow?.n ?? 0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user