Skip to content

Commit 24df6c9

Browse files
ajay-prajapati07Ajay  Prajapatia-ganguly
authored
feat(task-service): notes column in tasks table (#2345)
* feat(task-service): notes column in tasks table MIGRATION CHANGE: migration-20250919063843- added notes column in tasks table migration-20250919063621- added notes column in tasks table gh-2344 * fix copilot comments --------- Co-authored-by: Ajay Prajapati <[email protected]> Co-authored-by: a-ganguly <[email protected]>
1 parent 76bd715 commit 24df6c9

File tree

7 files changed

+98
-0
lines changed

7 files changed

+98
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
'use strict';
2+
3+
const fs = require('fs');
4+
const path = require('path');
5+
6+
exports.up = function (db) {
7+
const filePath = path.join(
8+
__dirname,
9+
'sqls',
10+
'20250919063843-add-notes-column-up.sql',
11+
);
12+
return new Promise(function (resolve, reject) {
13+
fs.readFile(filePath, {encoding: 'utf-8'}, function (err, data) {
14+
if (err) return reject(err);
15+
16+
resolve(data);
17+
});
18+
}).then(function (data) {
19+
return db.runSql(data);
20+
});
21+
};
22+
23+
exports.down = function (db) {
24+
const filePath = path.join(
25+
__dirname,
26+
'sqls',
27+
'20250919063843-add-notes-column-down.sql',
28+
);
29+
return new Promise(function (resolve, reject) {
30+
fs.readFile(filePath, {encoding: 'utf-8'}, function (err, data) {
31+
if (err) return reject(err);
32+
33+
resolve(data);
34+
});
35+
}).then(function (data) {
36+
return db.runSql(data);
37+
});
38+
};
39+
40+
exports._meta = {
41+
version: 1,
42+
};
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ALTER TABLE main.tasks
2+
DROP COLUMN notes;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ALTER TABLE main.tasks
2+
ADD COLUMN notes TEXT;
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
'use strict';
2+
3+
const fs = require('fs');
4+
const path = require('path');
5+
6+
exports.up = function (db) {
7+
const filePath = path.join(
8+
__dirname,
9+
'sqls',
10+
'20250919063621-add-notes-column-up.sql',
11+
);
12+
return new Promise(function (resolve, reject) {
13+
fs.readFile(filePath, {encoding: 'utf-8'}, function (err, data) {
14+
if (err) return reject(err);
15+
16+
resolve(data);
17+
});
18+
}).then(function (data) {
19+
return db.runSql(data);
20+
});
21+
};
22+
23+
exports.down = function (db) {
24+
const filePath = path.join(
25+
__dirname,
26+
'sqls',
27+
'20250919063621-add-notes-column-down.sql',
28+
);
29+
return new Promise(function (resolve, reject) {
30+
fs.readFile(filePath, {encoding: 'utf-8'}, function (err, data) {
31+
if (err) return reject(err);
32+
33+
resolve(data);
34+
});
35+
}).then(function (data) {
36+
return db.runSql(data);
37+
});
38+
};
39+
40+
exports._meta = {
41+
version: 1,
42+
};
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ALTER TABLE main.tasks
2+
DROP COLUMN notes;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ALTER TABLE main.tasks
2+
ADD COLUMN notes TEXT;

services/task-service/src/models/task.model.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,4 +103,10 @@ export class Task<TS = TaskStatus> extends UserModifiableEntity<Task> {
103103
type: 'string',
104104
})
105105
externalId?: string;
106+
107+
@property({
108+
name: 'notes',
109+
type: 'string',
110+
})
111+
notes?: string;
106112
}

0 commit comments

Comments
 (0)