Skip to content

Commit

Permalink
Merge pull request #527 from contember/fix/system-migrations
Browse files Browse the repository at this point in the history
fix system migrations in 1.4
  • Loading branch information
matej21 committed Mar 20, 2024
2 parents f6019f1 + bd56721 commit a79d936
Showing 1 changed file with 3 additions and 8 deletions.
@@ -1,16 +1,11 @@
import { SelectBuilder } from '@contember/database'
import { Literal, SelectBuilder } from '@contember/database'
import { ExecutedMigration } from '../../dtos'
import { VERSION_INITIAL } from '@contember/schema-migrations'

type ExecutedMigrationRow = { id: number; name: string; migration: any; checksum: string | null; executed_at: Date; type: 'content' | 'schema' }
export const createExecutedMigrationQueryBuilder = () =>
SelectBuilder.create<ExecutedMigrationRow>()
.select('id')
.select('name')
.select('migration')
.select('checksum')
.select('executed_at')
.select('type')
.select(new Literal('*'))
.from('schema_migration')
.orderBy('version')

Expand All @@ -22,5 +17,5 @@ export const createExecutedMigrationDto = (row: ExecutedMigrationRow) =>
row.migration.modifications,
row.executed_at,
row.checksum,
row.type,
row.type ?? 'schema',
)

0 comments on commit a79d936

Please sign in to comment.