Files
archtika/web-app/src/lib/db-schema.ts

572 lines
14 KiB
TypeScript
Raw Normal View History

/* tslint:disable */
/* eslint-disable */
/**
* AUTO-GENERATED FILE - DO NOT EDIT!
*
* This file was automatically generated by pg-to-ts v.4.1.1
* $ pg-to-ts generate -c postgres://username:password@localhost:15432/archtika -t article -t change_log -t collab -t docs_category -t domain_prefix -t footer -t header -t home -t legal_information -t media -t settings -t user -t website -s internal
*
*/
export type Json = unknown;
// Table article
export interface Article {
id: string;
website_id: string;
user_id: string | null;
title: string;
meta_description: string | null;
meta_author: string | null;
cover_image: string | null;
publication_date: Date | null;
main_content: string | null;
2024-09-13 17:04:04 +02:00
category: string | null;
article_weight: number | null;
created_at: Date;
last_modified_at: Date;
last_modified_by: string | null;
title_description_search: any | null;
}
export interface ArticleInput {
id?: string;
website_id: string;
user_id?: string | null;
title: string;
meta_description?: string | null;
meta_author?: string | null;
cover_image?: string | null;
publication_date?: Date | null;
main_content?: string | null;
2024-09-13 17:04:04 +02:00
category?: string | null;
article_weight?: number | null;
created_at?: Date;
last_modified_at?: Date;
last_modified_by?: string | null;
title_description_search?: any | null;
}
const article = {
tableName: "article",
columns: [
"id",
"website_id",
"user_id",
"title",
"meta_description",
"meta_author",
"cover_image",
"publication_date",
"main_content",
2024-09-13 17:04:04 +02:00
"category",
"article_weight",
"created_at",
"last_modified_at",
"last_modified_by",
2024-09-13 17:04:04 +02:00
"title_description_search"
],
requiredForInsert: ["website_id", "title"],
primaryKey: "id",
foreignKeys: {
website_id: { table: "website", column: "id", $type: null as unknown as Website },
user_id: { table: "user", column: "id", $type: null as unknown as User },
cover_image: { table: "media", column: "id", $type: null as unknown as Media },
2024-09-13 17:04:04 +02:00
category: { table: "docs_category", column: "id", $type: null as unknown as DocsCategory },
last_modified_by: { table: "user", column: "id", $type: null as unknown as User }
},
$type: null as unknown as Article,
$input: null as unknown as ArticleInput
} as const;
// Table change_log
export interface ChangeLog {
2024-09-13 17:04:04 +02:00
id: string;
website_id: string | null;
user_id: string | null;
username: string;
2024-09-13 17:04:04 +02:00
tstamp: Date;
table_name: string;
operation: string;
old_value: any | null;
new_value: any | null;
}
export interface ChangeLogInput {
2024-09-13 17:04:04 +02:00
id?: string;
website_id?: string | null;
user_id?: string | null;
username?: string;
2024-09-13 17:04:04 +02:00
tstamp?: Date;
table_name: string;
operation: string;
old_value?: any | null;
new_value?: any | null;
}
const change_log = {
tableName: "change_log",
2024-09-13 17:04:04 +02:00
columns: [
"id",
"website_id",
"user_id",
"username",
2024-09-13 17:04:04 +02:00
"tstamp",
"table_name",
"operation",
"old_value",
"new_value"
],
requiredForInsert: ["table_name", "operation"],
primaryKey: "id",
foreignKeys: {
website_id: { table: "website", column: "id", $type: null as unknown as Website },
user_id: { table: "user", column: "id", $type: null as unknown as User }
},
$type: null as unknown as ChangeLog,
$input: null as unknown as ChangeLogInput
} as const;
// Table collab
export interface Collab {
website_id: string;
user_id: string;
permission_level: number;
added_at: Date;
last_modified_at: Date;
last_modified_by: string | null;
}
export interface CollabInput {
website_id: string;
user_id: string;
permission_level?: number;
added_at?: Date;
last_modified_at?: Date;
last_modified_by?: string | null;
}
const collab = {
tableName: "collab",
columns: [
"website_id",
"user_id",
"permission_level",
"added_at",
"last_modified_at",
"last_modified_by"
],
requiredForInsert: ["website_id", "user_id"],
primaryKey: "website_id",
foreignKeys: {
website_id: { table: "website", column: "id", $type: null as unknown as Website },
user_id: { table: "user", column: "id", $type: null as unknown as User },
last_modified_by: { table: "user", column: "id", $type: null as unknown as User }
},
$type: null as unknown as Collab,
$input: null as unknown as CollabInput
} as const;
// Table docs_category
export interface DocsCategory {
id: string;
website_id: string;
user_id: string | null;
category_name: string;
category_weight: number;
created_at: Date;
2024-09-13 17:04:04 +02:00
last_modified_at: Date;
last_modified_by: string | null;
}
export interface DocsCategoryInput {
id?: string;
website_id: string;
user_id?: string | null;
category_name: string;
category_weight: number;
created_at?: Date;
2024-09-13 17:04:04 +02:00
last_modified_at?: Date;
last_modified_by?: string | null;
}
const docs_category = {
tableName: "docs_category",
2024-09-13 17:04:04 +02:00
columns: [
"id",
"website_id",
"user_id",
"category_name",
"category_weight",
"created_at",
2024-09-13 17:04:04 +02:00
"last_modified_at",
"last_modified_by"
],
requiredForInsert: ["website_id", "category_name", "category_weight"],
primaryKey: "id",
foreignKeys: {
website_id: { table: "website", column: "id", $type: null as unknown as Website },
2024-09-13 17:04:04 +02:00
user_id: { table: "user", column: "id", $type: null as unknown as User },
last_modified_by: { table: "user", column: "id", $type: null as unknown as User }
},
$type: null as unknown as DocsCategory,
$input: null as unknown as DocsCategoryInput
} as const;
// Table domain_prefix
export interface DomainPrefix {
website_id: string;
prefix: string;
created_at: Date;
last_modified_at: Date;
last_modified_by: string | null;
}
export interface DomainPrefixInput {
website_id: string;
prefix: string;
created_at?: Date;
last_modified_at?: Date;
last_modified_by?: string | null;
}
const domain_prefix = {
tableName: "domain_prefix",
columns: ["website_id", "prefix", "created_at", "last_modified_at", "last_modified_by"],
requiredForInsert: ["website_id", "prefix"],
primaryKey: "website_id",
foreignKeys: {
website_id: { table: "website", column: "id", $type: null as unknown as Website },
last_modified_by: { table: "user", column: "id", $type: null as unknown as User }
},
$type: null as unknown as DomainPrefix,
$input: null as unknown as DomainPrefixInput
} as const;
// Table footer
export interface Footer {
website_id: string;
additional_text: string;
last_modified_at: Date;
last_modified_by: string | null;
}
export interface FooterInput {
website_id: string;
additional_text: string;
last_modified_at?: Date;
last_modified_by?: string | null;
}
const footer = {
tableName: "footer",
columns: ["website_id", "additional_text", "last_modified_at", "last_modified_by"],
requiredForInsert: ["website_id", "additional_text"],
primaryKey: "website_id",
foreignKeys: {
website_id: { table: "website", column: "id", $type: null as unknown as Website },
last_modified_by: { table: "user", column: "id", $type: null as unknown as User }
},
$type: null as unknown as Footer,
$input: null as unknown as FooterInput
} as const;
// Table header
export interface Header {
website_id: string;
logo_type: string;
logo_text: string | null;
logo_image: string | null;
last_modified_at: Date;
last_modified_by: string | null;
}
export interface HeaderInput {
website_id: string;
logo_type?: string;
logo_text?: string | null;
logo_image?: string | null;
last_modified_at?: Date;
last_modified_by?: string | null;
}
const header = {
tableName: "header",
columns: [
"website_id",
"logo_type",
"logo_text",
"logo_image",
"last_modified_at",
"last_modified_by"
],
requiredForInsert: ["website_id"],
primaryKey: "website_id",
foreignKeys: {
website_id: { table: "website", column: "id", $type: null as unknown as Website },
logo_image: { table: "media", column: "id", $type: null as unknown as Media },
last_modified_by: { table: "user", column: "id", $type: null as unknown as User }
},
$type: null as unknown as Header,
$input: null as unknown as HeaderInput
} as const;
// Table home
export interface Home {
website_id: string;
main_content: string;
last_modified_at: Date;
last_modified_by: string | null;
}
export interface HomeInput {
website_id: string;
main_content: string;
last_modified_at?: Date;
last_modified_by?: string | null;
}
const home = {
tableName: "home",
columns: ["website_id", "main_content", "last_modified_at", "last_modified_by"],
requiredForInsert: ["website_id", "main_content"],
primaryKey: "website_id",
foreignKeys: {
website_id: { table: "website", column: "id", $type: null as unknown as Website },
last_modified_by: { table: "user", column: "id", $type: null as unknown as User }
},
$type: null as unknown as Home,
$input: null as unknown as HomeInput
} as const;
// Table legal_information
export interface LegalInformation {
website_id: string;
main_content: string;
created_at: Date;
last_modified_at: Date;
last_modified_by: string | null;
}
export interface LegalInformationInput {
website_id: string;
main_content: string;
created_at?: Date;
last_modified_at?: Date;
last_modified_by?: string | null;
}
const legal_information = {
tableName: "legal_information",
columns: ["website_id", "main_content", "created_at", "last_modified_at", "last_modified_by"],
requiredForInsert: ["website_id", "main_content"],
primaryKey: "website_id",
foreignKeys: {
website_id: { table: "website", column: "id", $type: null as unknown as Website },
last_modified_by: { table: "user", column: "id", $type: null as unknown as User }
},
$type: null as unknown as LegalInformation,
$input: null as unknown as LegalInformationInput
} as const;
// Table media
export interface Media {
id: string;
website_id: string;
user_id: string | null;
blob: string;
mimetype: string;
original_name: string;
created_at: Date;
}
export interface MediaInput {
id?: string;
website_id: string;
user_id?: string | null;
blob: string;
mimetype: string;
original_name: string;
created_at?: Date;
}
const media = {
tableName: "media",
columns: ["id", "website_id", "user_id", "blob", "mimetype", "original_name", "created_at"],
requiredForInsert: ["website_id", "blob", "mimetype", "original_name"],
primaryKey: "id",
foreignKeys: {
website_id: { table: "website", column: "id", $type: null as unknown as Website },
user_id: { table: "user", column: "id", $type: null as unknown as User }
},
$type: null as unknown as Media,
$input: null as unknown as MediaInput
} as const;
// Table settings
export interface Settings {
website_id: string;
accent_color_dark_theme: string;
accent_color_light_theme: string;
background_color_dark_theme: string;
background_color_light_theme: string;
favicon_image: string | null;
last_modified_at: Date;
last_modified_by: string | null;
}
export interface SettingsInput {
website_id: string;
accent_color_dark_theme?: string;
accent_color_light_theme?: string;
background_color_dark_theme?: string;
background_color_light_theme?: string;
favicon_image?: string | null;
last_modified_at?: Date;
last_modified_by?: string | null;
}
const settings = {
tableName: "settings",
columns: [
"website_id",
"accent_color_dark_theme",
"accent_color_light_theme",
"background_color_dark_theme",
"background_color_light_theme",
"favicon_image",
"last_modified_at",
"last_modified_by"
],
requiredForInsert: ["website_id"],
primaryKey: "website_id",
foreignKeys: {
website_id: { table: "website", column: "id", $type: null as unknown as Website },
favicon_image: { table: "media", column: "id", $type: null as unknown as Media },
last_modified_by: { table: "user", column: "id", $type: null as unknown as User }
},
$type: null as unknown as Settings,
$input: null as unknown as SettingsInput
} as const;
// Table user
export interface User {
id: string;
username: string;
password_hash: string;
role: string;
created_at: Date;
}
export interface UserInput {
id?: string;
username: string;
password_hash: string;
role?: string;
created_at?: Date;
}
const user = {
tableName: "user",
columns: ["id", "username", "password_hash", "role", "created_at"],
requiredForInsert: ["username", "password_hash"],
primaryKey: "id",
foreignKeys: {},
$type: null as unknown as User,
$input: null as unknown as UserInput
} as const;
// Table website
export interface Website {
id: string;
user_id: string;
content_type: string;
title: string;
2024-09-13 17:04:04 +02:00
is_published: boolean;
created_at: Date;
last_modified_at: Date;
last_modified_by: string | null;
title_search: any | null;
}
export interface WebsiteInput {
id?: string;
user_id?: string;
content_type: string;
title: string;
2024-09-13 17:04:04 +02:00
is_published?: boolean;
created_at?: Date;
last_modified_at?: Date;
last_modified_by?: string | null;
title_search?: any | null;
}
const website = {
tableName: "website",
columns: [
"id",
"user_id",
"content_type",
"title",
2024-09-13 17:04:04 +02:00
"is_published",
"created_at",
"last_modified_at",
"last_modified_by",
2024-09-13 17:04:04 +02:00
"title_search"
],
requiredForInsert: ["content_type", "title"],
primaryKey: "id",
foreignKeys: {
user_id: { table: "user", column: "id", $type: null as unknown as User },
last_modified_by: { table: "user", column: "id", $type: null as unknown as User }
},
$type: null as unknown as Website,
$input: null as unknown as WebsiteInput
} as const;
export interface TableTypes {
article: {
select: Article;
input: ArticleInput;
};
change_log: {
select: ChangeLog;
input: ChangeLogInput;
};
collab: {
select: Collab;
input: CollabInput;
};
docs_category: {
select: DocsCategory;
input: DocsCategoryInput;
};
domain_prefix: {
select: DomainPrefix;
input: DomainPrefixInput;
};
footer: {
select: Footer;
input: FooterInput;
};
header: {
select: Header;
input: HeaderInput;
};
home: {
select: Home;
input: HomeInput;
};
legal_information: {
select: LegalInformation;
input: LegalInformationInput;
};
media: {
select: Media;
input: MediaInput;
};
settings: {
select: Settings;
input: SettingsInput;
};
user: {
select: User;
input: UserInput;
};
website: {
select: Website;
input: WebsiteInput;
};
}
export const tables = {
article,
change_log,
collab,
docs_category,
domain_prefix,
footer,
header,
home,
legal_information,
media,
settings,
user,
website
};