mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-28 18:20:57 +00:00
@@ -15,24 +15,6 @@ export class CreateInvoices1821000000002 implements MigrationInterface {
|
|||||||
name = "CreateInvoices1821000000002";
|
name = "CreateInvoices1821000000002";
|
||||||
|
|
||||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||||
<<<<<<< HEAD
|
|
||||||
const typeExists = await queryRunner.query(
|
|
||||||
`SELECT 1 FROM pg_type WHERE typname = 'invoices_status_enum' AND typnamespace = 'freight'::regnamespace;`,
|
|
||||||
);
|
|
||||||
|
|
||||||
if (!typeExists.length) {
|
|
||||||
await queryRunner.query(`
|
|
||||||
CREATE TYPE freight.invoices_status_enum AS ENUM (
|
|
||||||
'DRAFT',
|
|
||||||
'PENDING',
|
|
||||||
'PAID',
|
|
||||||
'OVERDUE',
|
|
||||||
'CANCELLED',
|
|
||||||
'REFUNDED'
|
|
||||||
);
|
|
||||||
`);
|
|
||||||
}
|
|
||||||
=======
|
|
||||||
await queryRunner.query(`
|
await queryRunner.query(`
|
||||||
CREATE TYPE IF NOT EXISTS freight.invoices_status_enum AS ENUM (
|
CREATE TYPE IF NOT EXISTS freight.invoices_status_enum AS ENUM (
|
||||||
'DRAFT',
|
'DRAFT',
|
||||||
@@ -43,7 +25,6 @@ export class CreateInvoices1821000000002 implements MigrationInterface {
|
|||||||
'REFUNDED'
|
'REFUNDED'
|
||||||
);
|
);
|
||||||
`);
|
`);
|
||||||
>>>>>>> 3ceacbe9a9087498cf007111b7b09ad3d35bce35
|
|
||||||
|
|
||||||
await queryRunner.query(`
|
await queryRunner.query(`
|
||||||
CREATE TABLE freight.invoices (
|
CREATE TABLE freight.invoices (
|
||||||
|
|||||||
@@ -35,8 +35,8 @@ export class FirstMile extends BaseEntity {
|
|||||||
@Column({ name: 'remaining_payment', type: 'numeric', precision: 14, scale: 2, default: 0 })
|
@Column({ name: 'remaining_payment', type: 'numeric', precision: 14, scale: 2, default: 0 })
|
||||||
remainingPayment!: number;
|
remainingPayment!: number;
|
||||||
|
|
||||||
// @Column({ type: 'boolean', default: false })
|
@Column({ type: 'boolean', default: false })
|
||||||
// isPostPaymentCompleted!: boolean;
|
isPostPaymentCompleted!: boolean;
|
||||||
|
|
||||||
@Column({ name: 'estimated_km', type: 'numeric', precision: 10, scale: 2, nullable: true })
|
@Column({ name: 'estimated_km', type: 'numeric', precision: 10, scale: 2, nullable: true })
|
||||||
estimatedKm?: number | null;
|
estimatedKm?: number | null;
|
||||||
|
|||||||
@@ -35,8 +35,8 @@ export class LastMile extends BaseEntity {
|
|||||||
@Column({ name: 'remaining_payment', type: 'numeric', precision: 14, scale: 2, default: 0 })
|
@Column({ name: 'remaining_payment', type: 'numeric', precision: 14, scale: 2, default: 0 })
|
||||||
remainingPayment!: number;
|
remainingPayment!: number;
|
||||||
|
|
||||||
// @Column({ type: 'boolean', default: false })
|
@Column({ type: 'boolean', default: false })
|
||||||
// isPostPaymentCompleted!: boolean;
|
isPostPaymentCompleted!: boolean;
|
||||||
|
|
||||||
@Column({ name: 'estimated_km', type: 'numeric', precision: 10, scale: 2, nullable: true })
|
@Column({ name: 'estimated_km', type: 'numeric', precision: 10, scale: 2, nullable: true })
|
||||||
estimatedKm?: number | null;
|
estimatedKm?: number | null;
|
||||||
|
|||||||
Reference in New Issue
Block a user