-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(sync): add lock for provider name (#284)
* fix(sync): add lock for provider name * migration
- Loading branch information
1 parent
dd5162c
commit f92111c
Showing
3 changed files
with
30 additions
and
2 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
packages/server/src/migrations/0.1.20-fix-client-schema.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,25 @@ | ||
import { Migration } from '@botpress/messaging-engine' | ||
|
||
export class FixClientSchemaMigration extends Migration { | ||
meta = { | ||
name: FixClientSchemaMigration.name, | ||
description: 'Fixes broken msg_clients table schema', | ||
version: '0.1.20' | ||
} | ||
|
||
async valid() { | ||
return this.trx.schema.hasTable('msg_clients') | ||
} | ||
|
||
async applied() { | ||
return false | ||
} | ||
|
||
async up() { | ||
return this.trx.schema.alterTable('msg_clients', (table) => { | ||
table.uuid('providerId').nullable().alter() | ||
}) | ||
} | ||
|
||
async down() {} | ||
} |
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import { Migration } from '@botpress/messaging-engine' | ||
import { StatusMigration } from './0.1.19-status' | ||
import { FixClientSchemaMigration } from './0.1.20-fix-client-schema' | ||
|
||
export const Migrations: { new (): Migration }[] = [StatusMigration] | ||
export const Migrations: { new (): Migration }[] = [StatusMigration, FixClientSchemaMigration] |
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