chore: distinguish between database columns and relations

This commit is contained in:
naskya 2024-05-24 08:58:12 +09:00
parent e143f0d7ac
commit ee33337a3f
No known key found for this signature in database
GPG key ID: 712D413B3A9FED5C

View file

@ -43,13 +43,6 @@ export class SwSubscription {
})
public sendReadMessage: boolean;
//#region Relations
@ManyToOne(() => User, {
onDelete: "CASCADE",
})
@JoinColumn()
public user: Relation<User>;
/**
* Type of subscription, used for Mastodon API notifications.
* Empty for Misskey notifications.
@ -71,10 +64,18 @@ export class SwSubscription {
})
public appAccessTokenId: AccessToken["id"] | null;
@ManyToOne((type) => AccessToken, {
//#region Relations
@ManyToOne(() => User, {
onDelete: "CASCADE",
})
@JoinColumn()
public appAccessToken: AccessToken | null;
public user: Relation<User>;
@ManyToOne(() => AccessToken, {
onDelete: "CASCADE",
nullable: true,
})
@JoinColumn()
public appAccessToken: Relation<AccessToken | null>;
//#endregion
}