-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.js
42 lines (42 loc) · 1020 Bytes
/
install.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
module.exports = {
/**
* Return a list of updates
*
* @param {Object} we we.js object
* @return {Array} a list of update objects
*/
updates() {
return [{
version: '1.4.1',
update(we, done) {
const sql = 'ALTER TABLE `sitecontacts` '+
' ADD COLUMN `formId` VARCHAR(200) NULL DEFAULT NULL;';
we.db.defaultConnection
.query(sql)
.then( ()=> {
done();
return null;
})
.catch( (err)=> {
we.log.warn(err);
done();
});
}
}, {
version: '2.1.0',
update(we, done) {
const sql = 'ALTER TABLE `sitecontacts` '+
' ADD COLUMN `customSubject` VARCHAR(1500) NULL DEFAULT NULL;';
we.db.defaultConnection
.query(sql)
.then( ()=> {
done();
})
.catch( (err)=> {
we.log.warn('we-plugin-contact:update:Error on alter sitecontacts table', err);
done();
});
}
}];
}
};