misskey/packages/backend/src/models/AutoRemovalCondition.ts
2024-09-07 20:18:19 +09:00

44 lines
908 B
TypeScript

/*
* SPDX-FileCopyrightText: syuilo and noridev and other misskey, cherrypick contributors
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { Entity, Column, PrimaryColumn } from 'typeorm';
import { id } from './util/id.js';
import { MiUser } from './User.js';
@Entity('auto_removal_condition')
// @Index(['userId'], { unique: true })
export class MiAutoRemovalCondition {
@PrimaryColumn({
...id(),
nullable: false,
})
public userId: MiUser['id'];
@Column('bigint', {
default: 7,
nullable: false,
})
public deleteAfter: number;
@Column('boolean', {
default: true,
nullable: false,
})
public noPiningNotes: boolean;
@Column('boolean', {
default: true,
nullable: false,
})
public noSpecifiedNotes: boolean;
constructor(data: Partial<MiAutoRemovalCondition>) {
if (data == null) return;
for (const [k, v] of Object.entries(data)) {
(this as any)[k] = v;
}
}
}