1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-06 01:15:56 +02:00
Files
misskey/packages/backend/src/models/ChannelFollowing.ts
anatawa12 666f78e676 enable and fix no-unused-vars and no-async-promise-executor (#17070)
* dev: set --no-bail for lint task

* lint: enable no-async-promise-executor lint and fix them

* lint: enable no-unused-vars with allowing _ prefix

* lint: fix semi
2026-01-08 11:49:12 +09:00

43 lines
901 B
TypeScript

/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm';
import { id } from './util/id.js';
import { MiUser } from './User.js';
import { MiChannel } from './Channel.js';
@Entity('channel_following')
@Index(['followerId', 'followeeId'], { unique: true })
export class MiChannelFollowing {
@PrimaryColumn(id())
public id: string;
@Index()
@Column({
...id(),
comment: 'The followee channel ID.',
})
public followeeId: MiChannel['id'];
@ManyToOne(() => MiChannel, {
onDelete: 'CASCADE',
})
@JoinColumn()
public followee: MiChannel | null;
@Index()
@Column({
...id(),
comment: 'The follower user ID.',
})
public followerId: MiUser['id'];
@ManyToOne(() => MiUser, {
onDelete: 'CASCADE',
})
@JoinColumn()
public follower: MiUser | null;
}