forked from FoundKeyGang/FoundKey
チャンネルを作成しているとアカウントを削除できないのを修正 (#7653)
* チャンネルを作成しているとアカウントを削除できないのを修正 * CHANGELOG * nullable
This commit is contained in:
parent
6a3a8ba4d0
commit
881b914c6a
4 changed files with 24 additions and 2 deletions
|
@ -7,6 +7,13 @@
|
|||
|
||||
-->
|
||||
|
||||
## 12.x.x (unreleased)
|
||||
|
||||
### Improvements
|
||||
|
||||
### Bugfixes
|
||||
- チャンネルを作成しているとアカウントを削除できないのを修正
|
||||
|
||||
## 12.88.0 (2021/08/17)
|
||||
|
||||
### Features
|
||||
|
|
14
migration/1629288472000-fix-channel-userId.ts
Normal file
14
migration/1629288472000-fix-channel-userId.ts
Normal file
|
@ -0,0 +1,14 @@
|
|||
import {MigrationInterface, QueryRunner} from "typeorm";
|
||||
|
||||
export class fixChannelUserId1629288472000 implements MigrationInterface {
|
||||
name = 'fixChannelUserId1629288472000'
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`ALTER TABLE "channel" ALTER COLUMN "userId" DROP NOT NULL;`);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`ALTER TABLE "channel" ALTER COLUMN "userId" SET NOT NULL;`);
|
||||
}
|
||||
|
||||
}
|
|
@ -23,9 +23,10 @@ export class Channel {
|
|||
@Index()
|
||||
@Column({
|
||||
...id(),
|
||||
nullable: true,
|
||||
comment: 'The owner ID.'
|
||||
})
|
||||
public userId: User['id'];
|
||||
public userId: User['id'] | null;
|
||||
|
||||
@ManyToOne(type => User, {
|
||||
onDelete: 'SET NULL'
|
||||
|
|
|
@ -90,7 +90,7 @@ export const packedChannelSchema = {
|
|||
},
|
||||
userId: {
|
||||
type: 'string' as const,
|
||||
nullable: false as const, optional: false as const,
|
||||
nullable: true as const, optional: false as const,
|
||||
format: 'id',
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue