mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
Add new user patch route
This commit is contained in:
parent
b96fe8116e
commit
0bdf559bdc
4 changed files with 180 additions and 0 deletions
40
database/entities/Token.ts
Normal file
40
database/entities/Token.ts
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
import {
|
||||
Entity,
|
||||
BaseEntity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
ManyToOne,
|
||||
} from "typeorm";
|
||||
import { User } from "./User";
|
||||
import { Application } from "./Application";
|
||||
|
||||
export enum TokenType {
|
||||
BEARER = "bearer",
|
||||
}
|
||||
|
||||
@Entity({
|
||||
name: "tokens",
|
||||
})
|
||||
export class Token extends BaseEntity {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id!: string;
|
||||
|
||||
@Column("varchar")
|
||||
token_type!: TokenType;
|
||||
|
||||
@Column("varchar")
|
||||
scope!: string;
|
||||
|
||||
@Column("varchar")
|
||||
access_token!: string;
|
||||
|
||||
@CreateDateColumn()
|
||||
created_at!: Date;
|
||||
|
||||
@ManyToOne(() => User, user => user.id)
|
||||
user!: User;
|
||||
|
||||
@ManyToOne(() => Application, application => application.id)
|
||||
application!: Application;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue