2020-08-04 14:38:26 +09:00
|
|
|
import {MigrationInterface, QueryRunner} from 'typeorm';
|
|
|
|
|
|
|
|
export class Init21596514165166 implements MigrationInterface {
|
2023-02-25 17:13:07 +09:00
|
|
|
name = 'Init21596514165166';
|
2020-08-04 14:38:26 +09:00
|
|
|
|
2023-02-25 17:13:07 +09:00
|
|
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
|
|
await queryRunner.query('ALTER TABLE "user" ALTER COLUMN "prevNotesCount" SET DEFAULT 0');
|
|
|
|
await queryRunner.query('ALTER TABLE "user" ALTER COLUMN "prevFollowingCount" SET DEFAULT 0');
|
|
|
|
await queryRunner.query('ALTER TABLE "user" ALTER COLUMN "prevFollowersCount" SET DEFAULT 0');
|
|
|
|
}
|
2020-08-04 14:38:26 +09:00
|
|
|
|
2023-02-25 17:13:07 +09:00
|
|
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
|
|
await queryRunner.query('ALTER TABLE "user" ALTER COLUMN "prevFollowersCount" DROP DEFAULT');
|
|
|
|
await queryRunner.query('ALTER TABLE "user" ALTER COLUMN "prevFollowingCount" DROP DEFAULT');
|
|
|
|
await queryRunner.query('ALTER TABLE "user" ALTER COLUMN "prevNotesCount" DROP DEFAULT');
|
|
|
|
}
|
2020-08-04 14:38:26 +09:00
|
|
|
|
|
|
|
}
|