Skip to content

Commit b6a1d51

Browse files
authored
Merge pull request #372 from janong24/notificationMigrationFiles
added migration files for notification preferences
2 parents 603d624 + a8c7f54 commit b6a1d51

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
"use strict";
2+
3+
/** @type {import('sequelize-cli').Migration} */
4+
module.exports = {
5+
async up(queryInterface, Sequelize) {
6+
await queryInterface.dropTable("NotificationPreferences");
7+
await queryInterface.createTable("NotificationPreferences", {
8+
id: {
9+
type: Sequelize.INTEGER,
10+
allowNull: false,
11+
autoIncrement: true,
12+
primaryKey: true,
13+
},
14+
uid: {
15+
type: Sequelize.STRING,
16+
allowNull: false,
17+
},
18+
permissionGranted: {
19+
type: Sequelize.BOOLEAN,
20+
allowNull: false,
21+
defaultValue: false,
22+
},
23+
activityReminders: {
24+
type: Sequelize.BOOLEAN,
25+
allowNull: false,
26+
defaultValue: true,
27+
},
28+
appointmentReminders: {
29+
type: Sequelize.BOOLEAN,
30+
allowNull: false,
31+
defaultValue: true,
32+
},
33+
medicationReminders: {
34+
type: Sequelize.BOOLEAN,
35+
allowNull: false,
36+
defaultValue: true,
37+
},
38+
foodIntakeReminders: {
39+
type: Sequelize.BOOLEAN,
40+
allowNull: false,
41+
defaultValue: true,
42+
},
43+
insulinDosageReminders: {
44+
type: Sequelize.BOOLEAN,
45+
allowNull: false,
46+
defaultValue: true,
47+
},
48+
glucoseMeasurementReminders: {
49+
type: Sequelize.BOOLEAN,
50+
allowNull: false,
51+
defaultValue: true,
52+
},
53+
});
54+
},
55+
56+
async down(queryInterface, Sequelize) {
57+
await queryInterface.dropTable("NotificationPreferences");
58+
},
59+
};

0 commit comments

Comments
 (0)