mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-26 18:42:49 +00:00
change the schema from public to freight
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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 })
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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, {
|
||||
|
||||
@@ -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 })
|
||||
|
||||
@@ -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`)
|
||||
|
||||
@@ -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({
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user