wip: auto note removal
This commit is contained in:
parent
f30c95e51a
commit
74c7b5fe70
12 changed files with 270 additions and 2 deletions
40
packages/backend/src/models/AutoRemovalCondition.ts
Normal file
40
packages/backend/src/models/AutoRemovalCondition.ts
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue