mirror of https://github.com/TZGyn/shortener
Backend added table for shortener visitors
parent
27851c74e0
commit
718c2fa6eb
@ -1,15 +1,33 @@
|
||||
import { Generated, Insertable, Selectable, Updateable } from 'kysely'
|
||||
import {
|
||||
ColumnType,
|
||||
Generated,
|
||||
Insertable,
|
||||
Selectable,
|
||||
Updateable,
|
||||
} from 'kysely'
|
||||
|
||||
export interface Database {
|
||||
shortener: ShortenerTable
|
||||
visitor: VisitorTable
|
||||
}
|
||||
|
||||
export interface ShortenerTable {
|
||||
id: Generated<number>
|
||||
link: string
|
||||
code: string
|
||||
created_at: ColumnType<Date, string | undefined, never>
|
||||
}
|
||||
|
||||
export type Shortener = Selectable<ShortenerTable>
|
||||
export type NewShortener = Insertable<ShortenerTable>
|
||||
export type ShortenerUpdate = Updateable<ShortenerTable>
|
||||
|
||||
export interface VisitorTable {
|
||||
id: Generated<number>
|
||||
shortener_id: number
|
||||
country: string
|
||||
created_at: ColumnType<Date, string | undefined, never>
|
||||
}
|
||||
|
||||
export type Visitor = Selectable<VisitorTable>
|
||||
export type NewVisitor = Insertable<VisitorTable>
|
||||
|
||||
Loading…
Reference in New Issue