change schema according to migration
This commit is contained in:
parent
e056db053b
commit
f11ed83afc
6 changed files with 34 additions and 34 deletions
|
@ -1,4 +1,4 @@
|
|||
import { Table, TableForeignKey, TableUnique, Unique } from "typeorm";
|
||||
import { Table, TableForeignKey, TableUnique } from "typeorm";
|
||||
import { getTypeByORM, isUUIDPrimary, getDefaultByORM } from "../ormHelper";
|
||||
|
||||
export const inspection_plan_table = new Table({
|
||||
|
@ -8,9 +8,9 @@ export const inspection_plan_table = new Table({
|
|||
{ name: "title", ...getTypeByORM("varchar") },
|
||||
{ name: "inspectionInterval", ...getTypeByORM("varchar") },
|
||||
{ name: "remindTime", ...getTypeByORM("varchar") },
|
||||
{ name: "createdAt", ...getTypeByORM("date"), default: getDefaultByORM("currentTimestamp") },
|
||||
{ name: "equipmentTypeId", ...getTypeByORM("uuid", true), default: getDefaultByORM("null") },
|
||||
{ name: "vehicleTypeId", ...getTypeByORM("uuid", true), default: getDefaultByORM("null") },
|
||||
{ name: "createdAt", ...getTypeByORM("datetime"), default: getDefaultByORM("currentTimestamp") },
|
||||
{ name: "equipmentTypeId", ...getTypeByORM("uuid", true) },
|
||||
{ name: "vehicleTypeId", ...getTypeByORM("uuid", true) },
|
||||
],
|
||||
foreignKeys: [
|
||||
new TableForeignKey({
|
||||
|
@ -35,7 +35,7 @@ export const inspection_versioned_plan_table = new Table({
|
|||
columns: [
|
||||
{ name: "id", ...getTypeByORM("uuid"), ...isUUIDPrimary },
|
||||
{ name: "version", ...getTypeByORM("int"), default: getDefaultByORM("number", 0) },
|
||||
{ name: "createdAt", ...getTypeByORM("date"), default: getDefaultByORM("currentTimestamp") },
|
||||
{ name: "createdAt", ...getTypeByORM("datetime"), default: getDefaultByORM("currentTimestamp") },
|
||||
{ name: "inspectionPlanId", ...getTypeByORM("uuid") },
|
||||
],
|
||||
foreignKeys: [
|
||||
|
@ -62,8 +62,8 @@ export const inspection_point_table = new Table({
|
|||
{ name: "title", ...getTypeByORM("varchar") },
|
||||
{ name: "description", ...getTypeByORM("text") },
|
||||
{ name: "type", ...getTypeByORM("varchar") },
|
||||
{ name: "min", ...getTypeByORM("int", true), default: getDefaultByORM("null") },
|
||||
{ name: "max", ...getTypeByORM("int", true), default: getDefaultByORM("null") },
|
||||
{ name: "min", ...getTypeByORM("int", true) },
|
||||
{ name: "max", ...getTypeByORM("int", true) },
|
||||
{ name: "sort", ...getTypeByORM("int"), default: getDefaultByORM("number", 0) },
|
||||
{ name: "versionedPlanId", ...getTypeByORM("uuid") },
|
||||
],
|
||||
|
@ -83,13 +83,13 @@ export const inspection_table = new Table({
|
|||
columns: [
|
||||
{ name: "id", ...getTypeByORM("uuid"), ...isUUIDPrimary },
|
||||
{ name: "context", ...getTypeByORM("text") },
|
||||
{ name: "createdAt", ...getTypeByORM("date"), default: getDefaultByORM("currentTimestamp") },
|
||||
{ name: "createdAt", ...getTypeByORM("datetime"), default: getDefaultByORM("currentTimestamp") },
|
||||
{ name: "finishedAt", ...getTypeByORM("date", true) },
|
||||
{ name: "nextInspection", ...getTypeByORM("date", true) },
|
||||
{ name: "inspectionPlanId", ...getTypeByORM("uuid") },
|
||||
{ name: "inspectionVersionedPlanId", ...getTypeByORM("uuid") },
|
||||
{ name: "equipmentId", ...getTypeByORM("uuid", true), default: getDefaultByORM("null") },
|
||||
{ name: "vehicleId", ...getTypeByORM("uuid", true), default: getDefaultByORM("null") },
|
||||
{ name: "equipmentId", ...getTypeByORM("uuid", true) },
|
||||
{ name: "vehicleId", ...getTypeByORM("uuid", true) },
|
||||
],
|
||||
foreignKeys: [
|
||||
new TableForeignKey({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue