remove all drops from sql files, add triggers and functions for updated_at, added files and folder tables, update some types

This commit is contained in:
creations 2025-03-06 13:57:43 -05:00
parent 6fdc82dd49
commit 94ba46cc2d
Signed by: creations
GPG key ID: 8F553AA4320FC711
11 changed files with 295 additions and 101 deletions

4
types/bun.d.ts vendored
View file

@ -6,10 +6,10 @@ type Params = Record<string, string>;
declare global {
type BunServer = Server;
type ExtendedRequest = Request & {
interface ExtendedRequest extends Request {
startPerf: number;
query: Query;
params: Params;
session: UserSession | ApiUserSession | null;
};
}
}

2
types/char.d.ts vendored
View file

@ -7,3 +7,5 @@ type DurationObject = {
minutes: number;
seconds: number;
};
type UUID = `${string}-${string}-${string}-${string}-${string}`;

8
types/config.d.ts vendored
View file

@ -13,3 +13,11 @@ type Setting = {
key: string;
value: string;
};
type Module = {
file: string;
module: {
order?: number;
createTable?: (reservation?: ReservedSQL) => Promise<void>;
};
};

33
types/file.d.ts vendored Normal file
View file

@ -0,0 +1,33 @@
type File = {
id: UUID;
owner: UUID;
folder?: UUID | null;
name: string;
original_name?: string | null;
mime_type: string;
size: number;
views: number;
max_views: number;
password?: string | null;
favorite: boolean;
tags: string[];
thumbnail: boolean;
created_at: Date;
updated_at: Date;
expires_at?: Date | null;
};
type Folder = {
id: UUID;
owner: UUID;
name: string;
public: boolean;
allow_uploads: boolean;
created_at: Date;
updated_at: Date;
};