-- ================================================================ -- 마이그레이션 (04) : 이미 01_schema.sql로 DB를 만든 경우에만 실행 -- 새로 만드는 경우엔 01_schema.sql에 이미 포함되어 있어 불필요합니다. -- 이번 업데이트로 추가된 컬럼들: -- · profiles.weekly_days (주 근무일수: 4일제/5일제) -- · items.sell_price / supplier / buy_url (판매가·거래처·구매링크) -- ================================================================ alter table profiles add column if not exists weekly_days numeric default 5; alter table items add column if not exists sell_price numeric default 0; alter table items add column if not exists supplier text; alter table items add column if not exists buy_url text; -- 직책 · 직책수당 (이번 업데이트) alter table profiles add column if not exists position text; alter table profiles add column if not exists position_pay numeric default 0; -- 메뉴 순서 개인 설정 (이번 업데이트) alter table profiles add column if not exists menu_order jsonb default '{}'::jsonb; -- 자금 분류(카테고리) 사용자 추가 기능 (이번 업데이트) create table if not exists tx_category_defs ( name text primary key, kind text not null default '지출', created_at timestamptz default now() ); alter table tx_category_defs enable row level security; drop policy if exists p_admin on tx_category_defs; create policy p_admin on tx_category_defs for all to authenticated using (is_admin()) with check (is_admin());