Skip to content

Commit ac9b3ba

Browse files
mvegterNino van Galen
authored andcommitted
fix: added missing fields
1 parent 5b3a78f commit ac9b3ba

3 files changed

Lines changed: 26 additions & 6 deletions

File tree

lib/database/adapters/LogAdapter.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ class LogAdapter extends IAdapter {
4949
return {
5050
id: entityObject.entryID,
5151
title: entityObject.title,
52+
subtype: 'run',
53+
origin: 'process',
54+
userId: 0,
55+
text: 'Yet another log',
5256
};
5357
}
5458
}

lib/database/migrations/20200505195925-create-log.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ module.exports = {
3838
announcement_valid_until: {
3939
type: Sequelize.DATE,
4040
},
41+
user_id: {
42+
allowNull: false,
43+
type: Sequelize.INTEGER,
44+
},
4145
created_at: {
4246
allowNull: false,
4347
type: Sequelize.DATE,

lib/database/seeders/20200426144121-seeder-skeleton.js

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,30 @@ module.exports = {
1515
up: (queryInterface, _Sequelize) => queryInterface.bulkInsert('Logs', [
1616
{
1717
title: 'First entry',
18-
createdAt: new Date(),
19-
updatedAt: new Date(),
18+
subtype: 'run',
19+
origin: 'human',
20+
user_id: 4,
21+
text: 'Power interruption due to unplugged wire.',
22+
created_at: new Date(),
23+
updated_at: new Date(),
2024
},
2125
{
2226
title: 'Second entry',
23-
createdAt: new Date(),
24-
updatedAt: new Date(),
27+
subtype: 'subsystem',
28+
origin: 'process',
29+
user_id: 0,
30+
text: 'Detected particle ABC123',
31+
created_at: new Date(),
32+
updated_at: new Date(),
2533
},
2634
{
2735
title: 'Third entry',
28-
createdAt: new Date(),
29-
updatedAt: new Date(),
36+
subtype: 'announcement',
37+
origin: 'human',
38+
user_id: 4,
39+
text: 'Cake at the particle accelerator!',
40+
created_at: new Date(),
41+
updated_at: new Date(),
3042
},
3143
]),
3244

0 commit comments

Comments
 (0)