fix(tkfb): 마이그레이션 FK 타입 불일치 수정 (signed/unsigned)

projects, sso_users 테이블은 signed int이므로 해당 FK에서 .unsigned() 제거

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Hyungi Ahn
2026-03-17 08:09:04 +09:00
parent d7cc568c01
commit 49949bda62

View File

@@ -30,7 +30,7 @@ exports.up = async (knex) => {
// 3. 공정표 항목
await knex.schema.createTable('schedule_entries', (table) => {
table.increments('entry_id').primary();
table.integer('project_id').unsigned().notNullable()
table.integer('project_id').notNullable()
.references('project_id').inTable('projects');
table.integer('phase_id').unsigned().notNullable()
.references('phase_id').inTable('schedule_phases');
@@ -42,7 +42,7 @@ exports.up = async (knex) => {
table.string('assignee', 100).nullable();
table.text('notes').nullable();
table.integer('display_order').defaultTo(0);
table.integer('created_by').unsigned().nullable()
table.integer('created_by').nullable()
.references('user_id').inTable('sso_users');
table.timestamp('created_at').defaultTo(knex.fn.now());
table.timestamp('updated_at').defaultTo(knex.fn.now());
@@ -61,7 +61,7 @@ exports.up = async (knex) => {
// 5. 마일스톤
await knex.schema.createTable('schedule_milestones', (table) => {
table.increments('milestone_id').primary();
table.integer('project_id').unsigned().notNullable()
table.integer('project_id').notNullable()
.references('project_id').inTable('projects');
table.integer('entry_id').unsigned().nullable()
.references('entry_id').inTable('schedule_entries').onDelete('SET NULL');
@@ -70,7 +70,7 @@ exports.up = async (knex) => {
table.string('milestone_type', 30).defaultTo('deadline');
table.string('status', 20).defaultTo('upcoming');
table.text('notes').nullable();
table.integer('created_by').unsigned().nullable()
table.integer('created_by').nullable()
.references('user_id').inTable('sso_users');
table.timestamp('created_at').defaultTo(knex.fn.now());
table.timestamp('updated_at').defaultTo(knex.fn.now());
@@ -85,7 +85,7 @@ exports.up = async (knex) => {
table.string('location', 200).nullable();
table.text('summary').nullable();
table.string('status', 20).defaultTo('draft');
table.integer('created_by').unsigned().nullable()
table.integer('created_by').nullable()
.references('user_id').inTable('sso_users');
table.timestamp('created_at').defaultTo(knex.fn.now());
table.timestamp('updated_at').defaultTo(knex.fn.now());
@@ -96,7 +96,7 @@ exports.up = async (knex) => {
table.increments('id').primary();
table.integer('meeting_id').unsigned().notNullable()
.references('meeting_id').inTable('meeting_minutes').onDelete('CASCADE');
table.integer('user_id').unsigned().notNullable()
table.integer('user_id').notNullable()
.references('user_id').inTable('sso_users');
table.unique(['meeting_id', 'user_id']);
});
@@ -106,7 +106,7 @@ exports.up = async (knex) => {
table.increments('item_id').primary();
table.integer('meeting_id').unsigned().notNullable()
.references('meeting_id').inTable('meeting_minutes').onDelete('CASCADE');
table.integer('project_id').unsigned().nullable()
table.integer('project_id').nullable()
.references('project_id').inTable('projects');
table.integer('milestone_id').unsigned().nullable()
.references('milestone_id').inTable('schedule_milestones').onDelete('SET NULL');
@@ -114,7 +114,7 @@ exports.up = async (knex) => {
table.text('content').notNullable();
table.text('decision').nullable();
table.text('action_required').nullable();
table.integer('responsible_user_id').unsigned().nullable()
table.integer('responsible_user_id').nullable()
.references('user_id').inTable('sso_users');
table.date('due_date').nullable();
table.string('status', 20).defaultTo('open');