From fec12b743c8e6403e3f89103963a5281af771858 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=ED=98=84=EC=A3=BC?= Date: Tue, 15 Jul 2025 11:18:09 +0900 Subject: [PATCH] =?UTF-8?q?[DB]=20=EC=98=A4=ED=94=88=20=EB=8C=80=EB=B9=84?= =?UTF-8?q?=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/sql/data/04_second_open.sql | 12 +++++- .../main/resources/sql/schema/01_drop-all.sql | 2 - .../resources/sql/schema/02_create-all.sql | 40 ------------------- 3 files changed, 10 insertions(+), 44 deletions(-) diff --git a/core/src/main/resources/sql/data/04_second_open.sql b/core/src/main/resources/sql/data/04_second_open.sql index bfe87e6c..d1e0b00e 100644 --- a/core/src/main/resources/sql/data/04_second_open.sql +++ b/core/src/main/resources/sql/data/04_second_open.sql @@ -22,7 +22,7 @@ delete from uri where id in ( 'uri.admin.settings.adminRoles' ); --- front_user +-- front_user 테이블 : household 로 사용되어 삭제 DROP TABLE IF EXISTS front_user_has_upload_file; DROP TABLE IF EXISTS front_user_has_role; DROP TABLE IF EXISTS front_user_social; @@ -33,6 +33,7 @@ DROP SEQUENCE IF EXISTS front_user_has_upload_file_seq; DROP SEQUENCE IF EXISTS front_user_has_role_seq; DROP SEQUENCE IF EXISTS front_user_social_seq ; +-- 일계부 테이블 : daily_xxx 로 사용되어 삭제 DROP TABLE IF EXISTS input_day_group; DROP TABLE IF EXISTS daily_input_status; DROP TABLE IF EXISTS income_expense_record; @@ -51,10 +52,17 @@ DROP SEQUENCE IF EXISTS work_input_seq; DROP SEQUENCE IF EXISTS forestry_self_consumption_seq; DROP SEQUENCE IF EXISTS agriculture_self_consumption_seq; +-- 샘플 게시판 테이블 : 미사용으로 삭제 +DROP TABLE IF EXISTS article_has_upload_file ; +DROP TABLE IF EXISTS article_comment ; +DROP TABLE IF EXISTS article ; +DROP SEQUENCE IF EXISTS article_comment_seq ; +-- 이월금(매달 1일, 말일) 테이블 : daily_summary 로 사용되어 삭제 +DROP TABLE IF EXISTS monthly_carryover; - +DROP SEQUENCE IF EXISTS monthly_carryover_seq; diff --git a/core/src/main/resources/sql/schema/01_drop-all.sql b/core/src/main/resources/sql/schema/01_drop-all.sql index 7beb6245..34d59754 100644 --- a/core/src/main/resources/sql/schema/01_drop-all.sql +++ b/core/src/main/resources/sql/schema/01_drop-all.sql @@ -39,7 +39,6 @@ DROP TABLE IF EXISTS suggestion; DROP TABLE IF EXISTS upload_receipt_files; DROP TABLE IF EXISTS forest_product_yield; DROP TABLE IF EXISTS forest_product; -DROP TABLE IF EXISTS monthly_carryover; DROP TABLE IF EXISTS bank_auto_transfer; DROP TABLE IF EXISTS monthly_input_status; @@ -84,7 +83,6 @@ DROP SEQUENCE IF EXISTS research_area_seq; DROP SEQUENCE IF EXISTS upload_receipt_files_seq; DROP SEQUENCE IF EXISTS forest_product_yield_seq; DROP SEQUENCE IF EXISTS forest_product_seq; -DROP SEQUENCE IF EXISTS monthly_carryover_seq; DROP SEQUENCE IF EXISTS bank_auto_transfer_seq; diff --git a/core/src/main/resources/sql/schema/02_create-all.sql b/core/src/main/resources/sql/schema/02_create-all.sql index 01c38404..aeb7b3ca 100644 --- a/core/src/main/resources/sql/schema/02_create-all.sql +++ b/core/src/main/resources/sql/schema/02_create-all.sql @@ -1016,46 +1016,6 @@ COMMENT ON COLUMN bank_auto_transfer.transfer_category_code IS '이체 카테고 COMMENT ON COLUMN bank_auto_transfer.unit IS '단위(직접입력)'; COMMENT ON COLUMN bank_auto_transfer.category IS '카테고리'; --- 6. monthly_carryover --- ============================================ --- TABLE : monthly_carryover --- DESC : 이월금(매달 1일, 말일) 테이블 --- ============================================ -CREATE SEQUENCE monthly_carryover_seq START WITH 1 INCREMENT BY 1 CACHE 1 NO CYCLE; - -CREATE TABLE monthly_carryover ( - id bigint DEFAULT nextval('monthly_carryover_seq') NOT NULL, -- 이월금 ID - household_seq bigint NOT NULL, -- 임가정보 일련번호 (FK) - month varchar(7) NOT NULL, -- 조사시행 월 (yyyy-mm) - start_price integer, -- 월초이월금(현금) - end_price integer, -- 월말현금 - created_at timestamp(6) NOT NULL, -- 생성일 - created_by varchar(255) NOT NULL, -- 생성자 - updated_at timestamp(6) NOT NULL, -- 수정일 - updated_by varchar(255) NOT NULL, -- 수정자 - deleted_at timestamp(6), -- 삭제일 - deleted_by varchar(255), -- 삭제자 - is_deleted boolean DEFAULT false, -- 삭제여부 - - CONSTRAINT monthly_carryover_pkey PRIMARY KEY (id), - CONSTRAINT fk_monthly_carryover__household FOREIGN KEY (household_seq) REFERENCES household(seq) -); - -COMMENT ON TABLE monthly_carryover IS '이월금(매달 1일, 말일)'; - -COMMENT ON COLUMN monthly_carryover.id IS '이월금 ID'; -COMMENT ON COLUMN monthly_carryover.household_seq IS '임가정보 일련번호'; -COMMENT ON COLUMN monthly_carryover.month IS '조사시행 월 (yyyy-mm)'; -COMMENT ON COLUMN monthly_carryover.start_price IS '월초이월금(현금)'; -COMMENT ON COLUMN monthly_carryover.end_price IS '월말현금'; -COMMENT ON COLUMN monthly_carryover.created_at IS '생성일'; -COMMENT ON COLUMN monthly_carryover.created_by IS '생성자'; -COMMENT ON COLUMN monthly_carryover.updated_at IS '수정일'; -COMMENT ON COLUMN monthly_carryover.updated_by IS '수정자'; -COMMENT ON COLUMN monthly_carryover.deleted_at IS '삭제일'; -COMMENT ON COLUMN monthly_carryover.deleted_by IS '삭제자'; -COMMENT ON COLUMN monthly_carryover.is_deleted IS '삭제여부'; - -- 12. upload_receipt_files -- ============================================