summaryrefslogtreecommitdiff
path: root/packages/backend/src/models/SystemAccount.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/backend/src/models/SystemAccount.ts')
-rw-r--r--packages/backend/src/models/SystemAccount.ts31
1 files changed, 31 insertions, 0 deletions
diff --git a/packages/backend/src/models/SystemAccount.ts b/packages/backend/src/models/SystemAccount.ts
new file mode 100644
index 0000000000..f32880b81d
--- /dev/null
+++ b/packages/backend/src/models/SystemAccount.ts
@@ -0,0 +1,31 @@
+/*
+ * SPDX-FileCopyrightText: syuilo and misskey-project
+ * SPDX-License-Identifier: AGPL-3.0-only
+ */
+
+import { Column, Entity, Index, JoinColumn, ManyToOne, PrimaryColumn } from 'typeorm';
+import { Serialized } from '@/types.js';
+import { id } from './util/id.js';
+import { MiUser } from './User.js';
+
+@Entity('system_account')
+@Index(['type'], { unique: true })
+export class MiSystemAccount {
+ @PrimaryColumn(id())
+ public id: string;
+
+ @Index()
+ @Column(id())
+ public userId: MiUser['id'];
+
+ @ManyToOne(type => MiUser, {
+ onDelete: 'CASCADE',
+ })
+ @JoinColumn()
+ public user: MiUser | null;
+
+ @Column('varchar', {
+ length: 256,
+ })
+ public type: string;
+}