transform migrations to work with mysql, postgres and sqlite
sqlite currently fails syntax of views
This commit is contained in:
parent
2cee8b5119
commit
a73c712626
29 changed files with 1626 additions and 382 deletions
|
@ -1,10 +1,11 @@
|
|||
import { Column, Entity, JoinColumn, ManyToOne, OneToMany, OneToOne, PrimaryColumn } from "typeorm";
|
||||
import { Column, ColumnType, Entity, JoinColumn, ManyToOne, OneToMany, OneToOne, PrimaryColumn } from "typeorm";
|
||||
import { membership } from "./membership";
|
||||
import { memberAwards } from "./memberAwards";
|
||||
import { memberQualifications } from "./memberQualifications";
|
||||
import { memberExecutivePositions } from "./memberExecutivePositions";
|
||||
import { communication } from "./communication";
|
||||
import { salutation } from "../../settings/salutation";
|
||||
import { getTypeByORM } from "../../../migrations/ormHelper";
|
||||
|
||||
@Entity()
|
||||
export class member {
|
||||
|
@ -20,7 +21,7 @@ export class member {
|
|||
@Column({ type: "varchar", length: 255 })
|
||||
nameaffix: string;
|
||||
|
||||
@Column({ type: "date" })
|
||||
@Column({ type: getTypeByORM("date").type as ColumnType })
|
||||
birthdate: Date;
|
||||
|
||||
@Column({ type: "varchar", length: 255, unique: true, nullable: true })
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { Column, Entity, ManyToOne, PrimaryColumn } from "typeorm";
|
||||
import { Column, ColumnType, Entity, ManyToOne, PrimaryColumn } from "typeorm";
|
||||
import { member } from "./member";
|
||||
import { award } from "../../settings/award";
|
||||
import { getTypeByORM } from "../../../migrations/ormHelper";
|
||||
|
||||
@Entity()
|
||||
export class memberAwards {
|
||||
|
@ -13,7 +14,7 @@ export class memberAwards {
|
|||
@Column({ type: "varchar", length: 255, nullable: true })
|
||||
note?: string;
|
||||
|
||||
@Column({ type: "date" })
|
||||
@Column({ type: getTypeByORM("date").type as ColumnType })
|
||||
date: Date;
|
||||
|
||||
@Column()
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { Column, Entity, ManyToOne, PrimaryColumn } from "typeorm";
|
||||
import { Column, ColumnType, Entity, ManyToOne, PrimaryColumn } from "typeorm";
|
||||
import { member } from "./member";
|
||||
import { executivePosition } from "../../settings/executivePosition";
|
||||
import { getTypeByORM } from "../../../migrations/ormHelper";
|
||||
|
||||
@Entity()
|
||||
export class memberExecutivePositions {
|
||||
|
@ -10,10 +11,10 @@ export class memberExecutivePositions {
|
|||
@Column({ type: "varchar", length: 255, nullable: true })
|
||||
note?: string;
|
||||
|
||||
@Column({ type: "date" })
|
||||
@Column({ type: getTypeByORM("date").type as ColumnType })
|
||||
start: Date;
|
||||
|
||||
@Column({ type: "date", nullable: true })
|
||||
@Column({ type: getTypeByORM("date").type as ColumnType, nullable: true })
|
||||
end?: Date;
|
||||
|
||||
@Column()
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { Column, Entity, ManyToOne, PrimaryColumn } from "typeorm";
|
||||
import { Column, ColumnType, Entity, ManyToOne, PrimaryColumn } from "typeorm";
|
||||
import { member } from "./member";
|
||||
import { qualification } from "../../settings/qualification";
|
||||
import { getTypeByORM } from "../../../migrations/ormHelper";
|
||||
|
||||
@Entity()
|
||||
export class memberQualifications {
|
||||
|
@ -10,10 +11,10 @@ export class memberQualifications {
|
|||
@Column({ type: "varchar", length: 255, nullable: true })
|
||||
note?: string;
|
||||
|
||||
@Column({ type: "date" })
|
||||
@Column({ type: getTypeByORM("date").type as ColumnType })
|
||||
start: Date;
|
||||
|
||||
@Column({ type: "date", nullable: true })
|
||||
@Column({ type: getTypeByORM("date").type as ColumnType, nullable: true })
|
||||
end?: Date;
|
||||
|
||||
@Column({ type: "varchar", length: 255, nullable: true })
|
||||
|
|
|
@ -1,16 +1,17 @@
|
|||
import { Column, Entity, JoinColumn, ManyToOne, PrimaryColumn } from "typeorm";
|
||||
import { Column, ColumnType, Entity, JoinColumn, ManyToOne, PrimaryColumn } from "typeorm";
|
||||
import { member } from "./member";
|
||||
import { membershipStatus } from "../../settings/membershipStatus";
|
||||
import { getTypeByORM } from "../../../migrations/ormHelper";
|
||||
|
||||
@Entity()
|
||||
export class membership {
|
||||
@PrimaryColumn({ generated: "increment", type: "int" })
|
||||
id: number;
|
||||
|
||||
@Column({ type: "date" })
|
||||
@Column({ type: getTypeByORM("date").type as ColumnType })
|
||||
start: Date;
|
||||
|
||||
@Column({ type: "date", nullable: true })
|
||||
@Column({ type: getTypeByORM("date").type as ColumnType, nullable: true })
|
||||
end?: Date;
|
||||
|
||||
@Column({ type: "varchar", length: 255, nullable: true })
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue