Skip to content

Commit c0552d5

Browse files
committed
changed all date columns to timestamp
1 parent f43ba32 commit c0552d5

2 files changed

Lines changed: 28 additions & 23 deletions

File tree

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,30 @@
11
exports.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

2128
exports.down = function(knex, Promise) {
22-
return knex.schema
23-
.dropTableIfExists('jobs')
24-
};
25-
29+
return knex.schema.dropTableIfExists("jobs");
30+
};

data/migrations/20200209124251_events_table.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ exports.up = function(knex) {
33
tbl.increments("id");
44
tbl.string("name").notNullable(); // Name of the event
55
tbl.string("location").notNullable(); // Event's location
6-
tbl.datetime("date").notNullable(); // Event's date and time
6+
tbl.timestamp("date").notNullable(); // Event's date and time
77
tbl.text("description"); // Event description
88
tbl.boolean("attended").defaultTo(false); // Did you attend the event?
99
tbl

0 commit comments

Comments
 (0)