mirror of
https://github.com/IT4Change/gradido.git
synced 2026-02-06 01:46:07 +00:00
covert public_key according to new standarts unhex/hex
This commit is contained in:
parent
a8407618bd
commit
580c5940d2
@ -7,6 +7,7 @@
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
|
||||
export async function upgrade(queryFn: (query: string, values?: any[]) => Promise<Array<any>>) {
|
||||
await queryFn('UPDATE `communities` SET `public_key` = UNHEX(publicKey);')
|
||||
await queryFn('ALTER TABLE `communities` MODIFY COLUMN `public_key` binary(32) NOT NULL;')
|
||||
// TODO: it is unclear if this is actually nullable - the model defines "default: null, nullable: true", but the table seems to be created without nullability(?)
|
||||
await queryFn(
|
||||
@ -16,6 +17,7 @@ export async function upgrade(queryFn: (query: string, values?: any[]) => Promis
|
||||
|
||||
export async function downgrade(queryFn: (query: string, values?: any[]) => Promise<Array<any>>) {
|
||||
await queryFn('ALTER TABLE `communities` MODIFY COLUMN `public_key` binary(64) NOT NULL;')
|
||||
await queryFn('UPDATE `communities` SET `public_key` = HEX(publicKey);')
|
||||
// TODO: see above
|
||||
await queryFn(
|
||||
'ALTER TABLE `federated_communities` MODIFY COLUMN `public_key` binary(64) NULL DEFAULT NULL;',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user