Skip to content

Commit bafb7c2

Browse files
AllesandriaAllesandria
authored andcommitted
tasks table structured
1 parent c69abbb commit bafb7c2

File tree

1 file changed

+19
-10
lines changed

1 file changed

+19
-10
lines changed
Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,24 @@
1-
/**
2-
* @param { import("knex").Knex } knex
3-
* @returns { Promise<void> }
4-
*/
1+
52
exports.up = function(knex) {
6-
3+
return knex.schema.createTable('tasks', tbl => {
4+
tbl.increments('task_id');
5+
tbl.varchar('task_description').notNullable();
6+
tbl.varchar('task_notes');
7+
tbl.boolean('task_completed');
8+
tbl.integer('project_id')
9+
.notNullable()
10+
.references('project_id')
11+
.inTable('projects')
12+
13+
14+
})
15+
16+
717
};
818

9-
/**
10-
* @param { import("knex").Knex } knex
11-
* @returns { Promise<void> }
12-
*/
19+
1320
exports.down = function(knex) {
14-
21+
return knex.schema.dropTableIfExists('tasks')
22+
23+
1524
};

0 commit comments

Comments
 (0)