UNPKG

@lynsoluciones/medusa-docs

Version:
39 lines (38 loc) 1.69 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Invoice1732635295623 = void 0; const typeorm_1 = require("typeorm"); class Invoice1732635295623 { async up(queryRunner) { await queryRunner.createTable(new typeorm_1.Table({ name: 'invoice', columns: [ { name: 'id', type: 'character varying', isPrimary: true }, { name: 'number', type: 'character varying' }, { name: 'display_number', type: 'character varying' }, { name: 'order_id', type: 'character varying' }, { name: 'document_settings_id', type: 'character varying' }, { name: 'created_at', type: 'TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now()' }, { name: 'updated_at', type: 'TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now()' }, { name: 'deleted_at', type: 'TIMESTAMP WITH TIME ZONE', isNullable: true } ], foreignKeys: [ { columnNames: ['order_id'], referencedColumnNames: ['id'], referencedTableName: 'public.order', }, { columnNames: ['document_settings_id'], referencedColumnNames: ['id'], referencedTableName: 'public.document_settings', } ] }), true); } async down(queryRunner) { await queryRunner.dropTable('invoice', true); await queryRunner.query(`UPDATE "order" SET metadata = metadata #- '{invoice_id}'`); } } exports.Invoice1732635295623 = Invoice1732635295623;