Merge pull request #2767 from gradido/2766-bug-migration-of-communities-with-errors

fix(database): change downwards migration to delete entries with last_announced_at IS NULL
This commit is contained in:
Alexander Friedland 2023-03-03 12:10:17 +01:00 committed by GitHub
commit c3e170d870
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,6 +23,7 @@ export async function upgrade(queryFn: (query: string, values?: any[]) => Promis
export async function downgrade(queryFn: (query: string, values?: any[]) => Promise<Array<any>>) {
// write downgrade logic as parameter of queryFn
await queryFn('DELETE FROM `communities` WHERE `last_announced_at` IS NULL;')
await queryFn(
'ALTER TABLE `communities` MODIFY COLUMN `last_announced_at` datetime(3) NOT NULL AFTER `end_point`;',
)