Skip to content

Commit ec952df

Browse files
AllesandriaAllesandria
authored andcommitted
starting model build for tasks table
1 parent f335dc9 commit ec952df

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

api/task/model.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
11
// build your `Task` model here
2+
const db = require('../../data/dbConfig')
3+
4+
module.exports = {
5+
get,
6+
insert
7+
};

seeds/project_name=Database_.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
exports.seed = async function(knex) {
3+
// Deletes ALL existing entries
4+
//await knex('table_name').del()
5+
await knex('projects').insert([
6+
{id: 1, colName: 'dummy data'},
7+
{id: 2, colName: 'rowValue2'},
8+
{id: 3, colName: 'rowValue3'}
9+
]);
10+
};

seeds/task_name=.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
exports.seed = async function(knex) {
3+
// Deletes ALL existing entries
4+
await knex('table_name').del()
5+
await knex('table_name').insert([
6+
{id: 1, colName: 'rowValue1'},
7+
{id: 2, colName: 'rowValue2'},
8+
{id: 3, colName: 'rowValue3'}
9+
]);
10+
};

0 commit comments

Comments
 (0)