migrate schema to postgres only
This commit is contained in:
parent
c849b8eb18
commit
97ffae009b
33 changed files with 363 additions and 1238 deletions
|
@ -1,12 +1,18 @@
|
|||
import { Table, TableForeignKey } from "typeorm";
|
||||
import { getDefaultByORM, getTypeByORM, isIncrementPrimary } from "../ormHelper";
|
||||
import { getDefaultByORM, getTypeByORM, isIncrementPrimary, isUUIDPrimary } from "../ormHelper";
|
||||
|
||||
export const query_table = new Table({
|
||||
name: "query",
|
||||
columns: [
|
||||
{ name: "id", ...getTypeByORM("int"), ...isIncrementPrimary },
|
||||
{ name: "id", ...getTypeByORM("uuid"), ...isUUIDPrimary },
|
||||
{ name: "title", ...getTypeByORM("varchar"), isUnique: true },
|
||||
{ name: "query", ...getTypeByORM("text"), default: getDefaultByORM("string") },
|
||||
{
|
||||
name: "updatedAt",
|
||||
...getTypeByORM("datetime", false, 6),
|
||||
default: getDefaultByORM("currentTimestamp", 6),
|
||||
onUpdate: getDefaultByORM<string>("currentTimestamp", 6),
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue