summaryrefslogtreecommitdiff
path: root/src/models/entities
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2021-01-11 20:38:34 +0900
committerGitHub <noreply@github.com>2021-01-11 20:38:34 +0900
commit6c975275f82c79eed2c7757d55283c95d23ca5b8 (patch)
tree2871e4c3a1a67295ea5c3e19b9136ae79a17088c /src/models/entities
parentfix context menu (diff)
downloadmisskey-6c975275f82c79eed2c7757d55283c95d23ca5b8.tar.gz
misskey-6c975275f82c79eed2c7757d55283c95d23ca5b8.tar.bz2
misskey-6c975275f82c79eed2c7757d55283c95d23ca5b8.zip
Registry (#7073)
* wip * wip * wip * wip * wip * Update registry.value.vue * wip * wip * wip * wip * typo
Diffstat (limited to 'src/models/entities')
-rw-r--r--src/models/entities/registry-item.ts58
-rw-r--r--src/models/entities/user-profile.ts1
2 files changed, 59 insertions, 0 deletions
diff --git a/src/models/entities/registry-item.ts b/src/models/entities/registry-item.ts
new file mode 100644
index 0000000000..54d2ef2082
--- /dev/null
+++ b/src/models/entities/registry-item.ts
@@ -0,0 +1,58 @@
+import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm';
+import { User } from './user';
+import { id } from '../id';
+
+// TODO: 同じdomain、同じscope、同じkeyのレコードは二つ以上存在しないように制約付けたい
+@Entity()
+export class RegistryItem {
+ @PrimaryColumn(id())
+ public id: string;
+
+ @Column('timestamp with time zone', {
+ comment: 'The created date of the RegistryItem.'
+ })
+ public createdAt: Date;
+
+ @Column('timestamp with time zone', {
+ comment: 'The updated date of the RegistryItem.'
+ })
+ public updatedAt: Date;
+
+ @Index()
+ @Column({
+ ...id(),
+ comment: 'The owner ID.'
+ })
+ public userId: User['id'];
+
+ @ManyToOne(type => User, {
+ onDelete: 'CASCADE'
+ })
+ @JoinColumn()
+ public user: User | null;
+
+ @Column('varchar', {
+ length: 1024,
+ comment: 'The key of the RegistryItem.'
+ })
+ public key: string;
+
+ @Column('jsonb', {
+ default: {}, nullable: true,
+ comment: 'The value of the RegistryItem.'
+ })
+ public value: any | null;
+
+ @Index()
+ @Column('varchar', {
+ length: 1024, array: true, default: '{}'
+ })
+ public scope: string[];
+
+ // サードパーティアプリに開放するときのためのカラム
+ @Index()
+ @Column('varchar', {
+ length: 512, nullable: true
+ })
+ public domain: string | null;
+}
diff --git a/src/models/entities/user-profile.ts b/src/models/entities/user-profile.ts
index 97a4150be0..0e2c660325 100644
--- a/src/models/entities/user-profile.ts
+++ b/src/models/entities/user-profile.ts
@@ -94,6 +94,7 @@ export class UserProfile {
})
public password: string | null;
+ // TODO: そのうち消す
@Column('jsonb', {
default: {},
comment: 'The client-specific data of the User.'