1
타임 스탬프 내 경로 응답으로 전송되고 있지만, 데이터베이스 내 테이블은 타임 스탬프
exports.up = (knex, Promise) => knex.schema.createTable('cohorts', (table) => {
table.increments('id')
.primary();
table.string('name', 'varchar(6)')
.notNullable();
table.string('type', 'varchar(3)')
.notNullable();
table.date('q1_start_date')
.notNullable();
table.date('q2_start_date')
.notNullable();
table.date('q3_start_date')
.notNullable();
table.date('q4_start_date')
.notNullable();
table.date('graduation_date')
.notNullable();
table.integer('campus_id')
.notNullable()
.references('id')
.inTable('campuses')
.onDelete('CASCADE');
table.timestamps(true, true);
});
exports.down = (knex, Promise) => knex.schema.dropTable('cohorts');
내가 확인할 때 내 마이그레이션에서 날짜를 사용하는 내 데이터베이스를 만들기 위해 PostgreSQL을 사용하고 표시되지 않습니다 데이터베이스의 내 테이블은 날짜 형식으로 저장됩니다. 그러나 bookshelf.js에 내 경로를 쓸 때 그 날짜는 타임 스탬프와 함께옵니다.
Here is my response with the timestamp
제가 table.date'말인지는 ('아마 바로 날짜 열을 생성합니다 .. 출력에'.format ('YYYY-MM-DD')를 '사용하려고 노력하지만, 당신은 zeores를 s에 추가합니다. 선택된 –