Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions typescript/type-orm/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions typescript/type-orm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"typeorm": "ts-node ./node_modules/typeorm/cli.js",
"start": "node dist/index.js",
"dev": "npm run clean && npm run build && npm run start",
"test": "npm run clean && npm run build && jest dist/test"
"test": "npm run clean && npm run build && node --experimental-vm-modules node_modules/jest/bin/jest.js dist/test"
},
"author": "",
"license": "ISC",
Expand All @@ -31,8 +31,7 @@
"npm-run-all": "^4.1.5",
"pg": "^8.13.1",
"ts-node": "^10.9.2",
"typeorm": "^0.3.28",
"uuid": "^11.0.3"
"typeorm": "^0.3.28"
},
"engines": {
"node": ">=18.0.0"
Expand Down
4 changes: 2 additions & 2 deletions typescript/type-orm/src/entity/Owner.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import "reflect-metadata";
import { randomUUID } from "crypto";
import { Column, Entity, PrimaryColumn, OneToMany } from "typeorm";
import { Pet } from "./Pet";
import { v4 as uuidv4 } from "uuid";

@Entity("owner")
export class Owner {
Expand Down Expand Up @@ -38,7 +38,7 @@ export class Owner {

constructor() {
if(!this.id) {
this.id = uuidv4();
this.id = randomUUID();
}
}
}
4 changes: 2 additions & 2 deletions typescript/type-orm/src/entity/Pet.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import "reflect-metadata";
import { randomUUID } from "crypto";
import { Column, Entity, ManyToOne, PrimaryColumn, JoinColumn, RelationId } from "typeorm";
import { Owner } from "./Owner";
import { v4 as uuidv4 } from "uuid";

@Entity("pet")
export class Pet {
Expand Down Expand Up @@ -36,7 +36,7 @@ export class Pet {

constructor() {
if (!this.id) {
this.id = uuidv4();
this.id = randomUUID();
}
}
}
4 changes: 2 additions & 2 deletions typescript/type-orm/src/entity/Vet.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import "reflect-metadata";
import { randomUUID } from "crypto";
import { Column, Entity, PrimaryColumn, ManyToMany, JoinTable } from "typeorm";
import { Specialty } from "./Specialty";
import { v4 as uuidv4 } from "uuid";

@Entity("vet")
export class Vet {
Expand Down Expand Up @@ -37,7 +37,7 @@ export class Vet {

constructor() {
if (!this.id) {
this.id = uuidv4();
this.id = randomUUID();
}
}
}
4 changes: 2 additions & 2 deletions typescript/type-orm/src/entity/VetSpecialty.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import "reflect-metadata";
import { randomUUID } from "crypto";
import { Entity, Column, PrimaryColumn } from "typeorm";
import { v4 as uuidv4 } from "uuid";

@Entity("vet_specialty")
export class VetSpecialty {
Expand All @@ -14,7 +14,7 @@ export class VetSpecialty {

constructor() {
if(!this.id) {
this.id = uuidv4();
this.id = randomUUID();
}
}
}
Loading