11exports . up = function ( knex , Promise ) {
2- return ( knex . schema
3- . createTable ( 'jobs' , tbl => {
4- tbl . increments ( 'id' ) ;
5- tbl . string ( 'position' ) . notNullable ( ) ; // Position Name
6- tbl . string ( 'company' ) . notNullable ( ) ; // Company Name
7- tbl . string ( 'link' ) ; // Link to job description
8- tbl . enum ( 'method' , [ 'LinkedIn' , 'Connection' , 'Job Website' , 'Company Site' , 'Other' ] ) . notNullable ( ) ;
9- tbl . string ( 'appDate' ) ; // Application Date
10- tbl . text ( 'notes' ) ; // Description of the job/interview notes
11- tbl . text ( 'color' ) // Color of the job card background
12- tbl . boolean ( 'interview' ) . defaultTo ( false ) ; // Checks if if there is an interview offer
13- tbl
14- . integer ( 'userId' )
15- . unsigned ( )
16- . references ( 'id' )
17- . inTable ( 'users' ) ; // Matches the job to the user
18- } )
19- ) } ;
2+ return knex . schema . createTable ( "jobs" , tbl => {
3+ tbl . increments ( "id" ) ;
4+ tbl . string ( "position" ) . notNullable ( ) ; // Position Name
5+ tbl . string ( "company" ) . notNullable ( ) ; // Company Name
6+ tbl . string ( "link" ) ; // Link to job description
7+ tbl
8+ . enum ( "method" , [
9+ "LinkedIn" ,
10+ "Connection" ,
11+ "Job Website" ,
12+ "Company Site" ,
13+ "Other"
14+ ] )
15+ . notNullable ( ) ;
16+ tbl . timestamp ( "appDate" ) ; // Application Date
17+ tbl . text ( "notes" ) ; // Description of the job/interview notes
18+ tbl . text ( "color" ) ; // Color of the job card background
19+ 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
25+ } ) ;
26+ } ;
2027
2128exports . down = function ( knex , Promise ) {
22- return knex . schema
23- . dropTableIfExists ( 'jobs' )
24- } ;
25-
29+ return knex . schema . dropTableIfExists ( "jobs" ) ;
30+ } ;
0 commit comments