Feat/note on order (#399)

* added NoteService and related endpoints && tests

* removed snapshots

* corrected error in service

* removed snapshot

* added the ability to note down author using a string

* updated model for note

* refactored to access logged in user

* added other user id option

* removed snapshot

* updated according to feedback

* removed snapshots

* reintroduced snapshots

* updated to snake case

* removed try catch from use-db
This commit is contained in:
Sebastian Mateos Nicolajsen
2021-09-22 15:19:35 +02:00
committed by GitHub
parent a82332da3e
commit 897ccf475a
18 changed files with 1054 additions and 46 deletions
@@ -0,0 +1,23 @@
import { MigrationInterface, QueryRunner } from "typeorm"
export class addNotes1632220294687 implements MigrationInterface {
name = "addNotes1632220294687"
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`CREATE TABLE "note" ("id" character varying NOT NULL, "value" character varying NOT NULL, "resource_type" character varying NOT NULL, "resource_id" character varying NOT NULL, "author_id" character varying, "created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updated_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "deleted_at" TIMESTAMP WITH TIME ZONE, "metadata" jsonb, CONSTRAINT "PK_96d0c172a4fba276b1bbed43058" PRIMARY KEY ("id"))`
)
await queryRunner.query(
`CREATE INDEX "IDX_f74980b411cf94af523a72af7d" ON "note" ("resource_type") `
)
await queryRunner.query(
`CREATE INDEX "IDX_3287f98befad26c3a7dab088cf" ON "note" ("resource_id") `
)
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`DROP INDEX "IDX_3287f98befad26c3a7dab088cf"`)
await queryRunner.query(`DROP INDEX "IDX_f74980b411cf94af523a72af7d"`)
await queryRunner.query(`DROP TABLE "note"`)
}
}