4796 lines
168 KiB
TypeScript
4796 lines
168 KiB
TypeScript
/* 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 { geometryColumn } from "@payloadcms/db-postgres";
|
|
import {
|
|
type AnyPgColumn,
|
|
boolean,
|
|
foreignKey,
|
|
index,
|
|
integer,
|
|
jsonb,
|
|
numeric,
|
|
pgEnum,
|
|
pgTable,
|
|
serial,
|
|
timestamp,
|
|
uniqueIndex,
|
|
varchar,
|
|
} from "@payloadcms/db-postgres/drizzle/pg-core";
|
|
import { relations } from "@payloadcms/db-postgres/drizzle";
|
|
|
|
export const enum_game_vehicles_status = pgEnum("enum_game_vehicles_status", [
|
|
"idle",
|
|
"assigned",
|
|
"in_transit",
|
|
"damaged",
|
|
"destroyed",
|
|
]);
|
|
export const enum_game_event_logs_target_collection = pgEnum(
|
|
"enum_game_event_logs_target_collection",
|
|
[
|
|
"game-structures",
|
|
"game-vehicles",
|
|
"game-npcs",
|
|
"structures",
|
|
"resources",
|
|
"assets",
|
|
"vehicles",
|
|
"factions",
|
|
"missions",
|
|
"campaigns",
|
|
"users",
|
|
"technologies",
|
|
"maps",
|
|
"shipments",
|
|
"bank-accounts",
|
|
"bank-transactions",
|
|
"ledger-entries",
|
|
"locker-storages",
|
|
"loadouts",
|
|
"market-listings",
|
|
"market-negotiations",
|
|
],
|
|
);
|
|
export const enum_users_roles = pgEnum("enum_users_roles", ["guest", "user", "admin", "developer"]);
|
|
export const enum_awards_type = pgEnum("enum_awards_type", ["commendation", "ribbon", "medal"]);
|
|
export const enum_assignments_type = pgEnum("enum_assignments_type", [
|
|
"division",
|
|
"squad",
|
|
"team",
|
|
"special",
|
|
]);
|
|
export const enum_missions_factions_involved_threat_level = pgEnum(
|
|
"enum_missions_factions_involved_threat_level",
|
|
["ally", "friendly", "neutral", "hostile"],
|
|
);
|
|
export const enum_missions_logistics_and_support_insertion = pgEnum(
|
|
"enum_missions_logistics_and_support_insertion",
|
|
["helicopter", "aircraft", "paradrop", "boat", "car", "onFoot"],
|
|
);
|
|
export const enum_missions_logistics_and_support_extraction = pgEnum(
|
|
"enum_missions_logistics_and_support_extraction",
|
|
["helicopter", "aircraft", "paradrop", "boat", "car", "onFoot"],
|
|
);
|
|
export const enum_missions_operation_type = pgEnum("enum_missions_operation_type", [
|
|
"main",
|
|
"side",
|
|
"external",
|
|
]);
|
|
export const enum_missions_classification_mission_type = pgEnum(
|
|
"enum_missions_classification_mission_type",
|
|
["Zeus", "PvE", "PvP", "PvPvE", "Training", "Special"],
|
|
);
|
|
export const enum_missions_ownership_and_status_status = pgEnum(
|
|
"enum_missions_ownership_and_status_status",
|
|
["Concept", "Planning", "Ready", "Scheduled", "Active", "Completed", "Cancelled"],
|
|
);
|
|
export const enum_missions_ownership_and_status_visibility = pgEnum(
|
|
"enum_missions_ownership_and_status_visibility",
|
|
["unit", "leadership", "intel", "private"],
|
|
);
|
|
export const enum_missions_civilian_presence = pgEnum("enum_missions_civilian_presence", [
|
|
"None",
|
|
"Low",
|
|
"Medium",
|
|
"High",
|
|
]);
|
|
export const enum_campaigns_status = pgEnum("enum_campaigns_status", [
|
|
"concept",
|
|
"inProgress",
|
|
"completed",
|
|
]);
|
|
export const enum_factions_type = pgEnum("enum_factions_type", [
|
|
"majorFaction",
|
|
"minorFaction",
|
|
"corporation",
|
|
"special",
|
|
]);
|
|
export const enum_technologies_approval_status = pgEnum("enum_technologies_approval_status", [
|
|
"in_progress",
|
|
"ready_for_review",
|
|
"approved",
|
|
"rejected",
|
|
"revision_requested",
|
|
]);
|
|
export const enum_technologies_type = pgEnum("enum_technologies_type", ["asset", "upgrade"]);
|
|
export const enum_assets_skin_configuration_applies_to_asset_types = pgEnum(
|
|
"enum_assets_skin_configuration_applies_to_asset_types",
|
|
["weapon", "uniform", "vest", "backpack", "helmet"],
|
|
);
|
|
export const enum_assets_approval_status = pgEnum("enum_assets_approval_status", [
|
|
"in_progress",
|
|
"ready_for_review",
|
|
"approved",
|
|
"rejected",
|
|
"revision_requested",
|
|
]);
|
|
export const enum_assets_asset_type = pgEnum("enum_assets_asset_type", [
|
|
"weapon",
|
|
"magazine",
|
|
"optic",
|
|
"muzzle",
|
|
"bipod",
|
|
"uniform",
|
|
"vest",
|
|
"backpack",
|
|
"helmet",
|
|
"facewear",
|
|
"nvg",
|
|
"radio",
|
|
"medical",
|
|
"tool",
|
|
"explosive",
|
|
"skin",
|
|
"miscellaneous",
|
|
]);
|
|
export const enum_assets_weapon_configuration_slot_type = pgEnum(
|
|
"enum_assets_weapon_configuration_slot_type",
|
|
["primary", "secondary", "launcher"],
|
|
);
|
|
export const enum_assets_nightvision_configuration_nvg_generation = pgEnum(
|
|
"enum_assets_nightvision_configuration_nvg_generation",
|
|
["gen1", "gen2", "gen3"],
|
|
);
|
|
export const enum_assets_market_trading_rarity = pgEnum("enum_assets_market_trading_rarity", [
|
|
"basic",
|
|
"common",
|
|
"uncommon",
|
|
"rare",
|
|
"veryRare",
|
|
"epic",
|
|
"legendary",
|
|
"unique",
|
|
]);
|
|
export const enum_resources_approval_status = pgEnum("enum_resources_approval_status", [
|
|
"in_progress",
|
|
"ready_for_review",
|
|
"approved",
|
|
"rejected",
|
|
"revision_requested",
|
|
]);
|
|
export const enum_resources_type = pgEnum("enum_resources_type", [
|
|
"physical",
|
|
"fluid",
|
|
"energy",
|
|
"abstract",
|
|
]);
|
|
export const enum_resources_rarity = pgEnum("enum_resources_rarity", [
|
|
"common",
|
|
"uncommon",
|
|
"rare",
|
|
"epic",
|
|
"legendary",
|
|
"exotic",
|
|
"unique",
|
|
]);
|
|
export const enum_vehicles_category = pgEnum("enum_vehicles_category", [
|
|
"civilian",
|
|
"utility",
|
|
"transport",
|
|
"weaponized",
|
|
"military",
|
|
]);
|
|
export const enum_vehicles_pylons_pylon_type = pgEnum("enum_vehicles_pylons_pylon_type", [
|
|
"mountedWeapon",
|
|
"pylon",
|
|
]);
|
|
export const enum_vehicles_approval_status = pgEnum("enum_vehicles_approval_status", [
|
|
"in_progress",
|
|
"ready_for_review",
|
|
"approved",
|
|
"rejected",
|
|
"revision_requested",
|
|
]);
|
|
export const enum_vehicles_armor_rating = pgEnum("enum_vehicles_armor_rating", [
|
|
"none",
|
|
"light",
|
|
"medium",
|
|
"heavy",
|
|
"composite",
|
|
]);
|
|
export const enum_structures_approval_status = pgEnum("enum_structures_approval_status", [
|
|
"in_progress",
|
|
"ready_for_review",
|
|
"approved",
|
|
"rejected",
|
|
"revision_requested",
|
|
]);
|
|
export const enum_structures_category = pgEnum("enum_structures_category", [
|
|
"logistics",
|
|
"military",
|
|
"civilian",
|
|
]);
|
|
export const enum_structures_terrain_type = pgEnum("enum_structures_terrain_type", [
|
|
"land",
|
|
"water",
|
|
]);
|
|
export const enum_structures_function_type = pgEnum("enum_structures_function_type", [
|
|
"producer",
|
|
"storage",
|
|
"sensor",
|
|
"converter",
|
|
"defense",
|
|
"miscellaneous",
|
|
]);
|
|
export const enum_shipments_status = pgEnum("enum_shipments_status", [
|
|
"pending",
|
|
"dispatched",
|
|
"in_transit",
|
|
"arrived",
|
|
"completed",
|
|
"cancelled",
|
|
"failed",
|
|
"stranded",
|
|
]);
|
|
export const enum_bank_accounts_account_type = pgEnum("enum_bank_accounts_account_type", [
|
|
"treasury",
|
|
"faction",
|
|
"personal",
|
|
]);
|
|
export const enum_bank_accounts_status = pgEnum("enum_bank_accounts_status", [
|
|
"open",
|
|
"frozen",
|
|
"closed",
|
|
]);
|
|
export const enum_bank_transactions_type = pgEnum("enum_bank_transactions_type", [
|
|
"deposit",
|
|
"withdrawal",
|
|
"transfer",
|
|
"payment",
|
|
"fee",
|
|
"salary",
|
|
"adjustment",
|
|
]);
|
|
export const enum_bank_transactions_status = pgEnum("enum_bank_transactions_status", [
|
|
"completed",
|
|
"reversed",
|
|
]);
|
|
export const enum_ledger_entries_type = pgEnum("enum_ledger_entries_type", [
|
|
"deposit",
|
|
"withdrawal",
|
|
"transfer",
|
|
"payment",
|
|
"fee",
|
|
"salary",
|
|
"adjustment",
|
|
]);
|
|
export const enum_market_listings_status = pgEnum("enum_market_listings_status", [
|
|
"active",
|
|
"sold",
|
|
"cancelled",
|
|
"expired",
|
|
]);
|
|
export const enum_market_negotiations_history_from = pgEnum(
|
|
"enum_market_negotiations_history_from",
|
|
["buyer", "seller"],
|
|
);
|
|
export const enum_market_negotiations_status = pgEnum("enum_market_negotiations_status", [
|
|
"open",
|
|
"accepted",
|
|
"rejected",
|
|
"closed",
|
|
"cancelled",
|
|
"expired",
|
|
]);
|
|
export const enum_market_negotiations_proposed_by = pgEnum("enum_market_negotiations_proposed_by", [
|
|
"buyer",
|
|
"seller",
|
|
]);
|
|
export const enum_narrative_events_triggers_type = pgEnum("enum_narrative_events_triggers_type", [
|
|
"manual",
|
|
"mission_complete",
|
|
"timer",
|
|
"condition",
|
|
]);
|
|
|
|
export const media = pgTable(
|
|
"media",
|
|
{
|
|
id: serial("id").primaryKey(),
|
|
alt: varchar("alt"),
|
|
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 game_hard_resources = pgTable(
|
|
"game_hard_resources",
|
|
{
|
|
id: serial("id").primaryKey(),
|
|
name: varchar("name").notNull(),
|
|
amount: numeric("amount", { mode: "number" }).notNull().default(0),
|
|
description: jsonb("description").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(),
|
|
},
|
|
(columns) => [
|
|
uniqueIndex("game_hard_resources_name_idx").on(columns.name),
|
|
index("game_hard_resources_updated_at_idx").on(columns.updatedAt),
|
|
index("game_hard_resources_created_at_idx").on(columns.createdAt),
|
|
],
|
|
);
|
|
|
|
export const game_structures_stored_resources = pgTable(
|
|
"game_structures_stored_resources",
|
|
{
|
|
_order: integer("_order").notNull(),
|
|
_parentID: integer("_parent_id").notNull(),
|
|
id: varchar("id").primaryKey(),
|
|
resource: integer("resource_id")
|
|
.notNull()
|
|
.references(() => resources.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
amount: numeric("amount", { mode: "number" }).notNull(),
|
|
gridX: numeric("grid_x", { mode: "number" }).notNull(),
|
|
gridY: numeric("grid_y", { mode: "number" }).notNull(),
|
|
rotated: boolean("rotated").default(false),
|
|
},
|
|
(columns) => [
|
|
index("game_structures_stored_resources_order_idx").on(columns._order),
|
|
index("game_structures_stored_resources_parent_id_idx").on(columns._parentID),
|
|
index("game_structures_stored_resources_resource_idx").on(columns.resource),
|
|
foreignKey({
|
|
columns: [columns["_parentID"]],
|
|
foreignColumns: [game_structures.id],
|
|
name: "game_structures_stored_resources_parent_id_fk",
|
|
}).onDelete("cascade"),
|
|
],
|
|
);
|
|
|
|
export const game_structures_void_storage = pgTable(
|
|
"game_structures_void_storage",
|
|
{
|
|
_order: integer("_order").notNull(),
|
|
_parentID: integer("_parent_id").notNull(),
|
|
id: varchar("id").primaryKey(),
|
|
resource: integer("resource_id")
|
|
.notNull()
|
|
.references(() => resources.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
amount: numeric("amount", { mode: "number" }).notNull(),
|
|
gridX: numeric("grid_x", { mode: "number" }).notNull(),
|
|
gridY: numeric("grid_y", { mode: "number" }).notNull(),
|
|
rotated: boolean("rotated").default(false),
|
|
},
|
|
(columns) => [
|
|
index("game_structures_void_storage_order_idx").on(columns._order),
|
|
index("game_structures_void_storage_parent_id_idx").on(columns._parentID),
|
|
index("game_structures_void_storage_resource_idx").on(columns.resource),
|
|
foreignKey({
|
|
columns: [columns["_parentID"]],
|
|
foreignColumns: [game_structures.id],
|
|
name: "game_structures_void_storage_parent_id_fk",
|
|
}).onDelete("cascade"),
|
|
],
|
|
);
|
|
|
|
export const game_structures = pgTable(
|
|
"game_structures",
|
|
{
|
|
id: serial("id").primaryKey(),
|
|
name: varchar("name").notNull(),
|
|
type: integer("type_id")
|
|
.notNull()
|
|
.references(() => structures.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
faction: integer("faction_id").references(() => factions.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
coordinates: geometryColumn("coordinates"),
|
|
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("game_structures_type_idx").on(columns.type),
|
|
index("game_structures_faction_idx").on(columns.faction),
|
|
index("game_structures_updated_at_idx").on(columns.updatedAt),
|
|
index("game_structures_created_at_idx").on(columns.createdAt),
|
|
],
|
|
);
|
|
|
|
export const game_vehicles_stored_resources = pgTable(
|
|
"game_vehicles_stored_resources",
|
|
{
|
|
_order: integer("_order").notNull(),
|
|
_parentID: integer("_parent_id").notNull(),
|
|
id: varchar("id").primaryKey(),
|
|
resource: integer("resource_id")
|
|
.notNull()
|
|
.references(() => resources.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
amount: numeric("amount", { mode: "number" }).notNull(),
|
|
gridX: numeric("grid_x", { mode: "number" }).notNull(),
|
|
gridY: numeric("grid_y", { mode: "number" }).notNull(),
|
|
rotated: boolean("rotated").default(false),
|
|
},
|
|
(columns) => [
|
|
index("game_vehicles_stored_resources_order_idx").on(columns._order),
|
|
index("game_vehicles_stored_resources_parent_id_idx").on(columns._parentID),
|
|
index("game_vehicles_stored_resources_resource_idx").on(columns.resource),
|
|
foreignKey({
|
|
columns: [columns["_parentID"]],
|
|
foreignColumns: [game_vehicles.id],
|
|
name: "game_vehicles_stored_resources_parent_id_fk",
|
|
}).onDelete("cascade"),
|
|
],
|
|
);
|
|
|
|
export const game_vehicles_void_storage = pgTable(
|
|
"game_vehicles_void_storage",
|
|
{
|
|
_order: integer("_order").notNull(),
|
|
_parentID: integer("_parent_id").notNull(),
|
|
id: varchar("id").primaryKey(),
|
|
resource: integer("resource_id")
|
|
.notNull()
|
|
.references(() => resources.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
amount: numeric("amount", { mode: "number" }).notNull(),
|
|
gridX: numeric("grid_x", { mode: "number" }).notNull(),
|
|
gridY: numeric("grid_y", { mode: "number" }).notNull(),
|
|
rotated: boolean("rotated").default(false),
|
|
},
|
|
(columns) => [
|
|
index("game_vehicles_void_storage_order_idx").on(columns._order),
|
|
index("game_vehicles_void_storage_parent_id_idx").on(columns._parentID),
|
|
index("game_vehicles_void_storage_resource_idx").on(columns.resource),
|
|
foreignKey({
|
|
columns: [columns["_parentID"]],
|
|
foreignColumns: [game_vehicles.id],
|
|
name: "game_vehicles_void_storage_parent_id_fk",
|
|
}).onDelete("cascade"),
|
|
],
|
|
);
|
|
|
|
export const game_vehicles = pgTable(
|
|
"game_vehicles",
|
|
{
|
|
id: serial("id").primaryKey(),
|
|
name: varchar("name").notNull(),
|
|
type: integer("type_id")
|
|
.notNull()
|
|
.references(() => vehicles.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
deployedAt: integer("deployed_at_id").references(() => game_structures.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
faction: integer("faction_id").references(() => factions.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
status: enum_game_vehicles_status("status").notNull().default("idle"),
|
|
currentFuel: numeric("current_fuel", { mode: "number" }).notNull().default(0),
|
|
currentHealth: numeric("current_health", { mode: "number" }).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(),
|
|
},
|
|
(columns) => [
|
|
index("game_vehicles_type_idx").on(columns.type),
|
|
index("game_vehicles_deployed_at_idx").on(columns.deployedAt),
|
|
index("game_vehicles_faction_idx").on(columns.faction),
|
|
index("game_vehicles_updated_at_idx").on(columns.updatedAt),
|
|
index("game_vehicles_created_at_idx").on(columns.createdAt),
|
|
],
|
|
);
|
|
|
|
export const game_npcs = pgTable(
|
|
"game_npcs",
|
|
{
|
|
id: serial("id").primaryKey(),
|
|
name: varchar("name").notNull(),
|
|
occupation: varchar("occupation"),
|
|
location: integer("location_id").references(() => game_structures.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
faction: integer("faction_id").references(() => factions.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
bio: varchar("bio"),
|
|
isGenerated: boolean("is_generated").default(false),
|
|
isInGame: boolean("is_in_game").default(true),
|
|
vendor_enabled: boolean("vendor_enabled").default(false),
|
|
vendor_priceModifier: numeric("vendor_price_modifier", { mode: "number" }).default(1),
|
|
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("game_npcs_location_idx").on(columns.location),
|
|
index("game_npcs_faction_idx").on(columns.faction),
|
|
index("game_npcs_updated_at_idx").on(columns.updatedAt),
|
|
index("game_npcs_created_at_idx").on(columns.createdAt),
|
|
],
|
|
);
|
|
|
|
export const game_npcs_rels = pgTable(
|
|
"game_npcs_rels",
|
|
{
|
|
id: serial("id").primaryKey(),
|
|
order: integer("order"),
|
|
parent: integer("parent_id").notNull(),
|
|
path: varchar("path").notNull(),
|
|
assetsID: integer("assets_id"),
|
|
},
|
|
(columns) => [
|
|
index("game_npcs_rels_order_idx").on(columns.order),
|
|
index("game_npcs_rels_parent_idx").on(columns.parent),
|
|
index("game_npcs_rels_path_idx").on(columns.path),
|
|
index("game_npcs_rels_assets_id_idx").on(columns.assetsID),
|
|
foreignKey({
|
|
columns: [columns["parent"]],
|
|
foreignColumns: [game_npcs.id],
|
|
name: "game_npcs_rels_parent_fk",
|
|
}).onDelete("cascade"),
|
|
foreignKey({
|
|
columns: [columns["assetsID"]],
|
|
foreignColumns: [assets.id],
|
|
name: "game_npcs_rels_assets_fk",
|
|
}).onDelete("cascade"),
|
|
],
|
|
);
|
|
|
|
export const game_event_logs = pgTable(
|
|
"game_event_logs",
|
|
{
|
|
id: serial("id").primaryKey(),
|
|
system: boolean("system").default(true),
|
|
timestamp: timestamp("timestamp", {
|
|
mode: "string",
|
|
withTimezone: true,
|
|
precision: 3,
|
|
}).notNull(),
|
|
type: varchar("type").notNull(),
|
|
message: varchar("message").notNull(),
|
|
actor: integer("actor_id").references(() => users.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
structure: integer("structure_id").references(() => game_structures.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
targetCollection: enum_game_event_logs_target_collection("target_collection"),
|
|
targetId: numeric("target_id", { mode: "number" }),
|
|
data: jsonb("data"),
|
|
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("game_event_logs_type_idx").on(columns.type),
|
|
index("game_event_logs_actor_idx").on(columns.actor),
|
|
index("game_event_logs_structure_idx").on(columns.structure),
|
|
index("game_event_logs_updated_at_idx").on(columns.updatedAt),
|
|
index("game_event_logs_created_at_idx").on(columns.createdAt),
|
|
],
|
|
);
|
|
|
|
export const users_roles = pgTable(
|
|
"users_roles",
|
|
{
|
|
order: integer("order").notNull(),
|
|
parent: integer("parent_id").notNull(),
|
|
value: enum_users_roles("value"),
|
|
id: serial("id").primaryKey(),
|
|
},
|
|
(columns) => [
|
|
index("users_roles_order_idx").on(columns.order),
|
|
index("users_roles_parent_idx").on(columns.parent),
|
|
foreignKey({
|
|
columns: [columns["parent"]],
|
|
foreignColumns: [users.id],
|
|
name: "users_roles_parent_fk",
|
|
}).onDelete("cascade"),
|
|
],
|
|
);
|
|
|
|
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(),
|
|
discordUsername: varchar("discord_username").notNull(),
|
|
displayName: varchar("display_name").notNull(),
|
|
payloadDisplayName: varchar("payload_display_name"),
|
|
steamId: varchar("steam_id").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(),
|
|
email: varchar("email"),
|
|
username: varchar("username").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) => [
|
|
uniqueIndex("users_discord_username_idx").on(columns.discordUsername),
|
|
index("users_updated_at_idx").on(columns.updatedAt),
|
|
index("users_created_at_idx").on(columns.createdAt),
|
|
uniqueIndex("users_username_idx").on(columns.username),
|
|
],
|
|
);
|
|
|
|
export const ranks = pgTable(
|
|
"ranks",
|
|
{
|
|
id: serial("id").primaryKey(),
|
|
_order: varchar("_order"),
|
|
name: varchar("name").notNull(),
|
|
abbreviation: varchar("abbreviation").notNull(),
|
|
description: varchar("description").notNull(),
|
|
insignia: integer("insignia_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("ranks__order_idx").on(columns._order),
|
|
uniqueIndex("ranks_name_idx").on(columns.name),
|
|
uniqueIndex("ranks_abbreviation_idx").on(columns.abbreviation),
|
|
index("ranks_insignia_idx").on(columns.insignia),
|
|
index("ranks_updated_at_idx").on(columns.updatedAt),
|
|
index("ranks_created_at_idx").on(columns.createdAt),
|
|
],
|
|
);
|
|
|
|
export const profiles = pgTable(
|
|
"profiles",
|
|
{
|
|
id: serial("id").primaryKey(),
|
|
user: integer("user_id")
|
|
.notNull()
|
|
.references(() => users.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
rank: integer("rank_id")
|
|
.notNull()
|
|
.references(() => ranks.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
dossier_personalExcerpt: varchar("dossier_personal_excerpt"),
|
|
dossier_intelExcerpt: jsonb("dossier_intel_excerpt"),
|
|
progression_scoreboard_infantryKills: numeric("progression_scoreboard_infantry_kills", {
|
|
mode: "number",
|
|
}).default(0),
|
|
progression_scoreboard_vehicleKills: numeric("progression_scoreboard_vehicle_kills", {
|
|
mode: "number",
|
|
}).default(0),
|
|
progression_scoreboard_armorKills: numeric("progression_scoreboard_armor_kills", {
|
|
mode: "number",
|
|
}).default(0),
|
|
progression_scoreboard_airKills: numeric("progression_scoreboard_air_kills", {
|
|
mode: "number",
|
|
}).default(0),
|
|
progression_scoreboard_deaths: numeric("progression_scoreboard_deaths", {
|
|
mode: "number",
|
|
}).default(0),
|
|
progression_minigames_flappyBird_gamesPlayed: numeric(
|
|
"progression_minigames_flappy_bird_games_played",
|
|
{ mode: "number" },
|
|
).default(0),
|
|
progression_minigames_flappyBird_totalPasses: numeric(
|
|
"progression_minigames_flappy_bird_total_passes",
|
|
{ mode: "number" },
|
|
).default(0),
|
|
progression_minigames_flappyBird_bestScore: numeric(
|
|
"progression_minigames_flappy_bird_best_score",
|
|
{ mode: "number" },
|
|
).default(0),
|
|
progression_minigames_flappyBird_xpEarned: numeric(
|
|
"progression_minigames_flappy_bird_xp_earned",
|
|
{ mode: "number" },
|
|
).default(0),
|
|
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("profiles_user_idx").on(columns.user),
|
|
index("profiles_rank_idx").on(columns.rank),
|
|
index("profiles_updated_at_idx").on(columns.updatedAt),
|
|
index("profiles_created_at_idx").on(columns.createdAt),
|
|
],
|
|
);
|
|
|
|
export const profiles_rels = pgTable(
|
|
"profiles_rels",
|
|
{
|
|
id: serial("id").primaryKey(),
|
|
order: integer("order"),
|
|
parent: integer("parent_id").notNull(),
|
|
path: varchar("path").notNull(),
|
|
awardsID: integer("awards_id"),
|
|
qualificationsID: integer("qualifications_id"),
|
|
},
|
|
(columns) => [
|
|
index("profiles_rels_order_idx").on(columns.order),
|
|
index("profiles_rels_parent_idx").on(columns.parent),
|
|
index("profiles_rels_path_idx").on(columns.path),
|
|
index("profiles_rels_awards_id_idx").on(columns.awardsID),
|
|
index("profiles_rels_qualifications_id_idx").on(columns.qualificationsID),
|
|
foreignKey({
|
|
columns: [columns["parent"]],
|
|
foreignColumns: [profiles.id],
|
|
name: "profiles_rels_parent_fk",
|
|
}).onDelete("cascade"),
|
|
foreignKey({
|
|
columns: [columns["awardsID"]],
|
|
foreignColumns: [awards.id],
|
|
name: "profiles_rels_awards_fk",
|
|
}).onDelete("cascade"),
|
|
foreignKey({
|
|
columns: [columns["qualificationsID"]],
|
|
foreignColumns: [qualifications.id],
|
|
name: "profiles_rels_qualifications_fk",
|
|
}).onDelete("cascade"),
|
|
],
|
|
);
|
|
|
|
export const awards = pgTable(
|
|
"awards",
|
|
{
|
|
id: serial("id").primaryKey(),
|
|
name: varchar("name").notNull(),
|
|
description: jsonb("description").notNull(),
|
|
type: enum_awards_type("type").default("commendation"),
|
|
image: integer("image_id").references(() => media.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
experiencePoints: numeric("experience_points", { mode: "number" }),
|
|
ribbonDesign: jsonb("ribbon_design"),
|
|
medalDesign: jsonb("medal_design"),
|
|
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) => [
|
|
uniqueIndex("awards_name_idx").on(columns.name),
|
|
index("awards_image_idx").on(columns.image),
|
|
index("awards_updated_at_idx").on(columns.updatedAt),
|
|
index("awards_created_at_idx").on(columns.createdAt),
|
|
],
|
|
);
|
|
|
|
export const qualifications = pgTable(
|
|
"qualifications",
|
|
{
|
|
id: serial("id").primaryKey(),
|
|
name: varchar("name").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(),
|
|
},
|
|
(columns) => [
|
|
uniqueIndex("qualifications_name_idx").on(columns.name),
|
|
index("qualifications_updated_at_idx").on(columns.updatedAt),
|
|
index("qualifications_created_at_idx").on(columns.createdAt),
|
|
],
|
|
);
|
|
|
|
export const assignments = pgTable(
|
|
"assignments",
|
|
{
|
|
id: serial("id").primaryKey(),
|
|
name: varchar("name").notNull(),
|
|
type: enum_assignments_type("type").notNull(),
|
|
callsign: varchar("callsign"),
|
|
description: jsonb("description"),
|
|
leader: integer("leader_id").references(() => users.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("assignments_leader_idx").on(columns.leader),
|
|
index("assignments_updated_at_idx").on(columns.updatedAt),
|
|
index("assignments_created_at_idx").on(columns.createdAt),
|
|
],
|
|
);
|
|
|
|
export const assignments_rels = pgTable(
|
|
"assignments_rels",
|
|
{
|
|
id: serial("id").primaryKey(),
|
|
order: integer("order"),
|
|
parent: integer("parent_id").notNull(),
|
|
path: varchar("path").notNull(),
|
|
assignmentsID: integer("assignments_id"),
|
|
usersID: integer("users_id"),
|
|
},
|
|
(columns) => [
|
|
index("assignments_rels_order_idx").on(columns.order),
|
|
index("assignments_rels_parent_idx").on(columns.parent),
|
|
index("assignments_rels_path_idx").on(columns.path),
|
|
index("assignments_rels_assignments_id_idx").on(columns.assignmentsID),
|
|
index("assignments_rels_users_id_idx").on(columns.usersID),
|
|
foreignKey({
|
|
columns: [columns["parent"]],
|
|
foreignColumns: [assignments.id],
|
|
name: "assignments_rels_parent_fk",
|
|
}).onDelete("cascade"),
|
|
foreignKey({
|
|
columns: [columns["assignmentsID"]],
|
|
foreignColumns: [assignments.id],
|
|
name: "assignments_rels_assignments_fk",
|
|
}).onDelete("cascade"),
|
|
foreignKey({
|
|
columns: [columns["usersID"]],
|
|
foreignColumns: [users.id],
|
|
name: "assignments_rels_users_fk",
|
|
}).onDelete("cascade"),
|
|
],
|
|
);
|
|
|
|
export const experience = pgTable(
|
|
"experience",
|
|
{
|
|
id: serial("id").primaryKey(),
|
|
name: varchar("name").notNull(),
|
|
requiredPoints: numeric("required_points", { mode: "number" }).notNull(),
|
|
description: jsonb("description").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(),
|
|
},
|
|
(columns) => [
|
|
uniqueIndex("experience_name_idx").on(columns.name),
|
|
index("experience_updated_at_idx").on(columns.updatedAt),
|
|
index("experience_created_at_idx").on(columns.createdAt),
|
|
],
|
|
);
|
|
|
|
export const user_notifications = pgTable(
|
|
"user_notifications",
|
|
{
|
|
id: serial("id").primaryKey(),
|
|
user: integer("user_id")
|
|
.notNull()
|
|
.references(() => users.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
type: varchar("type"),
|
|
title: varchar("title").notNull(),
|
|
message: varchar("message"),
|
|
link: varchar("link"),
|
|
read: boolean("read").default(false),
|
|
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("user_notifications_user_idx").on(columns.user),
|
|
index("user_notifications_read_idx").on(columns.read),
|
|
index("user_notifications_updated_at_idx").on(columns.updatedAt),
|
|
index("user_notifications_created_at_idx").on(columns.createdAt),
|
|
],
|
|
);
|
|
|
|
export const missions_mission_roles_provided_roles = pgTable(
|
|
"missions_mission_roles_provided_roles",
|
|
{
|
|
_order: integer("_order").notNull(),
|
|
_parentID: integer("_parent_id").notNull(),
|
|
id: varchar("id").primaryKey(),
|
|
roleName: varchar("role_name").notNull(),
|
|
missionCritical: boolean("mission_critical").default(true),
|
|
minimumRank: integer("minimum_rank_id").references(() => ranks.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
},
|
|
(columns) => [
|
|
index("missions_mission_roles_provided_roles_order_idx").on(columns._order),
|
|
index("missions_mission_roles_provided_roles_parent_id_idx").on(columns._parentID),
|
|
index("missions_mission_roles_provided_roles_minimum_rank_idx").on(columns.minimumRank),
|
|
foreignKey({
|
|
columns: [columns["_parentID"]],
|
|
foreignColumns: [missions.id],
|
|
name: "missions_mission_roles_provided_roles_parent_id_fk",
|
|
}).onDelete("cascade"),
|
|
],
|
|
);
|
|
|
|
export const missions_briefing = pgTable(
|
|
"missions_briefing",
|
|
{
|
|
_order: integer("_order").notNull(),
|
|
_parentID: integer("_parent_id").notNull(),
|
|
id: varchar("id").primaryKey(),
|
|
sectionName: varchar("section_name").notNull(),
|
|
details: jsonb("details").notNull(),
|
|
},
|
|
(columns) => [
|
|
index("missions_briefing_order_idx").on(columns._order),
|
|
index("missions_briefing_parent_id_idx").on(columns._parentID),
|
|
foreignKey({
|
|
columns: [columns["_parentID"]],
|
|
foreignColumns: [missions.id],
|
|
name: "missions_briefing_parent_id_fk",
|
|
}).onDelete("cascade"),
|
|
],
|
|
);
|
|
|
|
export const missions_mission_objectives = pgTable(
|
|
"missions_mission_objectives",
|
|
{
|
|
_order: integer("_order").notNull(),
|
|
_parentID: integer("_parent_id").notNull(),
|
|
id: varchar("id").primaryKey(),
|
|
title: varchar("title").notNull(),
|
|
description: varchar("description"),
|
|
missionCritical: boolean("mission_critical").default(true),
|
|
successOrFailConditions: varchar("success_or_fail_conditions"),
|
|
},
|
|
(columns) => [
|
|
index("missions_mission_objectives_order_idx").on(columns._order),
|
|
index("missions_mission_objectives_parent_id_idx").on(columns._parentID),
|
|
foreignKey({
|
|
columns: [columns["_parentID"]],
|
|
foreignColumns: [missions.id],
|
|
name: "missions_mission_objectives_parent_id_fk",
|
|
}).onDelete("cascade"),
|
|
],
|
|
);
|
|
|
|
export const missions_factions_involved = pgTable(
|
|
"missions_factions_involved",
|
|
{
|
|
_order: integer("_order").notNull(),
|
|
_parentID: integer("_parent_id").notNull(),
|
|
id: varchar("id").primaryKey(),
|
|
faction: integer("faction_id")
|
|
.notNull()
|
|
.references(() => factions.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
threatLevel: enum_missions_factions_involved_threat_level("threat_level")
|
|
.notNull()
|
|
.default("hostile"),
|
|
},
|
|
(columns) => [
|
|
index("missions_factions_involved_order_idx").on(columns._order),
|
|
index("missions_factions_involved_parent_id_idx").on(columns._parentID),
|
|
index("missions_factions_involved_faction_idx").on(columns.faction),
|
|
foreignKey({
|
|
columns: [columns["_parentID"]],
|
|
foreignColumns: [missions.id],
|
|
name: "missions_factions_involved_parent_id_fk",
|
|
}).onDelete("cascade"),
|
|
],
|
|
);
|
|
|
|
export const missions_logistics_and_support_insertion = pgTable(
|
|
"missions_logistics_and_support_insertion",
|
|
{
|
|
order: integer("order").notNull(),
|
|
parent: integer("parent_id").notNull(),
|
|
value: enum_missions_logistics_and_support_insertion("value"),
|
|
id: serial("id").primaryKey(),
|
|
},
|
|
(columns) => [
|
|
index("missions_logistics_and_support_insertion_order_idx").on(columns.order),
|
|
index("missions_logistics_and_support_insertion_parent_idx").on(columns.parent),
|
|
foreignKey({
|
|
columns: [columns["parent"]],
|
|
foreignColumns: [missions.id],
|
|
name: "missions_logistics_and_support_insertion_parent_fk",
|
|
}).onDelete("cascade"),
|
|
],
|
|
);
|
|
|
|
export const missions_logistics_and_support_extraction = pgTable(
|
|
"missions_logistics_and_support_extraction",
|
|
{
|
|
order: integer("order").notNull(),
|
|
parent: integer("parent_id").notNull(),
|
|
value: enum_missions_logistics_and_support_extraction("value"),
|
|
id: serial("id").primaryKey(),
|
|
},
|
|
(columns) => [
|
|
index("missions_logistics_and_support_extraction_order_idx").on(columns.order),
|
|
index("missions_logistics_and_support_extraction_parent_idx").on(columns.parent),
|
|
foreignKey({
|
|
columns: [columns["parent"]],
|
|
foreignColumns: [missions.id],
|
|
name: "missions_logistics_and_support_extraction_parent_fk",
|
|
}).onDelete("cascade"),
|
|
],
|
|
);
|
|
|
|
export const missions_logistics_and_support_assets_available = pgTable(
|
|
"missions_logistics_and_support_assets_available",
|
|
{
|
|
_order: integer("_order").notNull(),
|
|
_parentID: integer("_parent_id").notNull(),
|
|
id: varchar("id").primaryKey(),
|
|
assetType: varchar("asset_type").notNull(),
|
|
assetCount: varchar("asset_count"),
|
|
doesRespawn: boolean("does_respawn"),
|
|
assetCallsign: varchar("asset_callsign"),
|
|
},
|
|
(columns) => [
|
|
index("missions_logistics_and_support_assets_available_order_idx").on(columns._order),
|
|
index("missions_logistics_and_support_assets_available_parent_id_idx").on(columns._parentID),
|
|
foreignKey({
|
|
columns: [columns["_parentID"]],
|
|
foreignColumns: [missions.id],
|
|
name: "missions_logistics_and_support_assets_available_parent_id_fk",
|
|
}).onDelete("cascade"),
|
|
],
|
|
);
|
|
|
|
export const missions_comms_and_docs_frequencies = pgTable(
|
|
"missions_comms_and_docs_frequencies",
|
|
{
|
|
_order: integer("_order").notNull(),
|
|
_parentID: integer("_parent_id").notNull(),
|
|
id: varchar("id").primaryKey(),
|
|
frequency: numeric("frequency", { mode: "number" }).notNull(),
|
|
channel: numeric("channel", { mode: "number" }),
|
|
netName: varchar("net_name").notNull(),
|
|
freqUsage: varchar("freq_usage").notNull(),
|
|
},
|
|
(columns) => [
|
|
index("missions_comms_and_docs_frequencies_order_idx").on(columns._order),
|
|
index("missions_comms_and_docs_frequencies_parent_id_idx").on(columns._parentID),
|
|
foreignKey({
|
|
columns: [columns["_parentID"]],
|
|
foreignColumns: [missions.id],
|
|
name: "missions_comms_and_docs_frequencies_parent_id_fk",
|
|
}).onDelete("cascade"),
|
|
],
|
|
);
|
|
|
|
export const missions = pgTable(
|
|
"missions",
|
|
{
|
|
id: serial("id").primaryKey(),
|
|
name: varchar("name").notNull(),
|
|
codeName: varchar("code_name").notNull(),
|
|
summary: varchar("summary").notNull(),
|
|
operationType: enum_missions_operation_type("operation_type").notNull(),
|
|
classification_map: integer("classification_map_id")
|
|
.notNull()
|
|
.references(() => maps.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
classification_missionType: enum_missions_classification_mission_type(
|
|
"classification_mission_type",
|
|
)
|
|
.notNull()
|
|
.default("Zeus"),
|
|
classification_campaign: integer("classification_campaign_id")
|
|
.notNull()
|
|
.references(() => campaigns.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
classification_customScripts: boolean("classification_custom_scripts"),
|
|
classification_startDateTime: timestamp("classification_start_date_time", {
|
|
mode: "string",
|
|
withTimezone: true,
|
|
precision: 3,
|
|
}).notNull(),
|
|
classification_estimatedDuration: numeric("classification_estimated_duration", {
|
|
mode: "number",
|
|
})
|
|
.notNull()
|
|
.default(240),
|
|
ownershipAndStatus_status: enum_missions_ownership_and_status_status(
|
|
"ownership_and_status_status",
|
|
)
|
|
.notNull()
|
|
.default("Concept"),
|
|
ownershipAndStatus_visibility: enum_missions_ownership_and_status_visibility(
|
|
"ownership_and_status_visibility",
|
|
)
|
|
.notNull()
|
|
.default("leadership"),
|
|
missionRoles_maxPlayers: numeric("mission_roles_max_players", { mode: "number" })
|
|
.notNull()
|
|
.default(32),
|
|
missionRoles_notes: varchar("mission_roles_notes"),
|
|
civilianPresence: enum_missions_civilian_presence("civilian_presence").default("None"),
|
|
gameDetails_serverDetails_serverIp: varchar("game_details_server_details_server_ip")
|
|
.notNull()
|
|
.default("arma.onyxsimple.com"),
|
|
gameDetails_serverDetails_serverPort: numeric("game_details_server_details_server_port", {
|
|
mode: "number",
|
|
})
|
|
.notNull()
|
|
.default(2302),
|
|
gameDetails_serverDetails_serverPassword: varchar(
|
|
"game_details_server_details_server_password",
|
|
).default("ptf313"),
|
|
gameDetails_gameSetup_missionFile: integer(
|
|
"game_details_game_setup_mission_file_id",
|
|
).references(() => mission_files.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
gameDetails_gameSetup_requiredMods: integer(
|
|
"game_details_game_setup_required_mods_id",
|
|
).references(() => mod_lists.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
commsAndDocs_radioPlan: jsonb("comms_and_docs_radio_plan"),
|
|
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) => [
|
|
uniqueIndex("missions_code_name_idx").on(columns.codeName),
|
|
index("missions_classification_classification_map_idx").on(columns.classification_map),
|
|
index("missions_classification_classification_campaign_idx").on(
|
|
columns.classification_campaign,
|
|
),
|
|
index("missions_game_details_game_setup_game_details_game_setup_idx").on(
|
|
columns.gameDetails_gameSetup_missionFile,
|
|
),
|
|
index("missions_game_details_game_setup_game_details_game_set_1_idx").on(
|
|
columns.gameDetails_gameSetup_requiredMods,
|
|
),
|
|
index("missions_updated_at_idx").on(columns.updatedAt),
|
|
index("missions_created_at_idx").on(columns.createdAt),
|
|
],
|
|
);
|
|
|
|
export const missions_rels = pgTable(
|
|
"missions_rels",
|
|
{
|
|
id: serial("id").primaryKey(),
|
|
order: integer("order"),
|
|
parent: integer("parent_id").notNull(),
|
|
path: varchar("path").notNull(),
|
|
usersID: integer("users_id"),
|
|
qualificationsID: integer("qualifications_id"),
|
|
},
|
|
(columns) => [
|
|
index("missions_rels_order_idx").on(columns.order),
|
|
index("missions_rels_parent_idx").on(columns.parent),
|
|
index("missions_rels_path_idx").on(columns.path),
|
|
index("missions_rels_users_id_idx").on(columns.usersID),
|
|
index("missions_rels_qualifications_id_idx").on(columns.qualificationsID),
|
|
foreignKey({
|
|
columns: [columns["parent"]],
|
|
foreignColumns: [missions.id],
|
|
name: "missions_rels_parent_fk",
|
|
}).onDelete("cascade"),
|
|
foreignKey({
|
|
columns: [columns["usersID"]],
|
|
foreignColumns: [users.id],
|
|
name: "missions_rels_users_fk",
|
|
}).onDelete("cascade"),
|
|
foreignKey({
|
|
columns: [columns["qualificationsID"]],
|
|
foreignColumns: [qualifications.id],
|
|
name: "missions_rels_qualifications_fk",
|
|
}).onDelete("cascade"),
|
|
],
|
|
);
|
|
|
|
export const campaigns = pgTable(
|
|
"campaigns",
|
|
{
|
|
id: serial("id").primaryKey(),
|
|
name: varchar("name").notNull(),
|
|
summary: varchar("summary").notNull().default("An Arma 3 campaign."),
|
|
status: enum_campaigns_status("status").notNull().default("concept"),
|
|
description: jsonb("description"),
|
|
startDate: timestamp("start_date", { mode: "string", withTimezone: true, precision: 3 }),
|
|
endDate: timestamp("end_date", { mode: "string", withTimezone: true, precision: 3 }),
|
|
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) => [
|
|
uniqueIndex("campaigns_name_idx").on(columns.name),
|
|
index("campaigns_updated_at_idx").on(columns.updatedAt),
|
|
index("campaigns_created_at_idx").on(columns.createdAt),
|
|
],
|
|
);
|
|
|
|
export const factions = pgTable(
|
|
"factions",
|
|
{
|
|
id: serial("id").primaryKey(),
|
|
name: varchar("name").notNull(),
|
|
type: enum_factions_type("type").notNull().default("minorFaction"),
|
|
description: jsonb("description"),
|
|
playableFaction: boolean("playable_faction"),
|
|
startingFaction: boolean("starting_faction"),
|
|
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) => [
|
|
uniqueIndex("factions_name_idx").on(columns.name),
|
|
index("factions_updated_at_idx").on(columns.updatedAt),
|
|
index("factions_created_at_idx").on(columns.createdAt),
|
|
],
|
|
);
|
|
|
|
export const factions_rels = pgTable(
|
|
"factions_rels",
|
|
{
|
|
id: serial("id").primaryKey(),
|
|
order: integer("order"),
|
|
parent: integer("parent_id").notNull(),
|
|
path: varchar("path").notNull(),
|
|
campaignsID: integer("campaigns_id"),
|
|
},
|
|
(columns) => [
|
|
index("factions_rels_order_idx").on(columns.order),
|
|
index("factions_rels_parent_idx").on(columns.parent),
|
|
index("factions_rels_path_idx").on(columns.path),
|
|
index("factions_rels_campaigns_id_idx").on(columns.campaignsID),
|
|
foreignKey({
|
|
columns: [columns["parent"]],
|
|
foreignColumns: [factions.id],
|
|
name: "factions_rels_parent_fk",
|
|
}).onDelete("cascade"),
|
|
foreignKey({
|
|
columns: [columns["campaignsID"]],
|
|
foreignColumns: [campaigns.id],
|
|
name: "factions_rels_campaigns_fk",
|
|
}).onDelete("cascade"),
|
|
],
|
|
);
|
|
|
|
export const technologies_requirements_prerequisite_technologies = pgTable(
|
|
"technologies_requirements_prerequisite_technologies",
|
|
{
|
|
_order: integer("_order").notNull(),
|
|
_parentID: integer("_parent_id").notNull(),
|
|
id: varchar("id").primaryKey(),
|
|
},
|
|
(columns) => [
|
|
index("technologies_requirements_prerequisite_technologies_order_idx").on(columns._order),
|
|
index("technologies_requirements_prerequisite_technologies_parent_id_idx").on(
|
|
columns._parentID,
|
|
),
|
|
foreignKey({
|
|
columns: [columns["_parentID"]],
|
|
foreignColumns: [technologies.id],
|
|
name: "technologies_requirements_prerequisite_technologies_parent_id_fk",
|
|
}).onDelete("cascade"),
|
|
],
|
|
);
|
|
|
|
export const technologies_research_costs_resources = pgTable(
|
|
"technologies_research_costs_resources",
|
|
{
|
|
_order: integer("_order").notNull(),
|
|
_parentID: integer("_parent_id").notNull(),
|
|
id: varchar("id").primaryKey(),
|
|
resource: integer("resource_id")
|
|
.notNull()
|
|
.references(() => resources.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
amount: numeric("amount", { mode: "number" }).notNull().default(1),
|
|
},
|
|
(columns) => [
|
|
index("technologies_research_costs_resources_order_idx").on(columns._order),
|
|
index("technologies_research_costs_resources_parent_id_idx").on(columns._parentID),
|
|
index("technologies_research_costs_resources_resource_idx").on(columns.resource),
|
|
foreignKey({
|
|
columns: [columns["_parentID"]],
|
|
foreignColumns: [technologies.id],
|
|
name: "technologies_research_costs_resources_parent_id_fk",
|
|
}).onDelete("cascade"),
|
|
],
|
|
);
|
|
|
|
export const technologies = pgTable(
|
|
"technologies",
|
|
{
|
|
id: serial("id").primaryKey(),
|
|
name: varchar("name").notNull(),
|
|
approvalStatus: enum_technologies_approval_status("approval_status")
|
|
.notNull()
|
|
.default("in_progress"),
|
|
type: enum_technologies_type("type").notNull().default("upgrade"),
|
|
summary: varchar("summary").notNull(),
|
|
description: jsonb("description"),
|
|
researchCosts_minimumResearchDuration: numeric("research_costs_minimum_research_duration", {
|
|
mode: "number",
|
|
})
|
|
.notNull()
|
|
.default(0),
|
|
researchCosts_maximumResearchDuration: numeric("research_costs_maximum_research_duration", {
|
|
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("technologies_updated_at_idx").on(columns.updatedAt),
|
|
index("technologies_created_at_idx").on(columns.createdAt),
|
|
],
|
|
);
|
|
|
|
export const technologies_rels = pgTable(
|
|
"technologies_rels",
|
|
{
|
|
id: serial("id").primaryKey(),
|
|
order: integer("order"),
|
|
parent: integer("parent_id").notNull(),
|
|
path: varchar("path").notNull(),
|
|
technologiesID: integer("technologies_id"),
|
|
},
|
|
(columns) => [
|
|
index("technologies_rels_order_idx").on(columns.order),
|
|
index("technologies_rels_parent_idx").on(columns.parent),
|
|
index("technologies_rels_path_idx").on(columns.path),
|
|
index("technologies_rels_technologies_id_idx").on(columns.technologiesID),
|
|
foreignKey({
|
|
columns: [columns["parent"]],
|
|
foreignColumns: [technologies.id],
|
|
name: "technologies_rels_parent_fk",
|
|
}).onDelete("cascade"),
|
|
foreignKey({
|
|
columns: [columns["technologiesID"]],
|
|
foreignColumns: [technologies.id],
|
|
name: "technologies_rels_technologies_fk",
|
|
}).onDelete("cascade"),
|
|
],
|
|
);
|
|
|
|
export const assets_skin_configuration_applies_to_asset_types = pgTable(
|
|
"assets_skin_configuration_applies_to_asset_types",
|
|
{
|
|
order: integer("order").notNull(),
|
|
parent: integer("parent_id").notNull(),
|
|
value: enum_assets_skin_configuration_applies_to_asset_types("value"),
|
|
id: serial("id").primaryKey(),
|
|
},
|
|
(columns) => [
|
|
index("assets_skin_configuration_applies_to_asset_types_order_idx").on(columns.order),
|
|
index("assets_skin_configuration_applies_to_asset_types_parent_idx").on(columns.parent),
|
|
foreignKey({
|
|
columns: [columns["parent"]],
|
|
foreignColumns: [assets.id],
|
|
name: "assets_skin_configuration_applies_to_asset_types_parent_fk",
|
|
}).onDelete("cascade"),
|
|
],
|
|
);
|
|
|
|
export const assets_crafting_crafting_data_inputs = pgTable(
|
|
"assets_crafting_crafting_data_inputs",
|
|
{
|
|
_order: integer("_order").notNull(),
|
|
_parentID: integer("_parent_id").notNull(),
|
|
id: varchar("id").primaryKey(),
|
|
quantity: numeric("quantity", { mode: "number" }),
|
|
lended: boolean("lended"),
|
|
},
|
|
(columns) => [
|
|
index("assets_crafting_crafting_data_inputs_order_idx").on(columns._order),
|
|
index("assets_crafting_crafting_data_inputs_parent_id_idx").on(columns._parentID),
|
|
foreignKey({
|
|
columns: [columns["_parentID"]],
|
|
foreignColumns: [assets.id],
|
|
name: "assets_crafting_crafting_data_inputs_parent_id_fk",
|
|
}).onDelete("cascade"),
|
|
],
|
|
);
|
|
|
|
export const assets_crafting_crafting_data_byproducts = pgTable(
|
|
"assets_crafting_crafting_data_byproducts",
|
|
{
|
|
_order: integer("_order").notNull(),
|
|
_parentID: integer("_parent_id").notNull(),
|
|
id: varchar("id").primaryKey(),
|
|
quantity: numeric("quantity", { mode: "number" }),
|
|
},
|
|
(columns) => [
|
|
index("assets_crafting_crafting_data_byproducts_order_idx").on(columns._order),
|
|
index("assets_crafting_crafting_data_byproducts_parent_id_idx").on(columns._parentID),
|
|
foreignKey({
|
|
columns: [columns["_parentID"]],
|
|
foreignColumns: [assets.id],
|
|
name: "assets_crafting_crafting_data_byproducts_parent_id_fk",
|
|
}).onDelete("cascade"),
|
|
],
|
|
);
|
|
|
|
export const assets = pgTable(
|
|
"assets",
|
|
{
|
|
id: serial("id").primaryKey(),
|
|
name: varchar("name").notNull(),
|
|
approvalStatus: enum_assets_approval_status("approval_status").notNull().default("in_progress"),
|
|
className: varchar("class_name").notNull().default(""),
|
|
assetType: enum_assets_asset_type("asset_type").notNull().default("weapon"),
|
|
"Weapon Configuration_slotType": enum_assets_weapon_configuration_slot_type(
|
|
"weapon_configuration_slot_type",
|
|
),
|
|
"Nightvision Configuration_nvgGeneration": enum_assets_nightvision_configuration_nvg_generation(
|
|
"nightvision_configuration_nvg_generation",
|
|
),
|
|
"Nightvision Configuration_nvgHasThermals": boolean(
|
|
"nightvision_configuration_nvg_has_thermals",
|
|
),
|
|
"Container Configuration_capacityKg": numeric("container_configuration_capacity_kg", {
|
|
mode: "number",
|
|
}),
|
|
"Container Configuration_weightKg": numeric("container_configuration_weight_kg", {
|
|
mode: "number",
|
|
}),
|
|
"Magazine Configuration_roundCapacity": numeric("magazine_configuration_round_capacity", {
|
|
mode: "number",
|
|
}),
|
|
"Magazine Configuration_ammoType": varchar("magazine_configuration_ammo_type"),
|
|
"Magazine Configuration_greenmagCompatible": boolean(
|
|
"magazine_configuration_greenmag_compatible",
|
|
),
|
|
"Asset Metadata_mod": varchar("asset_metadata_mod"),
|
|
"Asset Metadata_thumbnail": integer("asset_metadata_thumbnail_id").references(() => media.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
"Asset Metadata_gameDescription": varchar("asset_metadata_game_description"),
|
|
tradeable: boolean("tradeable"),
|
|
marketTrading_Rarity: enum_assets_market_trading_rarity("market_trading_rarity"),
|
|
marketTrading_perceivedValue_baseBuyPrice: numeric(
|
|
"market_trading_perceived_value_base_buy_price",
|
|
{ mode: "number" },
|
|
),
|
|
marketTrading_perceivedValue_baseSellPrice: numeric(
|
|
"market_trading_perceived_value_base_sell_price",
|
|
{ mode: "number" },
|
|
),
|
|
crafting_craftable: boolean("crafting_craftable"),
|
|
crafting_blueprintRequired: boolean("crafting_blueprint_required"),
|
|
crafting_technologyRequiredToUse: boolean("crafting_technology_required_to_use"),
|
|
crafting_craftingData_craftingTimePerUnit: numeric(
|
|
"crafting_crafting_data_crafting_time_per_unit",
|
|
{ mode: "number" },
|
|
)
|
|
.notNull()
|
|
.default(1),
|
|
crafting_craftingData_batchSize: numeric("crafting_crafting_data_batch_size", {
|
|
mode: "number",
|
|
})
|
|
.notNull()
|
|
.default(1),
|
|
storageDimensions_gridWidth: numeric("storage_dimensions_grid_width", { mode: "number" })
|
|
.notNull()
|
|
.default(1),
|
|
storageDimensions_gridHeight: numeric("storage_dimensions_grid_height", { mode: "number" })
|
|
.notNull()
|
|
.default(1),
|
|
storageDimensions_stackable: boolean("storage_dimensions_stackable").default(true),
|
|
storageDimensions_maxStackSize: numeric("storage_dimensions_max_stack_size", {
|
|
mode: "number",
|
|
}),
|
|
storageDimensions_rotatable: boolean("storage_dimensions_rotatable").default(true),
|
|
isLive: boolean("is_live"),
|
|
notes: jsonb("notes"),
|
|
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("assets_asset_metadata_asset_metadata_thumbnail_idx").on(
|
|
columns["Asset Metadata_thumbnail"],
|
|
),
|
|
index("assets_updated_at_idx").on(columns.updatedAt),
|
|
index("assets_created_at_idx").on(columns.createdAt),
|
|
],
|
|
);
|
|
|
|
export const assets_rels = pgTable(
|
|
"assets_rels",
|
|
{
|
|
id: serial("id").primaryKey(),
|
|
order: integer("order"),
|
|
parent: integer("parent_id").notNull(),
|
|
path: varchar("path").notNull(),
|
|
assetsID: integer("assets_id"),
|
|
technologiesID: integer("technologies_id"),
|
|
resourcesID: integer("resources_id"),
|
|
structuresID: integer("structures_id"),
|
|
},
|
|
(columns) => [
|
|
index("assets_rels_order_idx").on(columns.order),
|
|
index("assets_rels_parent_idx").on(columns.parent),
|
|
index("assets_rels_path_idx").on(columns.path),
|
|
index("assets_rels_assets_id_idx").on(columns.assetsID),
|
|
index("assets_rels_technologies_id_idx").on(columns.technologiesID),
|
|
index("assets_rels_resources_id_idx").on(columns.resourcesID),
|
|
index("assets_rels_structures_id_idx").on(columns.structuresID),
|
|
foreignKey({
|
|
columns: [columns["parent"]],
|
|
foreignColumns: [assets.id],
|
|
name: "assets_rels_parent_fk",
|
|
}).onDelete("cascade"),
|
|
foreignKey({
|
|
columns: [columns["assetsID"]],
|
|
foreignColumns: [assets.id],
|
|
name: "assets_rels_assets_fk",
|
|
}).onDelete("cascade"),
|
|
foreignKey({
|
|
columns: [columns["technologiesID"]],
|
|
foreignColumns: [technologies.id],
|
|
name: "assets_rels_technologies_fk",
|
|
}).onDelete("cascade"),
|
|
foreignKey({
|
|
columns: [columns["resourcesID"]],
|
|
foreignColumns: [resources.id],
|
|
name: "assets_rels_resources_fk",
|
|
}).onDelete("cascade"),
|
|
foreignKey({
|
|
columns: [columns["structuresID"]],
|
|
foreignColumns: [structures.id],
|
|
name: "assets_rels_structures_fk",
|
|
}).onDelete("cascade"),
|
|
],
|
|
);
|
|
|
|
export const resources = pgTable(
|
|
"resources",
|
|
{
|
|
id: serial("id").primaryKey(),
|
|
name: varchar("name").notNull(),
|
|
codeName: varchar("code_name").notNull(),
|
|
approvalStatus: enum_resources_approval_status("approval_status")
|
|
.notNull()
|
|
.default("in_progress"),
|
|
type: enum_resources_type("type").notNull().default("physical"),
|
|
description: jsonb("description"),
|
|
icon: integer("icon_id").references(() => media.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
color: varchar("color"),
|
|
baseValue: numeric("base_value", { mode: "number" }).notNull().default(1),
|
|
tradeable: boolean("tradeable"),
|
|
rarity: enum_resources_rarity("rarity").notNull().default("common"),
|
|
unitOfMeasure: varchar("unit_of_measure").notNull(),
|
|
massPerUnit: numeric("mass_per_unit", { mode: "number" }).notNull().default(0),
|
|
stackSize: numeric("stack_size", { mode: "number" }).default(1),
|
|
gridWidth: numeric("grid_width", { mode: "number" }).notNull().default(1),
|
|
gridHeight: numeric("grid_height", { mode: "number" }).notNull().default(1),
|
|
stackable: boolean("stackable").default(true),
|
|
maxStackSize: numeric("max_stack_size", { mode: "number" }),
|
|
rotatable: boolean("rotatable").default(true),
|
|
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("resources_icon_idx").on(columns.icon),
|
|
index("resources_updated_at_idx").on(columns.updatedAt),
|
|
index("resources_created_at_idx").on(columns.createdAt),
|
|
],
|
|
);
|
|
|
|
export const vehicles_category = pgTable(
|
|
"vehicles_category",
|
|
{
|
|
order: integer("order").notNull(),
|
|
parent: integer("parent_id").notNull(),
|
|
value: enum_vehicles_category("value"),
|
|
id: serial("id").primaryKey(),
|
|
},
|
|
(columns) => [
|
|
index("vehicles_category_order_idx").on(columns.order),
|
|
index("vehicles_category_parent_idx").on(columns.parent),
|
|
foreignKey({
|
|
columns: [columns["parent"]],
|
|
foreignColumns: [vehicles.id],
|
|
name: "vehicles_category_parent_fk",
|
|
}).onDelete("cascade"),
|
|
],
|
|
);
|
|
|
|
export const vehicles_materials = pgTable(
|
|
"vehicles_materials",
|
|
{
|
|
_order: integer("_order").notNull(),
|
|
_parentID: integer("_parent_id").notNull(),
|
|
id: varchar("id").primaryKey(),
|
|
resource: integer("resource_id")
|
|
.notNull()
|
|
.references(() => resources.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
amount: numeric("amount", { mode: "number" }),
|
|
},
|
|
(columns) => [
|
|
index("vehicles_materials_order_idx").on(columns._order),
|
|
index("vehicles_materials_parent_id_idx").on(columns._parentID),
|
|
index("vehicles_materials_resource_idx").on(columns.resource),
|
|
foreignKey({
|
|
columns: [columns["_parentID"]],
|
|
foreignColumns: [vehicles.id],
|
|
name: "vehicles_materials_parent_id_fk",
|
|
}).onDelete("cascade"),
|
|
],
|
|
);
|
|
|
|
export const vehicles_scrap_returns = pgTable(
|
|
"vehicles_scrap_returns",
|
|
{
|
|
_order: integer("_order").notNull(),
|
|
_parentID: integer("_parent_id").notNull(),
|
|
id: varchar("id").primaryKey(),
|
|
resource: integer("resource_id")
|
|
.notNull()
|
|
.references(() => resources.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
amount: numeric("amount", { mode: "number" }).default(1),
|
|
chance: numeric("chance", { mode: "number" }).default(100),
|
|
},
|
|
(columns) => [
|
|
index("vehicles_scrap_returns_order_idx").on(columns._order),
|
|
index("vehicles_scrap_returns_parent_id_idx").on(columns._parentID),
|
|
index("vehicles_scrap_returns_resource_idx").on(columns.resource),
|
|
foreignKey({
|
|
columns: [columns["_parentID"]],
|
|
foreignColumns: [vehicles.id],
|
|
name: "vehicles_scrap_returns_parent_id_fk",
|
|
}).onDelete("cascade"),
|
|
],
|
|
);
|
|
|
|
export const vehicles_upkeep_costs = pgTable(
|
|
"vehicles_upkeep_costs",
|
|
{
|
|
_order: integer("_order").notNull(),
|
|
_parentID: integer("_parent_id").notNull(),
|
|
id: varchar("id").primaryKey(),
|
|
resource: integer("resource_id")
|
|
.notNull()
|
|
.references(() => resources.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
amount: numeric("amount", { mode: "number" }).default(1),
|
|
},
|
|
(columns) => [
|
|
index("vehicles_upkeep_costs_order_idx").on(columns._order),
|
|
index("vehicles_upkeep_costs_parent_id_idx").on(columns._parentID),
|
|
index("vehicles_upkeep_costs_resource_idx").on(columns.resource),
|
|
foreignKey({
|
|
columns: [columns["_parentID"]],
|
|
foreignColumns: [vehicles.id],
|
|
name: "vehicles_upkeep_costs_parent_id_fk",
|
|
}).onDelete("cascade"),
|
|
],
|
|
);
|
|
|
|
export const vehicles_allowed_virtual_cargo = pgTable(
|
|
"vehicles_allowed_virtual_cargo",
|
|
{
|
|
_order: integer("_order").notNull(),
|
|
_parentID: integer("_parent_id").notNull(),
|
|
id: varchar("id").primaryKey(),
|
|
amount: numeric("amount", { mode: "number" }).default(1),
|
|
},
|
|
(columns) => [
|
|
index("vehicles_allowed_virtual_cargo_order_idx").on(columns._order),
|
|
index("vehicles_allowed_virtual_cargo_parent_id_idx").on(columns._parentID),
|
|
foreignKey({
|
|
columns: [columns["_parentID"]],
|
|
foreignColumns: [vehicles.id],
|
|
name: "vehicles_allowed_virtual_cargo_parent_id_fk",
|
|
}).onDelete("cascade"),
|
|
],
|
|
);
|
|
|
|
export const vehicles_pylons = pgTable(
|
|
"vehicles_pylons",
|
|
{
|
|
_order: integer("_order").notNull(),
|
|
_parentID: integer("_parent_id").notNull(),
|
|
id: varchar("id").primaryKey(),
|
|
pylonName: varchar("pylon_name").notNull(),
|
|
pylonType: enum_vehicles_pylons_pylon_type("pylon_type").notNull().default("mountedWeapon"),
|
|
amount: numeric("amount", { mode: "number" }).default(1),
|
|
ammoType: integer("ammo_type_id").references(() => assets.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
},
|
|
(columns) => [
|
|
index("vehicles_pylons_order_idx").on(columns._order),
|
|
index("vehicles_pylons_parent_id_idx").on(columns._parentID),
|
|
index("vehicles_pylons_ammo_type_idx").on(columns.ammoType),
|
|
foreignKey({
|
|
columns: [columns["_parentID"]],
|
|
foreignColumns: [vehicles.id],
|
|
name: "vehicles_pylons_parent_id_fk",
|
|
}).onDelete("cascade"),
|
|
],
|
|
);
|
|
|
|
export const vehicles = pgTable(
|
|
"vehicles",
|
|
{
|
|
id: serial("id").primaryKey(),
|
|
name: varchar("name").notNull(),
|
|
classname: varchar("classname"),
|
|
approvalStatus: enum_vehicles_approval_status("approval_status")
|
|
.notNull()
|
|
.default("in_progress"),
|
|
description: jsonb("description"),
|
|
image: integer("image_id").references(() => media.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
fuel_fuelType: integer("fuel_fuel_type_id")
|
|
.notNull()
|
|
.references(() => resources.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
fuel_fuelCapacity: numeric("fuel_fuel_capacity", { mode: "number" }).notNull(),
|
|
fuel_fuelConsumptionRate: numeric("fuel_fuel_consumption_rate", { mode: "number" })
|
|
.notNull()
|
|
.default(1),
|
|
constructionTime: numeric("construction_time", { mode: "number" }),
|
|
width: numeric("width", { mode: "number" }),
|
|
height: numeric("height", { mode: "number" }),
|
|
maxMass: numeric("max_mass", { mode: "number" }),
|
|
aceCargoSlots: numeric("ace_cargo_slots", { mode: "number" }),
|
|
maxHealth: numeric("max_health", { mode: "number" }),
|
|
armorRating: enum_vehicles_armor_rating("armor_rating"),
|
|
maxSpeedOnRoad: numeric("max_speed_on_road", { mode: "number" }),
|
|
maxSpeedOffRoad: numeric("max_speed_off_road", { mode: "number" }),
|
|
maxAirspeed: numeric("max_airspeed", { mode: "number" }),
|
|
maxKnots: numeric("max_knots", { 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("vehicles_image_idx").on(columns.image),
|
|
index("vehicles_fuel_fuel_fuel_type_idx").on(columns.fuel_fuelType),
|
|
index("vehicles_updated_at_idx").on(columns.updatedAt),
|
|
index("vehicles_created_at_idx").on(columns.createdAt),
|
|
],
|
|
);
|
|
|
|
export const vehicles_rels = pgTable(
|
|
"vehicles_rels",
|
|
{
|
|
id: serial("id").primaryKey(),
|
|
order: integer("order"),
|
|
parent: integer("parent_id").notNull(),
|
|
path: varchar("path").notNull(),
|
|
technologiesID: integer("technologies_id"),
|
|
assetsID: integer("assets_id"),
|
|
vehiclesID: integer("vehicles_id"),
|
|
resourcesID: integer("resources_id"),
|
|
},
|
|
(columns) => [
|
|
index("vehicles_rels_order_idx").on(columns.order),
|
|
index("vehicles_rels_parent_idx").on(columns.parent),
|
|
index("vehicles_rels_path_idx").on(columns.path),
|
|
index("vehicles_rels_technologies_id_idx").on(columns.technologiesID),
|
|
index("vehicles_rels_assets_id_idx").on(columns.assetsID),
|
|
index("vehicles_rels_vehicles_id_idx").on(columns.vehiclesID),
|
|
index("vehicles_rels_resources_id_idx").on(columns.resourcesID),
|
|
foreignKey({
|
|
columns: [columns["parent"]],
|
|
foreignColumns: [vehicles.id],
|
|
name: "vehicles_rels_parent_fk",
|
|
}).onDelete("cascade"),
|
|
foreignKey({
|
|
columns: [columns["technologiesID"]],
|
|
foreignColumns: [technologies.id],
|
|
name: "vehicles_rels_technologies_fk",
|
|
}).onDelete("cascade"),
|
|
foreignKey({
|
|
columns: [columns["assetsID"]],
|
|
foreignColumns: [assets.id],
|
|
name: "vehicles_rels_assets_fk",
|
|
}).onDelete("cascade"),
|
|
foreignKey({
|
|
columns: [columns["vehiclesID"]],
|
|
foreignColumns: [vehicles.id],
|
|
name: "vehicles_rels_vehicles_fk",
|
|
}).onDelete("cascade"),
|
|
foreignKey({
|
|
columns: [columns["resourcesID"]],
|
|
foreignColumns: [resources.id],
|
|
name: "vehicles_rels_resources_fk",
|
|
}).onDelete("cascade"),
|
|
],
|
|
);
|
|
|
|
export const structures_materials = pgTable(
|
|
"structures_materials",
|
|
{
|
|
_order: integer("_order").notNull(),
|
|
_parentID: integer("_parent_id").notNull(),
|
|
id: varchar("id").primaryKey(),
|
|
resource: integer("resource_id")
|
|
.notNull()
|
|
.references(() => resources.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
amount: numeric("amount", { mode: "number" }),
|
|
},
|
|
(columns) => [
|
|
index("structures_materials_order_idx").on(columns._order),
|
|
index("structures_materials_parent_id_idx").on(columns._parentID),
|
|
index("structures_materials_resource_idx").on(columns.resource),
|
|
foreignKey({
|
|
columns: [columns["_parentID"]],
|
|
foreignColumns: [structures.id],
|
|
name: "structures_materials_parent_id_fk",
|
|
}).onDelete("cascade"),
|
|
],
|
|
);
|
|
|
|
export const structures_resources_in_range = pgTable(
|
|
"structures_resources_in_range",
|
|
{
|
|
_order: integer("_order").notNull(),
|
|
_parentID: integer("_parent_id").notNull(),
|
|
id: varchar("id").primaryKey(),
|
|
resource: integer("resource_id").references(() => resources.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
range: numeric("range", { mode: "number" }),
|
|
},
|
|
(columns) => [
|
|
index("structures_resources_in_range_order_idx").on(columns._order),
|
|
index("structures_resources_in_range_parent_id_idx").on(columns._parentID),
|
|
index("structures_resources_in_range_resource_idx").on(columns.resource),
|
|
foreignKey({
|
|
columns: [columns["_parentID"]],
|
|
foreignColumns: [structures.id],
|
|
name: "structures_resources_in_range_parent_id_fk",
|
|
}).onDelete("cascade"),
|
|
],
|
|
);
|
|
|
|
export const structures_structures_in_range = pgTable(
|
|
"structures_structures_in_range",
|
|
{
|
|
_order: integer("_order").notNull(),
|
|
_parentID: integer("_parent_id").notNull(),
|
|
id: varchar("id").primaryKey(),
|
|
structure: integer("structure_id").references(() => structures.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
range: numeric("range", { mode: "number" }),
|
|
},
|
|
(columns) => [
|
|
index("structures_structures_in_range_order_idx").on(columns._order),
|
|
index("structures_structures_in_range_parent_id_idx").on(columns._parentID),
|
|
index("structures_structures_in_range_structure_idx").on(columns.structure),
|
|
foreignKey({
|
|
columns: [columns["_parentID"]],
|
|
foreignColumns: [structures.id],
|
|
name: "structures_structures_in_range_parent_id_fk",
|
|
}).onDelete("cascade"),
|
|
],
|
|
);
|
|
|
|
export const structures_upkeep = pgTable(
|
|
"structures_upkeep",
|
|
{
|
|
_order: integer("_order").notNull(),
|
|
_parentID: integer("_parent_id").notNull(),
|
|
id: varchar("id").primaryKey(),
|
|
resource: integer("resource_id").references(() => resources.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
amount: numeric("amount", { mode: "number" }),
|
|
},
|
|
(columns) => [
|
|
index("structures_upkeep_order_idx").on(columns._order),
|
|
index("structures_upkeep_parent_id_idx").on(columns._parentID),
|
|
index("structures_upkeep_resource_idx").on(columns.resource),
|
|
foreignKey({
|
|
columns: [columns["_parentID"]],
|
|
foreignColumns: [structures.id],
|
|
name: "structures_upkeep_parent_id_fk",
|
|
}).onDelete("cascade"),
|
|
],
|
|
);
|
|
|
|
export const structures_auto_generated_resources = pgTable(
|
|
"structures_auto_generated_resources",
|
|
{
|
|
_order: integer("_order").notNull(),
|
|
_parentID: integer("_parent_id").notNull(),
|
|
id: varchar("id").primaryKey(),
|
|
resource: integer("resource_id")
|
|
.notNull()
|
|
.references(() => resources.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
minAmount: numeric("min_amount", { mode: "number" }).notNull(),
|
|
maxAmount: numeric("max_amount", { mode: "number" }),
|
|
minFrequency: varchar("min_frequency").notNull().default("1"),
|
|
maxFrequency: varchar("max_frequency"),
|
|
produceChance: numeric("produce_chance", { mode: "number" }).default(100),
|
|
},
|
|
(columns) => [
|
|
index("structures_auto_generated_resources_order_idx").on(columns._order),
|
|
index("structures_auto_generated_resources_parent_id_idx").on(columns._parentID),
|
|
index("structures_auto_generated_resources_resource_idx").on(columns.resource),
|
|
foreignKey({
|
|
columns: [columns["_parentID"]],
|
|
foreignColumns: [structures.id],
|
|
name: "structures_auto_generated_resources_parent_id_fk",
|
|
}).onDelete("cascade"),
|
|
],
|
|
);
|
|
|
|
export const structures_allowed_storage = pgTable(
|
|
"structures_allowed_storage",
|
|
{
|
|
_order: integer("_order").notNull(),
|
|
_parentID: integer("_parent_id").notNull(),
|
|
id: varchar("id").primaryKey(),
|
|
amount: numeric("amount", { mode: "number" }),
|
|
},
|
|
(columns) => [
|
|
index("structures_allowed_storage_order_idx").on(columns._order),
|
|
index("structures_allowed_storage_parent_id_idx").on(columns._parentID),
|
|
foreignKey({
|
|
columns: [columns["_parentID"]],
|
|
foreignColumns: [structures.id],
|
|
name: "structures_allowed_storage_parent_id_fk",
|
|
}).onDelete("cascade"),
|
|
],
|
|
);
|
|
|
|
export const structures_prohibited_storage = pgTable(
|
|
"structures_prohibited_storage",
|
|
{
|
|
_order: integer("_order").notNull(),
|
|
_parentID: integer("_parent_id").notNull(),
|
|
id: varchar("id").primaryKey(),
|
|
},
|
|
(columns) => [
|
|
index("structures_prohibited_storage_order_idx").on(columns._order),
|
|
index("structures_prohibited_storage_parent_id_idx").on(columns._parentID),
|
|
foreignKey({
|
|
columns: [columns["_parentID"]],
|
|
foreignColumns: [structures.id],
|
|
name: "structures_prohibited_storage_parent_id_fk",
|
|
}).onDelete("cascade"),
|
|
],
|
|
);
|
|
|
|
export const structures = pgTable(
|
|
"structures",
|
|
{
|
|
id: serial("id").primaryKey(),
|
|
name: varchar("name").notNull(),
|
|
codeName: varchar("code_name").notNull(),
|
|
approvalStatus: enum_structures_approval_status("approval_status")
|
|
.notNull()
|
|
.default("in_progress"),
|
|
description: jsonb("description").notNull(),
|
|
image: integer("image_id").references(() => media.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
category: enum_structures_category("category").notNull(),
|
|
constructionTime: numeric("construction_time", { mode: "number" }).notNull(),
|
|
requiresUpgrade: boolean("requires_upgrade"),
|
|
upgradesInto: integer("upgrades_into_id").references((): AnyPgColumn => structures.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
upgradeCostMultiplier: numeric("upgrade_cost_multiplier", { mode: "number" }).default(1),
|
|
terrainType: enum_structures_terrain_type("terrain_type").notNull(),
|
|
sellPrice: numeric("sell_price", { mode: "number" }),
|
|
functionType: enum_structures_function_type("function_type"),
|
|
maxCapacityMass: numeric("max_capacity_mass", { mode: "number" }),
|
|
restrictToAllowed: boolean("restrict_to_allowed").default(false),
|
|
xSize: numeric("x_size", { mode: "number" }),
|
|
ySize: numeric("y_size", { mode: "number" }),
|
|
maxHealth: numeric("max_health", { mode: "number" }).notNull(),
|
|
repairSpeed: numeric("repair_speed", { 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("structures_image_idx").on(columns.image),
|
|
index("structures_upgrades_into_idx").on(columns.upgradesInto),
|
|
index("structures_updated_at_idx").on(columns.updatedAt),
|
|
index("structures_created_at_idx").on(columns.createdAt),
|
|
],
|
|
);
|
|
|
|
export const structures_rels = pgTable(
|
|
"structures_rels",
|
|
{
|
|
id: serial("id").primaryKey(),
|
|
order: integer("order"),
|
|
parent: integer("parent_id").notNull(),
|
|
path: varchar("path").notNull(),
|
|
technologiesID: integer("technologies_id"),
|
|
assetsID: integer("assets_id"),
|
|
vehiclesID: integer("vehicles_id"),
|
|
resourcesID: integer("resources_id"),
|
|
},
|
|
(columns) => [
|
|
index("structures_rels_order_idx").on(columns.order),
|
|
index("structures_rels_parent_idx").on(columns.parent),
|
|
index("structures_rels_path_idx").on(columns.path),
|
|
index("structures_rels_technologies_id_idx").on(columns.technologiesID),
|
|
index("structures_rels_assets_id_idx").on(columns.assetsID),
|
|
index("structures_rels_vehicles_id_idx").on(columns.vehiclesID),
|
|
index("structures_rels_resources_id_idx").on(columns.resourcesID),
|
|
foreignKey({
|
|
columns: [columns["parent"]],
|
|
foreignColumns: [structures.id],
|
|
name: "structures_rels_parent_fk",
|
|
}).onDelete("cascade"),
|
|
foreignKey({
|
|
columns: [columns["technologiesID"]],
|
|
foreignColumns: [technologies.id],
|
|
name: "structures_rels_technologies_fk",
|
|
}).onDelete("cascade"),
|
|
foreignKey({
|
|
columns: [columns["assetsID"]],
|
|
foreignColumns: [assets.id],
|
|
name: "structures_rels_assets_fk",
|
|
}).onDelete("cascade"),
|
|
foreignKey({
|
|
columns: [columns["vehiclesID"]],
|
|
foreignColumns: [vehicles.id],
|
|
name: "structures_rels_vehicles_fk",
|
|
}).onDelete("cascade"),
|
|
foreignKey({
|
|
columns: [columns["resourcesID"]],
|
|
foreignColumns: [resources.id],
|
|
name: "structures_rels_resources_fk",
|
|
}).onDelete("cascade"),
|
|
],
|
|
);
|
|
|
|
export const shipments_cargo = pgTable(
|
|
"shipments_cargo",
|
|
{
|
|
_order: integer("_order").notNull(),
|
|
_parentID: integer("_parent_id").notNull(),
|
|
id: varchar("id").primaryKey(),
|
|
amount: numeric("amount", { mode: "number" }).notNull(),
|
|
},
|
|
(columns) => [
|
|
index("shipments_cargo_order_idx").on(columns._order),
|
|
index("shipments_cargo_parent_id_idx").on(columns._parentID),
|
|
foreignKey({
|
|
columns: [columns["_parentID"]],
|
|
foreignColumns: [shipments.id],
|
|
name: "shipments_cargo_parent_id_fk",
|
|
}).onDelete("cascade"),
|
|
],
|
|
);
|
|
|
|
export const shipments = pgTable(
|
|
"shipments",
|
|
{
|
|
id: serial("id").primaryKey(),
|
|
name: varchar("name"),
|
|
origin: integer("origin_id")
|
|
.notNull()
|
|
.references(() => game_structures.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
destination: integer("destination_id")
|
|
.notNull()
|
|
.references(() => game_structures.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
transportVehicle: integer("transport_vehicle_id")
|
|
.notNull()
|
|
.references(() => game_vehicles.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
distance: numeric("distance", { mode: "number" }).notNull(),
|
|
fuelCost: numeric("fuel_cost", { mode: "number" }).notNull(),
|
|
fuelConsumed: numeric("fuel_consumed", { mode: "number" }).default(0),
|
|
status: enum_shipments_status("status").notNull().default("pending"),
|
|
dispatchedAt: timestamp("dispatched_at", { mode: "string", withTimezone: true, precision: 3 }),
|
|
estimatedArrival: timestamp("estimated_arrival", {
|
|
mode: "string",
|
|
withTimezone: true,
|
|
precision: 3,
|
|
}),
|
|
completedAt: timestamp("completed_at", { mode: "string", withTimezone: true, precision: 3 }),
|
|
autoReturn: boolean("auto_return").default(false),
|
|
createdBy: integer("created_by_id").references(() => users.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
failureReason: varchar("failure_reason"),
|
|
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("shipments_origin_idx").on(columns.origin),
|
|
index("shipments_destination_idx").on(columns.destination),
|
|
index("shipments_transport_vehicle_idx").on(columns.transportVehicle),
|
|
index("shipments_created_by_idx").on(columns.createdBy),
|
|
index("shipments_updated_at_idx").on(columns.updatedAt),
|
|
index("shipments_created_at_idx").on(columns.createdAt),
|
|
],
|
|
);
|
|
|
|
export const shipments_rels = pgTable(
|
|
"shipments_rels",
|
|
{
|
|
id: serial("id").primaryKey(),
|
|
order: integer("order"),
|
|
parent: integer("parent_id").notNull(),
|
|
path: varchar("path").notNull(),
|
|
resourcesID: integer("resources_id"),
|
|
assetsID: integer("assets_id"),
|
|
vehiclesID: integer("vehicles_id"),
|
|
},
|
|
(columns) => [
|
|
index("shipments_rels_order_idx").on(columns.order),
|
|
index("shipments_rels_parent_idx").on(columns.parent),
|
|
index("shipments_rels_path_idx").on(columns.path),
|
|
index("shipments_rels_resources_id_idx").on(columns.resourcesID),
|
|
index("shipments_rels_assets_id_idx").on(columns.assetsID),
|
|
index("shipments_rels_vehicles_id_idx").on(columns.vehiclesID),
|
|
foreignKey({
|
|
columns: [columns["parent"]],
|
|
foreignColumns: [shipments.id],
|
|
name: "shipments_rels_parent_fk",
|
|
}).onDelete("cascade"),
|
|
foreignKey({
|
|
columns: [columns["resourcesID"]],
|
|
foreignColumns: [resources.id],
|
|
name: "shipments_rels_resources_fk",
|
|
}).onDelete("cascade"),
|
|
foreignKey({
|
|
columns: [columns["assetsID"]],
|
|
foreignColumns: [assets.id],
|
|
name: "shipments_rels_assets_fk",
|
|
}).onDelete("cascade"),
|
|
foreignKey({
|
|
columns: [columns["vehiclesID"]],
|
|
foreignColumns: [vehicles.id],
|
|
name: "shipments_rels_vehicles_fk",
|
|
}).onDelete("cascade"),
|
|
],
|
|
);
|
|
|
|
export const bank_accounts = pgTable(
|
|
"bank_accounts",
|
|
{
|
|
id: serial("id").primaryKey(),
|
|
name: varchar("name").notNull(),
|
|
accountType: enum_bank_accounts_account_type("account_type").notNull().default("personal"),
|
|
ownerFaction: integer("owner_faction_id").references(() => factions.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
ownerUser: integer("owner_user_id").references(() => users.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
currency: integer("currency_id")
|
|
.notNull()
|
|
.references(() => resources.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
balance: numeric("balance", { mode: "number" }).default(0),
|
|
status: enum_bank_accounts_status("status").notNull().default("open"),
|
|
createdAt: timestamp("created_at", { mode: "string", withTimezone: true, precision: 3 })
|
|
.defaultNow()
|
|
.notNull(),
|
|
updatedAt: timestamp("updated_at", { mode: "string", withTimezone: true, precision: 3 })
|
|
.defaultNow()
|
|
.notNull(),
|
|
},
|
|
(columns) => [
|
|
index("bank_accounts_owner_faction_idx").on(columns.ownerFaction),
|
|
index("bank_accounts_owner_user_idx").on(columns.ownerUser),
|
|
index("bank_accounts_currency_idx").on(columns.currency),
|
|
index("bank_accounts_updated_at_idx").on(columns.updatedAt),
|
|
],
|
|
);
|
|
|
|
export const bank_transactions = pgTable(
|
|
"bank_transactions",
|
|
{
|
|
id: serial("id").primaryKey(),
|
|
transactionNumber: varchar("transaction_number").notNull(),
|
|
type: enum_bank_transactions_type("type").notNull(),
|
|
fromAccount: integer("from_account_id").references(() => bank_accounts.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
toAccount: integer("to_account_id").references(() => bank_accounts.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
amount: numeric("amount", { mode: "number" }).notNull(),
|
|
fee: numeric("fee", { mode: "number" }).default(0),
|
|
memo: varchar("memo"),
|
|
actor: integer("actor_id").references(() => users.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
status: enum_bank_transactions_status("status").notNull().default("completed"),
|
|
reference: integer("reference_id").references((): AnyPgColumn => bank_transactions.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
timestamp: timestamp("timestamp", {
|
|
mode: "string",
|
|
withTimezone: true,
|
|
precision: 3,
|
|
}).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(),
|
|
},
|
|
(columns) => [
|
|
uniqueIndex("bank_transactions_transaction_number_idx").on(columns.transactionNumber),
|
|
index("bank_transactions_from_account_idx").on(columns.fromAccount),
|
|
index("bank_transactions_to_account_idx").on(columns.toAccount),
|
|
index("bank_transactions_actor_idx").on(columns.actor),
|
|
index("bank_transactions_reference_idx").on(columns.reference),
|
|
index("bank_transactions_updated_at_idx").on(columns.updatedAt),
|
|
index("bank_transactions_created_at_idx").on(columns.createdAt),
|
|
],
|
|
);
|
|
|
|
export const ledger_entries = pgTable(
|
|
"ledger_entries",
|
|
{
|
|
id: serial("id").primaryKey(),
|
|
account: integer("account_id")
|
|
.notNull()
|
|
.references(() => bank_accounts.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
transaction: integer("transaction_id")
|
|
.notNull()
|
|
.references(() => bank_transactions.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
type: enum_ledger_entries_type("type").notNull(),
|
|
amount: numeric("amount", { mode: "number" }).notNull(),
|
|
balanceAfter: numeric("balance_after", { mode: "number" }),
|
|
memo: varchar("memo"),
|
|
timestamp: timestamp("timestamp", {
|
|
mode: "string",
|
|
withTimezone: true,
|
|
precision: 3,
|
|
}).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(),
|
|
},
|
|
(columns) => [
|
|
index("ledger_entries_account_idx").on(columns.account),
|
|
index("ledger_entries_transaction_idx").on(columns.transaction),
|
|
index("ledger_entries_updated_at_idx").on(columns.updatedAt),
|
|
index("ledger_entries_created_at_idx").on(columns.createdAt),
|
|
],
|
|
);
|
|
|
|
export const locker_storages_items_equipment_attachments = pgTable(
|
|
"locker_storages_items_equipment_attachments",
|
|
{
|
|
_order: integer("_order").notNull(),
|
|
_parentID: varchar("_parent_id").notNull(),
|
|
id: varchar("id").primaryKey(),
|
|
asset: integer("asset_id")
|
|
.notNull()
|
|
.references(() => assets.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
},
|
|
(columns) => [
|
|
index("locker_storages_items_equipment_attachments_order_idx").on(columns._order),
|
|
index("locker_storages_items_equipment_attachments_parent_id_idx").on(columns._parentID),
|
|
index("locker_storages_items_equipment_attachments_asset_idx").on(columns.asset),
|
|
foreignKey({
|
|
columns: [columns["_parentID"]],
|
|
foreignColumns: [locker_storages_items.id],
|
|
name: "locker_storages_items_equipment_attachments_parent_id_fk",
|
|
}).onDelete("cascade"),
|
|
],
|
|
);
|
|
|
|
export const locker_storages_items = pgTable(
|
|
"locker_storages_items",
|
|
{
|
|
_order: integer("_order").notNull(),
|
|
_parentID: integer("_parent_id").notNull(),
|
|
id: varchar("id").primaryKey(),
|
|
asset: integer("asset_id")
|
|
.notNull()
|
|
.references(() => assets.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
quantity: numeric("quantity", { mode: "number" }).notNull().default(1),
|
|
gridX: numeric("grid_x", { mode: "number" }).notNull().default(0),
|
|
gridY: numeric("grid_y", { mode: "number" }).notNull().default(0),
|
|
rotated: boolean("rotated").default(false),
|
|
equipment_skin: integer("equipment_skin_id").references(() => assets.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
equipment_customName: varchar("equipment_custom_name"),
|
|
},
|
|
(columns) => [
|
|
index("locker_storages_items_order_idx").on(columns._order),
|
|
index("locker_storages_items_parent_id_idx").on(columns._parentID),
|
|
index("locker_storages_items_asset_idx").on(columns.asset),
|
|
index("locker_storages_items_equipment_equipment_skin_idx").on(columns.equipment_skin),
|
|
foreignKey({
|
|
columns: [columns["_parentID"]],
|
|
foreignColumns: [locker_storages.id],
|
|
name: "locker_storages_items_parent_id_fk",
|
|
}).onDelete("cascade"),
|
|
],
|
|
);
|
|
|
|
export const locker_storages = pgTable(
|
|
"locker_storages",
|
|
{
|
|
id: serial("id").primaryKey(),
|
|
name: varchar("name").notNull().default("Personal Locker"),
|
|
ownerUser: integer("owner_user_id")
|
|
.notNull()
|
|
.references(() => users.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
itemCount: numeric("item_count", { 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("locker_storages_owner_user_idx").on(columns.ownerUser),
|
|
index("locker_storages_updated_at_idx").on(columns.updatedAt),
|
|
index("locker_storages_created_at_idx").on(columns.createdAt),
|
|
],
|
|
);
|
|
|
|
export const loadouts = pgTable(
|
|
"loadouts",
|
|
{
|
|
id: serial("id").primaryKey(),
|
|
name: varchar("name").notNull(),
|
|
description: varchar("description"),
|
|
ownerUser: integer("owner_user_id")
|
|
.notNull()
|
|
.references(() => users.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
equipped: boolean("equipped").default(false),
|
|
slots_primary: integer("slots_primary_id").references(() => assets.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
slots_secondary: integer("slots_secondary_id").references(() => assets.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
slots_launcher: integer("slots_launcher_id").references(() => assets.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
slots_uniform: integer("slots_uniform_id").references(() => assets.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
slots_vest: integer("slots_vest_id").references(() => assets.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
slots_backpack: integer("slots_backpack_id").references(() => assets.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
slots_helmet: integer("slots_helmet_id").references(() => assets.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
slots_facewear: integer("slots_facewear_id").references(() => assets.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
slots_nvg: integer("slots_nvg_id").references(() => assets.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
slots_radio: integer("slots_radio_id").references(() => assets.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
slots_optic: integer("slots_optic_id").references(() => assets.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
slots_muzzle: integer("slots_muzzle_id").references(() => assets.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
slots_bipod: integer("slots_bipod_id").references(() => assets.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("loadouts_owner_user_idx").on(columns.ownerUser),
|
|
index("loadouts_slots_slots_primary_idx").on(columns.slots_primary),
|
|
index("loadouts_slots_slots_secondary_idx").on(columns.slots_secondary),
|
|
index("loadouts_slots_slots_launcher_idx").on(columns.slots_launcher),
|
|
index("loadouts_slots_slots_uniform_idx").on(columns.slots_uniform),
|
|
index("loadouts_slots_slots_vest_idx").on(columns.slots_vest),
|
|
index("loadouts_slots_slots_backpack_idx").on(columns.slots_backpack),
|
|
index("loadouts_slots_slots_helmet_idx").on(columns.slots_helmet),
|
|
index("loadouts_slots_slots_facewear_idx").on(columns.slots_facewear),
|
|
index("loadouts_slots_slots_nvg_idx").on(columns.slots_nvg),
|
|
index("loadouts_slots_slots_radio_idx").on(columns.slots_radio),
|
|
index("loadouts_slots_slots_optic_idx").on(columns.slots_optic),
|
|
index("loadouts_slots_slots_muzzle_idx").on(columns.slots_muzzle),
|
|
index("loadouts_slots_slots_bipod_idx").on(columns.slots_bipod),
|
|
index("loadouts_updated_at_idx").on(columns.updatedAt),
|
|
index("loadouts_created_at_idx").on(columns.createdAt),
|
|
],
|
|
);
|
|
|
|
export const market_listings = pgTable(
|
|
"market_listings",
|
|
{
|
|
id: serial("id").primaryKey(),
|
|
asset: integer("asset_id")
|
|
.notNull()
|
|
.references(() => assets.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
seller: integer("seller_id").references(() => users.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
npc: integer("npc_id").references(() => game_npcs.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
quantity: numeric("quantity", { mode: "number" }).notNull().default(1),
|
|
price: numeric("price", { mode: "number" }).notNull(),
|
|
desiredPrice: numeric("desired_price", { mode: "number" }),
|
|
minPrice: numeric("min_price", { mode: "number" }),
|
|
currency: integer("currency_id").references(() => resources.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
status: enum_market_listings_status("status").notNull().default("active"),
|
|
isAutoGenerated: boolean("is_auto_generated").default(false),
|
|
listedAt: timestamp("listed_at", {
|
|
mode: "string",
|
|
withTimezone: true,
|
|
precision: 3,
|
|
}).notNull(),
|
|
expiresAt: timestamp("expires_at", { mode: "string", withTimezone: true, precision: 3 }),
|
|
soldAt: timestamp("sold_at", { mode: "string", withTimezone: true, precision: 3 }),
|
|
buyer: integer("buyer_id").references(() => users.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("market_listings_asset_idx").on(columns.asset),
|
|
index("market_listings_seller_idx").on(columns.seller),
|
|
index("market_listings_npc_idx").on(columns.npc),
|
|
index("market_listings_currency_idx").on(columns.currency),
|
|
index("market_listings_status_idx").on(columns.status),
|
|
index("market_listings_buyer_idx").on(columns.buyer),
|
|
index("market_listings_updated_at_idx").on(columns.updatedAt),
|
|
index("market_listings_created_at_idx").on(columns.createdAt),
|
|
],
|
|
);
|
|
|
|
export const market_negotiations_history = pgTable(
|
|
"market_negotiations_history",
|
|
{
|
|
_order: integer("_order").notNull(),
|
|
_parentID: integer("_parent_id").notNull(),
|
|
id: varchar("id").primaryKey(),
|
|
amount: numeric("amount", { mode: "number" }).notNull(),
|
|
from: enum_market_negotiations_history_from("from").notNull(),
|
|
note: varchar("note"),
|
|
at: timestamp("at", { mode: "string", withTimezone: true, precision: 3 }).notNull(),
|
|
},
|
|
(columns) => [
|
|
index("market_negotiations_history_order_idx").on(columns._order),
|
|
index("market_negotiations_history_parent_id_idx").on(columns._parentID),
|
|
foreignKey({
|
|
columns: [columns["_parentID"]],
|
|
foreignColumns: [market_negotiations.id],
|
|
name: "market_negotiations_history_parent_id_fk",
|
|
}).onDelete("cascade"),
|
|
],
|
|
);
|
|
|
|
export const market_negotiations = pgTable(
|
|
"market_negotiations",
|
|
{
|
|
id: serial("id").primaryKey(),
|
|
listing: integer("listing_id")
|
|
.notNull()
|
|
.references(() => market_listings.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
buyer: integer("buyer_id")
|
|
.notNull()
|
|
.references(() => users.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
status: enum_market_negotiations_status("status").notNull().default("open"),
|
|
patience: numeric("patience", { mode: "number" }).default(0),
|
|
amount: numeric("amount", { mode: "number" }).notNull(),
|
|
proposedBy: enum_market_negotiations_proposed_by("proposed_by").notNull().default("buyer"),
|
|
acceptedPrice: numeric("accepted_price", { 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("market_negotiations_listing_idx").on(columns.listing),
|
|
index("market_negotiations_buyer_idx").on(columns.buyer),
|
|
index("market_negotiations_status_idx").on(columns.status),
|
|
index("market_negotiations_updated_at_idx").on(columns.updatedAt),
|
|
index("market_negotiations_created_at_idx").on(columns.createdAt),
|
|
],
|
|
);
|
|
|
|
export const maps = pgTable(
|
|
"maps",
|
|
{
|
|
id: serial("id").primaryKey(),
|
|
name: varchar("name").notNull(),
|
|
fileName: varchar("file_name"),
|
|
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) => [
|
|
uniqueIndex("maps_name_idx").on(columns.name),
|
|
uniqueIndex("maps_file_name_idx").on(columns.fileName),
|
|
index("maps_updated_at_idx").on(columns.updatedAt),
|
|
index("maps_created_at_idx").on(columns.createdAt),
|
|
],
|
|
);
|
|
|
|
export const narrative_events = pgTable(
|
|
"narrative_events",
|
|
{
|
|
id: serial("id").primaryKey(),
|
|
name: varchar("name").notNull(),
|
|
summary: varchar("summary").notNull(),
|
|
flowData: jsonb("flow_data").notNull(),
|
|
triggers_type: enum_narrative_events_triggers_type("triggers_type").default("manual"),
|
|
triggers_condition: jsonb("triggers_condition"),
|
|
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("narrative_events_updated_at_idx").on(columns.updatedAt),
|
|
index("narrative_events_created_at_idx").on(columns.createdAt),
|
|
],
|
|
);
|
|
|
|
export const mission_files = pgTable(
|
|
"mission_files",
|
|
{
|
|
id: serial("id").primaryKey(),
|
|
missionFileName: varchar("mission_file_name").notNull(),
|
|
author: integer("author_id")
|
|
.notNull()
|
|
.references(() => users.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(),
|
|
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("mission_files_author_idx").on(columns.author),
|
|
index("mission_files_updated_at_idx").on(columns.updatedAt),
|
|
index("mission_files_created_at_idx").on(columns.createdAt),
|
|
uniqueIndex("mission_files_filename_idx").on(columns.filename),
|
|
],
|
|
);
|
|
|
|
export const mod_lists = pgTable(
|
|
"mod_lists",
|
|
{
|
|
id: serial("id").primaryKey(),
|
|
modlistName: varchar("modlist_name").notNull(),
|
|
author: integer("author_id")
|
|
.notNull()
|
|
.references(() => users.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(),
|
|
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("mod_lists_author_idx").on(columns.author),
|
|
index("mod_lists_updated_at_idx").on(columns.updatedAt),
|
|
index("mod_lists_created_at_idx").on(columns.createdAt),
|
|
uniqueIndex("mod_lists_filename_idx").on(columns.filename),
|
|
],
|
|
);
|
|
|
|
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(),
|
|
mediaID: integer("media_id"),
|
|
"game-hard-resourcesID": integer("game_hard_resources_id"),
|
|
"game-structuresID": integer("game_structures_id"),
|
|
"game-vehiclesID": integer("game_vehicles_id"),
|
|
"game-npcsID": integer("game_npcs_id"),
|
|
"game-event-logsID": integer("game_event_logs_id"),
|
|
usersID: integer("users_id"),
|
|
ranksID: integer("ranks_id"),
|
|
profilesID: integer("profiles_id"),
|
|
awardsID: integer("awards_id"),
|
|
qualificationsID: integer("qualifications_id"),
|
|
assignmentsID: integer("assignments_id"),
|
|
experienceID: integer("experience_id"),
|
|
"user-notificationsID": integer("user_notifications_id"),
|
|
missionsID: integer("missions_id"),
|
|
campaignsID: integer("campaigns_id"),
|
|
factionsID: integer("factions_id"),
|
|
technologiesID: integer("technologies_id"),
|
|
assetsID: integer("assets_id"),
|
|
resourcesID: integer("resources_id"),
|
|
vehiclesID: integer("vehicles_id"),
|
|
structuresID: integer("structures_id"),
|
|
shipmentsID: integer("shipments_id"),
|
|
"bank-accountsID": integer("bank_accounts_id"),
|
|
"bank-transactionsID": integer("bank_transactions_id"),
|
|
"ledger-entriesID": integer("ledger_entries_id"),
|
|
"locker-storagesID": integer("locker_storages_id"),
|
|
loadoutsID: integer("loadouts_id"),
|
|
"market-listingsID": integer("market_listings_id"),
|
|
"market-negotiationsID": integer("market_negotiations_id"),
|
|
mapsID: integer("maps_id"),
|
|
"narrative-eventsID": integer("narrative_events_id"),
|
|
"mission-filesID": integer("mission_files_id"),
|
|
"mod-listsID": integer("mod_lists_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_media_id_idx").on(columns.mediaID),
|
|
index("payload_locked_documents_rels_game_hard_resources_id_idx").on(
|
|
columns["game-hard-resourcesID"],
|
|
),
|
|
index("payload_locked_documents_rels_game_structures_id_idx").on(columns["game-structuresID"]),
|
|
index("payload_locked_documents_rels_game_vehicles_id_idx").on(columns["game-vehiclesID"]),
|
|
index("payload_locked_documents_rels_game_npcs_id_idx").on(columns["game-npcsID"]),
|
|
index("payload_locked_documents_rels_game_event_logs_id_idx").on(columns["game-event-logsID"]),
|
|
index("payload_locked_documents_rels_users_id_idx").on(columns.usersID),
|
|
index("payload_locked_documents_rels_ranks_id_idx").on(columns.ranksID),
|
|
index("payload_locked_documents_rels_profiles_id_idx").on(columns.profilesID),
|
|
index("payload_locked_documents_rels_awards_id_idx").on(columns.awardsID),
|
|
index("payload_locked_documents_rels_qualifications_id_idx").on(columns.qualificationsID),
|
|
index("payload_locked_documents_rels_assignments_id_idx").on(columns.assignmentsID),
|
|
index("payload_locked_documents_rels_experience_id_idx").on(columns.experienceID),
|
|
index("payload_locked_documents_rels_user_notifications_id_idx").on(
|
|
columns["user-notificationsID"],
|
|
),
|
|
index("payload_locked_documents_rels_missions_id_idx").on(columns.missionsID),
|
|
index("payload_locked_documents_rels_campaigns_id_idx").on(columns.campaignsID),
|
|
index("payload_locked_documents_rels_factions_id_idx").on(columns.factionsID),
|
|
index("payload_locked_documents_rels_technologies_id_idx").on(columns.technologiesID),
|
|
index("payload_locked_documents_rels_assets_id_idx").on(columns.assetsID),
|
|
index("payload_locked_documents_rels_resources_id_idx").on(columns.resourcesID),
|
|
index("payload_locked_documents_rels_vehicles_id_idx").on(columns.vehiclesID),
|
|
index("payload_locked_documents_rels_structures_id_idx").on(columns.structuresID),
|
|
index("payload_locked_documents_rels_shipments_id_idx").on(columns.shipmentsID),
|
|
index("payload_locked_documents_rels_bank_accounts_id_idx").on(columns["bank-accountsID"]),
|
|
index("payload_locked_documents_rels_bank_transactions_id_idx").on(
|
|
columns["bank-transactionsID"],
|
|
),
|
|
index("payload_locked_documents_rels_ledger_entries_id_idx").on(columns["ledger-entriesID"]),
|
|
index("payload_locked_documents_rels_locker_storages_id_idx").on(columns["locker-storagesID"]),
|
|
index("payload_locked_documents_rels_loadouts_id_idx").on(columns.loadoutsID),
|
|
index("payload_locked_documents_rels_market_listings_id_idx").on(columns["market-listingsID"]),
|
|
index("payload_locked_documents_rels_market_negotiations_id_idx").on(
|
|
columns["market-negotiationsID"],
|
|
),
|
|
index("payload_locked_documents_rels_maps_id_idx").on(columns.mapsID),
|
|
index("payload_locked_documents_rels_narrative_events_id_idx").on(
|
|
columns["narrative-eventsID"],
|
|
),
|
|
index("payload_locked_documents_rels_mission_files_id_idx").on(columns["mission-filesID"]),
|
|
index("payload_locked_documents_rels_mod_lists_id_idx").on(columns["mod-listsID"]),
|
|
foreignKey({
|
|
columns: [columns["parent"]],
|
|
foreignColumns: [payload_locked_documents.id],
|
|
name: "payload_locked_documents_rels_parent_fk",
|
|
}).onDelete("cascade"),
|
|
foreignKey({
|
|
columns: [columns["mediaID"]],
|
|
foreignColumns: [media.id],
|
|
name: "payload_locked_documents_rels_media_fk",
|
|
}).onDelete("cascade"),
|
|
foreignKey({
|
|
columns: [columns["game-hard-resourcesID"]],
|
|
foreignColumns: [game_hard_resources.id],
|
|
name: "payload_locked_documents_rels_game_hard_resources_fk",
|
|
}).onDelete("cascade"),
|
|
foreignKey({
|
|
columns: [columns["game-structuresID"]],
|
|
foreignColumns: [game_structures.id],
|
|
name: "payload_locked_documents_rels_game_structures_fk",
|
|
}).onDelete("cascade"),
|
|
foreignKey({
|
|
columns: [columns["game-vehiclesID"]],
|
|
foreignColumns: [game_vehicles.id],
|
|
name: "payload_locked_documents_rels_game_vehicles_fk",
|
|
}).onDelete("cascade"),
|
|
foreignKey({
|
|
columns: [columns["game-npcsID"]],
|
|
foreignColumns: [game_npcs.id],
|
|
name: "payload_locked_documents_rels_game_npcs_fk",
|
|
}).onDelete("cascade"),
|
|
foreignKey({
|
|
columns: [columns["game-event-logsID"]],
|
|
foreignColumns: [game_event_logs.id],
|
|
name: "payload_locked_documents_rels_game_event_logs_fk",
|
|
}).onDelete("cascade"),
|
|
foreignKey({
|
|
columns: [columns["usersID"]],
|
|
foreignColumns: [users.id],
|
|
name: "payload_locked_documents_rels_users_fk",
|
|
}).onDelete("cascade"),
|
|
foreignKey({
|
|
columns: [columns["ranksID"]],
|
|
foreignColumns: [ranks.id],
|
|
name: "payload_locked_documents_rels_ranks_fk",
|
|
}).onDelete("cascade"),
|
|
foreignKey({
|
|
columns: [columns["profilesID"]],
|
|
foreignColumns: [profiles.id],
|
|
name: "payload_locked_documents_rels_profiles_fk",
|
|
}).onDelete("cascade"),
|
|
foreignKey({
|
|
columns: [columns["awardsID"]],
|
|
foreignColumns: [awards.id],
|
|
name: "payload_locked_documents_rels_awards_fk",
|
|
}).onDelete("cascade"),
|
|
foreignKey({
|
|
columns: [columns["qualificationsID"]],
|
|
foreignColumns: [qualifications.id],
|
|
name: "payload_locked_documents_rels_qualifications_fk",
|
|
}).onDelete("cascade"),
|
|
foreignKey({
|
|
columns: [columns["assignmentsID"]],
|
|
foreignColumns: [assignments.id],
|
|
name: "payload_locked_documents_rels_assignments_fk",
|
|
}).onDelete("cascade"),
|
|
foreignKey({
|
|
columns: [columns["experienceID"]],
|
|
foreignColumns: [experience.id],
|
|
name: "payload_locked_documents_rels_experience_fk",
|
|
}).onDelete("cascade"),
|
|
foreignKey({
|
|
columns: [columns["user-notificationsID"]],
|
|
foreignColumns: [user_notifications.id],
|
|
name: "payload_locked_documents_rels_user_notifications_fk",
|
|
}).onDelete("cascade"),
|
|
foreignKey({
|
|
columns: [columns["missionsID"]],
|
|
foreignColumns: [missions.id],
|
|
name: "payload_locked_documents_rels_missions_fk",
|
|
}).onDelete("cascade"),
|
|
foreignKey({
|
|
columns: [columns["campaignsID"]],
|
|
foreignColumns: [campaigns.id],
|
|
name: "payload_locked_documents_rels_campaigns_fk",
|
|
}).onDelete("cascade"),
|
|
foreignKey({
|
|
columns: [columns["factionsID"]],
|
|
foreignColumns: [factions.id],
|
|
name: "payload_locked_documents_rels_factions_fk",
|
|
}).onDelete("cascade"),
|
|
foreignKey({
|
|
columns: [columns["technologiesID"]],
|
|
foreignColumns: [technologies.id],
|
|
name: "payload_locked_documents_rels_technologies_fk",
|
|
}).onDelete("cascade"),
|
|
foreignKey({
|
|
columns: [columns["assetsID"]],
|
|
foreignColumns: [assets.id],
|
|
name: "payload_locked_documents_rels_assets_fk",
|
|
}).onDelete("cascade"),
|
|
foreignKey({
|
|
columns: [columns["resourcesID"]],
|
|
foreignColumns: [resources.id],
|
|
name: "payload_locked_documents_rels_resources_fk",
|
|
}).onDelete("cascade"),
|
|
foreignKey({
|
|
columns: [columns["vehiclesID"]],
|
|
foreignColumns: [vehicles.id],
|
|
name: "payload_locked_documents_rels_vehicles_fk",
|
|
}).onDelete("cascade"),
|
|
foreignKey({
|
|
columns: [columns["structuresID"]],
|
|
foreignColumns: [structures.id],
|
|
name: "payload_locked_documents_rels_structures_fk",
|
|
}).onDelete("cascade"),
|
|
foreignKey({
|
|
columns: [columns["shipmentsID"]],
|
|
foreignColumns: [shipments.id],
|
|
name: "payload_locked_documents_rels_shipments_fk",
|
|
}).onDelete("cascade"),
|
|
foreignKey({
|
|
columns: [columns["bank-accountsID"]],
|
|
foreignColumns: [bank_accounts.id],
|
|
name: "payload_locked_documents_rels_bank_accounts_fk",
|
|
}).onDelete("cascade"),
|
|
foreignKey({
|
|
columns: [columns["bank-transactionsID"]],
|
|
foreignColumns: [bank_transactions.id],
|
|
name: "payload_locked_documents_rels_bank_transactions_fk",
|
|
}).onDelete("cascade"),
|
|
foreignKey({
|
|
columns: [columns["ledger-entriesID"]],
|
|
foreignColumns: [ledger_entries.id],
|
|
name: "payload_locked_documents_rels_ledger_entries_fk",
|
|
}).onDelete("cascade"),
|
|
foreignKey({
|
|
columns: [columns["locker-storagesID"]],
|
|
foreignColumns: [locker_storages.id],
|
|
name: "payload_locked_documents_rels_locker_storages_fk",
|
|
}).onDelete("cascade"),
|
|
foreignKey({
|
|
columns: [columns["loadoutsID"]],
|
|
foreignColumns: [loadouts.id],
|
|
name: "payload_locked_documents_rels_loadouts_fk",
|
|
}).onDelete("cascade"),
|
|
foreignKey({
|
|
columns: [columns["market-listingsID"]],
|
|
foreignColumns: [market_listings.id],
|
|
name: "payload_locked_documents_rels_market_listings_fk",
|
|
}).onDelete("cascade"),
|
|
foreignKey({
|
|
columns: [columns["market-negotiationsID"]],
|
|
foreignColumns: [market_negotiations.id],
|
|
name: "payload_locked_documents_rels_market_negotiations_fk",
|
|
}).onDelete("cascade"),
|
|
foreignKey({
|
|
columns: [columns["mapsID"]],
|
|
foreignColumns: [maps.id],
|
|
name: "payload_locked_documents_rels_maps_fk",
|
|
}).onDelete("cascade"),
|
|
foreignKey({
|
|
columns: [columns["narrative-eventsID"]],
|
|
foreignColumns: [narrative_events.id],
|
|
name: "payload_locked_documents_rels_narrative_events_fk",
|
|
}).onDelete("cascade"),
|
|
foreignKey({
|
|
columns: [columns["mission-filesID"]],
|
|
foreignColumns: [mission_files.id],
|
|
name: "payload_locked_documents_rels_mission_files_fk",
|
|
}).onDelete("cascade"),
|
|
foreignKey({
|
|
columns: [columns["mod-listsID"]],
|
|
foreignColumns: [mod_lists.id],
|
|
name: "payload_locked_documents_rels_mod_lists_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 game_rules = pgTable(
|
|
"game_rules",
|
|
{
|
|
id: serial("id").primaryKey(),
|
|
mainCurrency: integer("main_currency_id")
|
|
.notNull()
|
|
.references(() => resources.id, {
|
|
onDelete: "set null",
|
|
}),
|
|
proximityThreshold: numeric("proximity_threshold", { mode: "number" }).default(10),
|
|
gameTickIntervalMinutes: numeric("game_tick_interval_minutes", { mode: "number" }).default(10),
|
|
lockerGridWidth: numeric("locker_grid_width", { mode: "number" }).default(10),
|
|
lockerGridHeight: numeric("locker_grid_height", { mode: "number" }).default(6),
|
|
updatedAt: timestamp("updated_at", { mode: "string", withTimezone: true, precision: 3 }),
|
|
createdAt: timestamp("created_at", { mode: "string", withTimezone: true, precision: 3 }),
|
|
},
|
|
(columns) => [index("game_rules_main_currency_idx").on(columns.mainCurrency)],
|
|
);
|
|
|
|
export const game_rules_rels = pgTable(
|
|
"game_rules_rels",
|
|
{
|
|
id: serial("id").primaryKey(),
|
|
order: integer("order"),
|
|
parent: integer("parent_id").notNull(),
|
|
path: varchar("path").notNull(),
|
|
assignmentsID: integer("assignments_id"),
|
|
},
|
|
(columns) => [
|
|
index("game_rules_rels_order_idx").on(columns.order),
|
|
index("game_rules_rels_parent_idx").on(columns.parent),
|
|
index("game_rules_rels_path_idx").on(columns.path),
|
|
index("game_rules_rels_assignments_id_idx").on(columns.assignmentsID),
|
|
foreignKey({
|
|
columns: [columns["parent"]],
|
|
foreignColumns: [game_rules.id],
|
|
name: "game_rules_rels_parent_fk",
|
|
}).onDelete("cascade"),
|
|
foreignKey({
|
|
columns: [columns["assignmentsID"]],
|
|
foreignColumns: [assignments.id],
|
|
name: "game_rules_rels_assignments_fk",
|
|
}).onDelete("cascade"),
|
|
],
|
|
);
|
|
|
|
export const relations_media = relations(media, () => ({}));
|
|
export const relations_game_hard_resources = relations(game_hard_resources, () => ({}));
|
|
export const relations_game_structures_stored_resources = relations(
|
|
game_structures_stored_resources,
|
|
({ one }) => ({
|
|
_parentID: one(game_structures, {
|
|
fields: [game_structures_stored_resources._parentID],
|
|
references: [game_structures.id],
|
|
relationName: "storedResources",
|
|
}),
|
|
resource: one(resources, {
|
|
fields: [game_structures_stored_resources.resource],
|
|
references: [resources.id],
|
|
relationName: "resource",
|
|
}),
|
|
}),
|
|
);
|
|
export const relations_game_structures_void_storage = relations(
|
|
game_structures_void_storage,
|
|
({ one }) => ({
|
|
_parentID: one(game_structures, {
|
|
fields: [game_structures_void_storage._parentID],
|
|
references: [game_structures.id],
|
|
relationName: "voidStorage",
|
|
}),
|
|
resource: one(resources, {
|
|
fields: [game_structures_void_storage.resource],
|
|
references: [resources.id],
|
|
relationName: "resource",
|
|
}),
|
|
}),
|
|
);
|
|
export const relations_game_structures = relations(game_structures, ({ one, many }) => ({
|
|
type: one(structures, {
|
|
fields: [game_structures.type],
|
|
references: [structures.id],
|
|
relationName: "type",
|
|
}),
|
|
faction: one(factions, {
|
|
fields: [game_structures.faction],
|
|
references: [factions.id],
|
|
relationName: "faction",
|
|
}),
|
|
storedResources: many(game_structures_stored_resources, {
|
|
relationName: "storedResources",
|
|
}),
|
|
voidStorage: many(game_structures_void_storage, {
|
|
relationName: "voidStorage",
|
|
}),
|
|
}));
|
|
export const relations_game_vehicles_stored_resources = relations(
|
|
game_vehicles_stored_resources,
|
|
({ one }) => ({
|
|
_parentID: one(game_vehicles, {
|
|
fields: [game_vehicles_stored_resources._parentID],
|
|
references: [game_vehicles.id],
|
|
relationName: "storedResources",
|
|
}),
|
|
resource: one(resources, {
|
|
fields: [game_vehicles_stored_resources.resource],
|
|
references: [resources.id],
|
|
relationName: "resource",
|
|
}),
|
|
}),
|
|
);
|
|
export const relations_game_vehicles_void_storage = relations(
|
|
game_vehicles_void_storage,
|
|
({ one }) => ({
|
|
_parentID: one(game_vehicles, {
|
|
fields: [game_vehicles_void_storage._parentID],
|
|
references: [game_vehicles.id],
|
|
relationName: "voidStorage",
|
|
}),
|
|
resource: one(resources, {
|
|
fields: [game_vehicles_void_storage.resource],
|
|
references: [resources.id],
|
|
relationName: "resource",
|
|
}),
|
|
}),
|
|
);
|
|
export const relations_game_vehicles = relations(game_vehicles, ({ one, many }) => ({
|
|
type: one(vehicles, {
|
|
fields: [game_vehicles.type],
|
|
references: [vehicles.id],
|
|
relationName: "type",
|
|
}),
|
|
deployedAt: one(game_structures, {
|
|
fields: [game_vehicles.deployedAt],
|
|
references: [game_structures.id],
|
|
relationName: "deployedAt",
|
|
}),
|
|
faction: one(factions, {
|
|
fields: [game_vehicles.faction],
|
|
references: [factions.id],
|
|
relationName: "faction",
|
|
}),
|
|
storedResources: many(game_vehicles_stored_resources, {
|
|
relationName: "storedResources",
|
|
}),
|
|
voidStorage: many(game_vehicles_void_storage, {
|
|
relationName: "voidStorage",
|
|
}),
|
|
}));
|
|
export const relations_game_npcs_rels = relations(game_npcs_rels, ({ one }) => ({
|
|
parent: one(game_npcs, {
|
|
fields: [game_npcs_rels.parent],
|
|
references: [game_npcs.id],
|
|
relationName: "_rels",
|
|
}),
|
|
assetsID: one(assets, {
|
|
fields: [game_npcs_rels.assetsID],
|
|
references: [assets.id],
|
|
relationName: "assets",
|
|
}),
|
|
}));
|
|
export const relations_game_npcs = relations(game_npcs, ({ one, many }) => ({
|
|
location: one(game_structures, {
|
|
fields: [game_npcs.location],
|
|
references: [game_structures.id],
|
|
relationName: "location",
|
|
}),
|
|
faction: one(factions, {
|
|
fields: [game_npcs.faction],
|
|
references: [factions.id],
|
|
relationName: "faction",
|
|
}),
|
|
_rels: many(game_npcs_rels, {
|
|
relationName: "_rels",
|
|
}),
|
|
}));
|
|
export const relations_game_event_logs = relations(game_event_logs, ({ one }) => ({
|
|
actor: one(users, {
|
|
fields: [game_event_logs.actor],
|
|
references: [users.id],
|
|
relationName: "actor",
|
|
}),
|
|
structure: one(game_structures, {
|
|
fields: [game_event_logs.structure],
|
|
references: [game_structures.id],
|
|
relationName: "structure",
|
|
}),
|
|
}));
|
|
export const relations_users_roles = relations(users_roles, ({ one }) => ({
|
|
parent: one(users, {
|
|
fields: [users_roles.parent],
|
|
references: [users.id],
|
|
relationName: "roles",
|
|
}),
|
|
}));
|
|
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 }) => ({
|
|
roles: many(users_roles, {
|
|
relationName: "roles",
|
|
}),
|
|
sessions: many(users_sessions, {
|
|
relationName: "sessions",
|
|
}),
|
|
}));
|
|
export const relations_ranks = relations(ranks, ({ one }) => ({
|
|
insignia: one(media, {
|
|
fields: [ranks.insignia],
|
|
references: [media.id],
|
|
relationName: "insignia",
|
|
}),
|
|
}));
|
|
export const relations_profiles_rels = relations(profiles_rels, ({ one }) => ({
|
|
parent: one(profiles, {
|
|
fields: [profiles_rels.parent],
|
|
references: [profiles.id],
|
|
relationName: "_rels",
|
|
}),
|
|
awardsID: one(awards, {
|
|
fields: [profiles_rels.awardsID],
|
|
references: [awards.id],
|
|
relationName: "awards",
|
|
}),
|
|
qualificationsID: one(qualifications, {
|
|
fields: [profiles_rels.qualificationsID],
|
|
references: [qualifications.id],
|
|
relationName: "qualifications",
|
|
}),
|
|
}));
|
|
export const relations_profiles = relations(profiles, ({ one, many }) => ({
|
|
user: one(users, {
|
|
fields: [profiles.user],
|
|
references: [users.id],
|
|
relationName: "user",
|
|
}),
|
|
rank: one(ranks, {
|
|
fields: [profiles.rank],
|
|
references: [ranks.id],
|
|
relationName: "rank",
|
|
}),
|
|
_rels: many(profiles_rels, {
|
|
relationName: "_rels",
|
|
}),
|
|
}));
|
|
export const relations_awards = relations(awards, ({ one }) => ({
|
|
image: one(media, {
|
|
fields: [awards.image],
|
|
references: [media.id],
|
|
relationName: "image",
|
|
}),
|
|
}));
|
|
export const relations_qualifications = relations(qualifications, () => ({}));
|
|
export const relations_assignments_rels = relations(assignments_rels, ({ one }) => ({
|
|
parent: one(assignments, {
|
|
fields: [assignments_rels.parent],
|
|
references: [assignments.id],
|
|
relationName: "_rels",
|
|
}),
|
|
assignmentsID: one(assignments, {
|
|
fields: [assignments_rels.assignmentsID],
|
|
references: [assignments.id],
|
|
relationName: "assignments",
|
|
}),
|
|
usersID: one(users, {
|
|
fields: [assignments_rels.usersID],
|
|
references: [users.id],
|
|
relationName: "users",
|
|
}),
|
|
}));
|
|
export const relations_assignments = relations(assignments, ({ one, many }) => ({
|
|
leader: one(users, {
|
|
fields: [assignments.leader],
|
|
references: [users.id],
|
|
relationName: "leader",
|
|
}),
|
|
_rels: many(assignments_rels, {
|
|
relationName: "_rels",
|
|
}),
|
|
}));
|
|
export const relations_experience = relations(experience, () => ({}));
|
|
export const relations_user_notifications = relations(user_notifications, ({ one }) => ({
|
|
user: one(users, {
|
|
fields: [user_notifications.user],
|
|
references: [users.id],
|
|
relationName: "user",
|
|
}),
|
|
}));
|
|
export const relations_missions_mission_roles_provided_roles = relations(
|
|
missions_mission_roles_provided_roles,
|
|
({ one }) => ({
|
|
_parentID: one(missions, {
|
|
fields: [missions_mission_roles_provided_roles._parentID],
|
|
references: [missions.id],
|
|
relationName: "missionRoles_providedRoles",
|
|
}),
|
|
minimumRank: one(ranks, {
|
|
fields: [missions_mission_roles_provided_roles.minimumRank],
|
|
references: [ranks.id],
|
|
relationName: "minimumRank",
|
|
}),
|
|
}),
|
|
);
|
|
export const relations_missions_briefing = relations(missions_briefing, ({ one }) => ({
|
|
_parentID: one(missions, {
|
|
fields: [missions_briefing._parentID],
|
|
references: [missions.id],
|
|
relationName: "briefing",
|
|
}),
|
|
}));
|
|
export const relations_missions_mission_objectives = relations(
|
|
missions_mission_objectives,
|
|
({ one }) => ({
|
|
_parentID: one(missions, {
|
|
fields: [missions_mission_objectives._parentID],
|
|
references: [missions.id],
|
|
relationName: "missionObjectives",
|
|
}),
|
|
}),
|
|
);
|
|
export const relations_missions_factions_involved = relations(
|
|
missions_factions_involved,
|
|
({ one }) => ({
|
|
_parentID: one(missions, {
|
|
fields: [missions_factions_involved._parentID],
|
|
references: [missions.id],
|
|
relationName: "factionsInvolved",
|
|
}),
|
|
faction: one(factions, {
|
|
fields: [missions_factions_involved.faction],
|
|
references: [factions.id],
|
|
relationName: "faction",
|
|
}),
|
|
}),
|
|
);
|
|
export const relations_missions_logistics_and_support_insertion = relations(
|
|
missions_logistics_and_support_insertion,
|
|
({ one }) => ({
|
|
parent: one(missions, {
|
|
fields: [missions_logistics_and_support_insertion.parent],
|
|
references: [missions.id],
|
|
relationName: "logisticsAndSupport_insertion",
|
|
}),
|
|
}),
|
|
);
|
|
export const relations_missions_logistics_and_support_extraction = relations(
|
|
missions_logistics_and_support_extraction,
|
|
({ one }) => ({
|
|
parent: one(missions, {
|
|
fields: [missions_logistics_and_support_extraction.parent],
|
|
references: [missions.id],
|
|
relationName: "logisticsAndSupport_extraction",
|
|
}),
|
|
}),
|
|
);
|
|
export const relations_missions_logistics_and_support_assets_available = relations(
|
|
missions_logistics_and_support_assets_available,
|
|
({ one }) => ({
|
|
_parentID: one(missions, {
|
|
fields: [missions_logistics_and_support_assets_available._parentID],
|
|
references: [missions.id],
|
|
relationName: "logisticsAndSupport_assetsAvailable",
|
|
}),
|
|
}),
|
|
);
|
|
export const relations_missions_comms_and_docs_frequencies = relations(
|
|
missions_comms_and_docs_frequencies,
|
|
({ one }) => ({
|
|
_parentID: one(missions, {
|
|
fields: [missions_comms_and_docs_frequencies._parentID],
|
|
references: [missions.id],
|
|
relationName: "commsAndDocs_frequencies",
|
|
}),
|
|
}),
|
|
);
|
|
export const relations_missions_rels = relations(missions_rels, ({ one }) => ({
|
|
parent: one(missions, {
|
|
fields: [missions_rels.parent],
|
|
references: [missions.id],
|
|
relationName: "_rels",
|
|
}),
|
|
usersID: one(users, {
|
|
fields: [missions_rels.usersID],
|
|
references: [users.id],
|
|
relationName: "users",
|
|
}),
|
|
qualificationsID: one(qualifications, {
|
|
fields: [missions_rels.qualificationsID],
|
|
references: [qualifications.id],
|
|
relationName: "qualifications",
|
|
}),
|
|
}));
|
|
export const relations_missions = relations(missions, ({ one, many }) => ({
|
|
classification_map: one(maps, {
|
|
fields: [missions.classification_map],
|
|
references: [maps.id],
|
|
relationName: "classification_map",
|
|
}),
|
|
classification_campaign: one(campaigns, {
|
|
fields: [missions.classification_campaign],
|
|
references: [campaigns.id],
|
|
relationName: "classification_campaign",
|
|
}),
|
|
missionRoles_providedRoles: many(missions_mission_roles_provided_roles, {
|
|
relationName: "missionRoles_providedRoles",
|
|
}),
|
|
briefing: many(missions_briefing, {
|
|
relationName: "briefing",
|
|
}),
|
|
missionObjectives: many(missions_mission_objectives, {
|
|
relationName: "missionObjectives",
|
|
}),
|
|
factionsInvolved: many(missions_factions_involved, {
|
|
relationName: "factionsInvolved",
|
|
}),
|
|
gameDetails_gameSetup_missionFile: one(mission_files, {
|
|
fields: [missions.gameDetails_gameSetup_missionFile],
|
|
references: [mission_files.id],
|
|
relationName: "gameDetails_gameSetup_missionFile",
|
|
}),
|
|
gameDetails_gameSetup_requiredMods: one(mod_lists, {
|
|
fields: [missions.gameDetails_gameSetup_requiredMods],
|
|
references: [mod_lists.id],
|
|
relationName: "gameDetails_gameSetup_requiredMods",
|
|
}),
|
|
logisticsAndSupport_insertion: many(missions_logistics_and_support_insertion, {
|
|
relationName: "logisticsAndSupport_insertion",
|
|
}),
|
|
logisticsAndSupport_extraction: many(missions_logistics_and_support_extraction, {
|
|
relationName: "logisticsAndSupport_extraction",
|
|
}),
|
|
logisticsAndSupport_assetsAvailable: many(missions_logistics_and_support_assets_available, {
|
|
relationName: "logisticsAndSupport_assetsAvailable",
|
|
}),
|
|
commsAndDocs_frequencies: many(missions_comms_and_docs_frequencies, {
|
|
relationName: "commsAndDocs_frequencies",
|
|
}),
|
|
_rels: many(missions_rels, {
|
|
relationName: "_rels",
|
|
}),
|
|
}));
|
|
export const relations_campaigns = relations(campaigns, () => ({}));
|
|
export const relations_factions_rels = relations(factions_rels, ({ one }) => ({
|
|
parent: one(factions, {
|
|
fields: [factions_rels.parent],
|
|
references: [factions.id],
|
|
relationName: "_rels",
|
|
}),
|
|
campaignsID: one(campaigns, {
|
|
fields: [factions_rels.campaignsID],
|
|
references: [campaigns.id],
|
|
relationName: "campaigns",
|
|
}),
|
|
}));
|
|
export const relations_factions = relations(factions, ({ many }) => ({
|
|
_rels: many(factions_rels, {
|
|
relationName: "_rels",
|
|
}),
|
|
}));
|
|
export const relations_technologies_requirements_prerequisite_technologies = relations(
|
|
technologies_requirements_prerequisite_technologies,
|
|
({ one }) => ({
|
|
_parentID: one(technologies, {
|
|
fields: [technologies_requirements_prerequisite_technologies._parentID],
|
|
references: [technologies.id],
|
|
relationName: "requirements_prerequisiteTechnologies",
|
|
}),
|
|
}),
|
|
);
|
|
export const relations_technologies_research_costs_resources = relations(
|
|
technologies_research_costs_resources,
|
|
({ one }) => ({
|
|
_parentID: one(technologies, {
|
|
fields: [technologies_research_costs_resources._parentID],
|
|
references: [technologies.id],
|
|
relationName: "researchCosts_resources",
|
|
}),
|
|
resource: one(resources, {
|
|
fields: [technologies_research_costs_resources.resource],
|
|
references: [resources.id],
|
|
relationName: "resource",
|
|
}),
|
|
}),
|
|
);
|
|
export const relations_technologies_rels = relations(technologies_rels, ({ one }) => ({
|
|
parent: one(technologies, {
|
|
fields: [technologies_rels.parent],
|
|
references: [technologies.id],
|
|
relationName: "_rels",
|
|
}),
|
|
technologiesID: one(technologies, {
|
|
fields: [technologies_rels.technologiesID],
|
|
references: [technologies.id],
|
|
relationName: "technologies",
|
|
}),
|
|
}));
|
|
export const relations_technologies = relations(technologies, ({ many }) => ({
|
|
requirements_prerequisiteTechnologies: many(technologies_requirements_prerequisite_technologies, {
|
|
relationName: "requirements_prerequisiteTechnologies",
|
|
}),
|
|
researchCosts_resources: many(technologies_research_costs_resources, {
|
|
relationName: "researchCosts_resources",
|
|
}),
|
|
_rels: many(technologies_rels, {
|
|
relationName: "_rels",
|
|
}),
|
|
}));
|
|
export const relations_assets_skin_configuration_applies_to_asset_types = relations(
|
|
assets_skin_configuration_applies_to_asset_types,
|
|
({ one }) => ({
|
|
parent: one(assets, {
|
|
fields: [assets_skin_configuration_applies_to_asset_types.parent],
|
|
references: [assets.id],
|
|
relationName: "Skin Configuration_appliesToAssetTypes",
|
|
}),
|
|
}),
|
|
);
|
|
export const relations_assets_crafting_crafting_data_inputs = relations(
|
|
assets_crafting_crafting_data_inputs,
|
|
({ one }) => ({
|
|
_parentID: one(assets, {
|
|
fields: [assets_crafting_crafting_data_inputs._parentID],
|
|
references: [assets.id],
|
|
relationName: "crafting_craftingData_inputs",
|
|
}),
|
|
}),
|
|
);
|
|
export const relations_assets_crafting_crafting_data_byproducts = relations(
|
|
assets_crafting_crafting_data_byproducts,
|
|
({ one }) => ({
|
|
_parentID: one(assets, {
|
|
fields: [assets_crafting_crafting_data_byproducts._parentID],
|
|
references: [assets.id],
|
|
relationName: "crafting_craftingData_byproducts",
|
|
}),
|
|
}),
|
|
);
|
|
export const relations_assets_rels = relations(assets_rels, ({ one }) => ({
|
|
parent: one(assets, {
|
|
fields: [assets_rels.parent],
|
|
references: [assets.id],
|
|
relationName: "_rels",
|
|
}),
|
|
assetsID: one(assets, {
|
|
fields: [assets_rels.assetsID],
|
|
references: [assets.id],
|
|
relationName: "assets",
|
|
}),
|
|
technologiesID: one(technologies, {
|
|
fields: [assets_rels.technologiesID],
|
|
references: [technologies.id],
|
|
relationName: "technologies",
|
|
}),
|
|
resourcesID: one(resources, {
|
|
fields: [assets_rels.resourcesID],
|
|
references: [resources.id],
|
|
relationName: "resources",
|
|
}),
|
|
structuresID: one(structures, {
|
|
fields: [assets_rels.structuresID],
|
|
references: [structures.id],
|
|
relationName: "structures",
|
|
}),
|
|
}));
|
|
export const relations_assets = relations(assets, ({ one, many }) => ({
|
|
"Skin Configuration_appliesToAssetTypes": many(assets_skin_configuration_applies_to_asset_types, {
|
|
relationName: "Skin Configuration_appliesToAssetTypes",
|
|
}),
|
|
"Asset Metadata_thumbnail": one(media, {
|
|
fields: [assets["Asset Metadata_thumbnail"]],
|
|
references: [media.id],
|
|
relationName: "Asset Metadata_thumbnail",
|
|
}),
|
|
crafting_craftingData_inputs: many(assets_crafting_crafting_data_inputs, {
|
|
relationName: "crafting_craftingData_inputs",
|
|
}),
|
|
crafting_craftingData_byproducts: many(assets_crafting_crafting_data_byproducts, {
|
|
relationName: "crafting_craftingData_byproducts",
|
|
}),
|
|
_rels: many(assets_rels, {
|
|
relationName: "_rels",
|
|
}),
|
|
}));
|
|
export const relations_resources = relations(resources, ({ one }) => ({
|
|
icon: one(media, {
|
|
fields: [resources.icon],
|
|
references: [media.id],
|
|
relationName: "icon",
|
|
}),
|
|
}));
|
|
export const relations_vehicles_category = relations(vehicles_category, ({ one }) => ({
|
|
parent: one(vehicles, {
|
|
fields: [vehicles_category.parent],
|
|
references: [vehicles.id],
|
|
relationName: "category",
|
|
}),
|
|
}));
|
|
export const relations_vehicles_materials = relations(vehicles_materials, ({ one }) => ({
|
|
_parentID: one(vehicles, {
|
|
fields: [vehicles_materials._parentID],
|
|
references: [vehicles.id],
|
|
relationName: "materials",
|
|
}),
|
|
resource: one(resources, {
|
|
fields: [vehicles_materials.resource],
|
|
references: [resources.id],
|
|
relationName: "resource",
|
|
}),
|
|
}));
|
|
export const relations_vehicles_scrap_returns = relations(vehicles_scrap_returns, ({ one }) => ({
|
|
_parentID: one(vehicles, {
|
|
fields: [vehicles_scrap_returns._parentID],
|
|
references: [vehicles.id],
|
|
relationName: "scrapReturns",
|
|
}),
|
|
resource: one(resources, {
|
|
fields: [vehicles_scrap_returns.resource],
|
|
references: [resources.id],
|
|
relationName: "resource",
|
|
}),
|
|
}));
|
|
export const relations_vehicles_upkeep_costs = relations(vehicles_upkeep_costs, ({ one }) => ({
|
|
_parentID: one(vehicles, {
|
|
fields: [vehicles_upkeep_costs._parentID],
|
|
references: [vehicles.id],
|
|
relationName: "upkeepCosts",
|
|
}),
|
|
resource: one(resources, {
|
|
fields: [vehicles_upkeep_costs.resource],
|
|
references: [resources.id],
|
|
relationName: "resource",
|
|
}),
|
|
}));
|
|
export const relations_vehicles_allowed_virtual_cargo = relations(
|
|
vehicles_allowed_virtual_cargo,
|
|
({ one }) => ({
|
|
_parentID: one(vehicles, {
|
|
fields: [vehicles_allowed_virtual_cargo._parentID],
|
|
references: [vehicles.id],
|
|
relationName: "allowedVirtualCargo",
|
|
}),
|
|
}),
|
|
);
|
|
export const relations_vehicles_pylons = relations(vehicles_pylons, ({ one }) => ({
|
|
_parentID: one(vehicles, {
|
|
fields: [vehicles_pylons._parentID],
|
|
references: [vehicles.id],
|
|
relationName: "pylons",
|
|
}),
|
|
ammoType: one(assets, {
|
|
fields: [vehicles_pylons.ammoType],
|
|
references: [assets.id],
|
|
relationName: "ammoType",
|
|
}),
|
|
}));
|
|
export const relations_vehicles_rels = relations(vehicles_rels, ({ one }) => ({
|
|
parent: one(vehicles, {
|
|
fields: [vehicles_rels.parent],
|
|
references: [vehicles.id],
|
|
relationName: "_rels",
|
|
}),
|
|
technologiesID: one(technologies, {
|
|
fields: [vehicles_rels.technologiesID],
|
|
references: [technologies.id],
|
|
relationName: "technologies",
|
|
}),
|
|
assetsID: one(assets, {
|
|
fields: [vehicles_rels.assetsID],
|
|
references: [assets.id],
|
|
relationName: "assets",
|
|
}),
|
|
vehiclesID: one(vehicles, {
|
|
fields: [vehicles_rels.vehiclesID],
|
|
references: [vehicles.id],
|
|
relationName: "vehicles",
|
|
}),
|
|
resourcesID: one(resources, {
|
|
fields: [vehicles_rels.resourcesID],
|
|
references: [resources.id],
|
|
relationName: "resources",
|
|
}),
|
|
}));
|
|
export const relations_vehicles = relations(vehicles, ({ one, many }) => ({
|
|
image: one(media, {
|
|
fields: [vehicles.image],
|
|
references: [media.id],
|
|
relationName: "image",
|
|
}),
|
|
category: many(vehicles_category, {
|
|
relationName: "category",
|
|
}),
|
|
fuel_fuelType: one(resources, {
|
|
fields: [vehicles.fuel_fuelType],
|
|
references: [resources.id],
|
|
relationName: "fuel_fuelType",
|
|
}),
|
|
materials: many(vehicles_materials, {
|
|
relationName: "materials",
|
|
}),
|
|
scrapReturns: many(vehicles_scrap_returns, {
|
|
relationName: "scrapReturns",
|
|
}),
|
|
upkeepCosts: many(vehicles_upkeep_costs, {
|
|
relationName: "upkeepCosts",
|
|
}),
|
|
allowedVirtualCargo: many(vehicles_allowed_virtual_cargo, {
|
|
relationName: "allowedVirtualCargo",
|
|
}),
|
|
pylons: many(vehicles_pylons, {
|
|
relationName: "pylons",
|
|
}),
|
|
_rels: many(vehicles_rels, {
|
|
relationName: "_rels",
|
|
}),
|
|
}));
|
|
export const relations_structures_materials = relations(structures_materials, ({ one }) => ({
|
|
_parentID: one(structures, {
|
|
fields: [structures_materials._parentID],
|
|
references: [structures.id],
|
|
relationName: "materials",
|
|
}),
|
|
resource: one(resources, {
|
|
fields: [structures_materials.resource],
|
|
references: [resources.id],
|
|
relationName: "resource",
|
|
}),
|
|
}));
|
|
export const relations_structures_resources_in_range = relations(
|
|
structures_resources_in_range,
|
|
({ one }) => ({
|
|
_parentID: one(structures, {
|
|
fields: [structures_resources_in_range._parentID],
|
|
references: [structures.id],
|
|
relationName: "resourcesInRange",
|
|
}),
|
|
resource: one(resources, {
|
|
fields: [structures_resources_in_range.resource],
|
|
references: [resources.id],
|
|
relationName: "resource",
|
|
}),
|
|
}),
|
|
);
|
|
export const relations_structures_structures_in_range = relations(
|
|
structures_structures_in_range,
|
|
({ one }) => ({
|
|
_parentID: one(structures, {
|
|
fields: [structures_structures_in_range._parentID],
|
|
references: [structures.id],
|
|
relationName: "structuresInRange",
|
|
}),
|
|
structure: one(structures, {
|
|
fields: [structures_structures_in_range.structure],
|
|
references: [structures.id],
|
|
relationName: "structure",
|
|
}),
|
|
}),
|
|
);
|
|
export const relations_structures_upkeep = relations(structures_upkeep, ({ one }) => ({
|
|
_parentID: one(structures, {
|
|
fields: [structures_upkeep._parentID],
|
|
references: [structures.id],
|
|
relationName: "upkeep",
|
|
}),
|
|
resource: one(resources, {
|
|
fields: [structures_upkeep.resource],
|
|
references: [resources.id],
|
|
relationName: "resource",
|
|
}),
|
|
}));
|
|
export const relations_structures_auto_generated_resources = relations(
|
|
structures_auto_generated_resources,
|
|
({ one }) => ({
|
|
_parentID: one(structures, {
|
|
fields: [structures_auto_generated_resources._parentID],
|
|
references: [structures.id],
|
|
relationName: "autoGeneratedResources",
|
|
}),
|
|
resource: one(resources, {
|
|
fields: [structures_auto_generated_resources.resource],
|
|
references: [resources.id],
|
|
relationName: "resource",
|
|
}),
|
|
}),
|
|
);
|
|
export const relations_structures_allowed_storage = relations(
|
|
structures_allowed_storage,
|
|
({ one }) => ({
|
|
_parentID: one(structures, {
|
|
fields: [structures_allowed_storage._parentID],
|
|
references: [structures.id],
|
|
relationName: "allowedStorage",
|
|
}),
|
|
}),
|
|
);
|
|
export const relations_structures_prohibited_storage = relations(
|
|
structures_prohibited_storage,
|
|
({ one }) => ({
|
|
_parentID: one(structures, {
|
|
fields: [structures_prohibited_storage._parentID],
|
|
references: [structures.id],
|
|
relationName: "prohibitedStorage",
|
|
}),
|
|
}),
|
|
);
|
|
export const relations_structures_rels = relations(structures_rels, ({ one }) => ({
|
|
parent: one(structures, {
|
|
fields: [structures_rels.parent],
|
|
references: [structures.id],
|
|
relationName: "_rels",
|
|
}),
|
|
technologiesID: one(technologies, {
|
|
fields: [structures_rels.technologiesID],
|
|
references: [technologies.id],
|
|
relationName: "technologies",
|
|
}),
|
|
assetsID: one(assets, {
|
|
fields: [structures_rels.assetsID],
|
|
references: [assets.id],
|
|
relationName: "assets",
|
|
}),
|
|
vehiclesID: one(vehicles, {
|
|
fields: [structures_rels.vehiclesID],
|
|
references: [vehicles.id],
|
|
relationName: "vehicles",
|
|
}),
|
|
resourcesID: one(resources, {
|
|
fields: [structures_rels.resourcesID],
|
|
references: [resources.id],
|
|
relationName: "resources",
|
|
}),
|
|
}));
|
|
export const relations_structures = relations(structures, ({ one, many }) => ({
|
|
image: one(media, {
|
|
fields: [structures.image],
|
|
references: [media.id],
|
|
relationName: "image",
|
|
}),
|
|
materials: many(structures_materials, {
|
|
relationName: "materials",
|
|
}),
|
|
upgradesInto: one(structures, {
|
|
fields: [structures.upgradesInto],
|
|
references: [structures.id],
|
|
relationName: "upgradesInto",
|
|
}),
|
|
resourcesInRange: many(structures_resources_in_range, {
|
|
relationName: "resourcesInRange",
|
|
}),
|
|
structuresInRange: many(structures_structures_in_range, {
|
|
relationName: "structuresInRange",
|
|
}),
|
|
upkeep: many(structures_upkeep, {
|
|
relationName: "upkeep",
|
|
}),
|
|
autoGeneratedResources: many(structures_auto_generated_resources, {
|
|
relationName: "autoGeneratedResources",
|
|
}),
|
|
allowedStorage: many(structures_allowed_storage, {
|
|
relationName: "allowedStorage",
|
|
}),
|
|
prohibitedStorage: many(structures_prohibited_storage, {
|
|
relationName: "prohibitedStorage",
|
|
}),
|
|
_rels: many(structures_rels, {
|
|
relationName: "_rels",
|
|
}),
|
|
}));
|
|
export const relations_shipments_cargo = relations(shipments_cargo, ({ one }) => ({
|
|
_parentID: one(shipments, {
|
|
fields: [shipments_cargo._parentID],
|
|
references: [shipments.id],
|
|
relationName: "cargo",
|
|
}),
|
|
}));
|
|
export const relations_shipments_rels = relations(shipments_rels, ({ one }) => ({
|
|
parent: one(shipments, {
|
|
fields: [shipments_rels.parent],
|
|
references: [shipments.id],
|
|
relationName: "_rels",
|
|
}),
|
|
resourcesID: one(resources, {
|
|
fields: [shipments_rels.resourcesID],
|
|
references: [resources.id],
|
|
relationName: "resources",
|
|
}),
|
|
assetsID: one(assets, {
|
|
fields: [shipments_rels.assetsID],
|
|
references: [assets.id],
|
|
relationName: "assets",
|
|
}),
|
|
vehiclesID: one(vehicles, {
|
|
fields: [shipments_rels.vehiclesID],
|
|
references: [vehicles.id],
|
|
relationName: "vehicles",
|
|
}),
|
|
}));
|
|
export const relations_shipments = relations(shipments, ({ one, many }) => ({
|
|
origin: one(game_structures, {
|
|
fields: [shipments.origin],
|
|
references: [game_structures.id],
|
|
relationName: "origin",
|
|
}),
|
|
destination: one(game_structures, {
|
|
fields: [shipments.destination],
|
|
references: [game_structures.id],
|
|
relationName: "destination",
|
|
}),
|
|
transportVehicle: one(game_vehicles, {
|
|
fields: [shipments.transportVehicle],
|
|
references: [game_vehicles.id],
|
|
relationName: "transportVehicle",
|
|
}),
|
|
cargo: many(shipments_cargo, {
|
|
relationName: "cargo",
|
|
}),
|
|
createdBy: one(users, {
|
|
fields: [shipments.createdBy],
|
|
references: [users.id],
|
|
relationName: "createdBy",
|
|
}),
|
|
_rels: many(shipments_rels, {
|
|
relationName: "_rels",
|
|
}),
|
|
}));
|
|
export const relations_bank_accounts = relations(bank_accounts, ({ one }) => ({
|
|
ownerFaction: one(factions, {
|
|
fields: [bank_accounts.ownerFaction],
|
|
references: [factions.id],
|
|
relationName: "ownerFaction",
|
|
}),
|
|
ownerUser: one(users, {
|
|
fields: [bank_accounts.ownerUser],
|
|
references: [users.id],
|
|
relationName: "ownerUser",
|
|
}),
|
|
currency: one(resources, {
|
|
fields: [bank_accounts.currency],
|
|
references: [resources.id],
|
|
relationName: "currency",
|
|
}),
|
|
}));
|
|
export const relations_bank_transactions = relations(bank_transactions, ({ one }) => ({
|
|
fromAccount: one(bank_accounts, {
|
|
fields: [bank_transactions.fromAccount],
|
|
references: [bank_accounts.id],
|
|
relationName: "fromAccount",
|
|
}),
|
|
toAccount: one(bank_accounts, {
|
|
fields: [bank_transactions.toAccount],
|
|
references: [bank_accounts.id],
|
|
relationName: "toAccount",
|
|
}),
|
|
actor: one(users, {
|
|
fields: [bank_transactions.actor],
|
|
references: [users.id],
|
|
relationName: "actor",
|
|
}),
|
|
reference: one(bank_transactions, {
|
|
fields: [bank_transactions.reference],
|
|
references: [bank_transactions.id],
|
|
relationName: "reference",
|
|
}),
|
|
}));
|
|
export const relations_ledger_entries = relations(ledger_entries, ({ one }) => ({
|
|
account: one(bank_accounts, {
|
|
fields: [ledger_entries.account],
|
|
references: [bank_accounts.id],
|
|
relationName: "account",
|
|
}),
|
|
transaction: one(bank_transactions, {
|
|
fields: [ledger_entries.transaction],
|
|
references: [bank_transactions.id],
|
|
relationName: "transaction",
|
|
}),
|
|
}));
|
|
export const relations_locker_storages_items_equipment_attachments = relations(
|
|
locker_storages_items_equipment_attachments,
|
|
({ one }) => ({
|
|
_parentID: one(locker_storages_items, {
|
|
fields: [locker_storages_items_equipment_attachments._parentID],
|
|
references: [locker_storages_items.id],
|
|
relationName: "equipment_attachments",
|
|
}),
|
|
asset: one(assets, {
|
|
fields: [locker_storages_items_equipment_attachments.asset],
|
|
references: [assets.id],
|
|
relationName: "asset",
|
|
}),
|
|
}),
|
|
);
|
|
export const relations_locker_storages_items = relations(
|
|
locker_storages_items,
|
|
({ one, many }) => ({
|
|
_parentID: one(locker_storages, {
|
|
fields: [locker_storages_items._parentID],
|
|
references: [locker_storages.id],
|
|
relationName: "items",
|
|
}),
|
|
asset: one(assets, {
|
|
fields: [locker_storages_items.asset],
|
|
references: [assets.id],
|
|
relationName: "asset",
|
|
}),
|
|
equipment_attachments: many(locker_storages_items_equipment_attachments, {
|
|
relationName: "equipment_attachments",
|
|
}),
|
|
equipment_skin: one(assets, {
|
|
fields: [locker_storages_items.equipment_skin],
|
|
references: [assets.id],
|
|
relationName: "equipment_skin",
|
|
}),
|
|
}),
|
|
);
|
|
export const relations_locker_storages = relations(locker_storages, ({ one, many }) => ({
|
|
ownerUser: one(users, {
|
|
fields: [locker_storages.ownerUser],
|
|
references: [users.id],
|
|
relationName: "ownerUser",
|
|
}),
|
|
items: many(locker_storages_items, {
|
|
relationName: "items",
|
|
}),
|
|
}));
|
|
export const relations_loadouts = relations(loadouts, ({ one }) => ({
|
|
ownerUser: one(users, {
|
|
fields: [loadouts.ownerUser],
|
|
references: [users.id],
|
|
relationName: "ownerUser",
|
|
}),
|
|
slots_primary: one(assets, {
|
|
fields: [loadouts.slots_primary],
|
|
references: [assets.id],
|
|
relationName: "slots_primary",
|
|
}),
|
|
slots_secondary: one(assets, {
|
|
fields: [loadouts.slots_secondary],
|
|
references: [assets.id],
|
|
relationName: "slots_secondary",
|
|
}),
|
|
slots_launcher: one(assets, {
|
|
fields: [loadouts.slots_launcher],
|
|
references: [assets.id],
|
|
relationName: "slots_launcher",
|
|
}),
|
|
slots_uniform: one(assets, {
|
|
fields: [loadouts.slots_uniform],
|
|
references: [assets.id],
|
|
relationName: "slots_uniform",
|
|
}),
|
|
slots_vest: one(assets, {
|
|
fields: [loadouts.slots_vest],
|
|
references: [assets.id],
|
|
relationName: "slots_vest",
|
|
}),
|
|
slots_backpack: one(assets, {
|
|
fields: [loadouts.slots_backpack],
|
|
references: [assets.id],
|
|
relationName: "slots_backpack",
|
|
}),
|
|
slots_helmet: one(assets, {
|
|
fields: [loadouts.slots_helmet],
|
|
references: [assets.id],
|
|
relationName: "slots_helmet",
|
|
}),
|
|
slots_facewear: one(assets, {
|
|
fields: [loadouts.slots_facewear],
|
|
references: [assets.id],
|
|
relationName: "slots_facewear",
|
|
}),
|
|
slots_nvg: one(assets, {
|
|
fields: [loadouts.slots_nvg],
|
|
references: [assets.id],
|
|
relationName: "slots_nvg",
|
|
}),
|
|
slots_radio: one(assets, {
|
|
fields: [loadouts.slots_radio],
|
|
references: [assets.id],
|
|
relationName: "slots_radio",
|
|
}),
|
|
slots_optic: one(assets, {
|
|
fields: [loadouts.slots_optic],
|
|
references: [assets.id],
|
|
relationName: "slots_optic",
|
|
}),
|
|
slots_muzzle: one(assets, {
|
|
fields: [loadouts.slots_muzzle],
|
|
references: [assets.id],
|
|
relationName: "slots_muzzle",
|
|
}),
|
|
slots_bipod: one(assets, {
|
|
fields: [loadouts.slots_bipod],
|
|
references: [assets.id],
|
|
relationName: "slots_bipod",
|
|
}),
|
|
}));
|
|
export const relations_market_listings = relations(market_listings, ({ one }) => ({
|
|
asset: one(assets, {
|
|
fields: [market_listings.asset],
|
|
references: [assets.id],
|
|
relationName: "asset",
|
|
}),
|
|
seller: one(users, {
|
|
fields: [market_listings.seller],
|
|
references: [users.id],
|
|
relationName: "seller",
|
|
}),
|
|
npc: one(game_npcs, {
|
|
fields: [market_listings.npc],
|
|
references: [game_npcs.id],
|
|
relationName: "npc",
|
|
}),
|
|
currency: one(resources, {
|
|
fields: [market_listings.currency],
|
|
references: [resources.id],
|
|
relationName: "currency",
|
|
}),
|
|
buyer: one(users, {
|
|
fields: [market_listings.buyer],
|
|
references: [users.id],
|
|
relationName: "buyer",
|
|
}),
|
|
}));
|
|
export const relations_market_negotiations_history = relations(
|
|
market_negotiations_history,
|
|
({ one }) => ({
|
|
_parentID: one(market_negotiations, {
|
|
fields: [market_negotiations_history._parentID],
|
|
references: [market_negotiations.id],
|
|
relationName: "history",
|
|
}),
|
|
}),
|
|
);
|
|
export const relations_market_negotiations = relations(market_negotiations, ({ one, many }) => ({
|
|
listing: one(market_listings, {
|
|
fields: [market_negotiations.listing],
|
|
references: [market_listings.id],
|
|
relationName: "listing",
|
|
}),
|
|
buyer: one(users, {
|
|
fields: [market_negotiations.buyer],
|
|
references: [users.id],
|
|
relationName: "buyer",
|
|
}),
|
|
history: many(market_negotiations_history, {
|
|
relationName: "history",
|
|
}),
|
|
}));
|
|
export const relations_maps = relations(maps, () => ({}));
|
|
export const relations_narrative_events = relations(narrative_events, () => ({}));
|
|
export const relations_mission_files = relations(mission_files, ({ one }) => ({
|
|
author: one(users, {
|
|
fields: [mission_files.author],
|
|
references: [users.id],
|
|
relationName: "author",
|
|
}),
|
|
}));
|
|
export const relations_mod_lists = relations(mod_lists, ({ one }) => ({
|
|
author: one(users, {
|
|
fields: [mod_lists.author],
|
|
references: [users.id],
|
|
relationName: "author",
|
|
}),
|
|
}));
|
|
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",
|
|
}),
|
|
mediaID: one(media, {
|
|
fields: [payload_locked_documents_rels.mediaID],
|
|
references: [media.id],
|
|
relationName: "media",
|
|
}),
|
|
"game-hard-resourcesID": one(game_hard_resources, {
|
|
fields: [payload_locked_documents_rels["game-hard-resourcesID"]],
|
|
references: [game_hard_resources.id],
|
|
relationName: "game-hard-resources",
|
|
}),
|
|
"game-structuresID": one(game_structures, {
|
|
fields: [payload_locked_documents_rels["game-structuresID"]],
|
|
references: [game_structures.id],
|
|
relationName: "game-structures",
|
|
}),
|
|
"game-vehiclesID": one(game_vehicles, {
|
|
fields: [payload_locked_documents_rels["game-vehiclesID"]],
|
|
references: [game_vehicles.id],
|
|
relationName: "game-vehicles",
|
|
}),
|
|
"game-npcsID": one(game_npcs, {
|
|
fields: [payload_locked_documents_rels["game-npcsID"]],
|
|
references: [game_npcs.id],
|
|
relationName: "game-npcs",
|
|
}),
|
|
"game-event-logsID": one(game_event_logs, {
|
|
fields: [payload_locked_documents_rels["game-event-logsID"]],
|
|
references: [game_event_logs.id],
|
|
relationName: "game-event-logs",
|
|
}),
|
|
usersID: one(users, {
|
|
fields: [payload_locked_documents_rels.usersID],
|
|
references: [users.id],
|
|
relationName: "users",
|
|
}),
|
|
ranksID: one(ranks, {
|
|
fields: [payload_locked_documents_rels.ranksID],
|
|
references: [ranks.id],
|
|
relationName: "ranks",
|
|
}),
|
|
profilesID: one(profiles, {
|
|
fields: [payload_locked_documents_rels.profilesID],
|
|
references: [profiles.id],
|
|
relationName: "profiles",
|
|
}),
|
|
awardsID: one(awards, {
|
|
fields: [payload_locked_documents_rels.awardsID],
|
|
references: [awards.id],
|
|
relationName: "awards",
|
|
}),
|
|
qualificationsID: one(qualifications, {
|
|
fields: [payload_locked_documents_rels.qualificationsID],
|
|
references: [qualifications.id],
|
|
relationName: "qualifications",
|
|
}),
|
|
assignmentsID: one(assignments, {
|
|
fields: [payload_locked_documents_rels.assignmentsID],
|
|
references: [assignments.id],
|
|
relationName: "assignments",
|
|
}),
|
|
experienceID: one(experience, {
|
|
fields: [payload_locked_documents_rels.experienceID],
|
|
references: [experience.id],
|
|
relationName: "experience",
|
|
}),
|
|
"user-notificationsID": one(user_notifications, {
|
|
fields: [payload_locked_documents_rels["user-notificationsID"]],
|
|
references: [user_notifications.id],
|
|
relationName: "user-notifications",
|
|
}),
|
|
missionsID: one(missions, {
|
|
fields: [payload_locked_documents_rels.missionsID],
|
|
references: [missions.id],
|
|
relationName: "missions",
|
|
}),
|
|
campaignsID: one(campaigns, {
|
|
fields: [payload_locked_documents_rels.campaignsID],
|
|
references: [campaigns.id],
|
|
relationName: "campaigns",
|
|
}),
|
|
factionsID: one(factions, {
|
|
fields: [payload_locked_documents_rels.factionsID],
|
|
references: [factions.id],
|
|
relationName: "factions",
|
|
}),
|
|
technologiesID: one(technologies, {
|
|
fields: [payload_locked_documents_rels.technologiesID],
|
|
references: [technologies.id],
|
|
relationName: "technologies",
|
|
}),
|
|
assetsID: one(assets, {
|
|
fields: [payload_locked_documents_rels.assetsID],
|
|
references: [assets.id],
|
|
relationName: "assets",
|
|
}),
|
|
resourcesID: one(resources, {
|
|
fields: [payload_locked_documents_rels.resourcesID],
|
|
references: [resources.id],
|
|
relationName: "resources",
|
|
}),
|
|
vehiclesID: one(vehicles, {
|
|
fields: [payload_locked_documents_rels.vehiclesID],
|
|
references: [vehicles.id],
|
|
relationName: "vehicles",
|
|
}),
|
|
structuresID: one(structures, {
|
|
fields: [payload_locked_documents_rels.structuresID],
|
|
references: [structures.id],
|
|
relationName: "structures",
|
|
}),
|
|
shipmentsID: one(shipments, {
|
|
fields: [payload_locked_documents_rels.shipmentsID],
|
|
references: [shipments.id],
|
|
relationName: "shipments",
|
|
}),
|
|
"bank-accountsID": one(bank_accounts, {
|
|
fields: [payload_locked_documents_rels["bank-accountsID"]],
|
|
references: [bank_accounts.id],
|
|
relationName: "bank-accounts",
|
|
}),
|
|
"bank-transactionsID": one(bank_transactions, {
|
|
fields: [payload_locked_documents_rels["bank-transactionsID"]],
|
|
references: [bank_transactions.id],
|
|
relationName: "bank-transactions",
|
|
}),
|
|
"ledger-entriesID": one(ledger_entries, {
|
|
fields: [payload_locked_documents_rels["ledger-entriesID"]],
|
|
references: [ledger_entries.id],
|
|
relationName: "ledger-entries",
|
|
}),
|
|
"locker-storagesID": one(locker_storages, {
|
|
fields: [payload_locked_documents_rels["locker-storagesID"]],
|
|
references: [locker_storages.id],
|
|
relationName: "locker-storages",
|
|
}),
|
|
loadoutsID: one(loadouts, {
|
|
fields: [payload_locked_documents_rels.loadoutsID],
|
|
references: [loadouts.id],
|
|
relationName: "loadouts",
|
|
}),
|
|
"market-listingsID": one(market_listings, {
|
|
fields: [payload_locked_documents_rels["market-listingsID"]],
|
|
references: [market_listings.id],
|
|
relationName: "market-listings",
|
|
}),
|
|
"market-negotiationsID": one(market_negotiations, {
|
|
fields: [payload_locked_documents_rels["market-negotiationsID"]],
|
|
references: [market_negotiations.id],
|
|
relationName: "market-negotiations",
|
|
}),
|
|
mapsID: one(maps, {
|
|
fields: [payload_locked_documents_rels.mapsID],
|
|
references: [maps.id],
|
|
relationName: "maps",
|
|
}),
|
|
"narrative-eventsID": one(narrative_events, {
|
|
fields: [payload_locked_documents_rels["narrative-eventsID"]],
|
|
references: [narrative_events.id],
|
|
relationName: "narrative-events",
|
|
}),
|
|
"mission-filesID": one(mission_files, {
|
|
fields: [payload_locked_documents_rels["mission-filesID"]],
|
|
references: [mission_files.id],
|
|
relationName: "mission-files",
|
|
}),
|
|
"mod-listsID": one(mod_lists, {
|
|
fields: [payload_locked_documents_rels["mod-listsID"]],
|
|
references: [mod_lists.id],
|
|
relationName: "mod-lists",
|
|
}),
|
|
}),
|
|
);
|
|
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_game_rules_rels = relations(game_rules_rels, ({ one }) => ({
|
|
parent: one(game_rules, {
|
|
fields: [game_rules_rels.parent],
|
|
references: [game_rules.id],
|
|
relationName: "_rels",
|
|
}),
|
|
assignmentsID: one(assignments, {
|
|
fields: [game_rules_rels.assignmentsID],
|
|
references: [assignments.id],
|
|
relationName: "assignments",
|
|
}),
|
|
}));
|
|
export const relations_game_rules = relations(game_rules, ({ one, many }) => ({
|
|
mainCurrency: one(resources, {
|
|
fields: [game_rules.mainCurrency],
|
|
references: [resources.id],
|
|
relationName: "mainCurrency",
|
|
}),
|
|
_rels: many(game_rules_rels, {
|
|
relationName: "_rels",
|
|
}),
|
|
}));
|
|
|
|
type DatabaseSchema = {
|
|
enum_game_vehicles_status: typeof enum_game_vehicles_status;
|
|
enum_game_event_logs_target_collection: typeof enum_game_event_logs_target_collection;
|
|
enum_users_roles: typeof enum_users_roles;
|
|
enum_awards_type: typeof enum_awards_type;
|
|
enum_assignments_type: typeof enum_assignments_type;
|
|
enum_missions_factions_involved_threat_level: typeof enum_missions_factions_involved_threat_level;
|
|
enum_missions_logistics_and_support_insertion: typeof enum_missions_logistics_and_support_insertion;
|
|
enum_missions_logistics_and_support_extraction: typeof enum_missions_logistics_and_support_extraction;
|
|
enum_missions_operation_type: typeof enum_missions_operation_type;
|
|
enum_missions_classification_mission_type: typeof enum_missions_classification_mission_type;
|
|
enum_missions_ownership_and_status_status: typeof enum_missions_ownership_and_status_status;
|
|
enum_missions_ownership_and_status_visibility: typeof enum_missions_ownership_and_status_visibility;
|
|
enum_missions_civilian_presence: typeof enum_missions_civilian_presence;
|
|
enum_campaigns_status: typeof enum_campaigns_status;
|
|
enum_factions_type: typeof enum_factions_type;
|
|
enum_technologies_approval_status: typeof enum_technologies_approval_status;
|
|
enum_technologies_type: typeof enum_technologies_type;
|
|
enum_assets_skin_configuration_applies_to_asset_types: typeof enum_assets_skin_configuration_applies_to_asset_types;
|
|
enum_assets_approval_status: typeof enum_assets_approval_status;
|
|
enum_assets_asset_type: typeof enum_assets_asset_type;
|
|
enum_assets_weapon_configuration_slot_type: typeof enum_assets_weapon_configuration_slot_type;
|
|
enum_assets_nightvision_configuration_nvg_generation: typeof enum_assets_nightvision_configuration_nvg_generation;
|
|
enum_assets_market_trading_rarity: typeof enum_assets_market_trading_rarity;
|
|
enum_resources_approval_status: typeof enum_resources_approval_status;
|
|
enum_resources_type: typeof enum_resources_type;
|
|
enum_resources_rarity: typeof enum_resources_rarity;
|
|
enum_vehicles_category: typeof enum_vehicles_category;
|
|
enum_vehicles_pylons_pylon_type: typeof enum_vehicles_pylons_pylon_type;
|
|
enum_vehicles_approval_status: typeof enum_vehicles_approval_status;
|
|
enum_vehicles_armor_rating: typeof enum_vehicles_armor_rating;
|
|
enum_structures_approval_status: typeof enum_structures_approval_status;
|
|
enum_structures_category: typeof enum_structures_category;
|
|
enum_structures_terrain_type: typeof enum_structures_terrain_type;
|
|
enum_structures_function_type: typeof enum_structures_function_type;
|
|
enum_shipments_status: typeof enum_shipments_status;
|
|
enum_bank_accounts_account_type: typeof enum_bank_accounts_account_type;
|
|
enum_bank_accounts_status: typeof enum_bank_accounts_status;
|
|
enum_bank_transactions_type: typeof enum_bank_transactions_type;
|
|
enum_bank_transactions_status: typeof enum_bank_transactions_status;
|
|
enum_ledger_entries_type: typeof enum_ledger_entries_type;
|
|
enum_market_listings_status: typeof enum_market_listings_status;
|
|
enum_market_negotiations_history_from: typeof enum_market_negotiations_history_from;
|
|
enum_market_negotiations_status: typeof enum_market_negotiations_status;
|
|
enum_market_negotiations_proposed_by: typeof enum_market_negotiations_proposed_by;
|
|
enum_narrative_events_triggers_type: typeof enum_narrative_events_triggers_type;
|
|
media: typeof media;
|
|
game_hard_resources: typeof game_hard_resources;
|
|
game_structures_stored_resources: typeof game_structures_stored_resources;
|
|
game_structures_void_storage: typeof game_structures_void_storage;
|
|
game_structures: typeof game_structures;
|
|
game_vehicles_stored_resources: typeof game_vehicles_stored_resources;
|
|
game_vehicles_void_storage: typeof game_vehicles_void_storage;
|
|
game_vehicles: typeof game_vehicles;
|
|
game_npcs: typeof game_npcs;
|
|
game_npcs_rels: typeof game_npcs_rels;
|
|
game_event_logs: typeof game_event_logs;
|
|
users_roles: typeof users_roles;
|
|
users_sessions: typeof users_sessions;
|
|
users: typeof users;
|
|
ranks: typeof ranks;
|
|
profiles: typeof profiles;
|
|
profiles_rels: typeof profiles_rels;
|
|
awards: typeof awards;
|
|
qualifications: typeof qualifications;
|
|
assignments: typeof assignments;
|
|
assignments_rels: typeof assignments_rels;
|
|
experience: typeof experience;
|
|
user_notifications: typeof user_notifications;
|
|
missions_mission_roles_provided_roles: typeof missions_mission_roles_provided_roles;
|
|
missions_briefing: typeof missions_briefing;
|
|
missions_mission_objectives: typeof missions_mission_objectives;
|
|
missions_factions_involved: typeof missions_factions_involved;
|
|
missions_logistics_and_support_insertion: typeof missions_logistics_and_support_insertion;
|
|
missions_logistics_and_support_extraction: typeof missions_logistics_and_support_extraction;
|
|
missions_logistics_and_support_assets_available: typeof missions_logistics_and_support_assets_available;
|
|
missions_comms_and_docs_frequencies: typeof missions_comms_and_docs_frequencies;
|
|
missions: typeof missions;
|
|
missions_rels: typeof missions_rels;
|
|
campaigns: typeof campaigns;
|
|
factions: typeof factions;
|
|
factions_rels: typeof factions_rels;
|
|
technologies_requirements_prerequisite_technologies: typeof technologies_requirements_prerequisite_technologies;
|
|
technologies_research_costs_resources: typeof technologies_research_costs_resources;
|
|
technologies: typeof technologies;
|
|
technologies_rels: typeof technologies_rels;
|
|
assets_skin_configuration_applies_to_asset_types: typeof assets_skin_configuration_applies_to_asset_types;
|
|
assets_crafting_crafting_data_inputs: typeof assets_crafting_crafting_data_inputs;
|
|
assets_crafting_crafting_data_byproducts: typeof assets_crafting_crafting_data_byproducts;
|
|
assets: typeof assets;
|
|
assets_rels: typeof assets_rels;
|
|
resources: typeof resources;
|
|
vehicles_category: typeof vehicles_category;
|
|
vehicles_materials: typeof vehicles_materials;
|
|
vehicles_scrap_returns: typeof vehicles_scrap_returns;
|
|
vehicles_upkeep_costs: typeof vehicles_upkeep_costs;
|
|
vehicles_allowed_virtual_cargo: typeof vehicles_allowed_virtual_cargo;
|
|
vehicles_pylons: typeof vehicles_pylons;
|
|
vehicles: typeof vehicles;
|
|
vehicles_rels: typeof vehicles_rels;
|
|
structures_materials: typeof structures_materials;
|
|
structures_resources_in_range: typeof structures_resources_in_range;
|
|
structures_structures_in_range: typeof structures_structures_in_range;
|
|
structures_upkeep: typeof structures_upkeep;
|
|
structures_auto_generated_resources: typeof structures_auto_generated_resources;
|
|
structures_allowed_storage: typeof structures_allowed_storage;
|
|
structures_prohibited_storage: typeof structures_prohibited_storage;
|
|
structures: typeof structures;
|
|
structures_rels: typeof structures_rels;
|
|
shipments_cargo: typeof shipments_cargo;
|
|
shipments: typeof shipments;
|
|
shipments_rels: typeof shipments_rels;
|
|
bank_accounts: typeof bank_accounts;
|
|
bank_transactions: typeof bank_transactions;
|
|
ledger_entries: typeof ledger_entries;
|
|
locker_storages_items_equipment_attachments: typeof locker_storages_items_equipment_attachments;
|
|
locker_storages_items: typeof locker_storages_items;
|
|
locker_storages: typeof locker_storages;
|
|
loadouts: typeof loadouts;
|
|
market_listings: typeof market_listings;
|
|
market_negotiations_history: typeof market_negotiations_history;
|
|
market_negotiations: typeof market_negotiations;
|
|
maps: typeof maps;
|
|
narrative_events: typeof narrative_events;
|
|
mission_files: typeof mission_files;
|
|
mod_lists: typeof mod_lists;
|
|
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;
|
|
game_rules: typeof game_rules;
|
|
game_rules_rels: typeof game_rules_rels;
|
|
relations_media: typeof relations_media;
|
|
relations_game_hard_resources: typeof relations_game_hard_resources;
|
|
relations_game_structures_stored_resources: typeof relations_game_structures_stored_resources;
|
|
relations_game_structures_void_storage: typeof relations_game_structures_void_storage;
|
|
relations_game_structures: typeof relations_game_structures;
|
|
relations_game_vehicles_stored_resources: typeof relations_game_vehicles_stored_resources;
|
|
relations_game_vehicles_void_storage: typeof relations_game_vehicles_void_storage;
|
|
relations_game_vehicles: typeof relations_game_vehicles;
|
|
relations_game_npcs_rels: typeof relations_game_npcs_rels;
|
|
relations_game_npcs: typeof relations_game_npcs;
|
|
relations_game_event_logs: typeof relations_game_event_logs;
|
|
relations_users_roles: typeof relations_users_roles;
|
|
relations_users_sessions: typeof relations_users_sessions;
|
|
relations_users: typeof relations_users;
|
|
relations_ranks: typeof relations_ranks;
|
|
relations_profiles_rels: typeof relations_profiles_rels;
|
|
relations_profiles: typeof relations_profiles;
|
|
relations_awards: typeof relations_awards;
|
|
relations_qualifications: typeof relations_qualifications;
|
|
relations_assignments_rels: typeof relations_assignments_rels;
|
|
relations_assignments: typeof relations_assignments;
|
|
relations_experience: typeof relations_experience;
|
|
relations_user_notifications: typeof relations_user_notifications;
|
|
relations_missions_mission_roles_provided_roles: typeof relations_missions_mission_roles_provided_roles;
|
|
relations_missions_briefing: typeof relations_missions_briefing;
|
|
relations_missions_mission_objectives: typeof relations_missions_mission_objectives;
|
|
relations_missions_factions_involved: typeof relations_missions_factions_involved;
|
|
relations_missions_logistics_and_support_insertion: typeof relations_missions_logistics_and_support_insertion;
|
|
relations_missions_logistics_and_support_extraction: typeof relations_missions_logistics_and_support_extraction;
|
|
relations_missions_logistics_and_support_assets_available: typeof relations_missions_logistics_and_support_assets_available;
|
|
relations_missions_comms_and_docs_frequencies: typeof relations_missions_comms_and_docs_frequencies;
|
|
relations_missions_rels: typeof relations_missions_rels;
|
|
relations_missions: typeof relations_missions;
|
|
relations_campaigns: typeof relations_campaigns;
|
|
relations_factions_rels: typeof relations_factions_rels;
|
|
relations_factions: typeof relations_factions;
|
|
relations_technologies_requirements_prerequisite_technologies: typeof relations_technologies_requirements_prerequisite_technologies;
|
|
relations_technologies_research_costs_resources: typeof relations_technologies_research_costs_resources;
|
|
relations_technologies_rels: typeof relations_technologies_rels;
|
|
relations_technologies: typeof relations_technologies;
|
|
relations_assets_skin_configuration_applies_to_asset_types: typeof relations_assets_skin_configuration_applies_to_asset_types;
|
|
relations_assets_crafting_crafting_data_inputs: typeof relations_assets_crafting_crafting_data_inputs;
|
|
relations_assets_crafting_crafting_data_byproducts: typeof relations_assets_crafting_crafting_data_byproducts;
|
|
relations_assets_rels: typeof relations_assets_rels;
|
|
relations_assets: typeof relations_assets;
|
|
relations_resources: typeof relations_resources;
|
|
relations_vehicles_category: typeof relations_vehicles_category;
|
|
relations_vehicles_materials: typeof relations_vehicles_materials;
|
|
relations_vehicles_scrap_returns: typeof relations_vehicles_scrap_returns;
|
|
relations_vehicles_upkeep_costs: typeof relations_vehicles_upkeep_costs;
|
|
relations_vehicles_allowed_virtual_cargo: typeof relations_vehicles_allowed_virtual_cargo;
|
|
relations_vehicles_pylons: typeof relations_vehicles_pylons;
|
|
relations_vehicles_rels: typeof relations_vehicles_rels;
|
|
relations_vehicles: typeof relations_vehicles;
|
|
relations_structures_materials: typeof relations_structures_materials;
|
|
relations_structures_resources_in_range: typeof relations_structures_resources_in_range;
|
|
relations_structures_structures_in_range: typeof relations_structures_structures_in_range;
|
|
relations_structures_upkeep: typeof relations_structures_upkeep;
|
|
relations_structures_auto_generated_resources: typeof relations_structures_auto_generated_resources;
|
|
relations_structures_allowed_storage: typeof relations_structures_allowed_storage;
|
|
relations_structures_prohibited_storage: typeof relations_structures_prohibited_storage;
|
|
relations_structures_rels: typeof relations_structures_rels;
|
|
relations_structures: typeof relations_structures;
|
|
relations_shipments_cargo: typeof relations_shipments_cargo;
|
|
relations_shipments_rels: typeof relations_shipments_rels;
|
|
relations_shipments: typeof relations_shipments;
|
|
relations_bank_accounts: typeof relations_bank_accounts;
|
|
relations_bank_transactions: typeof relations_bank_transactions;
|
|
relations_ledger_entries: typeof relations_ledger_entries;
|
|
relations_locker_storages_items_equipment_attachments: typeof relations_locker_storages_items_equipment_attachments;
|
|
relations_locker_storages_items: typeof relations_locker_storages_items;
|
|
relations_locker_storages: typeof relations_locker_storages;
|
|
relations_loadouts: typeof relations_loadouts;
|
|
relations_market_listings: typeof relations_market_listings;
|
|
relations_market_negotiations_history: typeof relations_market_negotiations_history;
|
|
relations_market_negotiations: typeof relations_market_negotiations;
|
|
relations_maps: typeof relations_maps;
|
|
relations_narrative_events: typeof relations_narrative_events;
|
|
relations_mission_files: typeof relations_mission_files;
|
|
relations_mod_lists: typeof relations_mod_lists;
|
|
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_game_rules_rels: typeof relations_game_rules_rels;
|
|
relations_game_rules: typeof relations_game_rules;
|
|
};
|
|
|
|
declare module "@payloadcms/db-postgres" {
|
|
export interface GeneratedDatabaseSchema {
|
|
schema: DatabaseSchema;
|
|
}
|
|
}
|