From 2d56f736641b0692bec00be90b0789affc56e4cc Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Tue, 30 May 2023 10:27:07 +0200 Subject: [PATCH] database migration --- .../0067-private_key_in_community_table.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 database/migrations/0067-private_key_in_community_table.ts diff --git a/database/migrations/0067-private_key_in_community_table.ts b/database/migrations/0067-private_key_in_community_table.ts new file mode 100644 index 000000000..999ef8708 --- /dev/null +++ b/database/migrations/0067-private_key_in_community_table.ts @@ -0,0 +1,16 @@ +/* MIGRATION TO ADD PRIVATE KEY IN COMMUNITY TABLE + * + * This migration adds a field for the private key in the community.table + */ + +/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ +/* eslint-disable @typescript-eslint/no-explicit-any */ +export async function upgrade(queryFn: (query: string, values?: any[]) => Promise>) { + await queryFn( + 'ALTER TABLE `communities` ADD COLUMN `private_key` binary(64) DEFAULT NULL AFTER `public_key`;', + ) +} + +export async function downgrade(queryFn: (query: string, values?: any[]) => Promise>) { + await queryFn('ALTER TABLE `communities` DROP COLUMN `private_key`;') +}