mirror of
https://iceshrimp.dev/crimekillz/iceshrimp-161sh.git
synced 2024-11-24 04:59:06 +01:00
48 lines
1.9 KiB
TypeScript
48 lines
1.9 KiB
TypeScript
import { MigrationInterface, QueryRunner } from "typeorm";
|
|
export class chartV91644060125705 implements MigrationInterface {
|
|
name = "chartV91644060125705";
|
|
|
|
async up(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.query(
|
|
`UPDATE "__chart__hashtag" SET "___local_users"=2147483647 WHERE "___local_users" > 2147483647`,
|
|
);
|
|
await queryRunner.query(
|
|
`UPDATE "__chart__hashtag" SET "___remote_users"=2147483647 WHERE "___remote_users" > 2147483647`,
|
|
);
|
|
await queryRunner.query(
|
|
`UPDATE "__chart_day__hashtag" SET "___local_users"=2147483647 WHERE "___local_users" > 2147483647`,
|
|
);
|
|
await queryRunner.query(
|
|
`UPDATE "__chart_day__hashtag" SET "___remote_users"=2147483647 WHERE "___remote_users" > 2147483647`,
|
|
);
|
|
|
|
await queryRunner.query(
|
|
`ALTER TABLE "__chart__hashtag" ALTER COLUMN "___local_users" TYPE integer USING "___local_users"::integer`,
|
|
);
|
|
await queryRunner.query(
|
|
`ALTER TABLE "__chart__hashtag" ALTER COLUMN "___remote_users" TYPE integer USING "___remote_users"::integer`,
|
|
);
|
|
await queryRunner.query(
|
|
`ALTER TABLE "__chart_day__hashtag" ALTER COLUMN "___local_users" TYPE integer USING "___local_users"::integer`,
|
|
);
|
|
await queryRunner.query(
|
|
`ALTER TABLE "__chart_day__hashtag" ALTER COLUMN "___remote_users" TYPE integer USING "___remote_users"::integer`,
|
|
);
|
|
}
|
|
|
|
async down(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.query(
|
|
`ALTER TABLE "__chart__hashtag" ALTER COLUMN "___local_users" TYPE bigint USING "___local_users"::bigint`,
|
|
);
|
|
await queryRunner.query(
|
|
`ALTER TABLE "__chart__hashtag" ALTER COLUMN "___remote_users" TYPE bigint USING "___remote_users"::bigint`,
|
|
);
|
|
await queryRunner.query(
|
|
`ALTER TABLE "__chart_day__hashtag" ALTER COLUMN "___local_users" TYPE bigint USING "___local_users"::bigint`,
|
|
);
|
|
await queryRunner.query(
|
|
`ALTER TABLE "__chart_day__hashtag" ALTER COLUMN "___remote_users" TYPE bigint USING "___remote_users"::bigint`,
|
|
);
|
|
}
|
|
}
|