diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2020-03-28 11:24:37 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2020-03-28 11:24:37 +0900 |
| commit | 6be127e18bdbea6031698baeb8632f917a8346eb (patch) | |
| tree | 4b7ceb082d76b0628df6496bc802172106721ce9 /src/models | |
| parent | wip (diff) | |
| download | misskey-6be127e18bdbea6031698baeb8632f917a8346eb.tar.gz misskey-6be127e18bdbea6031698baeb8632f917a8346eb.tar.bz2 misskey-6be127e18bdbea6031698baeb8632f917a8346eb.zip | |
Implement MiAuth
Diffstat (limited to 'src/models')
| -rw-r--r-- | src/models/entities/access-token.ts | 54 |
1 files changed, 52 insertions, 2 deletions
diff --git a/src/models/entities/access-token.ts b/src/models/entities/access-token.ts index 137bf1444d..5f41b3c1fc 100644 --- a/src/models/entities/access-token.ts +++ b/src/models/entities/access-token.ts @@ -13,6 +13,12 @@ export class AccessToken { }) public createdAt: Date; + @Column('timestamp with time zone', { + nullable: true, + default: null, + }) + public lastUsedAt: Date | null; + @Index() @Column('varchar', { length: 128 @@ -21,6 +27,14 @@ export class AccessToken { @Index() @Column('varchar', { + length: 128, + nullable: true, + default: null + }) + public session: string | null; + + @Index() + @Column('varchar', { length: 128 }) public hash: string; @@ -35,12 +49,48 @@ export class AccessToken { @JoinColumn() public user: User | null; - @Column(id()) - public appId: App['id']; + @Column({ + ...id(), + nullable: true, + default: null + }) + public appId: App['id'] | null; @ManyToOne(type => App, { onDelete: 'CASCADE' }) @JoinColumn() public app: App | null; + + @Column('varchar', { + length: 128, + nullable: true, + default: null + }) + public name: string | null; + + @Column('varchar', { + length: 512, + nullable: true, + default: null + }) + public description: string | null; + + @Column('varchar', { + length: 512, + nullable: true, + default: null + }) + public iconUrl: string | null; + + @Column('varchar', { + length: 64, array: true, + default: '{}' + }) + public permission: string[]; + + @Column('boolean', { + default: false + }) + public fetched: boolean; } |