feat: plugins v1.5
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
import { MigrationInterface, QueryRunner } from 'typeorm';
|
||||
|
||||
export class ServerPluginInstallMetadata1000000000008 implements MigrationInterface {
|
||||
name = 'ServerPluginInstallMetadata1000000000008';
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`ALTER TABLE "server_plugin_requirements" ADD COLUMN "installUrl" TEXT`);
|
||||
await queryRunner.query(`ALTER TABLE "server_plugin_requirements" ADD COLUMN "sourceUrl" TEXT`);
|
||||
await queryRunner.query(`ALTER TABLE "server_plugin_requirements" ADD COLUMN "manifestJson" TEXT`);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`CREATE TABLE "temporary_server_plugin_requirements" (
|
||||
"serverId" TEXT NOT NULL,
|
||||
"pluginId" TEXT NOT NULL,
|
||||
"status" TEXT NOT NULL,
|
||||
"versionRange" TEXT,
|
||||
"reason" TEXT,
|
||||
"configuredBy" TEXT,
|
||||
"createdAt" INTEGER NOT NULL,
|
||||
"updatedAt" INTEGER NOT NULL,
|
||||
PRIMARY KEY ("serverId", "pluginId")
|
||||
)`);
|
||||
await queryRunner.query(`INSERT INTO "temporary_server_plugin_requirements" ("serverId", "pluginId", "status", "versionRange", "reason", "configuredBy", "createdAt", "updatedAt")
|
||||
SELECT "serverId", "pluginId", "status", "versionRange", "reason", "configuredBy", "createdAt", "updatedAt" FROM "server_plugin_requirements"`);
|
||||
await queryRunner.query(`DROP TABLE "server_plugin_requirements"`);
|
||||
await queryRunner.query(`ALTER TABLE "temporary_server_plugin_requirements" RENAME TO "server_plugin_requirements"`);
|
||||
await queryRunner.query(`CREATE INDEX IF NOT EXISTS "idx_server_plugin_requirements_status" ON "server_plugin_requirements" ("status")`);
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import { NormalizeServerArrays1000000000004 } from './1000000000004-NormalizeSer
|
||||
import { ServerRoleAccessControl1000000000005 } from './1000000000005-ServerRoleAccessControl';
|
||||
import { GameMatchMisses1000000000006 } from './1000000000006-GameMatchMisses';
|
||||
import { PluginSupport1000000000007 } from './1000000000007-PluginSupport';
|
||||
import { ServerPluginInstallMetadata1000000000008 } from './1000000000008-ServerPluginInstallMetadata';
|
||||
|
||||
export const serverMigrations = [
|
||||
InitialSchema1000000000000,
|
||||
@@ -15,5 +16,6 @@ export const serverMigrations = [
|
||||
NormalizeServerArrays1000000000004,
|
||||
ServerRoleAccessControl1000000000005,
|
||||
GameMatchMisses1000000000006,
|
||||
PluginSupport1000000000007
|
||||
PluginSupport1000000000007,
|
||||
ServerPluginInstallMetadata1000000000008
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user