Skip to content

Commit 423f995

Browse files
AllesandriaAllesandria
authored andcommitted
made projects table migration
1 parent a53b33f commit 423f995

File tree

4 files changed

+24
-4
lines changed

4 files changed

+24
-4
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,12 @@ Build the migration(s) in Knex inside the `data/migrations` folder using appropr
5959
- [ ] `task_id` - primary key - table.increments("task_id")
6060
- [ ] `task_description` - required - notNullable - varchar
6161
- [ ] `task_notes` - optional - varchar
62-
- [ ] `task_completed` - the database defaults it to `false` (integer 0) if not provided -boolean (fals)
63-
- [ ] `project_id` - required and points to an actual `project_id` in the `projects` table
62+
- [ ] `task_completed` - the database defaults it to `false` (integer 0) if not provided -boolean (false)
63+
- [ ] `project_id` - required and points to an actual `project_id` in the `projects` table - foreign key - notnullable
6464

6565
- [ ] A **resource assignment** connects a resource and a project, and is stored in a `project_resources` table. You decide what columns to use.
66+
- [ ] `project_name`
67+
- [ ] `resource_name`
6668

6769
### Required Endpoints
6870

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
exports.up = function(knex) {
3+
4+
5+
6+
7+
};
8+
9+
10+
exports.down = function(knex) {
11+
12+
13+
14+
15+
};

knexfile.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ module.exports = {
88
development: {
99
client: 'sqlite3',
1010
connection: {
11-
filename: './data/projects2.db3'
11+
filename: './data/projectresources.db3'
1212
},
13+
useNullAsDefault: true,
1314
migrations: {
1415
directory: './data/migrations'
1516
}

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
"scripts": {
66
"test": "cross-env NODE_ENV=testing jest --verbose --watch --runInBand --silent",
77
"start": "node index.js",
8-
"server": "nodemon index.js"
8+
"server": "nodemon index.js",
9+
"migrate": "knex migrate:latest",
10+
"rollback": "knex migrate:rollback"
911
},
1012
"repository": {
1113
"type": "git",

0 commit comments

Comments
 (0)