chore: Updates based on PR feedback

This commit is contained in:
Stevche Radevski
2024-02-21 16:05:51 +01:00
parent c99ca5cc22
commit ec6351b363
5 changed files with 53 additions and 15 deletions

View File

@@ -17,12 +17,19 @@ const TypeIndex = createPsqlIndexStatementHelper({
columns: "type",
})
const TokenIndex = createPsqlIndexStatementHelper({
tableName: "api_key",
columns: "token",
unique: true,
})
@Entity()
export default class ApiKey {
@PrimaryKey({ columnType: "text" })
id: string
@Property({ columnType: "text" })
@TokenIndex.MikroORMIndex()
token: string
@Property({ columnType: "text" })