mirror of
https://github.com/colanode/colanode.git
synced 2025-12-29 00:25:03 +01:00
53 lines
1.9 KiB
TypeScript
53 lines
1.9 KiB
TypeScript
import { ColumnType, Insertable, Selectable, Updateable } from 'kysely';
|
|
|
|
interface ServerTable {
|
|
domain: ColumnType<string, string, never>;
|
|
name: ColumnType<string, string, string>;
|
|
avatar: ColumnType<string, string, string>;
|
|
attributes: ColumnType<string, string, string>;
|
|
version: ColumnType<string, string, string>;
|
|
created_at: ColumnType<string, string, string>;
|
|
last_synced_at: ColumnType<string | null, string | null, string>;
|
|
}
|
|
|
|
export type SelectServer = Selectable<ServerTable>;
|
|
export type CreateServer = Insertable<ServerTable>;
|
|
export type UpdateServer = Updateable<ServerTable>;
|
|
|
|
interface AccountTable {
|
|
id: ColumnType<string, string, never>;
|
|
server: ColumnType<string, string, never>;
|
|
name: ColumnType<string, string, string>;
|
|
email: ColumnType<string, string, never>;
|
|
avatar: ColumnType<string | null, string | null, string | null>;
|
|
token: ColumnType<string, string, string>;
|
|
device_id: ColumnType<string, string, never>;
|
|
status: ColumnType<string, string, string>;
|
|
}
|
|
|
|
export type SelectAccount = Selectable<AccountTable>;
|
|
export type CreateAccount = Insertable<AccountTable>;
|
|
export type UpdateAccount = Updateable<AccountTable>;
|
|
|
|
interface WorkspaceTable {
|
|
id: ColumnType<string, string, never>;
|
|
account_id: ColumnType<string, string, never>;
|
|
name: ColumnType<string, string, string>;
|
|
description: ColumnType<string | null, string | null, string | null>;
|
|
avatar: ColumnType<string | null, string | null, string | null>;
|
|
version_id: ColumnType<string, string, string>;
|
|
role: ColumnType<number, number, number>;
|
|
user_id: ColumnType<string, string, never>;
|
|
synced: ColumnType<number, number, number>;
|
|
}
|
|
|
|
export type SelectWorkspace = Selectable<WorkspaceTable>;
|
|
export type CreateWorkspace = Insertable<WorkspaceTable>;
|
|
export type UpdateWorkspace = Updateable<WorkspaceTable>;
|
|
|
|
export interface AppDatabaseSchema {
|
|
servers: ServerTable;
|
|
accounts: AccountTable;
|
|
workspaces: WorkspaceTable;
|
|
}
|