barkey/packages/backend/migration/1731198456912-relationshipsPrivateByDefault.js

16 lines
889 B
JavaScript
Raw Permalink Normal View History

2024-11-10 07:55:02 +00:00
export class RelationshipsPrivateByDefault1731198456912 {
name = 'RelationshipsPrivateByDefault1731198456912'
2024-11-10 01:27:41 +00:00
async up(queryRunner) {
await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "publicReactions" SET DEFAULT false`);
await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "followingVisibility" SET DEFAULT 'private'`);
await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "followersVisibility" SET DEFAULT 'private'`);
}
async down(queryRunner) {
await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "followersVisibility" SET DEFAULT 'public'`);
await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "followingVisibility" SET DEFAULT 'public'`);
await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "publicReactions" SET DEFAULT true`);
}
}