feat: v2.2 batch (calendar, self-service, sort, description, filename search, stats, collab, invoice) on pre-redesign base
This commit is contained in:
1 parent
453bece72c
commit
7204dd6b60
108 files changed
+10400
-105
No files matched your search
+10
-1
@@ -30,7 +30,11 @@ export type PostgresTestDatabase = {
|
||||
};
|
||||
|
||||
export async function startPostgres(
|
||||
{ through, migrationsDir }: { through?: string; migrationsDir?: string } = {},
|
||||
{
|
||||
through,
|
||||
migrationsDir,
|
||||
alsoApply = [],
|
||||
}: { through?: string; migrationsDir?: string; alsoApply?: string[] } = {},
|
||||
): Promise<PostgresTestDatabase> {
|
||||
const container = await new PostgreSqlContainer("postgres:17-alpine")
|
||||
.withDatabase("portal")
|
||||
@@ -44,6 +48,11 @@ export async function startPostgres(
|
||||
if (through && throughIndex < 0) throw new Error(`Unknown migration: ${through}`);
|
||||
let appliedMigrationCount = throughIndex + 1;
|
||||
await applyMigrationFiles(pool, migrationsDir, migrationFiles.slice(0, appliedMigrationCount));
|
||||
// Additive current-chain migrations (new tables/columns) that the historical
|
||||
// chain predates, so current service code can run against the old schema.
|
||||
for (const file of alsoApply) {
|
||||
await pool.query(await readFile(path.join(process.cwd(), file), "utf8"));
|
||||
}
|
||||
|
||||
const db = drizzle({ client: pool, schema });
|
||||
|
||||
|
||||
Reference in new issue
Block a user