migrate schema to postgres only

This commit is contained in:
Julian Krauser 2025-06-07 15:20:20 +02:00
parent c849b8eb18
commit 97ffae009b
33 changed files with 363 additions and 1238 deletions

View file

@ -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),
},
],
});