diff --git a/src/db/data/handler.ts b/src/db/data/handler.ts index bc9fe14d..e079dfba 100644 --- a/src/db/data/handler.ts +++ b/src/db/data/handler.ts @@ -29,10 +29,8 @@ export const saveDepartmentToDB = async (college: College[]): Promise => { const saveNotice = (notice: Notice, major: string): Promise => { const saveNoticeQuery = - 'INSERT INTO ' + - major + - ' (title, link, content, uploadDate) VALUES (?, ?, ?, ?)'; - const values = [notice.title, notice.path, notice.description, notice.date]; + 'INSERT INTO ' + major + ' (title, link, uploadDate) VALUES (?, ?, ?)'; + const values = [notice.title, notice.path, notice.date]; return new Promise((resolve) => { db.query(saveNoticeQuery, values, (err) => { @@ -152,7 +150,7 @@ const saveSchoolNotice = async ( }); }); - const saveNoticeQuery = `INSERT INTO 학교${mode} (title, link, content, uploadDate) VALUES (?, ?, ?, ?);`; + const saveNoticeQuery = `INSERT INTO 학교${mode} (title, link, uploadDate) VALUES (?, ?, ?);`; const savePromises: Promise[] = []; for (const list of notices) { @@ -165,12 +163,7 @@ const saveSchoolNotice = async ( savePromises.push( new Promise((resolve) => { - const values = [ - notice.title, - notice.path, - notice.description, - notice.date, - ]; + const values = [notice.title, notice.path, notice.date]; db.query(saveNoticeQuery, values, async (error) => { if (error) { console.log('학교 공지사항 입력 실패!'); diff --git a/src/db/table/createTables.ts b/src/db/table/createTables.ts index 14dfaa2e..e100e3b0 100644 --- a/src/db/table/createTables.ts +++ b/src/db/table/createTables.ts @@ -46,7 +46,6 @@ const createNoticeTable = (college: College[]) => { id INT PRIMARY KEY AUTO_INCREMENT, title VARCHAR(255) NOT NULL, link VARCHAR(255) NOT NULL UNIQUE, - content TEXT NOT NULL, uploadDate VARCHAR(255) NOT NULL );`; @@ -90,7 +89,6 @@ const createSchoolNoticeTable = () => { id INT PRIMARY KEY AUTO_INCREMENT, title VARCHAR(255) NOT NULL, link VARCHAR(255) NOT NULL UNIQUE, - content TEXT NOT NULL, uploadDate VARCHAR(255) NOT NULL );`;