File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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} ;
You can’t perform that action at this time.
0 commit comments