-
-
Notifications
You must be signed in to change notification settings - Fork 16.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fixes #1947 * Lint fix * fallback from timestamp with timezone to timestamp --------- Co-authored-by: Emrah TOY <[email protected]>
- Loading branch information
Showing
12 changed files
with
75 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
packages/server/src/database/migrations/postgres/1710497452584-FieldTypes.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { MigrationInterface, QueryRunner } from 'typeorm' | ||
|
||
export class FieldTypes1710497452584 implements MigrationInterface { | ||
name = 'FieldTypes1710497452584' | ||
|
||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(`ALTER TABLE "chat_message" ALTER COLUMN "chatflowid" type uuid USING "chatflowid"::uuid`) | ||
await queryRunner.query(`ALTER TABLE "chat_message" ALTER COLUMN "chatId" type uuid USING "chatId"::uuid`) | ||
await queryRunner.query(`ALTER TABLE "chat_message" ALTER COLUMN "sessionId" type uuid USING "sessionId"::uuid`) | ||
|
||
await queryRunner.query(`ALTER TABLE "assistant" ALTER COLUMN "credential" type uuid USING "credential"::uuid`) | ||
|
||
await queryRunner.query(`ALTER TABLE "chat_message_feedback" ALTER COLUMN "chatflowid" type uuid USING "chatflowid"::uuid`) | ||
await queryRunner.query(`ALTER TABLE "chat_message_feedback" ALTER COLUMN "chatId" type uuid USING "chatId"::uuid`) | ||
await queryRunner.query(`ALTER TABLE "chat_message_feedback" ALTER COLUMN "messageId" type uuid USING "messageId"::uuid`) | ||
|
||
await queryRunner.query(`ALTER TABLE "chat_message_feedback" ADD CONSTRAINT "UQ_6352078b5a294f2d22179ea7955" UNIQUE ("messageId")`) | ||
|
||
await queryRunner.query(`CREATE INDEX IF NOT EXISTS "IDX_f56c36fe42894d57e5c664d229" ON "chat_message" ("chatflowid") `) | ||
await queryRunner.query(`CREATE INDEX IF NOT EXISTS "IDX_f56c36fe42894d57e5c664d230" ON "chat_message_feedback" ("chatflowid") `) | ||
await queryRunner.query(`CREATE INDEX IF NOT EXISTS "IDX_9acddcb7a2b51fe37669049fc6" ON "chat_message_feedback" ("chatId") `) | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(`DROP INDEX "public"."IDX_9acddcb7a2b51fe37669049fc6"`) | ||
await queryRunner.query(`DROP INDEX "public"."IDX_f56c36fe42894d57e5c664d229"`) | ||
await queryRunner.query(`DROP INDEX "public"."IDX_f56c36fe42894d57e5c664d230"`) | ||
|
||
await queryRunner.query(`ALTER TABLE "chat_message_feedback" DROP CONSTRAINT "UQ_6352078b5a294f2d22179ea7955"`) | ||
|
||
await queryRunner.query(`ALTER TABLE "chat_message" ALTER COLUMN "chatflowid" type varchar USING "chatflowid"::varchar`) | ||
await queryRunner.query(`ALTER TABLE "chat_message" ALTER COLUMN "chatId" type varchar USING "chatId"::varchar`) | ||
await queryRunner.query(`ALTER TABLE "chat_message" ALTER COLUMN "sessionId" type varchar USING "sessionId"::varchar`) | ||
|
||
await queryRunner.query(`ALTER TABLE "assistant" ALTER COLUMN "credential" type varchar USING "credential"::varchar`) | ||
|
||
await queryRunner.query(`ALTER TABLE "chat_message_feedback" ALTER COLUMN "chatflowid" type varchar USING "chatflowid"::varchar`) | ||
await queryRunner.query(`ALTER TABLE "chat_message_feedback" ALTER COLUMN "chatId" type varchar USING "chatId"::varchar`) | ||
await queryRunner.query(`ALTER TABLE "chat_message_feedback" ALTER COLUMN "messageId" type varchar USING "messageId"::varchar`) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { DataSource } from 'typeorm' | ||
import { getDataSource } from '../DataSource' | ||
|
||
export const dataSource: DataSource = getDataSource() |