-
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.
feat(sockets): enable sockets by default (#364)
* feat(sockets): enable sockets by default * typing * migration
- Loading branch information
1 parent
fcf5d8c
commit da24263
Showing
9 changed files
with
44 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { getTableId, Migration } from '@botpress/messaging-engine' | ||
|
||
export class UserTokensMigration extends Migration { | ||
meta = { | ||
name: UserTokensMigration.name, | ||
description: 'Adds msg_user_tokens table', | ||
version: '1.1.0' | ||
} | ||
|
||
async valid() { | ||
return true | ||
} | ||
|
||
async applied() { | ||
return this.trx.schema.hasTable(getTableId('msg_user_tokens')) | ||
} | ||
|
||
async up() { | ||
// since it was possible to have this table created in the past with an experimental option, we delete it here | ||
await this.trx.schema.dropTableIfExists(getTableId('msg_user_tokens')) | ||
|
||
await this.trx.schema.createTable(getTableId('msg_user_tokens'), (table) => { | ||
table.uuid('id').primary() | ||
table.uuid('userId').references('id').inTable(getTableId('msg_users')) | ||
table.string('token').notNullable() | ||
table.timestamp('expiry').nullable() | ||
}) | ||
} | ||
|
||
async down() { | ||
await this.trx.schema.dropTable(getTableId('msg_user_tokens')) | ||
} | ||
} |
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