wip: auto note removal

This commit is contained in:
아르페 2024-02-16 06:41:21 +09:00 committed by 무라쿠모
parent f30c95e51a
commit 74c7b5fe70
No known key found for this signature in database
GPG key ID: 139D6573F92DA9F7
12 changed files with 270 additions and 2 deletions

View file

@ -0,0 +1,40 @@
/*
* SPDX-FileCopyrightText: syuilo and noridev and other misskey, cherrypick contributors
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { Entity, Column, PrimaryColumn, Index } from 'typeorm';
import { id } from './util/id.js';
@Entity('auto_removal_condition')
// @Index(['userId'], { unique: true })
export class MiAutoRemovalCondition {
@PrimaryColumn(id())
public id: string;
@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;
}
}
}