You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import db from "@core/db";
import Bookshelf from 'bookshelf'
const bookshelf = Bookshelf(db);
bookshelf.plugin(require('bookshelf-json-columns'));
export default class Session extends bookshelf.Model {
get tableName() {
return 'sessions';
}
static jsonColumns = ['browser'];
// removing initialize does not solve the problem so it is not the cause
initialize() {
bookshelf.Model.prototype.initialize.apply(this, arguments);
this.on('saved', async (session) => {
// send notification
})
}
script() {
return this.belongsTo(Script)
}
}
During work with it in process I call save multiple times (a long-running process and I need to flush data to db periodically).
Model looks like this:
During work with it in process I call
save
multiple times (a long-running process and I need to flush data to db periodically).I save other properties, like so:
As a result
browser
field in db looks like this:The text was updated successfully, but these errors were encountered: