2024-04-07 05:38:52 +02:00
|
|
|
import type { MigrationInterface, QueryRunner } from "typeorm";
|
2022-02-05 22:24:06 +01:00
|
|
|
|
2024-03-03 05:20:32 +01:00
|
|
|
export class chartV111644095659741 implements MigrationInterface {
|
|
|
|
async up(queryRunner: QueryRunner): Promise<void> {
|
2023-04-07 03:56:46 +02:00
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart__active_users" DROP COLUMN "___local_users"`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart__active_users" DROP COLUMN "___remote_users"`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart__active_users" DROP COLUMN "unique_temp___local_users"`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart__active_users" DROP COLUMN "unique_temp___remote_users"`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart_day__active_users" DROP COLUMN "___local_users"`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart_day__active_users" DROP COLUMN "___remote_users"`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart_day__active_users" DROP COLUMN "unique_temp___local_users"`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart_day__active_users" DROP COLUMN "unique_temp___remote_users"`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart__active_users" ADD "unique_temp___users" character varying array NOT NULL DEFAULT '{}'`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart__active_users" ADD "___users" integer NOT NULL DEFAULT '0'`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart__active_users" ADD "unique_temp___notedUsers" character varying array NOT NULL DEFAULT '{}'`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart__active_users" ADD "___notedUsers" smallint NOT NULL DEFAULT '0'`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart__active_users" ADD "unique_temp___registeredWithinWeek" character varying array NOT NULL DEFAULT '{}'`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart__active_users" ADD "___registeredWithinWeek" smallint NOT NULL DEFAULT '0'`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart__active_users" ADD "unique_temp___registeredWithinMonth" character varying array NOT NULL DEFAULT '{}'`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart__active_users" ADD "___registeredWithinMonth" smallint NOT NULL DEFAULT '0'`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart__active_users" ADD "unique_temp___registeredWithinYear" character varying array NOT NULL DEFAULT '{}'`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart__active_users" ADD "___registeredWithinYear" smallint NOT NULL DEFAULT '0'`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart__active_users" ADD "unique_temp___registeredOutsideWeek" character varying array NOT NULL DEFAULT '{}'`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart__active_users" ADD "___registeredOutsideWeek" smallint NOT NULL DEFAULT '0'`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart__active_users" ADD "unique_temp___registeredOutsideMonth" character varying array NOT NULL DEFAULT '{}'`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart__active_users" ADD "___registeredOutsideMonth" smallint NOT NULL DEFAULT '0'`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart__active_users" ADD "unique_temp___registeredOutsideYear" character varying array NOT NULL DEFAULT '{}'`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart__active_users" ADD "___registeredOutsideYear" smallint NOT NULL DEFAULT '0'`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart_day__active_users" ADD "unique_temp___users" character varying array NOT NULL DEFAULT '{}'`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart_day__active_users" ADD "___users" integer NOT NULL DEFAULT '0'`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart_day__active_users" ADD "unique_temp___notedUsers" character varying array NOT NULL DEFAULT '{}'`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart_day__active_users" ADD "___notedUsers" smallint NOT NULL DEFAULT '0'`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart_day__active_users" ADD "unique_temp___registeredWithinWeek" character varying array NOT NULL DEFAULT '{}'`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart_day__active_users" ADD "___registeredWithinWeek" smallint NOT NULL DEFAULT '0'`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart_day__active_users" ADD "unique_temp___registeredWithinMonth" character varying array NOT NULL DEFAULT '{}'`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart_day__active_users" ADD "___registeredWithinMonth" smallint NOT NULL DEFAULT '0'`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart_day__active_users" ADD "unique_temp___registeredWithinYear" character varying array NOT NULL DEFAULT '{}'`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart_day__active_users" ADD "___registeredWithinYear" smallint NOT NULL DEFAULT '0'`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart_day__active_users" ADD "unique_temp___registeredOutsideWeek" character varying array NOT NULL DEFAULT '{}'`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart_day__active_users" ADD "___registeredOutsideWeek" smallint NOT NULL DEFAULT '0'`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart_day__active_users" ADD "unique_temp___registeredOutsideMonth" character varying array NOT NULL DEFAULT '{}'`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart_day__active_users" ADD "___registeredOutsideMonth" smallint NOT NULL DEFAULT '0'`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart_day__active_users" ADD "unique_temp___registeredOutsideYear" character varying array NOT NULL DEFAULT '{}'`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart_day__active_users" ADD "___registeredOutsideYear" smallint NOT NULL DEFAULT '0'`,
|
|
|
|
);
|
|
|
|
}
|
2022-02-05 22:24:06 +01:00
|
|
|
|
2024-03-03 05:20:32 +01:00
|
|
|
async down(queryRunner: QueryRunner): Promise<void> {
|
2023-04-07 03:56:46 +02:00
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart_day__active_users" DROP COLUMN "___registeredOutsideYear"`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart_day__active_users" DROP COLUMN "unique_temp___registeredOutsideYear"`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart_day__active_users" DROP COLUMN "___registeredOutsideMonth"`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart_day__active_users" DROP COLUMN "unique_temp___registeredOutsideMonth"`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart_day__active_users" DROP COLUMN "___registeredOutsideWeek"`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart_day__active_users" DROP COLUMN "unique_temp___registeredOutsideWeek"`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart_day__active_users" DROP COLUMN "___registeredWithinYear"`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart_day__active_users" DROP COLUMN "unique_temp___registeredWithinYear"`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart_day__active_users" DROP COLUMN "___registeredWithinMonth"`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart_day__active_users" DROP COLUMN "unique_temp___registeredWithinMonth"`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart_day__active_users" DROP COLUMN "___registeredWithinWeek"`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart_day__active_users" DROP COLUMN "unique_temp___registeredWithinWeek"`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart_day__active_users" DROP COLUMN "___notedUsers"`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart_day__active_users" DROP COLUMN "unique_temp___notedUsers"`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart_day__active_users" DROP COLUMN "___users"`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart_day__active_users" DROP COLUMN "unique_temp___users"`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart__active_users" DROP COLUMN "___registeredOutsideYear"`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart__active_users" DROP COLUMN "unique_temp___registeredOutsideYear"`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart__active_users" DROP COLUMN "___registeredOutsideMonth"`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart__active_users" DROP COLUMN "unique_temp___registeredOutsideMonth"`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart__active_users" DROP COLUMN "___registeredOutsideWeek"`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart__active_users" DROP COLUMN "unique_temp___registeredOutsideWeek"`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart__active_users" DROP COLUMN "___registeredWithinYear"`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart__active_users" DROP COLUMN "unique_temp___registeredWithinYear"`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart__active_users" DROP COLUMN "___registeredWithinMonth"`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart__active_users" DROP COLUMN "unique_temp___registeredWithinMonth"`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart__active_users" DROP COLUMN "___registeredWithinWeek"`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart__active_users" DROP COLUMN "unique_temp___registeredWithinWeek"`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart__active_users" DROP COLUMN "___notedUsers"`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart__active_users" DROP COLUMN "unique_temp___notedUsers"`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart__active_users" DROP COLUMN "___users"`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart__active_users" DROP COLUMN "unique_temp___users"`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart_day__active_users" ADD "unique_temp___remote_users" character varying array NOT NULL DEFAULT '{}'`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart_day__active_users" ADD "unique_temp___local_users" character varying array NOT NULL DEFAULT '{}'`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart_day__active_users" ADD "___remote_users" integer NOT NULL DEFAULT '0'`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart_day__active_users" ADD "___local_users" integer NOT NULL DEFAULT '0'`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart__active_users" ADD "unique_temp___remote_users" character varying array NOT NULL DEFAULT '{}'`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart__active_users" ADD "unique_temp___local_users" character varying array NOT NULL DEFAULT '{}'`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart__active_users" ADD "___remote_users" integer NOT NULL DEFAULT '0'`,
|
|
|
|
);
|
|
|
|
await queryRunner.query(
|
|
|
|
`ALTER TABLE "__chart__active_users" ADD "___local_users" integer NOT NULL DEFAULT '0'`,
|
|
|
|
);
|
|
|
|
}
|
2022-02-05 22:24:06 +01:00
|
|
|
}
|