Skip to content

Commit

Permalink
fix(hitl): made text column longer (resolve #578)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmytro Paniontko authored and epaminond committed Jul 31, 2018
1 parent 74512bb commit fe3ad87
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion packages/functionals/botpress-hitl/src/db.js
Expand Up @@ -9,6 +9,16 @@ function initialize() {
throw new Error('you must initialize the database before')
}

const table = 'hitl_messages'
const migrateTable = () =>
knex.schema.hasTable(table).then(exist => {
if (exist) {
return knex.schema.alterTable(table, t => {
t.string('text', 640).alter()
})
}
})

return helpers(knex)
.createTableIfNotExists('hitl_sessions', function(table) {
table.increments('id').primary()
Expand All @@ -29,12 +39,13 @@ function initialize() {
.references('hitl_sessions.id')
.onDelete('CASCADE')
table.string('type')
table.string('text')
table.string('text', 640)
table.jsonb('raw_message')
table.enu('direction', ['in', 'out'])
table.timestamp('ts')
})
})
.then(migrateTable)
}

function createUserSession(event) {
Expand Down

0 comments on commit fe3ad87

Please sign in to comment.