create table review_item ( id bigserial primary key, org_id bigint not null references organization (id) on delete cascade, seq integer not null, -- 순번 site_name varchar(300), category varchar(500), board_path varchar(500), board_name varchar(300), post_title varchar(1000), url varchar(1000), post_registered varchar(50), produced_date varchar(20), published_date varchar(20), has_attachment varchar(50), kogl_attached varchar(50), kogl_type varchar(50), ai_type varchar(50), surveyor_note varchar(1000), openable varchar(100), review_major varchar(200), -- 권리확인(대분류) review_minor varchar(300), -- 권리확인(세부) review_result varchar(200), -- 처리결과 judged_kogl_type varchar(50), -- 공공누리유형(판정) judged_ai_type varchar(50), opinion varchar(2000), lawyer_note varchar(1000), needs_processing varchar(50), -- 권리처리필요 web_edited_at timestamptz, -- null = 웹에서 손대지 않음 (재업로드 병합 판단 기준) created_at timestamptz not null default now(), updated_at timestamptz not null default now(), constraint uq_review_item unique (org_id, seq) ); create index ix_review_item_org on review_item (org_id, seq);