mirror of
https://github.com/immich-app/immich
synced 2026-08-29 13:15:45 +00:00
feat: schema-check (#25904)
This commit is contained in:
parent
7413356a2f
commit
8ef4e4d452
37 changed files with 449 additions and 213 deletions
|
|
@ -168,6 +168,8 @@ export interface Migrations {
|
|||
}
|
||||
|
||||
export interface DB {
|
||||
kysely_migrations: { timestamp: string; name: string };
|
||||
|
||||
activity: ActivityTable;
|
||||
|
||||
album: AlbumTable;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { Kysely, sql } from 'kysely';
|
||||
import { ErrorMessages } from 'src/constants';
|
||||
import { DatabaseExtension } from 'src/enum';
|
||||
import { getVectorExtension } from 'src/repositories/database.repository';
|
||||
import { LoggingRepository } from 'src/repositories/logging.repository';
|
||||
|
|
@ -16,9 +17,7 @@ export async function up(db: Kysely<any>): Promise<void> {
|
|||
rows: [lastMigration],
|
||||
} = await lastMigrationSql.execute(db);
|
||||
if (lastMigration?.name !== 'AddMissingIndex1744910873956') {
|
||||
throw new Error(
|
||||
'Invalid upgrade path. For more information, see https://docs.immich.app/errors/#typeorm-upgrade',
|
||||
);
|
||||
throw new Error(ErrorMessages.TypeOrmUpgrade);
|
||||
}
|
||||
logger.log('Database has up to date TypeORM migrations, skipping initial Kysely migration');
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue