|
|
|
@@ -0,0 +1,630 @@
|
|
|
|
|
/* tslint:disable */
|
|
|
|
|
/* eslint-disable */
|
|
|
|
|
/**
|
|
|
|
|
* This file was automatically generated by Payload.
|
|
|
|
|
* DO NOT MODIFY IT BY HAND. Instead, modify your source Payload config,
|
|
|
|
|
* and re-run `payload generate:db-schema` to regenerate this file.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import type {} from "@payloadcms/db-postgres";
|
|
|
|
|
import {
|
|
|
|
|
pgTable,
|
|
|
|
|
index,
|
|
|
|
|
uniqueIndex,
|
|
|
|
|
foreignKey,
|
|
|
|
|
integer,
|
|
|
|
|
varchar,
|
|
|
|
|
timestamp,
|
|
|
|
|
serial,
|
|
|
|
|
numeric,
|
|
|
|
|
boolean,
|
|
|
|
|
jsonb,
|
|
|
|
|
pgEnum,
|
|
|
|
|
} from "@payloadcms/db-postgres/drizzle/pg-core";
|
|
|
|
|
import { sql, relations } from "@payloadcms/db-postgres/drizzle";
|
|
|
|
|
export const enum_projects_status = pgEnum("enum_projects_status", [
|
|
|
|
|
"draft",
|
|
|
|
|
"published",
|
|
|
|
|
"archived",
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
export const users_sessions = pgTable(
|
|
|
|
|
"users_sessions",
|
|
|
|
|
{
|
|
|
|
|
_order: integer("_order").notNull(),
|
|
|
|
|
_parentID: integer("_parent_id").notNull(),
|
|
|
|
|
id: varchar("id").primaryKey(),
|
|
|
|
|
createdAt: timestamp("created_at", {
|
|
|
|
|
mode: "string",
|
|
|
|
|
withTimezone: true,
|
|
|
|
|
precision: 3,
|
|
|
|
|
}),
|
|
|
|
|
expiresAt: timestamp("expires_at", {
|
|
|
|
|
mode: "string",
|
|
|
|
|
withTimezone: true,
|
|
|
|
|
precision: 3,
|
|
|
|
|
}).notNull(),
|
|
|
|
|
},
|
|
|
|
|
(columns) => [
|
|
|
|
|
index("users_sessions_order_idx").on(columns._order),
|
|
|
|
|
index("users_sessions_parent_id_idx").on(columns._parentID),
|
|
|
|
|
foreignKey({
|
|
|
|
|
columns: [columns["_parentID"]],
|
|
|
|
|
foreignColumns: [users.id],
|
|
|
|
|
name: "users_sessions_parent_id_fk",
|
|
|
|
|
}).onDelete("cascade"),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
export const users = pgTable(
|
|
|
|
|
"users",
|
|
|
|
|
{
|
|
|
|
|
id: serial("id").primaryKey(),
|
|
|
|
|
updatedAt: timestamp("updated_at", {
|
|
|
|
|
mode: "string",
|
|
|
|
|
withTimezone: true,
|
|
|
|
|
precision: 3,
|
|
|
|
|
})
|
|
|
|
|
.defaultNow()
|
|
|
|
|
.notNull(),
|
|
|
|
|
createdAt: timestamp("created_at", {
|
|
|
|
|
mode: "string",
|
|
|
|
|
withTimezone: true,
|
|
|
|
|
precision: 3,
|
|
|
|
|
})
|
|
|
|
|
.defaultNow()
|
|
|
|
|
.notNull(),
|
|
|
|
|
email: varchar("email").notNull(),
|
|
|
|
|
resetPasswordToken: varchar("reset_password_token"),
|
|
|
|
|
resetPasswordExpiration: timestamp("reset_password_expiration", {
|
|
|
|
|
mode: "string",
|
|
|
|
|
withTimezone: true,
|
|
|
|
|
precision: 3,
|
|
|
|
|
}),
|
|
|
|
|
salt: varchar("salt"),
|
|
|
|
|
hash: varchar("hash"),
|
|
|
|
|
loginAttempts: numeric("login_attempts", { mode: "number" }).default(0),
|
|
|
|
|
lockUntil: timestamp("lock_until", {
|
|
|
|
|
mode: "string",
|
|
|
|
|
withTimezone: true,
|
|
|
|
|
precision: 3,
|
|
|
|
|
}),
|
|
|
|
|
},
|
|
|
|
|
(columns) => [
|
|
|
|
|
index("users_updated_at_idx").on(columns.updatedAt),
|
|
|
|
|
index("users_created_at_idx").on(columns.createdAt),
|
|
|
|
|
uniqueIndex("users_email_idx").on(columns.email),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
export const media = pgTable(
|
|
|
|
|
"media",
|
|
|
|
|
{
|
|
|
|
|
id: serial("id").primaryKey(),
|
|
|
|
|
alt: varchar("alt").notNull(),
|
|
|
|
|
updatedAt: timestamp("updated_at", {
|
|
|
|
|
mode: "string",
|
|
|
|
|
withTimezone: true,
|
|
|
|
|
precision: 3,
|
|
|
|
|
})
|
|
|
|
|
.defaultNow()
|
|
|
|
|
.notNull(),
|
|
|
|
|
createdAt: timestamp("created_at", {
|
|
|
|
|
mode: "string",
|
|
|
|
|
withTimezone: true,
|
|
|
|
|
precision: 3,
|
|
|
|
|
})
|
|
|
|
|
.defaultNow()
|
|
|
|
|
.notNull(),
|
|
|
|
|
url: varchar("url"),
|
|
|
|
|
thumbnailURL: varchar("thumbnail_u_r_l"),
|
|
|
|
|
filename: varchar("filename"),
|
|
|
|
|
mimeType: varchar("mime_type"),
|
|
|
|
|
filesize: numeric("filesize", { mode: "number" }),
|
|
|
|
|
width: numeric("width", { mode: "number" }),
|
|
|
|
|
height: numeric("height", { mode: "number" }),
|
|
|
|
|
focalX: numeric("focal_x", { mode: "number" }),
|
|
|
|
|
focalY: numeric("focal_y", { mode: "number" }),
|
|
|
|
|
},
|
|
|
|
|
(columns) => [
|
|
|
|
|
index("media_updated_at_idx").on(columns.updatedAt),
|
|
|
|
|
index("media_created_at_idx").on(columns.createdAt),
|
|
|
|
|
uniqueIndex("media_filename_idx").on(columns.filename),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
export const projects = pgTable(
|
|
|
|
|
"projects",
|
|
|
|
|
{
|
|
|
|
|
id: serial("id").primaryKey(),
|
|
|
|
|
name: varchar("name").notNull(),
|
|
|
|
|
description: varchar("description").notNull(),
|
|
|
|
|
shortDescription: varchar("short_description").notNull(),
|
|
|
|
|
icon: varchar("icon"),
|
|
|
|
|
status: enum_projects_status("status").notNull().default("draft"),
|
|
|
|
|
featured: boolean("featured").default(false),
|
|
|
|
|
autocheckUpdated: boolean("autocheck_updated").default(false),
|
|
|
|
|
lastUpdated: timestamp("last_updated", {
|
|
|
|
|
mode: "string",
|
|
|
|
|
withTimezone: true,
|
|
|
|
|
precision: 3,
|
|
|
|
|
}),
|
|
|
|
|
wakatimeOffset: numeric("wakatime_offset", { mode: "number" }),
|
|
|
|
|
bannerImage: integer("banner_image_id").references(() => media.id, {
|
|
|
|
|
onDelete: "set null",
|
|
|
|
|
}),
|
|
|
|
|
updatedAt: timestamp("updated_at", {
|
|
|
|
|
mode: "string",
|
|
|
|
|
withTimezone: true,
|
|
|
|
|
precision: 3,
|
|
|
|
|
})
|
|
|
|
|
.defaultNow()
|
|
|
|
|
.notNull(),
|
|
|
|
|
createdAt: timestamp("created_at", {
|
|
|
|
|
mode: "string",
|
|
|
|
|
withTimezone: true,
|
|
|
|
|
precision: 3,
|
|
|
|
|
})
|
|
|
|
|
.defaultNow()
|
|
|
|
|
.notNull(),
|
|
|
|
|
},
|
|
|
|
|
(columns) => [
|
|
|
|
|
index("projects_banner_image_idx").on(columns.bannerImage),
|
|
|
|
|
index("projects_updated_at_idx").on(columns.updatedAt),
|
|
|
|
|
index("projects_created_at_idx").on(columns.createdAt),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
export const projects_rels = pgTable(
|
|
|
|
|
"projects_rels",
|
|
|
|
|
{
|
|
|
|
|
id: serial("id").primaryKey(),
|
|
|
|
|
order: integer("order"),
|
|
|
|
|
parent: integer("parent_id").notNull(),
|
|
|
|
|
path: varchar("path").notNull(),
|
|
|
|
|
technologiesID: integer("technologies_id"),
|
|
|
|
|
},
|
|
|
|
|
(columns) => [
|
|
|
|
|
index("projects_rels_order_idx").on(columns.order),
|
|
|
|
|
index("projects_rels_parent_idx").on(columns.parent),
|
|
|
|
|
index("projects_rels_path_idx").on(columns.path),
|
|
|
|
|
index("projects_rels_technologies_id_idx").on(columns.technologiesID),
|
|
|
|
|
foreignKey({
|
|
|
|
|
columns: [columns["parent"]],
|
|
|
|
|
foreignColumns: [projects.id],
|
|
|
|
|
name: "projects_rels_parent_fk",
|
|
|
|
|
}).onDelete("cascade"),
|
|
|
|
|
foreignKey({
|
|
|
|
|
columns: [columns["technologiesID"]],
|
|
|
|
|
foreignColumns: [technologies.id],
|
|
|
|
|
name: "projects_rels_technologies_fk",
|
|
|
|
|
}).onDelete("cascade"),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
export const technologies = pgTable(
|
|
|
|
|
"technologies",
|
|
|
|
|
{
|
|
|
|
|
id: serial("id").primaryKey(),
|
|
|
|
|
name: varchar("name").notNull(),
|
|
|
|
|
url: varchar("url"),
|
|
|
|
|
updatedAt: timestamp("updated_at", {
|
|
|
|
|
mode: "string",
|
|
|
|
|
withTimezone: true,
|
|
|
|
|
precision: 3,
|
|
|
|
|
})
|
|
|
|
|
.defaultNow()
|
|
|
|
|
.notNull(),
|
|
|
|
|
createdAt: timestamp("created_at", {
|
|
|
|
|
mode: "string",
|
|
|
|
|
withTimezone: true,
|
|
|
|
|
precision: 3,
|
|
|
|
|
})
|
|
|
|
|
.defaultNow()
|
|
|
|
|
.notNull(),
|
|
|
|
|
},
|
|
|
|
|
(columns) => [
|
|
|
|
|
index("technologies_updated_at_idx").on(columns.updatedAt),
|
|
|
|
|
index("technologies_created_at_idx").on(columns.createdAt),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
export const links = pgTable(
|
|
|
|
|
"links",
|
|
|
|
|
{
|
|
|
|
|
id: serial("id").primaryKey(),
|
|
|
|
|
url: varchar("url").notNull(),
|
|
|
|
|
icon: varchar("icon"),
|
|
|
|
|
description: varchar("description"),
|
|
|
|
|
project: integer("project_id")
|
|
|
|
|
.notNull()
|
|
|
|
|
.references(() => projects.id, {
|
|
|
|
|
onDelete: "set null",
|
|
|
|
|
}),
|
|
|
|
|
updatedAt: timestamp("updated_at", {
|
|
|
|
|
mode: "string",
|
|
|
|
|
withTimezone: true,
|
|
|
|
|
precision: 3,
|
|
|
|
|
})
|
|
|
|
|
.defaultNow()
|
|
|
|
|
.notNull(),
|
|
|
|
|
createdAt: timestamp("created_at", {
|
|
|
|
|
mode: "string",
|
|
|
|
|
withTimezone: true,
|
|
|
|
|
precision: 3,
|
|
|
|
|
})
|
|
|
|
|
.defaultNow()
|
|
|
|
|
.notNull(),
|
|
|
|
|
},
|
|
|
|
|
(columns) => [
|
|
|
|
|
index("links_project_idx").on(columns.project),
|
|
|
|
|
index("links_updated_at_idx").on(columns.updatedAt),
|
|
|
|
|
index("links_created_at_idx").on(columns.createdAt),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
export const payload_kv = pgTable(
|
|
|
|
|
"payload_kv",
|
|
|
|
|
{
|
|
|
|
|
id: serial("id").primaryKey(),
|
|
|
|
|
key: varchar("key").notNull(),
|
|
|
|
|
data: jsonb("data").notNull(),
|
|
|
|
|
},
|
|
|
|
|
(columns) => [uniqueIndex("payload_kv_key_idx").on(columns.key)],
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
export const payload_locked_documents = pgTable(
|
|
|
|
|
"payload_locked_documents",
|
|
|
|
|
{
|
|
|
|
|
id: serial("id").primaryKey(),
|
|
|
|
|
globalSlug: varchar("global_slug"),
|
|
|
|
|
updatedAt: timestamp("updated_at", {
|
|
|
|
|
mode: "string",
|
|
|
|
|
withTimezone: true,
|
|
|
|
|
precision: 3,
|
|
|
|
|
})
|
|
|
|
|
.defaultNow()
|
|
|
|
|
.notNull(),
|
|
|
|
|
createdAt: timestamp("created_at", {
|
|
|
|
|
mode: "string",
|
|
|
|
|
withTimezone: true,
|
|
|
|
|
precision: 3,
|
|
|
|
|
})
|
|
|
|
|
.defaultNow()
|
|
|
|
|
.notNull(),
|
|
|
|
|
},
|
|
|
|
|
(columns) => [
|
|
|
|
|
index("payload_locked_documents_global_slug_idx").on(columns.globalSlug),
|
|
|
|
|
index("payload_locked_documents_updated_at_idx").on(columns.updatedAt),
|
|
|
|
|
index("payload_locked_documents_created_at_idx").on(columns.createdAt),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
export const payload_locked_documents_rels = pgTable(
|
|
|
|
|
"payload_locked_documents_rels",
|
|
|
|
|
{
|
|
|
|
|
id: serial("id").primaryKey(),
|
|
|
|
|
order: integer("order"),
|
|
|
|
|
parent: integer("parent_id").notNull(),
|
|
|
|
|
path: varchar("path").notNull(),
|
|
|
|
|
usersID: integer("users_id"),
|
|
|
|
|
mediaID: integer("media_id"),
|
|
|
|
|
projectsID: integer("projects_id"),
|
|
|
|
|
technologiesID: integer("technologies_id"),
|
|
|
|
|
linksID: integer("links_id"),
|
|
|
|
|
},
|
|
|
|
|
(columns) => [
|
|
|
|
|
index("payload_locked_documents_rels_order_idx").on(columns.order),
|
|
|
|
|
index("payload_locked_documents_rels_parent_idx").on(columns.parent),
|
|
|
|
|
index("payload_locked_documents_rels_path_idx").on(columns.path),
|
|
|
|
|
index("payload_locked_documents_rels_users_id_idx").on(columns.usersID),
|
|
|
|
|
index("payload_locked_documents_rels_media_id_idx").on(columns.mediaID),
|
|
|
|
|
index("payload_locked_documents_rels_projects_id_idx").on(
|
|
|
|
|
columns.projectsID,
|
|
|
|
|
),
|
|
|
|
|
index("payload_locked_documents_rels_technologies_id_idx").on(
|
|
|
|
|
columns.technologiesID,
|
|
|
|
|
),
|
|
|
|
|
index("payload_locked_documents_rels_links_id_idx").on(columns.linksID),
|
|
|
|
|
foreignKey({
|
|
|
|
|
columns: [columns["parent"]],
|
|
|
|
|
foreignColumns: [payload_locked_documents.id],
|
|
|
|
|
name: "payload_locked_documents_rels_parent_fk",
|
|
|
|
|
}).onDelete("cascade"),
|
|
|
|
|
foreignKey({
|
|
|
|
|
columns: [columns["usersID"]],
|
|
|
|
|
foreignColumns: [users.id],
|
|
|
|
|
name: "payload_locked_documents_rels_users_fk",
|
|
|
|
|
}).onDelete("cascade"),
|
|
|
|
|
foreignKey({
|
|
|
|
|
columns: [columns["mediaID"]],
|
|
|
|
|
foreignColumns: [media.id],
|
|
|
|
|
name: "payload_locked_documents_rels_media_fk",
|
|
|
|
|
}).onDelete("cascade"),
|
|
|
|
|
foreignKey({
|
|
|
|
|
columns: [columns["projectsID"]],
|
|
|
|
|
foreignColumns: [projects.id],
|
|
|
|
|
name: "payload_locked_documents_rels_projects_fk",
|
|
|
|
|
}).onDelete("cascade"),
|
|
|
|
|
foreignKey({
|
|
|
|
|
columns: [columns["technologiesID"]],
|
|
|
|
|
foreignColumns: [technologies.id],
|
|
|
|
|
name: "payload_locked_documents_rels_technologies_fk",
|
|
|
|
|
}).onDelete("cascade"),
|
|
|
|
|
foreignKey({
|
|
|
|
|
columns: [columns["linksID"]],
|
|
|
|
|
foreignColumns: [links.id],
|
|
|
|
|
name: "payload_locked_documents_rels_links_fk",
|
|
|
|
|
}).onDelete("cascade"),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
export const payload_preferences = pgTable(
|
|
|
|
|
"payload_preferences",
|
|
|
|
|
{
|
|
|
|
|
id: serial("id").primaryKey(),
|
|
|
|
|
key: varchar("key"),
|
|
|
|
|
value: jsonb("value"),
|
|
|
|
|
updatedAt: timestamp("updated_at", {
|
|
|
|
|
mode: "string",
|
|
|
|
|
withTimezone: true,
|
|
|
|
|
precision: 3,
|
|
|
|
|
})
|
|
|
|
|
.defaultNow()
|
|
|
|
|
.notNull(),
|
|
|
|
|
createdAt: timestamp("created_at", {
|
|
|
|
|
mode: "string",
|
|
|
|
|
withTimezone: true,
|
|
|
|
|
precision: 3,
|
|
|
|
|
})
|
|
|
|
|
.defaultNow()
|
|
|
|
|
.notNull(),
|
|
|
|
|
},
|
|
|
|
|
(columns) => [
|
|
|
|
|
index("payload_preferences_key_idx").on(columns.key),
|
|
|
|
|
index("payload_preferences_updated_at_idx").on(columns.updatedAt),
|
|
|
|
|
index("payload_preferences_created_at_idx").on(columns.createdAt),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
export const payload_preferences_rels = pgTable(
|
|
|
|
|
"payload_preferences_rels",
|
|
|
|
|
{
|
|
|
|
|
id: serial("id").primaryKey(),
|
|
|
|
|
order: integer("order"),
|
|
|
|
|
parent: integer("parent_id").notNull(),
|
|
|
|
|
path: varchar("path").notNull(),
|
|
|
|
|
usersID: integer("users_id"),
|
|
|
|
|
},
|
|
|
|
|
(columns) => [
|
|
|
|
|
index("payload_preferences_rels_order_idx").on(columns.order),
|
|
|
|
|
index("payload_preferences_rels_parent_idx").on(columns.parent),
|
|
|
|
|
index("payload_preferences_rels_path_idx").on(columns.path),
|
|
|
|
|
index("payload_preferences_rels_users_id_idx").on(columns.usersID),
|
|
|
|
|
foreignKey({
|
|
|
|
|
columns: [columns["parent"]],
|
|
|
|
|
foreignColumns: [payload_preferences.id],
|
|
|
|
|
name: "payload_preferences_rels_parent_fk",
|
|
|
|
|
}).onDelete("cascade"),
|
|
|
|
|
foreignKey({
|
|
|
|
|
columns: [columns["usersID"]],
|
|
|
|
|
foreignColumns: [users.id],
|
|
|
|
|
name: "payload_preferences_rels_users_fk",
|
|
|
|
|
}).onDelete("cascade"),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
export const payload_migrations = pgTable(
|
|
|
|
|
"payload_migrations",
|
|
|
|
|
{
|
|
|
|
|
id: serial("id").primaryKey(),
|
|
|
|
|
name: varchar("name"),
|
|
|
|
|
batch: numeric("batch", { mode: "number" }),
|
|
|
|
|
updatedAt: timestamp("updated_at", {
|
|
|
|
|
mode: "string",
|
|
|
|
|
withTimezone: true,
|
|
|
|
|
precision: 3,
|
|
|
|
|
})
|
|
|
|
|
.defaultNow()
|
|
|
|
|
.notNull(),
|
|
|
|
|
createdAt: timestamp("created_at", {
|
|
|
|
|
mode: "string",
|
|
|
|
|
withTimezone: true,
|
|
|
|
|
precision: 3,
|
|
|
|
|
})
|
|
|
|
|
.defaultNow()
|
|
|
|
|
.notNull(),
|
|
|
|
|
},
|
|
|
|
|
(columns) => [
|
|
|
|
|
index("payload_migrations_updated_at_idx").on(columns.updatedAt),
|
|
|
|
|
index("payload_migrations_created_at_idx").on(columns.createdAt),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
export const metadata = pgTable(
|
|
|
|
|
"metadata",
|
|
|
|
|
{
|
|
|
|
|
id: serial("id").primaryKey(),
|
|
|
|
|
tagline: varchar("tagline").notNull(),
|
|
|
|
|
resume: integer("resume_id")
|
|
|
|
|
.notNull()
|
|
|
|
|
.references(() => media.id, {
|
|
|
|
|
onDelete: "set null",
|
|
|
|
|
}),
|
|
|
|
|
resumeFilename: varchar("resume_filename"),
|
|
|
|
|
updatedAt: timestamp("updated_at", {
|
|
|
|
|
mode: "string",
|
|
|
|
|
withTimezone: true,
|
|
|
|
|
precision: 3,
|
|
|
|
|
}),
|
|
|
|
|
createdAt: timestamp("created_at", {
|
|
|
|
|
mode: "string",
|
|
|
|
|
withTimezone: true,
|
|
|
|
|
precision: 3,
|
|
|
|
|
}),
|
|
|
|
|
},
|
|
|
|
|
(columns) => [index("metadata_resume_idx").on(columns.resume)],
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
export const relations_users_sessions = relations(
|
|
|
|
|
users_sessions,
|
|
|
|
|
({ one }) => ({
|
|
|
|
|
_parentID: one(users, {
|
|
|
|
|
fields: [users_sessions._parentID],
|
|
|
|
|
references: [users.id],
|
|
|
|
|
relationName: "sessions",
|
|
|
|
|
}),
|
|
|
|
|
}),
|
|
|
|
|
);
|
|
|
|
|
export const relations_users = relations(users, ({ many }) => ({
|
|
|
|
|
sessions: many(users_sessions, {
|
|
|
|
|
relationName: "sessions",
|
|
|
|
|
}),
|
|
|
|
|
}));
|
|
|
|
|
export const relations_media = relations(media, () => ({}));
|
|
|
|
|
export const relations_projects_rels = relations(projects_rels, ({ one }) => ({
|
|
|
|
|
parent: one(projects, {
|
|
|
|
|
fields: [projects_rels.parent],
|
|
|
|
|
references: [projects.id],
|
|
|
|
|
relationName: "_rels",
|
|
|
|
|
}),
|
|
|
|
|
technologiesID: one(technologies, {
|
|
|
|
|
fields: [projects_rels.technologiesID],
|
|
|
|
|
references: [technologies.id],
|
|
|
|
|
relationName: "technologies",
|
|
|
|
|
}),
|
|
|
|
|
}));
|
|
|
|
|
export const relations_projects = relations(projects, ({ one, many }) => ({
|
|
|
|
|
bannerImage: one(media, {
|
|
|
|
|
fields: [projects.bannerImage],
|
|
|
|
|
references: [media.id],
|
|
|
|
|
relationName: "bannerImage",
|
|
|
|
|
}),
|
|
|
|
|
_rels: many(projects_rels, {
|
|
|
|
|
relationName: "_rels",
|
|
|
|
|
}),
|
|
|
|
|
}));
|
|
|
|
|
export const relations_technologies = relations(technologies, () => ({}));
|
|
|
|
|
export const relations_links = relations(links, ({ one }) => ({
|
|
|
|
|
project: one(projects, {
|
|
|
|
|
fields: [links.project],
|
|
|
|
|
references: [projects.id],
|
|
|
|
|
relationName: "project",
|
|
|
|
|
}),
|
|
|
|
|
}));
|
|
|
|
|
export const relations_payload_kv = relations(payload_kv, () => ({}));
|
|
|
|
|
export const relations_payload_locked_documents_rels = relations(
|
|
|
|
|
payload_locked_documents_rels,
|
|
|
|
|
({ one }) => ({
|
|
|
|
|
parent: one(payload_locked_documents, {
|
|
|
|
|
fields: [payload_locked_documents_rels.parent],
|
|
|
|
|
references: [payload_locked_documents.id],
|
|
|
|
|
relationName: "_rels",
|
|
|
|
|
}),
|
|
|
|
|
usersID: one(users, {
|
|
|
|
|
fields: [payload_locked_documents_rels.usersID],
|
|
|
|
|
references: [users.id],
|
|
|
|
|
relationName: "users",
|
|
|
|
|
}),
|
|
|
|
|
mediaID: one(media, {
|
|
|
|
|
fields: [payload_locked_documents_rels.mediaID],
|
|
|
|
|
references: [media.id],
|
|
|
|
|
relationName: "media",
|
|
|
|
|
}),
|
|
|
|
|
projectsID: one(projects, {
|
|
|
|
|
fields: [payload_locked_documents_rels.projectsID],
|
|
|
|
|
references: [projects.id],
|
|
|
|
|
relationName: "projects",
|
|
|
|
|
}),
|
|
|
|
|
technologiesID: one(technologies, {
|
|
|
|
|
fields: [payload_locked_documents_rels.technologiesID],
|
|
|
|
|
references: [technologies.id],
|
|
|
|
|
relationName: "technologies",
|
|
|
|
|
}),
|
|
|
|
|
linksID: one(links, {
|
|
|
|
|
fields: [payload_locked_documents_rels.linksID],
|
|
|
|
|
references: [links.id],
|
|
|
|
|
relationName: "links",
|
|
|
|
|
}),
|
|
|
|
|
}),
|
|
|
|
|
);
|
|
|
|
|
export const relations_payload_locked_documents = relations(
|
|
|
|
|
payload_locked_documents,
|
|
|
|
|
({ many }) => ({
|
|
|
|
|
_rels: many(payload_locked_documents_rels, {
|
|
|
|
|
relationName: "_rels",
|
|
|
|
|
}),
|
|
|
|
|
}),
|
|
|
|
|
);
|
|
|
|
|
export const relations_payload_preferences_rels = relations(
|
|
|
|
|
payload_preferences_rels,
|
|
|
|
|
({ one }) => ({
|
|
|
|
|
parent: one(payload_preferences, {
|
|
|
|
|
fields: [payload_preferences_rels.parent],
|
|
|
|
|
references: [payload_preferences.id],
|
|
|
|
|
relationName: "_rels",
|
|
|
|
|
}),
|
|
|
|
|
usersID: one(users, {
|
|
|
|
|
fields: [payload_preferences_rels.usersID],
|
|
|
|
|
references: [users.id],
|
|
|
|
|
relationName: "users",
|
|
|
|
|
}),
|
|
|
|
|
}),
|
|
|
|
|
);
|
|
|
|
|
export const relations_payload_preferences = relations(
|
|
|
|
|
payload_preferences,
|
|
|
|
|
({ many }) => ({
|
|
|
|
|
_rels: many(payload_preferences_rels, {
|
|
|
|
|
relationName: "_rels",
|
|
|
|
|
}),
|
|
|
|
|
}),
|
|
|
|
|
);
|
|
|
|
|
export const relations_payload_migrations = relations(
|
|
|
|
|
payload_migrations,
|
|
|
|
|
() => ({}),
|
|
|
|
|
);
|
|
|
|
|
export const relations_metadata = relations(metadata, ({ one }) => ({
|
|
|
|
|
resume: one(media, {
|
|
|
|
|
fields: [metadata.resume],
|
|
|
|
|
references: [media.id],
|
|
|
|
|
relationName: "resume",
|
|
|
|
|
}),
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
type DatabaseSchema = {
|
|
|
|
|
enum_projects_status: typeof enum_projects_status;
|
|
|
|
|
users_sessions: typeof users_sessions;
|
|
|
|
|
users: typeof users;
|
|
|
|
|
media: typeof media;
|
|
|
|
|
projects: typeof projects;
|
|
|
|
|
projects_rels: typeof projects_rels;
|
|
|
|
|
technologies: typeof technologies;
|
|
|
|
|
links: typeof links;
|
|
|
|
|
payload_kv: typeof payload_kv;
|
|
|
|
|
payload_locked_documents: typeof payload_locked_documents;
|
|
|
|
|
payload_locked_documents_rels: typeof payload_locked_documents_rels;
|
|
|
|
|
payload_preferences: typeof payload_preferences;
|
|
|
|
|
payload_preferences_rels: typeof payload_preferences_rels;
|
|
|
|
|
payload_migrations: typeof payload_migrations;
|
|
|
|
|
metadata: typeof metadata;
|
|
|
|
|
relations_users_sessions: typeof relations_users_sessions;
|
|
|
|
|
relations_users: typeof relations_users;
|
|
|
|
|
relations_media: typeof relations_media;
|
|
|
|
|
relations_projects_rels: typeof relations_projects_rels;
|
|
|
|
|
relations_projects: typeof relations_projects;
|
|
|
|
|
relations_technologies: typeof relations_technologies;
|
|
|
|
|
relations_links: typeof relations_links;
|
|
|
|
|
relations_payload_kv: typeof relations_payload_kv;
|
|
|
|
|
relations_payload_locked_documents_rels: typeof relations_payload_locked_documents_rels;
|
|
|
|
|
relations_payload_locked_documents: typeof relations_payload_locked_documents;
|
|
|
|
|
relations_payload_preferences_rels: typeof relations_payload_preferences_rels;
|
|
|
|
|
relations_payload_preferences: typeof relations_payload_preferences;
|
|
|
|
|
relations_payload_migrations: typeof relations_payload_migrations;
|
|
|
|
|
relations_metadata: typeof relations_metadata;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
declare module "@payloadcms/db-postgres" {
|
|
|
|
|
export interface GeneratedDatabaseSchema {
|
|
|
|
|
schema: DatabaseSchema;
|
|
|
|
|
}
|
|
|
|
|
}
|