/*
 * SPDX-FileCopyrightText: dakkar and other Sharkey contributors
 * SPDX-License-Identifier: AGPL-3.0-only
 */

export class SharkeyRepositoryUrl1708342829000 {
  name = 'SharkeyRepositoryUrl1708342829000'

  async up(queryRunner) {
    await queryRunner.query(`ALTER TABLE "meta" ALTER COLUMN "repositoryUrl" SET DEFAULT 'https://git.quollkey.org/Quollkey/Quollkey'`);
    await queryRunner.query(`ALTER TABLE "meta" ALTER COLUMN "feedbackUrl" SET DEFAULT 'https://git.quollkey.org/Quollkey/Quollkey/issues'`);
    await queryRunner.query(`UPDATE "meta" SET "repositoryUrl"=DEFAULT WHERE "repositoryUrl" IN ('https://git.quollkey.org/Quollkey/Quollkey','https://git.quollkey.org/Quollkey/Quollkey','https://github.com/misskey-dev/misskey')`);
    await queryRunner.query(`UPDATE "meta" SET "feedbackUrl"=DEFAULT WHERE "feedbackUrl" IN ('https://git.quollkey.org/Quollkey/Quollkey/issues/new/choose','https://git.quollkey.org/Quollkey/Quollkey/quollkey/issues/new','https://github.com/misskey-dev/misskey/issues/new')`);
  }

  async down(queryRunner) {
    await queryRunner.query(`ALTER TABLE "meta" ALTER COLUMN "repositoryUrl" SET DEFAULT 'https://git.quollkey.org/Quollkey/Quollkey'`);
    await queryRunner.query(`ALTER TABLE "meta" ALTER COLUMN "feedbackUrl" SET DEFAULT 'https://git.quollkey.org/Quollkey/Quollkey'`);
    await queryRunner.query(`UPDATE "meta" SET "repositoryUrl"=DEFAULT WHERE "repositoryUrl" IN ('https://git.quollkey.org/Quollkey/Quollkey')`);
    await queryRunner.query(`UPDATE "meta" SET "feedbackUrl"=DEFAULT WHERE "feedbackUrl" IN ('https://git.quollkey.org/Quollkey/Quollkey/issues')`);
  }
}
