mirror of
https://git.boykissers.com/pawkey/pawkey-sk.git
synced 2025-12-20 04:04:16 +00:00
fix: add music and registration word migration script
This should have been two files, AddMusicFieldsToMeta.js and AddRegWordFieldsToMeta.js but it's a bit too late to do that now because it will run twice. See if we can fix this later as it makes it difficult to cherry pick the music patch or registration word patch.
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
/** @type {import('typeorm').MigrationInterface} */
|
||||
export class AddMusicAndRegWordFieldsToMeta1743894419864 {
|
||||
name = 'AddMusicAndRegWordFieldsToMeta1743894419864'
|
||||
|
||||
async up(queryRunner) {
|
||||
await queryRunner.query(`ALTER TABLE "meta" ADD "regWordRequired" boolean NOT NULL DEFAULT false`);
|
||||
await queryRunner.query(`ALTER TABLE "meta" ADD "registrationWord" character varying(1024)`);
|
||||
await queryRunner.query(`ALTER TABLE "meta" ADD "musicSource" character varying(1024)`);
|
||||
await queryRunner.query(`ALTER TABLE "meta" ADD "musicEnabled" boolean NOT NULL DEFAULT false`);
|
||||
}
|
||||
|
||||
async down(queryRunner) {
|
||||
await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "musicEnabled"`);
|
||||
await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "musicSource"`);
|
||||
await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "registrationWord"`);
|
||||
await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "regWordRequired"`);
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: syuilo and misskey-project
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||
|
||||
export class AddMusicFieldsToMeta1743894419864 implements MigrationInterface {
|
||||
name = 'AddMusicFieldsToMeta1743894419864'
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`ALTER TABLE "meta" ADD "musicSource" character varying(1024)`);
|
||||
await queryRunner.query(`ALTER TABLE "meta" ADD "musicEnabled" boolean NOT NULL DEFAULT false`);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "musicEnabled"`);
|
||||
await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "musicSource"`);
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: syuilo and misskey-project
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||
|
||||
export class AddRegWordFieldsToMeta1743894419864 implements MigrationInterface {
|
||||
name = 'AddRegWordFieldsToMeta1743894419864'
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`ALTER TABLE "meta" ADD "regWordRequired" boolean NOT NULL DEFAULT false`);
|
||||
await queryRunner.query(`ALTER TABLE "meta" ADD "registrationWord" character varying(1024)`);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "registrationWord"`);
|
||||
await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "regWordRequired"`);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user