change the schema from public to freight

This commit is contained in:
marshal
2026-05-23 10:00:40 +03:00
parent ecbf1f2408
commit 2064e6efda
10 changed files with 10 additions and 10 deletions

View File

@@ -2,7 +2,7 @@ import { BaseEntity } from "@edr/api-common";
import { Freight } from "@edr/types";
import { Column, Entity } from "typeorm";
@Entity({ name: "invoices" })
@Entity({schema:"freight", name: "invoices" })
export class Invoice extends BaseEntity {
@Column({ name: "booking_id", type: "uuid" })
bookingId!: string;

View File

@@ -1,7 +1,7 @@
import { BaseEntity } from "@edr/api-common";
import { Column, Entity } from "typeorm";
@Entity({ name: "bookings" })
@Entity({ schema:"freight",name: "bookings" })
export class Booking extends BaseEntity {
// ── core ───────────────────────────────────────────────────────────────
@Column({ name: "reference", type: "varchar", length: 64, unique: true })

View File

@@ -2,7 +2,7 @@ import { BaseEntity } from "@edr/api-common";
import { Freight } from "@edr/types";
import { Column, Entity } from "typeorm";
@Entity({ name: "consignments" })
@Entity({schema:"freight", name: "consignments" })
export class Consignment extends BaseEntity {
@Column({ name: "booking_id", type: "uuid" })
bookingId!: string;

View File

@@ -4,7 +4,7 @@ import { Column, Entity } from "typeorm";
export type CustomerStatus = "Active" | "Pending" | "Inactive";
export type CustomerType = "Importer" | "Exporter" | "Supplier";
@Entity({ name: "customers" })
@Entity({schema:"freight", name: "customers" })
export class Customer extends BaseEntity {
@Column({ name: "name", type: "varchar", length: 256 })
name!: string;

View File

@@ -15,7 +15,7 @@ export interface DropdownOptionMeta {
badge?: string;
}
@Entity({ name: "dropdown_options" })
@Entity({schema:"freight", name: "dropdown_options" })
@Index(["settingId", "value"], { unique: true })
export class DropdownOption extends BaseEntity {
@ManyToOne(() => DropdownSetting, (setting) => setting.children, {

View File

@@ -12,7 +12,7 @@ export interface DropdownSettingMeta {
version?: string;
}
@Entity({ name: "dropdown_settings" })
@Entity({schema:"freight", name: "dropdown_settings" })
@Index(["code"], { unique: true })
export class DropdownSetting extends BaseEntity {
@Column({ name: "code", type: "varchar", length: 128, unique: true })

View File

@@ -10,7 +10,7 @@ import {
import { FileUploadSetting } from "./file-upload-setting.entity";
@Entity({ name: "file_upload_fields" })
@Entity({schema:"freight", name: "file_upload_fields" })
@Index(["settingId", "fileKey"], { unique: true })
@Check(`"max_files" > 0`)
@Check(`"max_size_mb" > 0`)

View File

@@ -8,7 +8,7 @@ import {
import { FileUploadField } from "./file-upload-field.entity";
@Entity({ name: "file_upload_settings" })
@Entity({ schema:"freight",name: "file_upload_settings" })
@Index(["code"], { unique: true })
export class FileUploadSetting extends BaseEntity {
@Column({

View File

@@ -2,7 +2,7 @@ import { BaseEntity } from "@edr/api-common";
import { Freight } from "@edr/types";
import { Column, Entity } from "typeorm";
@Entity({ name: "tracking_events" })
@Entity({schema:"freight", name: "tracking_events" })
export class TrackingEvent extends BaseEntity {
@Column({ name: "consignment_id", type: "uuid" })
consignmentId!: string;

View File

@@ -2,7 +2,7 @@ import { BaseEntity } from "@edr/api-common";
import { Freight } from "@edr/types";
import { Column, Entity } from "typeorm";
@Entity({ name: "trains" })
@Entity({ schema:"freight",name: "trains" })
export class Train extends BaseEntity {
@Column({ name: "code", type: "varchar", length: 32, unique: true })
code!: string;