Skip to content

Commit

Permalink
fix: added missing fields
Browse files Browse the repository at this point in the history
  • Loading branch information
mvegter authored and Nino van Galen committed May 8, 2020
1 parent 5b3a78f commit ac9b3ba
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 6 deletions.
4 changes: 4 additions & 0 deletions lib/database/adapters/LogAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ class LogAdapter extends IAdapter {
return {
id: entityObject.entryID,
title: entityObject.title,
subtype: 'run',
origin: 'process',
userId: 0,
text: 'Yet another log',
};
}
}
Expand Down
4 changes: 4 additions & 0 deletions lib/database/migrations/20200505195925-create-log.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ module.exports = {
announcement_valid_until: {
type: Sequelize.DATE,
},
user_id: {
allowNull: false,
type: Sequelize.INTEGER,
},
created_at: {
allowNull: false,
type: Sequelize.DATE,
Expand Down
24 changes: 18 additions & 6 deletions lib/database/seeders/20200426144121-seeder-skeleton.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,30 @@ module.exports = {
up: (queryInterface, _Sequelize) => queryInterface.bulkInsert('Logs', [
{
title: 'First entry',
createdAt: new Date(),
updatedAt: new Date(),
subtype: 'run',
origin: 'human',
user_id: 4,
text: 'Power interruption due to unplugged wire.',
created_at: new Date(),
updated_at: new Date(),
},
{
title: 'Second entry',
createdAt: new Date(),
updatedAt: new Date(),
subtype: 'subsystem',
origin: 'process',
user_id: 0,
text: 'Detected particle ABC123',
created_at: new Date(),
updated_at: new Date(),
},
{
title: 'Third entry',
createdAt: new Date(),
updatedAt: new Date(),
subtype: 'announcement',
origin: 'human',
user_id: 4,
text: 'Cake at the particle accelerator!',
created_at: new Date(),
updated_at: new Date(),
},
]),

Expand Down

0 comments on commit ac9b3ba

Please sign in to comment.