/* * 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) { if (data == null) return; for (const [k, v] of Object.entries(data)) { (this as any)[k] = v; } } }