Skip to content

Commit cb42aee

Browse files
committed
added favorite column to jobs
1 parent c0552d5 commit cb42aee

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
exports.up = function(knex, Promise) {
2-
return knex.schema.createTable("jobs", tbl => {
1+
exports.up = function (knex, Promise) {
2+
return knex.schema.createTable("jobs", (tbl) => {
33
tbl.increments("id");
44
tbl.string("position").notNullable(); // Position Name
55
tbl.string("company").notNullable(); // Company Name
@@ -10,21 +10,18 @@ exports.up = function(knex, Promise) {
1010
"Connection",
1111
"Job Website",
1212
"Company Site",
13-
"Other"
13+
"Other",
1414
])
1515
.notNullable();
1616
tbl.timestamp("appDate"); // Application Date
1717
tbl.text("notes"); // Description of the job/interview notes
1818
tbl.text("color"); // Color of the job card background
19+
tbl.boolean("favorite").defaultTo(false); // Checks to see if the jobs is a favorite
1920
tbl.boolean("interview").defaultTo(false); // Checks if if there is an interview offer
20-
tbl
21-
.integer("userId")
22-
.unsigned()
23-
.references("id")
24-
.inTable("users"); // Matches the job to the user
21+
tbl.integer("userId").unsigned().references("id").inTable("users"); // Matches the job to the user
2522
});
2623
};
2724

28-
exports.down = function(knex, Promise) {
25+
exports.down = function (knex, Promise) {
2926
return knex.schema.dropTableIfExists("jobs");
3027
};

0 commit comments

Comments
 (0)