File tree 6 files changed +41
-0
lines changed
packages/server/src/database/migrations
6 files changed +41
-0
lines changed Original file line number Diff line number Diff line change
1
+ import { MigrationInterface , QueryRunner } from 'typeorm'
2
+
3
+ export class AddArtifactsToChatMessage1726156258465 implements MigrationInterface {
4
+ public async up ( queryRunner : QueryRunner ) : Promise < void > {
5
+ const columnExists = await queryRunner . hasColumn ( 'chat_message' , 'artifacts' )
6
+ if ( ! columnExists ) queryRunner . query ( `ALTER TABLE \`chat_message\` ADD COLUMN \`artifacts\` LONGTEXT;` )
7
+ }
8
+
9
+ public async down ( queryRunner : QueryRunner ) : Promise < void > {
10
+ await queryRunner . query ( `ALTER TABLE \`chat_message\` DROP COLUMN \`artifacts\`;` )
11
+ }
12
+ }
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ import { AddApiKey1720230151480 } from './1720230151480-AddApiKey'
24
24
import { AddActionToChatMessage1721078251523 } from './1721078251523-AddActionToChatMessage'
25
25
import { LongTextColumn1722301395521 } from './1722301395521-LongTextColumn'
26
26
import { AddCustomTemplate1725629836652 } from './1725629836652-AddCustomTemplate'
27
+ import { AddArtifactsToChatMessage1726156258465 } from './1726156258465-AddArtifactsToChatMessage'
27
28
import { AddFollowUpPrompts1726666318346 } from './1726666318346-AddFollowUpPrompts'
28
29
29
30
export const mariadbMigrations = [
@@ -53,5 +54,6 @@ export const mariadbMigrations = [
53
54
AddActionToChatMessage1721078251523 ,
54
55
LongTextColumn1722301395521 ,
55
56
AddCustomTemplate1725629836652 ,
57
+ AddArtifactsToChatMessage1726156258465 ,
56
58
AddFollowUpPrompts1726666318346
57
59
]
Original file line number Diff line number Diff line change
1
+ import { MigrationInterface , QueryRunner } from 'typeorm'
2
+
3
+ export class AddArtifactsToChatMessage1726156258465 implements MigrationInterface {
4
+ public async up ( queryRunner : QueryRunner ) : Promise < void > {
5
+ const columnExists = await queryRunner . hasColumn ( 'chat_message' , 'artifacts' )
6
+ if ( ! columnExists ) queryRunner . query ( `ALTER TABLE \`chat_message\` ADD COLUMN \`artifacts\` LONGTEXT;` )
7
+ }
8
+
9
+ public async down ( queryRunner : QueryRunner ) : Promise < void > {
10
+ await queryRunner . query ( `ALTER TABLE \`chat_message\` DROP COLUMN \`artifacts\`;` )
11
+ }
12
+ }
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ import { AddApiKey1720230151480 } from './1720230151480-AddApiKey'
25
25
import { AddActionToChatMessage1721078251523 } from './1721078251523-AddActionToChatMessage'
26
26
import { LongTextColumn1722301395521 } from './1722301395521-LongTextColumn'
27
27
import { AddCustomTemplate1725629836652 } from './1725629836652-AddCustomTemplate'
28
+ import { AddArtifactsToChatMessage1726156258465 } from './1726156258465-AddArtifactsToChatMessage'
28
29
import { AddFollowUpPrompts1726666302024 } from './1726666302024-AddFollowUpPrompts'
29
30
30
31
export const mysqlMigrations = [
@@ -55,5 +56,6 @@ export const mysqlMigrations = [
55
56
AddActionToChatMessage1721078251523 ,
56
57
LongTextColumn1722301395521 ,
57
58
AddCustomTemplate1725629836652 ,
59
+ AddArtifactsToChatMessage1726156258465 ,
58
60
AddFollowUpPrompts1726666302024
59
61
]
Original file line number Diff line number Diff line change
1
+ import { MigrationInterface , QueryRunner } from 'typeorm'
2
+
3
+ export class AddArtifactsToChatMessage1726156258465 implements MigrationInterface {
4
+ public async up ( queryRunner : QueryRunner ) : Promise < void > {
5
+ await queryRunner . query ( `ALTER TABLE "chat_message" ADD COLUMN IF NOT EXISTS "artifacts" TEXT;` )
6
+ }
7
+
8
+ public async down ( queryRunner : QueryRunner ) : Promise < void > {
9
+ await queryRunner . query ( `ALTER TABLE "chat_message" DROP COLUMN "artifacts";` )
10
+ }
11
+ }
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ import { AddTypeToChatFlow1716300000000 } from './1716300000000-AddTypeToChatFlo
25
25
import { AddApiKey1720230151480 } from './1720230151480-AddApiKey'
26
26
import { AddActionToChatMessage1721078251523 } from './1721078251523-AddActionToChatMessage'
27
27
import { AddCustomTemplate1725629836652 } from './1725629836652-AddCustomTemplate'
28
+ import { AddArtifactsToChatMessage1726156258465 } from './1726156258465-AddArtifactsToChatMessage'
28
29
import { AddFollowUpPrompts1726666309552 } from './1726666309552-AddFollowUpPrompts'
29
30
30
31
export const postgresMigrations = [
@@ -55,5 +56,6 @@ export const postgresMigrations = [
55
56
AddApiKey1720230151480 ,
56
57
AddActionToChatMessage1721078251523 ,
57
58
AddCustomTemplate1725629836652 ,
59
+ AddArtifactsToChatMessage1726156258465 ,
58
60
AddFollowUpPrompts1726666309552
59
61
]
You can’t perform that action at this time.
0 commit comments