You've already forked immich
mirror of
https://github.com/immich-app/immich.git
synced 2025-08-10 23:22:22 +02:00
fix: missing migration folder broke non-root setups (#17266)
This commit is contained in:
@@ -2,7 +2,8 @@ import { Injectable } from '@nestjs/common';
|
|||||||
import AsyncLock from 'async-lock';
|
import AsyncLock from 'async-lock';
|
||||||
import { FileMigrationProvider, Kysely, Migrator, sql, Transaction } from 'kysely';
|
import { FileMigrationProvider, Kysely, Migrator, sql, Transaction } from 'kysely';
|
||||||
import { InjectKysely } from 'nestjs-kysely';
|
import { InjectKysely } from 'nestjs-kysely';
|
||||||
import { mkdir, readdir } from 'node:fs/promises';
|
import { existsSync } from 'node:fs';
|
||||||
|
import { readdir } from 'node:fs/promises';
|
||||||
import { join } from 'node:path';
|
import { join } from 'node:path';
|
||||||
import semver from 'semver';
|
import semver from 'semver';
|
||||||
import { EXTENSION_NAMES, POSTGRES_VERSION_RANGE, VECTOR_VERSION_RANGE, VECTORS_VERSION_RANGE } from 'src/constants';
|
import { EXTENSION_NAMES, POSTGRES_VERSION_RANGE, VECTOR_VERSION_RANGE, VECTORS_VERSION_RANGE } from 'src/constants';
|
||||||
@@ -212,8 +213,11 @@ export class DatabaseRepository {
|
|||||||
|
|
||||||
// eslint-disable-next-line unicorn/prefer-module
|
// eslint-disable-next-line unicorn/prefer-module
|
||||||
const migrationFolder = join(__dirname, '..', 'schema/migrations');
|
const migrationFolder = join(__dirname, '..', 'schema/migrations');
|
||||||
|
|
||||||
// TODO remove after we have at least one kysely migration
|
// TODO remove after we have at least one kysely migration
|
||||||
await mkdir(migrationFolder, { recursive: true });
|
if (!existsSync(migrationFolder)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.logger.debug('Running kysely migrations');
|
this.logger.debug('Running kysely migrations');
|
||||||
const migrator = new Migrator({
|
const migrator = new Migrator({
|
||||||
|
Reference in New Issue
Block a user