CREATE TABLE IF NOT EXISTS public.trn_rincian_sub_kegiatan (
    id_unik_rincian_sub_kegiatan uuid DEFAULT public.uuid_generate_v7() NOT NULL,
    tahun integer DEFAULT 0 NOT NULL,
	id_daerah integer DEFAULT 0 NOT NULL,
	id_unik_jadwal uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
	id_unik_skpd uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
	id_unik_sub_skpd uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
	id_unik_sub_kegiatan uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
	id_unik_aktivitas_sub_kegiatan uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
    id_unik_keterangan_sub_kegiatan uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
    id_unik_sumber_dana_sub_kegiatan uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
    id_akun integer DEFAULT 0 NOT NULL,
	lokus_akun text DEFAULT ''::text NOT NULL,
    id_unik_profil_penerima_bantuan uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
	set_form_input integer DEFAULT 0 NOT NULL,
    set_sisa_lelang boolean DEFAULT false NOT NULL,
	id_unik_standar_harga uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
	satuan character varying(100) DEFAULT ''::character varying NOT NULL,
	pajak integer DEFAULT 0 NOT NULL,
	harga_satuan numeric(17,2) DEFAULT 0 NOT NULL,
    volume numeric(17,2) DEFAULT 0 NOT NULL,
    koefisien text DEFAULT ''::text NOT NULL,
	total_harga numeric(17,2) DEFAULT 0 NOT NULL,
    vol_1 numeric(17,2) DEFAULT 0 NOT NULL,
    sat_1 character varying(100) DEFAULT ''::character varying NOT NULL,
    vol_2 numeric(17,2) DEFAULT 0 NOT NULL,
    sat_2 character varying(100) DEFAULT ''::character varying NOT NULL,
    vol_3 numeric(17,2) DEFAULT 0 NOT NULL,
    sat_3 character varying(100) DEFAULT ''::character varying NOT NULL,
    vol_4 numeric(17,2) DEFAULT 0 NOT NULL,
    sat_4 character varying(100) DEFAULT ''::character varying NOT NULL,
	pajak_murni integer DEFAULT 0 NOT NULL,
	harga_satuan_murni numeric(17,2) DEFAULT 0 NOT NULL,
    volume_murni numeric(17,2) DEFAULT 0 NOT NULL,
    koefisien_murni text DEFAULT ''::text NOT NULL,
	total_harga_murni numeric(17,2) DEFAULT 0 NOT NULL,
    vol_1_murni numeric(17,2) DEFAULT 0 NOT NULL,
    sat_1_murni character varying(100) DEFAULT ''::character varying NOT NULL,
    vol_2_murni numeric(17,2) DEFAULT 0 NOT NULL,
    sat_2_murni character varying(100) DEFAULT ''::character varying NOT NULL,
    vol_3_murni numeric(17,2) DEFAULT 0 NOT NULL,
    sat_3_murni character varying(100) DEFAULT ''::character varying NOT NULL,
    vol_4_murni numeric(17,2) DEFAULT 0 NOT NULL,
    sat_4_murni character varying(100) DEFAULT ''::character varying NOT NULL,
    id_bl_lama integer DEFAULT 0 NOT NULL,
	id_sub_bl_lama integer DEFAULT 0 NOT NULL,
	id_rinci_sub_bl_lama integer DEFAULT 0 NOT NULL,
	id_subs_sub_bl_lama integer DEFAULT 0 NOT NULL,
    id_ket_sub_bl_lama integer DEFAULT 0 NOT NULL,
	id_dana_sub_bl_lama integer DEFAULT 0 NOT NULL,
    id_penerima_bantuan_lama integer DEFAULT 0 NOT NULL,
    id_profil_penerima_bantuan_lama integer DEFAULT 0 NOT NULL,
    harga_satuan_lama double precision DEFAULT 0 NOT NULL,
    volume_lama double precision DEFAULT 0 NOT NULL,
    total_harga_lama double precision DEFAULT 0 NOT NULL,
    vol_1_lama double precision DEFAULT 0 NOT NULL,
    vol_2_lama double precision DEFAULT 0 NOT NULL,
    vol_3_lama double precision DEFAULT 0 NOT NULL,
    vol_4_lama double precision DEFAULT 0 NOT NULL,
    harga_satuan_murni_lama double precision DEFAULT 0 NOT NULL,
    volume_murni_lama double precision DEFAULT 0 NOT NULL,
    total_harga_murni_lama double precision DEFAULT 0 NOT NULL,
    [REDACTED] double precision DEFAULT 0 NOT NULL,
    [REDACTED] double precision DEFAULT 0 NOT NULL,
    [REDACTED] double precision DEFAULT 0 NOT NULL,
    [REDACTED] double precision DEFAULT 0 NOT NULL,
    created_at timestamp(6) without time zone DEFAULT now() NOT NULL,
    created_by integer DEFAULT 0 NOT NULL,
    updated_at timestamp(6) without time zone DEFAULT '0001-01-01 00:00:00'::timestamp without time zone NOT NULL,
    updated_by integer DEFAULT 0 NOT NULL,
    deleted_at timestamp(6) without time zone DEFAULT '0001-01-01 00:00:00'::timestamp without time zone NOT NULL,
    deleted_by integer DEFAULT 0 NOT NULL
);

ALTER TABLE public.trn_rincian_sub_kegiatan ADD CONSTRAINT trn_rincian_sub_kegiatan_pkey PRIMARY KEY (id_unik_rincian_sub_kegiatan, tahun, id_daerah);
ALTER TABLE public.trn_rincian_sub_kegiatan ADD CONSTRAINT trn_rincian_sub_kegiatan_unique_key UNIQUE (tahun, id_daerah, id_unik_jadwal, id_unik_skpd, id_unik_sub_skpd, id_unik_sub_kegiatan, id_unik_aktivitas_sub_kegiatan, id_unik_keterangan_sub_kegiatan, id_unik_sumber_dana_sub_kegiatan, id_akun, id_unik_standar_harga);

COMMENT ON TABLE public.trn_rincian_sub_kegiatan IS 'Tabel transaksi yang menyimpan rincian belanja dalam suatu sub kegiatan.';
COMMENT ON COLUMN public.trn_rincian_sub_kegiatan.id_unik_rincian_sub_kegiatan IS 'ID unik UUID sebagai ID primary key.';

COMMENT ON COLUMN public.trn_rincian_sub_kegiatan.tahun IS 'Tahun anggaran sub kegiatan.';
COMMENT ON COLUMN public.trn_rincian_sub_kegiatan.id_daerah IS 'Pemerintah daerah pelaksana sub kegiatan.';
COMMENT ON COLUMN public.trn_rincian_sub_kegiatan.id_unik_jadwal IS 'ID jadwal tahapan anggaran.';
COMMENT ON COLUMN public.trn_rincian_sub_kegiatan.id_unik_skpd IS 'ID SKPD induk yang membawahi pelaksana kegiatan.';
COMMENT ON COLUMN public.trn_rincian_sub_kegiatan.id_unik_sub_skpd IS 'ID SKPD pelaksana kegiatan.';
COMMENT ON COLUMN public.trn_rincian_sub_kegiatan.id_unik_sub_kegiatan IS 'ID sub kegiatan yang sudah diinput dalam rencana kerja.';
COMMENT ON COLUMN public.trn_rincian_sub_kegiatan.id_unik_aktivitas_sub_kegiatan IS 'ID aktvitas sub kegiatan yang sudah diinput.';
COMMENT ON COLUMN public.trn_rincian_sub_kegiatan.id_unik_keterangan_sub_kegiatan IS 'ID keterangan sub kegiatan yang sudah diinput.';
COMMENT ON COLUMN public.trn_rincian_sub_kegiatan.id_unik_sumber_dana_sub_kegiatan IS 'ID sumber dana yang sudah dipilih.';
COMMENT ON COLUMN public.trn_rincian_sub_kegiatan.id_akun IS 'ID akun belanja.';
COMMENT ON COLUMN public.trn_rincian_sub_kegiatan.lokus_akun IS 'Lokasi atau akun spesifik untuk belanja.';
COMMENT ON COLUMN public.trn_rincian_sub_kegiatan.id_unik_profil_penerima_bantuan IS 'ID profil penerima bantuan apabila belanja yang diinput adalah belanja bantuan.';
COMMENT ON COLUMN public.trn_rincian_sub_kegiatan.set_form_input IS 'Status penggunaan form input tertentu.';
COMMENT ON COLUMN public.trn_rincian_sub_kegiatan.set_sisa_lelang IS 'Penanda apakah merupakan sisa anggaran.';
COMMENT ON COLUMN public.trn_rincian_sub_kegiatan.id_unik_standar_harga IS 'ID standar harga yang digunakan.';
COMMENT ON COLUMN public.trn_rincian_sub_kegiatan.satuan IS 'Satuan volume belanja.';
COMMENT ON COLUMN public.trn_rincian_sub_kegiatan.pajak IS 'Persentase pajak yang dikenakan.';
COMMENT ON COLUMN public.trn_rincian_sub_kegiatan.harga_satuan IS 'Harga satuan belanja.';
COMMENT ON COLUMN public.trn_rincian_sub_kegiatan.volume IS 'Volume total belanja.';
COMMENT ON COLUMN public.trn_rincian_sub_kegiatan.koefisien IS 'Detail koefisien volume dan satuan.';
COMMENT ON COLUMN public.trn_rincian_sub_kegiatan.total_harga IS 'Total harga belanja.';
COMMENT ON COLUMN public.trn_rincian_sub_kegiatan.vol_1 IS 'Volume 1.';
COMMENT ON COLUMN public.trn_rincian_sub_kegiatan.sat_1 IS 'Satuan volume 1.';
COMMENT ON COLUMN public.trn_rincian_sub_kegiatan.vol_2 IS 'Volume 2.';
COMMENT ON COLUMN public.trn_rincian_sub_kegiatan.sat_2 IS 'Satuan volume 2.';
COMMENT ON COLUMN public.trn_rincian_sub_kegiatan.vol_3 IS 'Volume 3.';
COMMENT ON COLUMN public.trn_rincian_sub_kegiatan.sat_3 IS 'Satuan volume 3.';
COMMENT ON COLUMN public.trn_rincian_sub_kegiatan.vol_4 IS 'Volume 4.';
COMMENT ON COLUMN public.trn_rincian_sub_kegiatan.sat_4 IS 'Satuan volume 4.';
COMMENT ON COLUMN public.trn_rincian_sub_kegiatan.id_bl_lama IS 'Primary key tabel d_bl lama.';
COMMENT ON COLUMN public.trn_rincian_sub_kegiatan.id_sub_bl_lama IS 'Primary key tabel d_sub_bl lama.';
COMMENT ON COLUMN public.trn_rincian_sub_kegiatan.id_rinci_sub_bl_lama IS 'Primary key tabel d_rinci_sub_bl lama.';
COMMENT ON COLUMN public.trn_rincian_sub_kegiatan.id_subs_sub_bl_lama IS 'Primary key tabel d_subs_sub_bl lama.';
COMMENT ON COLUMN public.trn_rincian_sub_kegiatan.id_ket_sub_bl_lama IS 'Primary key tabel d_ket_sub_bl lama.';
COMMENT ON COLUMN public.trn_rincian_sub_kegiatan.id_dana_sub_bl_lama IS 'Primary key tabel d_dana_sub_bl lama.';
COMMENT ON COLUMN public.trn_rincian_sub_kegiatan.id_penerima_bantuan_lama IS 'Primary key tabel d_penerima_bantuan lama.';
COMMENT ON COLUMN public.trn_rincian_sub_kegiatan.id_profil_penerima_bantuan_lama IS 'Primary key tabel r_profil_user lama.';
COMMENT ON COLUMN public.trn_rincian_sub_kegiatan.created_at IS 'Tanggal dan waktu data dibuat.';
COMMENT ON COLUMN public.trn_rincian_sub_kegiatan.created_by IS 'ID pengguna yang membuat data.';
COMMENT ON COLUMN public.trn_rincian_sub_kegiatan.updated_at IS 'Tanggal dan waktu terakhir data diperbarui.';
COMMENT ON COLUMN public.trn_rincian_sub_kegiatan.updated_by IS 'ID pengguna yang memperbarui data.';
COMMENT ON COLUMN public.trn_rincian_sub_kegiatan.deleted_at IS 'Tanggal dan waktu data dihapus (soft delete).';
COMMENT ON COLUMN public.trn_rincian_sub_kegiatan.deleted_by IS 'ID pengguna yang menghapus data.';

CREATE INDEX trn_rincian_sub_kegiatan_id_unik_rincian_sub_kegiatan_idx ON public.trn_rincian_sub_kegiatan USING btree (id_unik_rincian_sub_kegiatan);
CREATE INDEX trn_rincian_sub_kegiatan_tahun_idx ON public.trn_rincian_sub_kegiatan USING btree (tahun);
CREATE INDEX trn_rincian_sub_kegiatan_id_daerah_idx ON public.trn_rincian_sub_kegiatan USING btree (id_daerah);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_jadwal_idx ON public.trn_rincian_sub_kegiatan USING btree (id_unik_jadwal);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_skpd_idx ON public.trn_rincian_sub_kegiatan USING btree (id_unik_skpd);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_sub_skpd_idx ON public.trn_rincian_sub_kegiatan USING btree (id_unik_sub_skpd);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_sub_kegiatan_idx ON public.trn_rincian_sub_kegiatan USING btree (id_unik_sub_kegiatan);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_aktivitas_sub_kegiatan_idx ON public.trn_rincian_sub_kegiatan USING btree (id_unik_aktivitas_sub_kegiatan);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_keterangan_sub_kegiatan_idx ON public.trn_rincian_sub_kegiatan USING btree (id_unik_keterangan_sub_kegiatan);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_sumber_dana_sub_kegiatan_idx ON public.trn_rincian_sub_kegiatan USING btree (id_unik_sumber_dana_sub_kegiatan);
CREATE INDEX trn_rincian_sub_kegiatan_id_akun_idx ON public.trn_rincian_sub_kegiatan USING btree (id_akun);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_profil_penerima_bantuan_idx ON public.trn_rincian_sub_kegiatan USING btree (id_unik_profil_penerima_bantuan);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_standar_harga_idx ON public.trn_rincian_sub_kegiatan USING btree (id_unik_standar_harga);


-- SCHEMA rancangan_murni;
CREATE TABLE IF NOT EXISTS rancangan_murni.trn_rincian_sub_kegiatan (
    id_unik_rincian_sub_kegiatan uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
    tahun integer DEFAULT 0 NOT NULL,
	id_daerah integer DEFAULT 0 NOT NULL,
	id_unik_jadwal uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
	id_unik_skpd uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
	id_unik_sub_skpd uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
	id_unik_sub_kegiatan uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
	id_unik_aktivitas_sub_kegiatan uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
    id_unik_keterangan_sub_kegiatan uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
    id_unik_sumber_dana_sub_kegiatan uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
    id_akun integer DEFAULT 0 NOT NULL,
	lokus_akun text DEFAULT ''::text NOT NULL,
    id_unik_profil_penerima_bantuan uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
	set_form_input integer DEFAULT 0 NOT NULL,
    set_sisa_lelang boolean DEFAULT false NOT NULL,
	id_unik_standar_harga uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
	satuan character varying(100) DEFAULT ''::character varying NOT NULL,
	pajak integer DEFAULT 0 NOT NULL,
	harga_satuan numeric(17,2) DEFAULT 0 NOT NULL,
    volume numeric(17,2) DEFAULT 0 NOT NULL,
    koefisien text DEFAULT ''::text NOT NULL,
	total_harga numeric(17,2) DEFAULT 0 NOT NULL,
    vol_1 numeric(17,2) DEFAULT 0 NOT NULL,
    sat_1 character varying(100) DEFAULT ''::character varying NOT NULL,
    vol_2 numeric(17,2) DEFAULT 0 NOT NULL,
    sat_2 character varying(100) DEFAULT ''::character varying NOT NULL,
    vol_3 numeric(17,2) DEFAULT 0 NOT NULL,
    sat_3 character varying(100) DEFAULT ''::character varying NOT NULL,
    vol_4 numeric(17,2) DEFAULT 0 NOT NULL,
    sat_4 character varying(100) DEFAULT ''::character varying NOT NULL,
	pajak_murni integer DEFAULT 0 NOT NULL,
	harga_satuan_murni numeric(17,2) DEFAULT 0 NOT NULL,
    volume_murni numeric(17,2) DEFAULT 0 NOT NULL,
    koefisien_murni text DEFAULT ''::text NOT NULL,
	total_harga_murni numeric(17,2) DEFAULT 0 NOT NULL,
    vol_1_murni numeric(17,2) DEFAULT 0 NOT NULL,
    sat_1_murni character varying(100) DEFAULT ''::character varying NOT NULL,
    vol_2_murni numeric(17,2) DEFAULT 0 NOT NULL,
    sat_2_murni character varying(100) DEFAULT ''::character varying NOT NULL,
    vol_3_murni numeric(17,2) DEFAULT 0 NOT NULL,
    sat_3_murni character varying(100) DEFAULT ''::character varying NOT NULL,
    vol_4_murni numeric(17,2) DEFAULT 0 NOT NULL,
    sat_4_murni character varying(100) DEFAULT ''::character varying NOT NULL,
    id_bl_lama integer DEFAULT 0 NOT NULL,
	id_sub_bl_lama integer DEFAULT 0 NOT NULL,
	id_rinci_sub_bl_lama integer DEFAULT 0 NOT NULL,
	id_subs_sub_bl_lama integer DEFAULT 0 NOT NULL,
    id_ket_sub_bl_lama integer DEFAULT 0 NOT NULL,
	id_dana_sub_bl_lama integer DEFAULT 0 NOT NULL,
    id_penerima_bantuan_lama integer DEFAULT 0 NOT NULL,
    id_profil_penerima_bantuan_lama integer DEFAULT 0 NOT NULL,
    harga_satuan_lama double precision DEFAULT 0 NOT NULL,
    volume_lama double precision DEFAULT 0 NOT NULL,
    total_harga_lama double precision DEFAULT 0 NOT NULL,
    vol_1_lama double precision DEFAULT 0 NOT NULL,
    vol_2_lama double precision DEFAULT 0 NOT NULL,
    vol_3_lama double precision DEFAULT 0 NOT NULL,
    vol_4_lama double precision DEFAULT 0 NOT NULL,
    harga_satuan_murni_lama double precision DEFAULT 0 NOT NULL,
    volume_murni_lama double precision DEFAULT 0 NOT NULL,
    total_harga_murni_lama double precision DEFAULT 0 NOT NULL,
    [REDACTED] double precision DEFAULT 0 NOT NULL,
    [REDACTED] double precision DEFAULT 0 NOT NULL,
    [REDACTED] double precision DEFAULT 0 NOT NULL,
    [REDACTED] double precision DEFAULT 0 NOT NULL,
    created_at timestamp(6) without time zone DEFAULT now() NOT NULL,
    created_by integer DEFAULT 0 NOT NULL,
    updated_at timestamp(6) without time zone DEFAULT '0001-01-01 00:00:00'::timestamp without time zone NOT NULL,
    updated_by integer DEFAULT 0 NOT NULL,
    deleted_at timestamp(6) without time zone DEFAULT '0001-01-01 00:00:00'::timestamp without time zone NOT NULL,
    deleted_by integer DEFAULT 0 NOT NULL
);

ALTER TABLE rancangan_murni.trn_rincian_sub_kegiatan ADD CONSTRAINT trn_rincian_sub_kegiatan_pkey PRIMARY KEY (id_unik_rincian_sub_kegiatan, tahun, id_daerah);
ALTER TABLE rancangan_murni.trn_rincian_sub_kegiatan ADD CONSTRAINT trn_rincian_sub_kegiatan_unique_key UNIQUE (tahun, id_daerah, id_unik_jadwal, id_unik_skpd, id_unik_sub_skpd, id_unik_sub_kegiatan, id_unik_aktivitas_sub_kegiatan, id_unik_keterangan_sub_kegiatan, id_unik_sumber_dana_sub_kegiatan, id_akun, id_unik_standar_harga);

COMMENT ON TABLE rancangan_murni.trn_rincian_sub_kegiatan IS 'Tabel transaksi yang menyimpan rincian belanja dalam suatu sub kegiatan.';
COMMENT ON COLUMN rancangan_murni.trn_rincian_sub_kegiatan.id_unik_rincian_sub_kegiatan IS 'ID unik UUID sebagai ID primary key.';

COMMENT ON COLUMN rancangan_murni.trn_rincian_sub_kegiatan.tahun IS 'Tahun anggaran sub kegiatan.';
COMMENT ON COLUMN rancangan_murni.trn_rincian_sub_kegiatan.id_daerah IS 'Pemerintah daerah pelaksana sub kegiatan.';
COMMENT ON COLUMN rancangan_murni.trn_rincian_sub_kegiatan.id_unik_jadwal IS 'ID jadwal tahapan anggaran.';
COMMENT ON COLUMN rancangan_murni.trn_rincian_sub_kegiatan.id_unik_skpd IS 'ID SKPD induk yang membawahi pelaksana kegiatan.';
COMMENT ON COLUMN rancangan_murni.trn_rincian_sub_kegiatan.id_unik_sub_skpd IS 'ID SKPD pelaksana kegiatan.';
COMMENT ON COLUMN rancangan_murni.trn_rincian_sub_kegiatan.id_unik_sub_kegiatan IS 'ID sub kegiatan yang sudah diinput dalam rencana kerja.';
COMMENT ON COLUMN rancangan_murni.trn_rincian_sub_kegiatan.id_unik_aktivitas_sub_kegiatan IS 'ID aktvitas sub kegiatan yang sudah diinput.';
COMMENT ON COLUMN rancangan_murni.trn_rincian_sub_kegiatan.id_unik_keterangan_sub_kegiatan IS 'ID keterangan sub kegiatan yang sudah diinput.';
COMMENT ON COLUMN rancangan_murni.trn_rincian_sub_kegiatan.id_unik_sumber_dana_sub_kegiatan IS 'ID sumber dana yang sudah dipilih.';
COMMENT ON COLUMN rancangan_murni.trn_rincian_sub_kegiatan.id_akun IS 'ID akun belanja.';
COMMENT ON COLUMN rancangan_murni.trn_rincian_sub_kegiatan.lokus_akun IS 'Lokasi atau akun spesifik untuk belanja.';
COMMENT ON COLUMN rancangan_murni.trn_rincian_sub_kegiatan.id_unik_profil_penerima_bantuan IS 'ID profil penerima bantuan apabila belanja yang diinput adalah belanja bantuan.';
COMMENT ON COLUMN rancangan_murni.trn_rincian_sub_kegiatan.set_form_input IS 'Status penggunaan form input tertentu.';
COMMENT ON COLUMN rancangan_murni.trn_rincian_sub_kegiatan.set_sisa_lelang IS 'Penanda apakah merupakan sisa anggaran.';
COMMENT ON COLUMN rancangan_murni.trn_rincian_sub_kegiatan.id_unik_standar_harga IS 'ID standar harga yang digunakan.';
COMMENT ON COLUMN rancangan_murni.trn_rincian_sub_kegiatan.satuan IS 'Satuan volume belanja.';
COMMENT ON COLUMN rancangan_murni.trn_rincian_sub_kegiatan.pajak IS 'Persentase pajak yang dikenakan.';
COMMENT ON COLUMN rancangan_murni.trn_rincian_sub_kegiatan.harga_satuan IS 'Harga satuan belanja.';
COMMENT ON COLUMN rancangan_murni.trn_rincian_sub_kegiatan.volume IS 'Volume total belanja.';
COMMENT ON COLUMN rancangan_murni.trn_rincian_sub_kegiatan.koefisien IS 'Detail koefisien volume dan satuan.';
COMMENT ON COLUMN rancangan_murni.trn_rincian_sub_kegiatan.total_harga IS 'Total harga belanja.';
COMMENT ON COLUMN rancangan_murni.trn_rincian_sub_kegiatan.vol_1 IS 'Volume 1.';
COMMENT ON COLUMN rancangan_murni.trn_rincian_sub_kegiatan.sat_1 IS 'Satuan volume 1.';
COMMENT ON COLUMN rancangan_murni.trn_rincian_sub_kegiatan.vol_2 IS 'Volume 2.';
COMMENT ON COLUMN rancangan_murni.trn_rincian_sub_kegiatan.sat_2 IS 'Satuan volume 2.';
COMMENT ON COLUMN rancangan_murni.trn_rincian_sub_kegiatan.vol_3 IS 'Volume 3.';
COMMENT ON COLUMN rancangan_murni.trn_rincian_sub_kegiatan.sat_3 IS 'Satuan volume 3.';
COMMENT ON COLUMN rancangan_murni.trn_rincian_sub_kegiatan.vol_4 IS 'Volume 4.';
COMMENT ON COLUMN rancangan_murni.trn_rincian_sub_kegiatan.sat_4 IS 'Satuan volume 4.';
COMMENT ON COLUMN rancangan_murni.trn_rincian_sub_kegiatan.id_bl_lama IS 'Primary key tabel d_bl lama.';
COMMENT ON COLUMN rancangan_murni.trn_rincian_sub_kegiatan.id_sub_bl_lama IS 'Primary key tabel d_sub_bl lama.';
COMMENT ON COLUMN rancangan_murni.trn_rincian_sub_kegiatan.id_rinci_sub_bl_lama IS 'Primary key tabel d_rinci_sub_bl lama.';
COMMENT ON COLUMN rancangan_murni.trn_rincian_sub_kegiatan.id_subs_sub_bl_lama IS 'Primary key tabel d_subs_sub_bl lama.';
COMMENT ON COLUMN rancangan_murni.trn_rincian_sub_kegiatan.id_ket_sub_bl_lama IS 'Primary key tabel d_ket_sub_bl lama.';
COMMENT ON COLUMN rancangan_murni.trn_rincian_sub_kegiatan.id_dana_sub_bl_lama IS 'Primary key tabel d_dana_sub_bl lama.';
COMMENT ON COLUMN rancangan_murni.trn_rincian_sub_kegiatan.id_penerima_bantuan_lama IS 'Primary key tabel d_penerima_bantuan lama.';
COMMENT ON COLUMN rancangan_murni.trn_rincian_sub_kegiatan.id_profil_penerima_bantuan_lama IS 'Primary key tabel r_profil_user lama.';
COMMENT ON COLUMN rancangan_murni.trn_rincian_sub_kegiatan.created_at IS 'Tanggal dan waktu data dibuat.';
COMMENT ON COLUMN rancangan_murni.trn_rincian_sub_kegiatan.created_by IS 'ID pengguna yang membuat data.';
COMMENT ON COLUMN rancangan_murni.trn_rincian_sub_kegiatan.updated_at IS 'Tanggal dan waktu terakhir data diperbarui.';
COMMENT ON COLUMN rancangan_murni.trn_rincian_sub_kegiatan.updated_by IS 'ID pengguna yang memperbarui data.';
COMMENT ON COLUMN rancangan_murni.trn_rincian_sub_kegiatan.deleted_at IS 'Tanggal dan waktu data dihapus (soft delete).';
COMMENT ON COLUMN rancangan_murni.trn_rincian_sub_kegiatan.deleted_by IS 'ID pengguna yang menghapus data.';

CREATE INDEX trn_rincian_sub_kegiatan_id_unik_rincian_sub_kegiatan_idx ON rancangan_murni.trn_rincian_sub_kegiatan USING btree (id_unik_rincian_sub_kegiatan);
CREATE INDEX trn_rincian_sub_kegiatan_tahun_idx ON rancangan_murni.trn_rincian_sub_kegiatan USING btree (tahun);
CREATE INDEX trn_rincian_sub_kegiatan_id_daerah_idx ON rancangan_murni.trn_rincian_sub_kegiatan USING btree (id_daerah);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_jadwal_idx ON rancangan_murni.trn_rincian_sub_kegiatan USING btree (id_unik_jadwal);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_skpd_idx ON rancangan_murni.trn_rincian_sub_kegiatan USING btree (id_unik_skpd);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_sub_skpd_idx ON rancangan_murni.trn_rincian_sub_kegiatan USING btree (id_unik_sub_skpd);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_sub_kegiatan_idx ON rancangan_murni.trn_rincian_sub_kegiatan USING btree (id_unik_sub_kegiatan);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_aktivitas_sub_kegiatan_idx ON rancangan_murni.trn_rincian_sub_kegiatan USING btree (id_unik_aktivitas_sub_kegiatan);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_keterangan_sub_kegiatan_idx ON rancangan_murni.trn_rincian_sub_kegiatan USING btree (id_unik_keterangan_sub_kegiatan);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_sumber_dana_sub_kegiatan_idx ON rancangan_murni.trn_rincian_sub_kegiatan USING btree (id_unik_sumber_dana_sub_kegiatan);
CREATE INDEX trn_rincian_sub_kegiatan_id_akun_idx ON rancangan_murni.trn_rincian_sub_kegiatan USING btree (id_akun);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_profil_penerima_bantuan_idx ON rancangan_murni.trn_rincian_sub_kegiatan USING btree (id_unik_profil_penerima_bantuan);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_standar_harga_idx ON rancangan_murni.trn_rincian_sub_kegiatan USING btree (id_unik_standar_harga);


-- SCHEMA penetapan_murni
CREATE TABLE IF NOT EXISTS penetapan_murni.trn_rincian_sub_kegiatan (
    id_unik_rincian_sub_kegiatan uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
    tahun integer DEFAULT 0 NOT NULL,
	id_daerah integer DEFAULT 0 NOT NULL,
	id_unik_jadwal uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
	id_unik_skpd uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
	id_unik_sub_skpd uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
	id_unik_sub_kegiatan uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
	id_unik_aktivitas_sub_kegiatan uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
    id_unik_keterangan_sub_kegiatan uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
    id_unik_sumber_dana_sub_kegiatan uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
    id_akun integer DEFAULT 0 NOT NULL,
	lokus_akun text DEFAULT ''::text NOT NULL,
    id_unik_profil_penerima_bantuan uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
	set_form_input integer DEFAULT 0 NOT NULL,
    set_sisa_lelang boolean DEFAULT false NOT NULL,
	id_unik_standar_harga uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
	satuan character varying(100) DEFAULT ''::character varying NOT NULL,
	pajak integer DEFAULT 0 NOT NULL,
	harga_satuan numeric(17,2) DEFAULT 0 NOT NULL,
    volume numeric(17,2) DEFAULT 0 NOT NULL,
    koefisien text DEFAULT ''::text NOT NULL,
	total_harga numeric(17,2) DEFAULT 0 NOT NULL,
    vol_1 numeric(17,2) DEFAULT 0 NOT NULL,
    sat_1 character varying(100) DEFAULT ''::character varying NOT NULL,
    vol_2 numeric(17,2) DEFAULT 0 NOT NULL,
    sat_2 character varying(100) DEFAULT ''::character varying NOT NULL,
    vol_3 numeric(17,2) DEFAULT 0 NOT NULL,
    sat_3 character varying(100) DEFAULT ''::character varying NOT NULL,
    vol_4 numeric(17,2) DEFAULT 0 NOT NULL,
    sat_4 character varying(100) DEFAULT ''::character varying NOT NULL,
	pajak_murni integer DEFAULT 0 NOT NULL,
	harga_satuan_murni numeric(17,2) DEFAULT 0 NOT NULL,
    volume_murni numeric(17,2) DEFAULT 0 NOT NULL,
    koefisien_murni text DEFAULT ''::text NOT NULL,
	total_harga_murni numeric(17,2) DEFAULT 0 NOT NULL,
    vol_1_murni numeric(17,2) DEFAULT 0 NOT NULL,
    sat_1_murni character varying(100) DEFAULT ''::character varying NOT NULL,
    vol_2_murni numeric(17,2) DEFAULT 0 NOT NULL,
    sat_2_murni character varying(100) DEFAULT ''::character varying NOT NULL,
    vol_3_murni numeric(17,2) DEFAULT 0 NOT NULL,
    sat_3_murni character varying(100) DEFAULT ''::character varying NOT NULL,
    vol_4_murni numeric(17,2) DEFAULT 0 NOT NULL,
    sat_4_murni character varying(100) DEFAULT ''::character varying NOT NULL,
    id_bl_lama integer DEFAULT 0 NOT NULL,
	id_sub_bl_lama integer DEFAULT 0 NOT NULL,
	id_rinci_sub_bl_lama integer DEFAULT 0 NOT NULL,
	id_subs_sub_bl_lama integer DEFAULT 0 NOT NULL,
    id_ket_sub_bl_lama integer DEFAULT 0 NOT NULL,
	id_dana_sub_bl_lama integer DEFAULT 0 NOT NULL,
    id_penerima_bantuan_lama integer DEFAULT 0 NOT NULL,
    id_profil_penerima_bantuan_lama integer DEFAULT 0 NOT NULL,
    harga_satuan_lama double precision DEFAULT 0 NOT NULL,
    volume_lama double precision DEFAULT 0 NOT NULL,
    total_harga_lama double precision DEFAULT 0 NOT NULL,
    vol_1_lama double precision DEFAULT 0 NOT NULL,
    vol_2_lama double precision DEFAULT 0 NOT NULL,
    vol_3_lama double precision DEFAULT 0 NOT NULL,
    vol_4_lama double precision DEFAULT 0 NOT NULL,
    harga_satuan_murni_lama double precision DEFAULT 0 NOT NULL,
    volume_murni_lama double precision DEFAULT 0 NOT NULL,
    total_harga_murni_lama double precision DEFAULT 0 NOT NULL,
    [REDACTED] double precision DEFAULT 0 NOT NULL,
    [REDACTED] double precision DEFAULT 0 NOT NULL,
    [REDACTED] double precision DEFAULT 0 NOT NULL,
    [REDACTED] double precision DEFAULT 0 NOT NULL,
    created_at timestamp(6) without time zone DEFAULT now() NOT NULL,
    created_by integer DEFAULT 0 NOT NULL,
    updated_at timestamp(6) without time zone DEFAULT '0001-01-01 00:00:00'::timestamp without time zone NOT NULL,
    updated_by integer DEFAULT 0 NOT NULL,
    deleted_at timestamp(6) without time zone DEFAULT '0001-01-01 00:00:00'::timestamp without time zone NOT NULL,
    deleted_by integer DEFAULT 0 NOT NULL
);

ALTER TABLE penetapan_murni.trn_rincian_sub_kegiatan ADD CONSTRAINT trn_rincian_sub_kegiatan_pkey PRIMARY KEY (id_unik_rincian_sub_kegiatan, tahun, id_daerah);
ALTER TABLE penetapan_murni.trn_rincian_sub_kegiatan ADD CONSTRAINT trn_rincian_sub_kegiatan_unique_key UNIQUE (tahun, id_daerah, id_unik_jadwal, id_unik_skpd, id_unik_sub_skpd, id_unik_sub_kegiatan, id_unik_aktivitas_sub_kegiatan, id_unik_keterangan_sub_kegiatan, id_unik_sumber_dana_sub_kegiatan, id_akun, id_unik_standar_harga);

COMMENT ON TABLE penetapan_murni.trn_rincian_sub_kegiatan IS 'Tabel transaksi yang menyimpan rincian belanja dalam suatu sub kegiatan.';
COMMENT ON COLUMN penetapan_murni.trn_rincian_sub_kegiatan.id_unik_rincian_sub_kegiatan IS 'ID unik UUID sebagai ID primary key.';

COMMENT ON COLUMN penetapan_murni.trn_rincian_sub_kegiatan.tahun IS 'Tahun anggaran sub kegiatan.';
COMMENT ON COLUMN penetapan_murni.trn_rincian_sub_kegiatan.id_daerah IS 'Pemerintah daerah pelaksana sub kegiatan.';
COMMENT ON COLUMN penetapan_murni.trn_rincian_sub_kegiatan.id_unik_jadwal IS 'ID jadwal tahapan anggaran.';
COMMENT ON COLUMN penetapan_murni.trn_rincian_sub_kegiatan.id_unik_skpd IS 'ID SKPD induk yang membawahi pelaksana kegiatan.';
COMMENT ON COLUMN penetapan_murni.trn_rincian_sub_kegiatan.id_unik_sub_skpd IS 'ID SKPD pelaksana kegiatan.';
COMMENT ON COLUMN penetapan_murni.trn_rincian_sub_kegiatan.id_unik_sub_kegiatan IS 'ID sub kegiatan yang sudah diinput dalam rencana kerja.';
COMMENT ON COLUMN penetapan_murni.trn_rincian_sub_kegiatan.id_unik_aktivitas_sub_kegiatan IS 'ID aktvitas sub kegiatan yang sudah diinput.';
COMMENT ON COLUMN penetapan_murni.trn_rincian_sub_kegiatan.id_unik_keterangan_sub_kegiatan IS 'ID keterangan sub kegiatan yang sudah diinput.';
COMMENT ON COLUMN penetapan_murni.trn_rincian_sub_kegiatan.id_unik_sumber_dana_sub_kegiatan IS 'ID sumber dana yang sudah dipilih.';
COMMENT ON COLUMN penetapan_murni.trn_rincian_sub_kegiatan.id_akun IS 'ID akun belanja.';
COMMENT ON COLUMN penetapan_murni.trn_rincian_sub_kegiatan.lokus_akun IS 'Lokasi atau akun spesifik untuk belanja.';
COMMENT ON COLUMN penetapan_murni.trn_rincian_sub_kegiatan.id_unik_profil_penerima_bantuan IS 'ID profil penerima bantuan apabila belanja yang diinput adalah belanja bantuan.';
COMMENT ON COLUMN penetapan_murni.trn_rincian_sub_kegiatan.set_form_input IS 'Status penggunaan form input tertentu.';
COMMENT ON COLUMN penetapan_murni.trn_rincian_sub_kegiatan.set_sisa_lelang IS 'Penanda apakah merupakan sisa anggaran.';
COMMENT ON COLUMN penetapan_murni.trn_rincian_sub_kegiatan.id_unik_standar_harga IS 'ID standar harga yang digunakan.';
COMMENT ON COLUMN penetapan_murni.trn_rincian_sub_kegiatan.satuan IS 'Satuan volume belanja.';
COMMENT ON COLUMN penetapan_murni.trn_rincian_sub_kegiatan.pajak IS 'Persentase pajak yang dikenakan.';
COMMENT ON COLUMN penetapan_murni.trn_rincian_sub_kegiatan.harga_satuan IS 'Harga satuan belanja.';
COMMENT ON COLUMN penetapan_murni.trn_rincian_sub_kegiatan.volume IS 'Volume total belanja.';
COMMENT ON COLUMN penetapan_murni.trn_rincian_sub_kegiatan.koefisien IS 'Detail koefisien volume dan satuan.';
COMMENT ON COLUMN penetapan_murni.trn_rincian_sub_kegiatan.total_harga IS 'Total harga belanja.';
COMMENT ON COLUMN penetapan_murni.trn_rincian_sub_kegiatan.vol_1 IS 'Volume 1.';
COMMENT ON COLUMN penetapan_murni.trn_rincian_sub_kegiatan.sat_1 IS 'Satuan volume 1.';
COMMENT ON COLUMN penetapan_murni.trn_rincian_sub_kegiatan.vol_2 IS 'Volume 2.';
COMMENT ON COLUMN penetapan_murni.trn_rincian_sub_kegiatan.sat_2 IS 'Satuan volume 2.';
COMMENT ON COLUMN penetapan_murni.trn_rincian_sub_kegiatan.vol_3 IS 'Volume 3.';
COMMENT ON COLUMN penetapan_murni.trn_rincian_sub_kegiatan.sat_3 IS 'Satuan volume 3.';
COMMENT ON COLUMN penetapan_murni.trn_rincian_sub_kegiatan.vol_4 IS 'Volume 4.';
COMMENT ON COLUMN penetapan_murni.trn_rincian_sub_kegiatan.sat_4 IS 'Satuan volume 4.';
COMMENT ON COLUMN penetapan_murni.trn_rincian_sub_kegiatan.id_bl_lama IS 'Primary key tabel d_bl lama.';
COMMENT ON COLUMN penetapan_murni.trn_rincian_sub_kegiatan.id_sub_bl_lama IS 'Primary key tabel d_sub_bl lama.';
COMMENT ON COLUMN penetapan_murni.trn_rincian_sub_kegiatan.id_rinci_sub_bl_lama IS 'Primary key tabel d_rinci_sub_bl lama.';
COMMENT ON COLUMN penetapan_murni.trn_rincian_sub_kegiatan.id_subs_sub_bl_lama IS 'Primary key tabel d_subs_sub_bl lama.';
COMMENT ON COLUMN penetapan_murni.trn_rincian_sub_kegiatan.id_ket_sub_bl_lama IS 'Primary key tabel d_ket_sub_bl lama.';
COMMENT ON COLUMN penetapan_murni.trn_rincian_sub_kegiatan.id_dana_sub_bl_lama IS 'Primary key tabel d_dana_sub_bl lama.';
COMMENT ON COLUMN penetapan_murni.trn_rincian_sub_kegiatan.id_penerima_bantuan_lama IS 'Primary key tabel d_penerima_bantuan lama.';
COMMENT ON COLUMN penetapan_murni.trn_rincian_sub_kegiatan.id_profil_penerima_bantuan_lama IS 'Primary key tabel r_profil_user lama.';
COMMENT ON COLUMN penetapan_murni.trn_rincian_sub_kegiatan.created_at IS 'Tanggal dan waktu data dibuat.';
COMMENT ON COLUMN penetapan_murni.trn_rincian_sub_kegiatan.created_by IS 'ID pengguna yang membuat data.';
COMMENT ON COLUMN penetapan_murni.trn_rincian_sub_kegiatan.updated_at IS 'Tanggal dan waktu terakhir data diperbarui.';
COMMENT ON COLUMN penetapan_murni.trn_rincian_sub_kegiatan.updated_by IS 'ID pengguna yang memperbarui data.';
COMMENT ON COLUMN penetapan_murni.trn_rincian_sub_kegiatan.deleted_at IS 'Tanggal dan waktu data dihapus (soft delete).';
COMMENT ON COLUMN penetapan_murni.trn_rincian_sub_kegiatan.deleted_by IS 'ID pengguna yang menghapus data.';

CREATE INDEX trn_rincian_sub_kegiatan_id_unik_rincian_sub_kegiatan_idx ON penetapan_murni.trn_rincian_sub_kegiatan USING btree (id_unik_rincian_sub_kegiatan);
CREATE INDEX trn_rincian_sub_kegiatan_tahun_idx ON penetapan_murni.trn_rincian_sub_kegiatan USING btree (tahun);
CREATE INDEX trn_rincian_sub_kegiatan_id_daerah_idx ON penetapan_murni.trn_rincian_sub_kegiatan USING btree (id_daerah);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_jadwal_idx ON penetapan_murni.trn_rincian_sub_kegiatan USING btree (id_unik_jadwal);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_skpd_idx ON penetapan_murni.trn_rincian_sub_kegiatan USING btree (id_unik_skpd);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_sub_skpd_idx ON penetapan_murni.trn_rincian_sub_kegiatan USING btree (id_unik_sub_skpd);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_sub_kegiatan_idx ON penetapan_murni.trn_rincian_sub_kegiatan USING btree (id_unik_sub_kegiatan);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_aktivitas_sub_kegiatan_idx ON penetapan_murni.trn_rincian_sub_kegiatan USING btree (id_unik_aktivitas_sub_kegiatan);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_keterangan_sub_kegiatan_idx ON penetapan_murni.trn_rincian_sub_kegiatan USING btree (id_unik_keterangan_sub_kegiatan);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_sumber_dana_sub_kegiatan_idx ON penetapan_murni.trn_rincian_sub_kegiatan USING btree (id_unik_sumber_dana_sub_kegiatan);
CREATE INDEX trn_rincian_sub_kegiatan_id_akun_idx ON penetapan_murni.trn_rincian_sub_kegiatan USING btree (id_akun);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_profil_penerima_bantuan_idx ON penetapan_murni.trn_rincian_sub_kegiatan USING btree (id_unik_profil_penerima_bantuan);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_standar_harga_idx ON penetapan_murni.trn_rincian_sub_kegiatan USING btree (id_unik_standar_harga);


-- SCHEMA rancangan_pergeseran;
CREATE TABLE IF NOT EXISTS rancangan_pergeseran.trn_rincian_sub_kegiatan (
    id_unik_rincian_sub_kegiatan uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
    tahun integer DEFAULT 0 NOT NULL,
	id_daerah integer DEFAULT 0 NOT NULL,
	id_unik_jadwal uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
	id_unik_skpd uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
	id_unik_sub_skpd uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
	id_unik_sub_kegiatan uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
	id_unik_aktivitas_sub_kegiatan uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
    id_unik_keterangan_sub_kegiatan uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
    id_unik_sumber_dana_sub_kegiatan uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
    id_akun integer DEFAULT 0 NOT NULL,
	lokus_akun text DEFAULT ''::text NOT NULL,
    id_unik_profil_penerima_bantuan uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
	set_form_input integer DEFAULT 0 NOT NULL,
    set_sisa_lelang boolean DEFAULT false NOT NULL,
	id_unik_standar_harga uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
	satuan character varying(100) DEFAULT ''::character varying NOT NULL,
	pajak integer DEFAULT 0 NOT NULL,
	harga_satuan numeric(17,2) DEFAULT 0 NOT NULL,
    volume numeric(17,2) DEFAULT 0 NOT NULL,
    koefisien text DEFAULT ''::text NOT NULL,
	total_harga numeric(17,2) DEFAULT 0 NOT NULL,
    vol_1 numeric(17,2) DEFAULT 0 NOT NULL,
    sat_1 character varying(100) DEFAULT ''::character varying NOT NULL,
    vol_2 numeric(17,2) DEFAULT 0 NOT NULL,
    sat_2 character varying(100) DEFAULT ''::character varying NOT NULL,
    vol_3 numeric(17,2) DEFAULT 0 NOT NULL,
    sat_3 character varying(100) DEFAULT ''::character varying NOT NULL,
    vol_4 numeric(17,2) DEFAULT 0 NOT NULL,
    sat_4 character varying(100) DEFAULT ''::character varying NOT NULL,
	pajak_murni integer DEFAULT 0 NOT NULL,
	harga_satuan_murni numeric(17,2) DEFAULT 0 NOT NULL,
    volume_murni numeric(17,2) DEFAULT 0 NOT NULL,
    koefisien_murni text DEFAULT ''::text NOT NULL,
	total_harga_murni numeric(17,2) DEFAULT 0 NOT NULL,
    vol_1_murni numeric(17,2) DEFAULT 0 NOT NULL,
    sat_1_murni character varying(100) DEFAULT ''::character varying NOT NULL,
    vol_2_murni numeric(17,2) DEFAULT 0 NOT NULL,
    sat_2_murni character varying(100) DEFAULT ''::character varying NOT NULL,
    vol_3_murni numeric(17,2) DEFAULT 0 NOT NULL,
    sat_3_murni character varying(100) DEFAULT ''::character varying NOT NULL,
    vol_4_murni numeric(17,2) DEFAULT 0 NOT NULL,
    sat_4_murni character varying(100) DEFAULT ''::character varying NOT NULL,
    id_bl_lama integer DEFAULT 0 NOT NULL,
	id_sub_bl_lama integer DEFAULT 0 NOT NULL,
	id_rinci_sub_bl_lama integer DEFAULT 0 NOT NULL,
	id_subs_sub_bl_lama integer DEFAULT 0 NOT NULL,
    id_ket_sub_bl_lama integer DEFAULT 0 NOT NULL,
	id_dana_sub_bl_lama integer DEFAULT 0 NOT NULL,
    id_penerima_bantuan_lama integer DEFAULT 0 NOT NULL,
    id_profil_penerima_bantuan_lama integer DEFAULT 0 NOT NULL,
    harga_satuan_lama double precision DEFAULT 0 NOT NULL,
    volume_lama double precision DEFAULT 0 NOT NULL,
    total_harga_lama double precision DEFAULT 0 NOT NULL,
    vol_1_lama double precision DEFAULT 0 NOT NULL,
    vol_2_lama double precision DEFAULT 0 NOT NULL,
    vol_3_lama double precision DEFAULT 0 NOT NULL,
    vol_4_lama double precision DEFAULT 0 NOT NULL,
    harga_satuan_murni_lama double precision DEFAULT 0 NOT NULL,
    volume_murni_lama double precision DEFAULT 0 NOT NULL,
    total_harga_murni_lama double precision DEFAULT 0 NOT NULL,
    [REDACTED] double precision DEFAULT 0 NOT NULL,
    [REDACTED] double precision DEFAULT 0 NOT NULL,
    [REDACTED] double precision DEFAULT 0 NOT NULL,
    [REDACTED] double precision DEFAULT 0 NOT NULL,
    created_at timestamp(6) without time zone DEFAULT now() NOT NULL,
    created_by integer DEFAULT 0 NOT NULL,
    updated_at timestamp(6) without time zone DEFAULT '0001-01-01 00:00:00'::timestamp without time zone NOT NULL,
    updated_by integer DEFAULT 0 NOT NULL,
    deleted_at timestamp(6) without time zone DEFAULT '0001-01-01 00:00:00'::timestamp without time zone NOT NULL,
    deleted_by integer DEFAULT 0 NOT NULL
);

ALTER TABLE rancangan_pergeseran.trn_rincian_sub_kegiatan ADD CONSTRAINT trn_rincian_sub_kegiatan_pkey PRIMARY KEY (id_unik_rincian_sub_kegiatan, tahun, id_daerah);
ALTER TABLE rancangan_pergeseran.trn_rincian_sub_kegiatan ADD CONSTRAINT trn_rincian_sub_kegiatan_unique_key UNIQUE (tahun, id_daerah, id_unik_jadwal, id_unik_skpd, id_unik_sub_skpd, id_unik_sub_kegiatan, id_unik_aktivitas_sub_kegiatan, id_unik_keterangan_sub_kegiatan, id_unik_sumber_dana_sub_kegiatan, id_akun, id_unik_standar_harga);

COMMENT ON TABLE rancangan_pergeseran.trn_rincian_sub_kegiatan IS 'Tabel transaksi yang menyimpan rincian belanja dalam suatu sub kegiatan.';
COMMENT ON COLUMN rancangan_pergeseran.trn_rincian_sub_kegiatan.id_unik_rincian_sub_kegiatan IS 'ID unik UUID sebagai ID primary key.';

COMMENT ON COLUMN rancangan_pergeseran.trn_rincian_sub_kegiatan.tahun IS 'Tahun anggaran sub kegiatan.';
COMMENT ON COLUMN rancangan_pergeseran.trn_rincian_sub_kegiatan.id_daerah IS 'Pemerintah daerah pelaksana sub kegiatan.';
COMMENT ON COLUMN rancangan_pergeseran.trn_rincian_sub_kegiatan.id_unik_jadwal IS 'ID jadwal tahapan anggaran.';
COMMENT ON COLUMN rancangan_pergeseran.trn_rincian_sub_kegiatan.id_unik_skpd IS 'ID SKPD induk yang membawahi pelaksana kegiatan.';
COMMENT ON COLUMN rancangan_pergeseran.trn_rincian_sub_kegiatan.id_unik_sub_skpd IS 'ID SKPD pelaksana kegiatan.';
COMMENT ON COLUMN rancangan_pergeseran.trn_rincian_sub_kegiatan.id_unik_sub_kegiatan IS 'ID sub kegiatan yang sudah diinput dalam rencana kerja.';
COMMENT ON COLUMN rancangan_pergeseran.trn_rincian_sub_kegiatan.id_unik_aktivitas_sub_kegiatan IS 'ID aktvitas sub kegiatan yang sudah diinput.';
COMMENT ON COLUMN rancangan_pergeseran.trn_rincian_sub_kegiatan.id_unik_keterangan_sub_kegiatan IS 'ID keterangan sub kegiatan yang sudah diinput.';
COMMENT ON COLUMN rancangan_pergeseran.trn_rincian_sub_kegiatan.id_unik_sumber_dana_sub_kegiatan IS 'ID sumber dana yang sudah dipilih.';
COMMENT ON COLUMN rancangan_pergeseran.trn_rincian_sub_kegiatan.id_akun IS 'ID akun belanja.';
COMMENT ON COLUMN rancangan_pergeseran.trn_rincian_sub_kegiatan.lokus_akun IS 'Lokasi atau akun spesifik untuk belanja.';
COMMENT ON COLUMN rancangan_pergeseran.trn_rincian_sub_kegiatan.id_unik_profil_penerima_bantuan IS 'ID profil penerima bantuan apabila belanja yang diinput adalah belanja bantuan.';
COMMENT ON COLUMN rancangan_pergeseran.trn_rincian_sub_kegiatan.set_form_input IS 'Status penggunaan form input tertentu.';
COMMENT ON COLUMN rancangan_pergeseran.trn_rincian_sub_kegiatan.set_sisa_lelang IS 'Penanda apakah merupakan sisa anggaran.';
COMMENT ON COLUMN rancangan_pergeseran.trn_rincian_sub_kegiatan.id_unik_standar_harga IS 'ID standar harga yang digunakan.';
COMMENT ON COLUMN rancangan_pergeseran.trn_rincian_sub_kegiatan.satuan IS 'Satuan volume belanja.';
COMMENT ON COLUMN rancangan_pergeseran.trn_rincian_sub_kegiatan.pajak IS 'Persentase pajak yang dikenakan.';
COMMENT ON COLUMN rancangan_pergeseran.trn_rincian_sub_kegiatan.harga_satuan IS 'Harga satuan belanja.';
COMMENT ON COLUMN rancangan_pergeseran.trn_rincian_sub_kegiatan.volume IS 'Volume total belanja.';
COMMENT ON COLUMN rancangan_pergeseran.trn_rincian_sub_kegiatan.koefisien IS 'Detail koefisien volume dan satuan.';
COMMENT ON COLUMN rancangan_pergeseran.trn_rincian_sub_kegiatan.total_harga IS 'Total harga belanja.';
COMMENT ON COLUMN rancangan_pergeseran.trn_rincian_sub_kegiatan.vol_1 IS 'Volume 1.';
COMMENT ON COLUMN rancangan_pergeseran.trn_rincian_sub_kegiatan.sat_1 IS 'Satuan volume 1.';
COMMENT ON COLUMN rancangan_pergeseran.trn_rincian_sub_kegiatan.vol_2 IS 'Volume 2.';
COMMENT ON COLUMN rancangan_pergeseran.trn_rincian_sub_kegiatan.sat_2 IS 'Satuan volume 2.';
COMMENT ON COLUMN rancangan_pergeseran.trn_rincian_sub_kegiatan.vol_3 IS 'Volume 3.';
COMMENT ON COLUMN rancangan_pergeseran.trn_rincian_sub_kegiatan.sat_3 IS 'Satuan volume 3.';
COMMENT ON COLUMN rancangan_pergeseran.trn_rincian_sub_kegiatan.vol_4 IS 'Volume 4.';
COMMENT ON COLUMN rancangan_pergeseran.trn_rincian_sub_kegiatan.sat_4 IS 'Satuan volume 4.';
COMMENT ON COLUMN rancangan_pergeseran.trn_rincian_sub_kegiatan.id_bl_lama IS 'Primary key tabel d_bl lama.';
COMMENT ON COLUMN rancangan_pergeseran.trn_rincian_sub_kegiatan.id_sub_bl_lama IS 'Primary key tabel d_sub_bl lama.';
COMMENT ON COLUMN rancangan_pergeseran.trn_rincian_sub_kegiatan.id_rinci_sub_bl_lama IS 'Primary key tabel d_rinci_sub_bl lama.';
COMMENT ON COLUMN rancangan_pergeseran.trn_rincian_sub_kegiatan.id_subs_sub_bl_lama IS 'Primary key tabel d_subs_sub_bl lama.';
COMMENT ON COLUMN rancangan_pergeseran.trn_rincian_sub_kegiatan.id_ket_sub_bl_lama IS 'Primary key tabel d_ket_sub_bl lama.';
COMMENT ON COLUMN rancangan_pergeseran.trn_rincian_sub_kegiatan.id_dana_sub_bl_lama IS 'Primary key tabel d_dana_sub_bl lama.';
COMMENT ON COLUMN rancangan_pergeseran.trn_rincian_sub_kegiatan.id_penerima_bantuan_lama IS 'Primary key tabel d_penerima_bantuan lama.';
COMMENT ON COLUMN rancangan_pergeseran.trn_rincian_sub_kegiatan.id_profil_penerima_bantuan_lama IS 'Primary key tabel r_profil_user lama.';
COMMENT ON COLUMN rancangan_pergeseran.trn_rincian_sub_kegiatan.created_at IS 'Tanggal dan waktu data dibuat.';
COMMENT ON COLUMN rancangan_pergeseran.trn_rincian_sub_kegiatan.created_by IS 'ID pengguna yang membuat data.';
COMMENT ON COLUMN rancangan_pergeseran.trn_rincian_sub_kegiatan.updated_at IS 'Tanggal dan waktu terakhir data diperbarui.';
COMMENT ON COLUMN rancangan_pergeseran.trn_rincian_sub_kegiatan.updated_by IS 'ID pengguna yang memperbarui data.';
COMMENT ON COLUMN rancangan_pergeseran.trn_rincian_sub_kegiatan.deleted_at IS 'Tanggal dan waktu data dihapus (soft delete).';
COMMENT ON COLUMN rancangan_pergeseran.trn_rincian_sub_kegiatan.deleted_by IS 'ID pengguna yang menghapus data.';

CREATE INDEX trn_rincian_sub_kegiatan_id_unik_rincian_sub_kegiatan_idx ON rancangan_pergeseran.trn_rincian_sub_kegiatan USING btree (id_unik_rincian_sub_kegiatan);
CREATE INDEX trn_rincian_sub_kegiatan_tahun_idx ON rancangan_pergeseran.trn_rincian_sub_kegiatan USING btree (tahun);
CREATE INDEX trn_rincian_sub_kegiatan_id_daerah_idx ON rancangan_pergeseran.trn_rincian_sub_kegiatan USING btree (id_daerah);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_jadwal_idx ON rancangan_pergeseran.trn_rincian_sub_kegiatan USING btree (id_unik_jadwal);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_skpd_idx ON rancangan_pergeseran.trn_rincian_sub_kegiatan USING btree (id_unik_skpd);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_sub_skpd_idx ON rancangan_pergeseran.trn_rincian_sub_kegiatan USING btree (id_unik_sub_skpd);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_sub_kegiatan_idx ON rancangan_pergeseran.trn_rincian_sub_kegiatan USING btree (id_unik_sub_kegiatan);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_aktivitas_sub_kegiatan_idx ON rancangan_pergeseran.trn_rincian_sub_kegiatan USING btree (id_unik_aktivitas_sub_kegiatan);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_keterangan_sub_kegiatan_idx ON rancangan_pergeseran.trn_rincian_sub_kegiatan USING btree (id_unik_keterangan_sub_kegiatan);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_sumber_dana_sub_kegiatan_idx ON rancangan_pergeseran.trn_rincian_sub_kegiatan USING btree (id_unik_sumber_dana_sub_kegiatan);
CREATE INDEX trn_rincian_sub_kegiatan_id_akun_idx ON rancangan_pergeseran.trn_rincian_sub_kegiatan USING btree (id_akun);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_profil_penerima_bantuan_idx ON rancangan_pergeseran.trn_rincian_sub_kegiatan USING btree (id_unik_profil_penerima_bantuan);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_standar_harga_idx ON rancangan_pergeseran.trn_rincian_sub_kegiatan USING btree (id_unik_standar_harga);


-- SCHEMA penetapan_peregseran
CREATE TABLE IF NOT EXISTS penetapan_pergeseran.trn_rincian_sub_kegiatan (
    id_unik_rincian_sub_kegiatan uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
    tahun integer DEFAULT 0 NOT NULL,
	id_daerah integer DEFAULT 0 NOT NULL,
	id_unik_jadwal uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
	id_unik_skpd uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
	id_unik_sub_skpd uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
	id_unik_sub_kegiatan uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
	id_unik_aktivitas_sub_kegiatan uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
    id_unik_keterangan_sub_kegiatan uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
    id_unik_sumber_dana_sub_kegiatan uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
    id_akun integer DEFAULT 0 NOT NULL,
	lokus_akun text DEFAULT ''::text NOT NULL,
    id_unik_profil_penerima_bantuan uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
	set_form_input integer DEFAULT 0 NOT NULL,
    set_sisa_lelang boolean DEFAULT false NOT NULL,
	id_unik_standar_harga uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
	satuan character varying(100) DEFAULT ''::character varying NOT NULL,
	pajak integer DEFAULT 0 NOT NULL,
	harga_satuan numeric(17,2) DEFAULT 0 NOT NULL,
    volume numeric(17,2) DEFAULT 0 NOT NULL,
    koefisien text DEFAULT ''::text NOT NULL,
	total_harga numeric(17,2) DEFAULT 0 NOT NULL,
    vol_1 numeric(17,2) DEFAULT 0 NOT NULL,
    sat_1 character varying(100) DEFAULT ''::character varying NOT NULL,
    vol_2 numeric(17,2) DEFAULT 0 NOT NULL,
    sat_2 character varying(100) DEFAULT ''::character varying NOT NULL,
    vol_3 numeric(17,2) DEFAULT 0 NOT NULL,
    sat_3 character varying(100) DEFAULT ''::character varying NOT NULL,
    vol_4 numeric(17,2) DEFAULT 0 NOT NULL,
    sat_4 character varying(100) DEFAULT ''::character varying NOT NULL,
	pajak_murni integer DEFAULT 0 NOT NULL,
	harga_satuan_murni numeric(17,2) DEFAULT 0 NOT NULL,
    volume_murni numeric(17,2) DEFAULT 0 NOT NULL,
    koefisien_murni text DEFAULT ''::text NOT NULL,
	total_harga_murni numeric(17,2) DEFAULT 0 NOT NULL,
    vol_1_murni numeric(17,2) DEFAULT 0 NOT NULL,
    sat_1_murni character varying(100) DEFAULT ''::character varying NOT NULL,
    vol_2_murni numeric(17,2) DEFAULT 0 NOT NULL,
    sat_2_murni character varying(100) DEFAULT ''::character varying NOT NULL,
    vol_3_murni numeric(17,2) DEFAULT 0 NOT NULL,
    sat_3_murni character varying(100) DEFAULT ''::character varying NOT NULL,
    vol_4_murni numeric(17,2) DEFAULT 0 NOT NULL,
    sat_4_murni character varying(100) DEFAULT ''::character varying NOT NULL,
    id_bl_lama integer DEFAULT 0 NOT NULL,
	id_sub_bl_lama integer DEFAULT 0 NOT NULL,
	id_rinci_sub_bl_lama integer DEFAULT 0 NOT NULL,
	id_subs_sub_bl_lama integer DEFAULT 0 NOT NULL,
    id_ket_sub_bl_lama integer DEFAULT 0 NOT NULL,
	id_dana_sub_bl_lama integer DEFAULT 0 NOT NULL,
    id_penerima_bantuan_lama integer DEFAULT 0 NOT NULL,
    id_profil_penerima_bantuan_lama integer DEFAULT 0 NOT NULL,
    harga_satuan_lama double precision DEFAULT 0 NOT NULL,
    volume_lama double precision DEFAULT 0 NOT NULL,
    total_harga_lama double precision DEFAULT 0 NOT NULL,
    vol_1_lama double precision DEFAULT 0 NOT NULL,
    vol_2_lama double precision DEFAULT 0 NOT NULL,
    vol_3_lama double precision DEFAULT 0 NOT NULL,
    vol_4_lama double precision DEFAULT 0 NOT NULL,
    harga_satuan_murni_lama double precision DEFAULT 0 NOT NULL,
    volume_murni_lama double precision DEFAULT 0 NOT NULL,
    total_harga_murni_lama double precision DEFAULT 0 NOT NULL,
    [REDACTED] double precision DEFAULT 0 NOT NULL,
    [REDACTED] double precision DEFAULT 0 NOT NULL,
    [REDACTED] double precision DEFAULT 0 NOT NULL,
    [REDACTED] double precision DEFAULT 0 NOT NULL,
    created_at timestamp(6) without time zone DEFAULT now() NOT NULL,
    created_by integer DEFAULT 0 NOT NULL,
    updated_at timestamp(6) without time zone DEFAULT '0001-01-01 00:00:00'::timestamp without time zone NOT NULL,
    updated_by integer DEFAULT 0 NOT NULL,
    deleted_at timestamp(6) without time zone DEFAULT '0001-01-01 00:00:00'::timestamp without time zone NOT NULL,
    deleted_by integer DEFAULT 0 NOT NULL
);

ALTER TABLE penetapan_pergeseran.trn_rincian_sub_kegiatan ADD CONSTRAINT trn_rincian_sub_kegiatan_pkey PRIMARY KEY (id_unik_rincian_sub_kegiatan, tahun, id_daerah);
ALTER TABLE penetapan_pergeseran.trn_rincian_sub_kegiatan ADD CONSTRAINT trn_rincian_sub_kegiatan_unique_key UNIQUE (tahun, id_daerah, id_unik_jadwal, id_unik_skpd, id_unik_sub_skpd, id_unik_sub_kegiatan, id_unik_aktivitas_sub_kegiatan, id_unik_keterangan_sub_kegiatan, id_unik_sumber_dana_sub_kegiatan, id_akun, id_unik_standar_harga);

COMMENT ON TABLE penetapan_pergeseran.trn_rincian_sub_kegiatan IS 'Tabel transaksi yang menyimpan rincian belanja dalam suatu sub kegiatan.';
COMMENT ON COLUMN penetapan_pergeseran.trn_rincian_sub_kegiatan.id_unik_rincian_sub_kegiatan IS 'ID unik UUID sebagai ID primary key.';

COMMENT ON COLUMN penetapan_pergeseran.trn_rincian_sub_kegiatan.tahun IS 'Tahun anggaran sub kegiatan.';
COMMENT ON COLUMN penetapan_pergeseran.trn_rincian_sub_kegiatan.id_daerah IS 'Pemerintah daerah pelaksana sub kegiatan.';
COMMENT ON COLUMN penetapan_pergeseran.trn_rincian_sub_kegiatan.id_unik_jadwal IS 'ID jadwal tahapan anggaran.';
COMMENT ON COLUMN penetapan_pergeseran.trn_rincian_sub_kegiatan.id_unik_skpd IS 'ID SKPD induk yang membawahi pelaksana kegiatan.';
COMMENT ON COLUMN penetapan_pergeseran.trn_rincian_sub_kegiatan.id_unik_sub_skpd IS 'ID SKPD pelaksana kegiatan.';
COMMENT ON COLUMN penetapan_pergeseran.trn_rincian_sub_kegiatan.id_unik_sub_kegiatan IS 'ID sub kegiatan yang sudah diinput dalam rencana kerja.';
COMMENT ON COLUMN penetapan_pergeseran.trn_rincian_sub_kegiatan.id_unik_aktivitas_sub_kegiatan IS 'ID aktvitas sub kegiatan yang sudah diinput.';
COMMENT ON COLUMN penetapan_pergeseran.trn_rincian_sub_kegiatan.id_unik_keterangan_sub_kegiatan IS 'ID keterangan sub kegiatan yang sudah diinput.';
COMMENT ON COLUMN penetapan_pergeseran.trn_rincian_sub_kegiatan.id_unik_sumber_dana_sub_kegiatan IS 'ID sumber dana yang sudah dipilih.';
COMMENT ON COLUMN penetapan_pergeseran.trn_rincian_sub_kegiatan.id_akun IS 'ID akun belanja.';
COMMENT ON COLUMN penetapan_pergeseran.trn_rincian_sub_kegiatan.lokus_akun IS 'Lokasi atau akun spesifik untuk belanja.';
COMMENT ON COLUMN penetapan_pergeseran.trn_rincian_sub_kegiatan.id_unik_profil_penerima_bantuan IS 'ID profil penerima bantuan apabila belanja yang diinput adalah belanja bantuan.';
COMMENT ON COLUMN penetapan_pergeseran.trn_rincian_sub_kegiatan.set_form_input IS 'Status penggunaan form input tertentu.';
COMMENT ON COLUMN penetapan_pergeseran.trn_rincian_sub_kegiatan.set_sisa_lelang IS 'Penanda apakah merupakan sisa anggaran.';
COMMENT ON COLUMN penetapan_pergeseran.trn_rincian_sub_kegiatan.id_unik_standar_harga IS 'ID standar harga yang digunakan.';
COMMENT ON COLUMN penetapan_pergeseran.trn_rincian_sub_kegiatan.satuan IS 'Satuan volume belanja.';
COMMENT ON COLUMN penetapan_pergeseran.trn_rincian_sub_kegiatan.pajak IS 'Persentase pajak yang dikenakan.';
COMMENT ON COLUMN penetapan_pergeseran.trn_rincian_sub_kegiatan.harga_satuan IS 'Harga satuan belanja.';
COMMENT ON COLUMN penetapan_pergeseran.trn_rincian_sub_kegiatan.volume IS 'Volume total belanja.';
COMMENT ON COLUMN penetapan_pergeseran.trn_rincian_sub_kegiatan.koefisien IS 'Detail koefisien volume dan satuan.';
COMMENT ON COLUMN penetapan_pergeseran.trn_rincian_sub_kegiatan.total_harga IS 'Total harga belanja.';
COMMENT ON COLUMN penetapan_pergeseran.trn_rincian_sub_kegiatan.vol_1 IS 'Volume 1.';
COMMENT ON COLUMN penetapan_pergeseran.trn_rincian_sub_kegiatan.sat_1 IS 'Satuan volume 1.';
COMMENT ON COLUMN penetapan_pergeseran.trn_rincian_sub_kegiatan.vol_2 IS 'Volume 2.';
COMMENT ON COLUMN penetapan_pergeseran.trn_rincian_sub_kegiatan.sat_2 IS 'Satuan volume 2.';
COMMENT ON COLUMN penetapan_pergeseran.trn_rincian_sub_kegiatan.vol_3 IS 'Volume 3.';
COMMENT ON COLUMN penetapan_pergeseran.trn_rincian_sub_kegiatan.sat_3 IS 'Satuan volume 3.';
COMMENT ON COLUMN penetapan_pergeseran.trn_rincian_sub_kegiatan.vol_4 IS 'Volume 4.';
COMMENT ON COLUMN penetapan_pergeseran.trn_rincian_sub_kegiatan.sat_4 IS 'Satuan volume 4.';
COMMENT ON COLUMN penetapan_pergeseran.trn_rincian_sub_kegiatan.id_bl_lama IS 'Primary key tabel d_bl lama.';
COMMENT ON COLUMN penetapan_pergeseran.trn_rincian_sub_kegiatan.id_sub_bl_lama IS 'Primary key tabel d_sub_bl lama.';
COMMENT ON COLUMN penetapan_pergeseran.trn_rincian_sub_kegiatan.id_rinci_sub_bl_lama IS 'Primary key tabel d_rinci_sub_bl lama.';
COMMENT ON COLUMN penetapan_pergeseran.trn_rincian_sub_kegiatan.id_subs_sub_bl_lama IS 'Primary key tabel d_subs_sub_bl lama.';
COMMENT ON COLUMN penetapan_pergeseran.trn_rincian_sub_kegiatan.id_ket_sub_bl_lama IS 'Primary key tabel d_ket_sub_bl lama.';
COMMENT ON COLUMN penetapan_pergeseran.trn_rincian_sub_kegiatan.id_dana_sub_bl_lama IS 'Primary key tabel d_dana_sub_bl lama.';
COMMENT ON COLUMN penetapan_pergeseran.trn_rincian_sub_kegiatan.id_penerima_bantuan_lama IS 'Primary key tabel d_penerima_bantuan lama.';
COMMENT ON COLUMN penetapan_pergeseran.trn_rincian_sub_kegiatan.id_profil_penerima_bantuan_lama IS 'Primary key tabel r_profil_user lama.';
COMMENT ON COLUMN penetapan_pergeseran.trn_rincian_sub_kegiatan.created_at IS 'Tanggal dan waktu data dibuat.';
COMMENT ON COLUMN penetapan_pergeseran.trn_rincian_sub_kegiatan.created_by IS 'ID pengguna yang membuat data.';
COMMENT ON COLUMN penetapan_pergeseran.trn_rincian_sub_kegiatan.updated_at IS 'Tanggal dan waktu terakhir data diperbarui.';
COMMENT ON COLUMN penetapan_pergeseran.trn_rincian_sub_kegiatan.updated_by IS 'ID pengguna yang memperbarui data.';
COMMENT ON COLUMN penetapan_pergeseran.trn_rincian_sub_kegiatan.deleted_at IS 'Tanggal dan waktu data dihapus (soft delete).';
COMMENT ON COLUMN penetapan_pergeseran.trn_rincian_sub_kegiatan.deleted_by IS 'ID pengguna yang menghapus data.';

CREATE INDEX trn_rincian_sub_kegiatan_id_unik_rincian_sub_kegiatan_idx ON penetapan_pergeseran.trn_rincian_sub_kegiatan USING btree (id_unik_rincian_sub_kegiatan);
CREATE INDEX trn_rincian_sub_kegiatan_tahun_idx ON penetapan_pergeseran.trn_rincian_sub_kegiatan USING btree (tahun);
CREATE INDEX trn_rincian_sub_kegiatan_id_daerah_idx ON penetapan_pergeseran.trn_rincian_sub_kegiatan USING btree (id_daerah);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_jadwal_idx ON penetapan_pergeseran.trn_rincian_sub_kegiatan USING btree (id_unik_jadwal);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_skpd_idx ON penetapan_pergeseran.trn_rincian_sub_kegiatan USING btree (id_unik_skpd);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_sub_skpd_idx ON penetapan_pergeseran.trn_rincian_sub_kegiatan USING btree (id_unik_sub_skpd);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_sub_kegiatan_idx ON penetapan_pergeseran.trn_rincian_sub_kegiatan USING btree (id_unik_sub_kegiatan);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_aktivitas_sub_kegiatan_idx ON penetapan_pergeseran.trn_rincian_sub_kegiatan USING btree (id_unik_aktivitas_sub_kegiatan);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_keterangan_sub_kegiatan_idx ON penetapan_pergeseran.trn_rincian_sub_kegiatan USING btree (id_unik_keterangan_sub_kegiatan);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_sumber_dana_sub_kegiatan_idx ON penetapan_pergeseran.trn_rincian_sub_kegiatan USING btree (id_unik_sumber_dana_sub_kegiatan);
CREATE INDEX trn_rincian_sub_kegiatan_id_akun_idx ON penetapan_pergeseran.trn_rincian_sub_kegiatan USING btree (id_akun);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_profil_penerima_bantuan_idx ON penetapan_pergeseran.trn_rincian_sub_kegiatan USING btree (id_unik_profil_penerima_bantuan);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_standar_harga_idx ON penetapan_pergeseran.trn_rincian_sub_kegiatan USING btree (id_unik_standar_harga);


-- SCHEMA rancangan_perubahan;
CREATE TABLE IF NOT EXISTS rancangan_perubahan.trn_rincian_sub_kegiatan (
    id_unik_rincian_sub_kegiatan uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
    tahun integer DEFAULT 0 NOT NULL,
	id_daerah integer DEFAULT 0 NOT NULL,
	id_unik_jadwal uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
	id_unik_skpd uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
	id_unik_sub_skpd uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
	id_unik_sub_kegiatan uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
	id_unik_aktivitas_sub_kegiatan uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
    id_unik_keterangan_sub_kegiatan uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
    id_unik_sumber_dana_sub_kegiatan uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
    id_akun integer DEFAULT 0 NOT NULL,
	lokus_akun text DEFAULT ''::text NOT NULL,
    id_unik_profil_penerima_bantuan uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
	set_form_input integer DEFAULT 0 NOT NULL,
    set_sisa_lelang boolean DEFAULT false NOT NULL,
	id_unik_standar_harga uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
	satuan character varying(100) DEFAULT ''::character varying NOT NULL,
	pajak integer DEFAULT 0 NOT NULL,
	harga_satuan numeric(17,2) DEFAULT 0 NOT NULL,
    volume numeric(17,2) DEFAULT 0 NOT NULL,
    koefisien text DEFAULT ''::text NOT NULL,
	total_harga numeric(17,2) DEFAULT 0 NOT NULL,
    vol_1 numeric(17,2) DEFAULT 0 NOT NULL,
    sat_1 character varying(100) DEFAULT ''::character varying NOT NULL,
    vol_2 numeric(17,2) DEFAULT 0 NOT NULL,
    sat_2 character varying(100) DEFAULT ''::character varying NOT NULL,
    vol_3 numeric(17,2) DEFAULT 0 NOT NULL,
    sat_3 character varying(100) DEFAULT ''::character varying NOT NULL,
    vol_4 numeric(17,2) DEFAULT 0 NOT NULL,
    sat_4 character varying(100) DEFAULT ''::character varying NOT NULL,
	pajak_murni integer DEFAULT 0 NOT NULL,
	harga_satuan_murni numeric(17,2) DEFAULT 0 NOT NULL,
    volume_murni numeric(17,2) DEFAULT 0 NOT NULL,
    koefisien_murni text DEFAULT ''::text NOT NULL,
	total_harga_murni numeric(17,2) DEFAULT 0 NOT NULL,
    vol_1_murni numeric(17,2) DEFAULT 0 NOT NULL,
    sat_1_murni character varying(100) DEFAULT ''::character varying NOT NULL,
    vol_2_murni numeric(17,2) DEFAULT 0 NOT NULL,
    sat_2_murni character varying(100) DEFAULT ''::character varying NOT NULL,
    vol_3_murni numeric(17,2) DEFAULT 0 NOT NULL,
    sat_3_murni character varying(100) DEFAULT ''::character varying NOT NULL,
    vol_4_murni numeric(17,2) DEFAULT 0 NOT NULL,
    sat_4_murni character varying(100) DEFAULT ''::character varying NOT NULL,
    id_bl_lama integer DEFAULT 0 NOT NULL,
	id_sub_bl_lama integer DEFAULT 0 NOT NULL,
	id_rinci_sub_bl_lama integer DEFAULT 0 NOT NULL,
	id_subs_sub_bl_lama integer DEFAULT 0 NOT NULL,
    id_ket_sub_bl_lama integer DEFAULT 0 NOT NULL,
	id_dana_sub_bl_lama integer DEFAULT 0 NOT NULL,
    id_penerima_bantuan_lama integer DEFAULT 0 NOT NULL,
    id_profil_penerima_bantuan_lama integer DEFAULT 0 NOT NULL,
    harga_satuan_lama double precision DEFAULT 0 NOT NULL,
    volume_lama double precision DEFAULT 0 NOT NULL,
    total_harga_lama double precision DEFAULT 0 NOT NULL,
    vol_1_lama double precision DEFAULT 0 NOT NULL,
    vol_2_lama double precision DEFAULT 0 NOT NULL,
    vol_3_lama double precision DEFAULT 0 NOT NULL,
    vol_4_lama double precision DEFAULT 0 NOT NULL,
    harga_satuan_murni_lama double precision DEFAULT 0 NOT NULL,
    volume_murni_lama double precision DEFAULT 0 NOT NULL,
    total_harga_murni_lama double precision DEFAULT 0 NOT NULL,
    [REDACTED] double precision DEFAULT 0 NOT NULL,
    [REDACTED] double precision DEFAULT 0 NOT NULL,
    [REDACTED] double precision DEFAULT 0 NOT NULL,
    [REDACTED] double precision DEFAULT 0 NOT NULL,
    created_at timestamp(6) without time zone DEFAULT now() NOT NULL,
    created_by integer DEFAULT 0 NOT NULL,
    updated_at timestamp(6) without time zone DEFAULT '0001-01-01 00:00:00'::timestamp without time zone NOT NULL,
    updated_by integer DEFAULT 0 NOT NULL,
    deleted_at timestamp(6) without time zone DEFAULT '0001-01-01 00:00:00'::timestamp without time zone NOT NULL,
    deleted_by integer DEFAULT 0 NOT NULL
);

ALTER TABLE rancangan_perubahan.trn_rincian_sub_kegiatan ADD CONSTRAINT trn_rincian_sub_kegiatan_pkey PRIMARY KEY (id_unik_rincian_sub_kegiatan, tahun, id_daerah);
ALTER TABLE rancangan_perubahan.trn_rincian_sub_kegiatan ADD CONSTRAINT trn_rincian_sub_kegiatan_unique_key UNIQUE (tahun, id_daerah, id_unik_jadwal, id_unik_skpd, id_unik_sub_skpd, id_unik_sub_kegiatan, id_unik_aktivitas_sub_kegiatan, id_unik_keterangan_sub_kegiatan, id_unik_sumber_dana_sub_kegiatan, id_akun, id_unik_standar_harga);

COMMENT ON TABLE rancangan_perubahan.trn_rincian_sub_kegiatan IS 'Tabel transaksi yang menyimpan rincian belanja dalam suatu sub kegiatan.';
COMMENT ON COLUMN rancangan_perubahan.trn_rincian_sub_kegiatan.id_unik_rincian_sub_kegiatan IS 'ID unik UUID sebagai ID primary key.';

COMMENT ON COLUMN rancangan_perubahan.trn_rincian_sub_kegiatan.tahun IS 'Tahun anggaran sub kegiatan.';
COMMENT ON COLUMN rancangan_perubahan.trn_rincian_sub_kegiatan.id_daerah IS 'Pemerintah daerah pelaksana sub kegiatan.';
COMMENT ON COLUMN rancangan_perubahan.trn_rincian_sub_kegiatan.id_unik_jadwal IS 'ID jadwal tahapan anggaran.';
COMMENT ON COLUMN rancangan_perubahan.trn_rincian_sub_kegiatan.id_unik_skpd IS 'ID SKPD induk yang membawahi pelaksana kegiatan.';
COMMENT ON COLUMN rancangan_perubahan.trn_rincian_sub_kegiatan.id_unik_sub_skpd IS 'ID SKPD pelaksana kegiatan.';
COMMENT ON COLUMN rancangan_perubahan.trn_rincian_sub_kegiatan.id_unik_sub_kegiatan IS 'ID sub kegiatan yang sudah diinput dalam rencana kerja.';
COMMENT ON COLUMN rancangan_perubahan.trn_rincian_sub_kegiatan.id_unik_aktivitas_sub_kegiatan IS 'ID aktvitas sub kegiatan yang sudah diinput.';
COMMENT ON COLUMN rancangan_perubahan.trn_rincian_sub_kegiatan.id_unik_keterangan_sub_kegiatan IS 'ID keterangan sub kegiatan yang sudah diinput.';
COMMENT ON COLUMN rancangan_perubahan.trn_rincian_sub_kegiatan.id_unik_sumber_dana_sub_kegiatan IS 'ID sumber dana yang sudah dipilih.';
COMMENT ON COLUMN rancangan_perubahan.trn_rincian_sub_kegiatan.id_akun IS 'ID akun belanja.';
COMMENT ON COLUMN rancangan_perubahan.trn_rincian_sub_kegiatan.lokus_akun IS 'Lokasi atau akun spesifik untuk belanja.';
COMMENT ON COLUMN rancangan_perubahan.trn_rincian_sub_kegiatan.id_unik_profil_penerima_bantuan IS 'ID profil penerima bantuan apabila belanja yang diinput adalah belanja bantuan.';
COMMENT ON COLUMN rancangan_perubahan.trn_rincian_sub_kegiatan.set_form_input IS 'Status penggunaan form input tertentu.';
COMMENT ON COLUMN rancangan_perubahan.trn_rincian_sub_kegiatan.set_sisa_lelang IS 'Penanda apakah merupakan sisa anggaran.';
COMMENT ON COLUMN rancangan_perubahan.trn_rincian_sub_kegiatan.id_unik_standar_harga IS 'ID standar harga yang digunakan.';
COMMENT ON COLUMN rancangan_perubahan.trn_rincian_sub_kegiatan.satuan IS 'Satuan volume belanja.';
COMMENT ON COLUMN rancangan_perubahan.trn_rincian_sub_kegiatan.pajak IS 'Persentase pajak yang dikenakan.';
COMMENT ON COLUMN rancangan_perubahan.trn_rincian_sub_kegiatan.harga_satuan IS 'Harga satuan belanja.';
COMMENT ON COLUMN rancangan_perubahan.trn_rincian_sub_kegiatan.volume IS 'Volume total belanja.';
COMMENT ON COLUMN rancangan_perubahan.trn_rincian_sub_kegiatan.koefisien IS 'Detail koefisien volume dan satuan.';
COMMENT ON COLUMN rancangan_perubahan.trn_rincian_sub_kegiatan.total_harga IS 'Total harga belanja.';
COMMENT ON COLUMN rancangan_perubahan.trn_rincian_sub_kegiatan.vol_1 IS 'Volume 1.';
COMMENT ON COLUMN rancangan_perubahan.trn_rincian_sub_kegiatan.sat_1 IS 'Satuan volume 1.';
COMMENT ON COLUMN rancangan_perubahan.trn_rincian_sub_kegiatan.vol_2 IS 'Volume 2.';
COMMENT ON COLUMN rancangan_perubahan.trn_rincian_sub_kegiatan.sat_2 IS 'Satuan volume 2.';
COMMENT ON COLUMN rancangan_perubahan.trn_rincian_sub_kegiatan.vol_3 IS 'Volume 3.';
COMMENT ON COLUMN rancangan_perubahan.trn_rincian_sub_kegiatan.sat_3 IS 'Satuan volume 3.';
COMMENT ON COLUMN rancangan_perubahan.trn_rincian_sub_kegiatan.vol_4 IS 'Volume 4.';
COMMENT ON COLUMN rancangan_perubahan.trn_rincian_sub_kegiatan.sat_4 IS 'Satuan volume 4.';
COMMENT ON COLUMN rancangan_perubahan.trn_rincian_sub_kegiatan.id_bl_lama IS 'Primary key tabel d_bl lama.';
COMMENT ON COLUMN rancangan_perubahan.trn_rincian_sub_kegiatan.id_sub_bl_lama IS 'Primary key tabel d_sub_bl lama.';
COMMENT ON COLUMN rancangan_perubahan.trn_rincian_sub_kegiatan.id_rinci_sub_bl_lama IS 'Primary key tabel d_rinci_sub_bl lama.';
COMMENT ON COLUMN rancangan_perubahan.trn_rincian_sub_kegiatan.id_subs_sub_bl_lama IS 'Primary key tabel d_subs_sub_bl lama.';
COMMENT ON COLUMN rancangan_perubahan.trn_rincian_sub_kegiatan.id_ket_sub_bl_lama IS 'Primary key tabel d_ket_sub_bl lama.';
COMMENT ON COLUMN rancangan_perubahan.trn_rincian_sub_kegiatan.id_dana_sub_bl_lama IS 'Primary key tabel d_dana_sub_bl lama.';
COMMENT ON COLUMN rancangan_perubahan.trn_rincian_sub_kegiatan.id_penerima_bantuan_lama IS 'Primary key tabel d_penerima_bantuan lama.';
COMMENT ON COLUMN rancangan_perubahan.trn_rincian_sub_kegiatan.id_profil_penerima_bantuan_lama IS 'Primary key tabel r_profil_user lama.';
COMMENT ON COLUMN rancangan_perubahan.trn_rincian_sub_kegiatan.created_at IS 'Tanggal dan waktu data dibuat.';
COMMENT ON COLUMN rancangan_perubahan.trn_rincian_sub_kegiatan.created_by IS 'ID pengguna yang membuat data.';
COMMENT ON COLUMN rancangan_perubahan.trn_rincian_sub_kegiatan.updated_at IS 'Tanggal dan waktu terakhir data diperbarui.';
COMMENT ON COLUMN rancangan_perubahan.trn_rincian_sub_kegiatan.updated_by IS 'ID pengguna yang memperbarui data.';
COMMENT ON COLUMN rancangan_perubahan.trn_rincian_sub_kegiatan.deleted_at IS 'Tanggal dan waktu data dihapus (soft delete).';
COMMENT ON COLUMN rancangan_perubahan.trn_rincian_sub_kegiatan.deleted_by IS 'ID pengguna yang menghapus data.';

CREATE INDEX trn_rincian_sub_kegiatan_id_unik_rincian_sub_kegiatan_idx ON rancangan_perubahan.trn_rincian_sub_kegiatan USING btree (id_unik_rincian_sub_kegiatan);
CREATE INDEX trn_rincian_sub_kegiatan_tahun_idx ON rancangan_perubahan.trn_rincian_sub_kegiatan USING btree (tahun);
CREATE INDEX trn_rincian_sub_kegiatan_id_daerah_idx ON rancangan_perubahan.trn_rincian_sub_kegiatan USING btree (id_daerah);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_jadwal_idx ON rancangan_perubahan.trn_rincian_sub_kegiatan USING btree (id_unik_jadwal);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_skpd_idx ON rancangan_perubahan.trn_rincian_sub_kegiatan USING btree (id_unik_skpd);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_sub_skpd_idx ON rancangan_perubahan.trn_rincian_sub_kegiatan USING btree (id_unik_sub_skpd);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_sub_kegiatan_idx ON rancangan_perubahan.trn_rincian_sub_kegiatan USING btree (id_unik_sub_kegiatan);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_aktivitas_sub_kegiatan_idx ON rancangan_perubahan.trn_rincian_sub_kegiatan USING btree (id_unik_aktivitas_sub_kegiatan);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_keterangan_sub_kegiatan_idx ON rancangan_perubahan.trn_rincian_sub_kegiatan USING btree (id_unik_keterangan_sub_kegiatan);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_sumber_dana_sub_kegiatan_idx ON rancangan_perubahan.trn_rincian_sub_kegiatan USING btree (id_unik_sumber_dana_sub_kegiatan);
CREATE INDEX trn_rincian_sub_kegiatan_id_akun_idx ON rancangan_perubahan.trn_rincian_sub_kegiatan USING btree (id_akun);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_profil_penerima_bantuan_idx ON rancangan_perubahan.trn_rincian_sub_kegiatan USING btree (id_unik_profil_penerima_bantuan);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_standar_harga_idx ON rancangan_perubahan.trn_rincian_sub_kegiatan USING btree (id_unik_standar_harga);


-- SCHEMA penetapan_perubahan;
CREATE TABLE IF NOT EXISTS penetapan_perubahan.trn_rincian_sub_kegiatan (
    id_unik_rincian_sub_kegiatan uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
    tahun integer DEFAULT 0 NOT NULL,
	id_daerah integer DEFAULT 0 NOT NULL,
	id_unik_jadwal uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
	id_unik_skpd uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
	id_unik_sub_skpd uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
	id_unik_sub_kegiatan uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
	id_unik_aktivitas_sub_kegiatan uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
    id_unik_keterangan_sub_kegiatan uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
    id_unik_sumber_dana_sub_kegiatan uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
    id_akun integer DEFAULT 0 NOT NULL,
	lokus_akun text DEFAULT ''::text NOT NULL,
    id_unik_profil_penerima_bantuan uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
	set_form_input integer DEFAULT 0 NOT NULL,
    set_sisa_lelang boolean DEFAULT false NOT NULL,
	id_unik_standar_harga uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
	satuan character varying(100) DEFAULT ''::character varying NOT NULL,
	pajak integer DEFAULT 0 NOT NULL,
	harga_satuan numeric(17,2) DEFAULT 0 NOT NULL,
    volume numeric(17,2) DEFAULT 0 NOT NULL,
    koefisien text DEFAULT ''::text NOT NULL,
	total_harga numeric(17,2) DEFAULT 0 NOT NULL,
    vol_1 numeric(17,2) DEFAULT 0 NOT NULL,
    sat_1 character varying(100) DEFAULT ''::character varying NOT NULL,
    vol_2 numeric(17,2) DEFAULT 0 NOT NULL,
    sat_2 character varying(100) DEFAULT ''::character varying NOT NULL,
    vol_3 numeric(17,2) DEFAULT 0 NOT NULL,
    sat_3 character varying(100) DEFAULT ''::character varying NOT NULL,
    vol_4 numeric(17,2) DEFAULT 0 NOT NULL,
    sat_4 character varying(100) DEFAULT ''::character varying NOT NULL,
	pajak_murni integer DEFAULT 0 NOT NULL,
	harga_satuan_murni numeric(17,2) DEFAULT 0 NOT NULL,
    volume_murni numeric(17,2) DEFAULT 0 NOT NULL,
    koefisien_murni text DEFAULT ''::text NOT NULL,
	total_harga_murni numeric(17,2) DEFAULT 0 NOT NULL,
    vol_1_murni numeric(17,2) DEFAULT 0 NOT NULL,
    sat_1_murni character varying(100) DEFAULT ''::character varying NOT NULL,
    vol_2_murni numeric(17,2) DEFAULT 0 NOT NULL,
    sat_2_murni character varying(100) DEFAULT ''::character varying NOT NULL,
    vol_3_murni numeric(17,2) DEFAULT 0 NOT NULL,
    sat_3_murni character varying(100) DEFAULT ''::character varying NOT NULL,
    vol_4_murni numeric(17,2) DEFAULT 0 NOT NULL,
    sat_4_murni character varying(100) DEFAULT ''::character varying NOT NULL,
    id_bl_lama integer DEFAULT 0 NOT NULL,
	id_sub_bl_lama integer DEFAULT 0 NOT NULL,
	id_rinci_sub_bl_lama integer DEFAULT 0 NOT NULL,
	id_subs_sub_bl_lama integer DEFAULT 0 NOT NULL,
    id_ket_sub_bl_lama integer DEFAULT 0 NOT NULL,
	id_dana_sub_bl_lama integer DEFAULT 0 NOT NULL,
    id_penerima_bantuan_lama integer DEFAULT 0 NOT NULL,
    id_profil_penerima_bantuan_lama integer DEFAULT 0 NOT NULL,
    harga_satuan_lama double precision DEFAULT 0 NOT NULL,
    volume_lama double precision DEFAULT 0 NOT NULL,
    total_harga_lama double precision DEFAULT 0 NOT NULL,
    vol_1_lama double precision DEFAULT 0 NOT NULL,
    vol_2_lama double precision DEFAULT 0 NOT NULL,
    vol_3_lama double precision DEFAULT 0 NOT NULL,
    vol_4_lama double precision DEFAULT 0 NOT NULL,
    harga_satuan_murni_lama double precision DEFAULT 0 NOT NULL,
    volume_murni_lama double precision DEFAULT 0 NOT NULL,
    total_harga_murni_lama double precision DEFAULT 0 NOT NULL,
    [REDACTED] double precision DEFAULT 0 NOT NULL,
    [REDACTED] double precision DEFAULT 0 NOT NULL,
    [REDACTED] double precision DEFAULT 0 NOT NULL,
    [REDACTED] double precision DEFAULT 0 NOT NULL,
    created_at timestamp(6) without time zone DEFAULT now() NOT NULL,
    created_by integer DEFAULT 0 NOT NULL,
    updated_at timestamp(6) without time zone DEFAULT '0001-01-01 00:00:00'::timestamp without time zone NOT NULL,
    updated_by integer DEFAULT 0 NOT NULL,
    deleted_at timestamp(6) without time zone DEFAULT '0001-01-01 00:00:00'::timestamp without time zone NOT NULL,
    deleted_by integer DEFAULT 0 NOT NULL
);

ALTER TABLE penetapan_perubahan.trn_rincian_sub_kegiatan ADD CONSTRAINT trn_rincian_sub_kegiatan_pkey PRIMARY KEY (id_unik_rincian_sub_kegiatan, tahun, id_daerah);
ALTER TABLE penetapan_perubahan.trn_rincian_sub_kegiatan ADD CONSTRAINT trn_rincian_sub_kegiatan_unique_key UNIQUE (tahun, id_daerah, id_unik_jadwal, id_unik_skpd, id_unik_sub_skpd, id_unik_sub_kegiatan, id_unik_aktivitas_sub_kegiatan, id_unik_keterangan_sub_kegiatan, id_unik_sumber_dana_sub_kegiatan, id_akun, id_unik_standar_harga);

COMMENT ON TABLE penetapan_perubahan.trn_rincian_sub_kegiatan IS 'Tabel transaksi yang menyimpan rincian belanja dalam suatu sub kegiatan.';
COMMENT ON COLUMN penetapan_perubahan.trn_rincian_sub_kegiatan.id_unik_rincian_sub_kegiatan IS 'ID unik UUID sebagai ID primary key.';

COMMENT ON COLUMN penetapan_perubahan.trn_rincian_sub_kegiatan.tahun IS 'Tahun anggaran sub kegiatan.';
COMMENT ON COLUMN penetapan_perubahan.trn_rincian_sub_kegiatan.id_daerah IS 'Pemerintah daerah pelaksana sub kegiatan.';
COMMENT ON COLUMN penetapan_perubahan.trn_rincian_sub_kegiatan.id_unik_jadwal IS 'ID jadwal tahapan anggaran.';
COMMENT ON COLUMN penetapan_perubahan.trn_rincian_sub_kegiatan.id_unik_skpd IS 'ID SKPD induk yang membawahi pelaksana kegiatan.';
COMMENT ON COLUMN penetapan_perubahan.trn_rincian_sub_kegiatan.id_unik_sub_skpd IS 'ID SKPD pelaksana kegiatan.';
COMMENT ON COLUMN penetapan_perubahan.trn_rincian_sub_kegiatan.id_unik_sub_kegiatan IS 'ID sub kegiatan yang sudah diinput dalam rencana kerja.';
COMMENT ON COLUMN penetapan_perubahan.trn_rincian_sub_kegiatan.id_unik_aktivitas_sub_kegiatan IS 'ID aktvitas sub kegiatan yang sudah diinput.';
COMMENT ON COLUMN penetapan_perubahan.trn_rincian_sub_kegiatan.id_unik_keterangan_sub_kegiatan IS 'ID keterangan sub kegiatan yang sudah diinput.';
COMMENT ON COLUMN penetapan_perubahan.trn_rincian_sub_kegiatan.id_unik_sumber_dana_sub_kegiatan IS 'ID sumber dana yang sudah dipilih.';
COMMENT ON COLUMN penetapan_perubahan.trn_rincian_sub_kegiatan.id_akun IS 'ID akun belanja.';
COMMENT ON COLUMN penetapan_perubahan.trn_rincian_sub_kegiatan.lokus_akun IS 'Lokasi atau akun spesifik untuk belanja.';
COMMENT ON COLUMN penetapan_perubahan.trn_rincian_sub_kegiatan.id_unik_profil_penerima_bantuan IS 'ID profil penerima bantuan apabila belanja yang diinput adalah belanja bantuan.';
COMMENT ON COLUMN penetapan_perubahan.trn_rincian_sub_kegiatan.set_form_input IS 'Status penggunaan form input tertentu.';
COMMENT ON COLUMN penetapan_perubahan.trn_rincian_sub_kegiatan.set_sisa_lelang IS 'Penanda apakah merupakan sisa anggaran.';
COMMENT ON COLUMN penetapan_perubahan.trn_rincian_sub_kegiatan.id_unik_standar_harga IS 'ID standar harga yang digunakan.';
COMMENT ON COLUMN penetapan_perubahan.trn_rincian_sub_kegiatan.satuan IS 'Satuan volume belanja.';
COMMENT ON COLUMN penetapan_perubahan.trn_rincian_sub_kegiatan.pajak IS 'Persentase pajak yang dikenakan.';
COMMENT ON COLUMN penetapan_perubahan.trn_rincian_sub_kegiatan.harga_satuan IS 'Harga satuan belanja.';
COMMENT ON COLUMN penetapan_perubahan.trn_rincian_sub_kegiatan.volume IS 'Volume total belanja.';
COMMENT ON COLUMN penetapan_perubahan.trn_rincian_sub_kegiatan.koefisien IS 'Detail koefisien volume dan satuan.';
COMMENT ON COLUMN penetapan_perubahan.trn_rincian_sub_kegiatan.total_harga IS 'Total harga belanja.';
COMMENT ON COLUMN penetapan_perubahan.trn_rincian_sub_kegiatan.vol_1 IS 'Volume 1.';
COMMENT ON COLUMN penetapan_perubahan.trn_rincian_sub_kegiatan.sat_1 IS 'Satuan volume 1.';
COMMENT ON COLUMN penetapan_perubahan.trn_rincian_sub_kegiatan.vol_2 IS 'Volume 2.';
COMMENT ON COLUMN penetapan_perubahan.trn_rincian_sub_kegiatan.sat_2 IS 'Satuan volume 2.';
COMMENT ON COLUMN penetapan_perubahan.trn_rincian_sub_kegiatan.vol_3 IS 'Volume 3.';
COMMENT ON COLUMN penetapan_perubahan.trn_rincian_sub_kegiatan.sat_3 IS 'Satuan volume 3.';
COMMENT ON COLUMN penetapan_perubahan.trn_rincian_sub_kegiatan.vol_4 IS 'Volume 4.';
COMMENT ON COLUMN penetapan_perubahan.trn_rincian_sub_kegiatan.sat_4 IS 'Satuan volume 4.';
COMMENT ON COLUMN penetapan_perubahan.trn_rincian_sub_kegiatan.id_bl_lama IS 'Primary key tabel d_bl lama.';
COMMENT ON COLUMN penetapan_perubahan.trn_rincian_sub_kegiatan.id_sub_bl_lama IS 'Primary key tabel d_sub_bl lama.';
COMMENT ON COLUMN penetapan_perubahan.trn_rincian_sub_kegiatan.id_rinci_sub_bl_lama IS 'Primary key tabel d_rinci_sub_bl lama.';
COMMENT ON COLUMN penetapan_perubahan.trn_rincian_sub_kegiatan.id_subs_sub_bl_lama IS 'Primary key tabel d_subs_sub_bl lama.';
COMMENT ON COLUMN penetapan_perubahan.trn_rincian_sub_kegiatan.id_ket_sub_bl_lama IS 'Primary key tabel d_ket_sub_bl lama.';
COMMENT ON COLUMN penetapan_perubahan.trn_rincian_sub_kegiatan.id_dana_sub_bl_lama IS 'Primary key tabel d_dana_sub_bl lama.';
COMMENT ON COLUMN penetapan_perubahan.trn_rincian_sub_kegiatan.id_penerima_bantuan_lama IS 'Primary key tabel d_penerima_bantuan lama.';
COMMENT ON COLUMN penetapan_perubahan.trn_rincian_sub_kegiatan.id_profil_penerima_bantuan_lama IS 'Primary key tabel r_profil_user lama.';
COMMENT ON COLUMN penetapan_perubahan.trn_rincian_sub_kegiatan.created_at IS 'Tanggal dan waktu data dibuat.';
COMMENT ON COLUMN penetapan_perubahan.trn_rincian_sub_kegiatan.created_by IS 'ID pengguna yang membuat data.';
COMMENT ON COLUMN penetapan_perubahan.trn_rincian_sub_kegiatan.updated_at IS 'Tanggal dan waktu terakhir data diperbarui.';
COMMENT ON COLUMN penetapan_perubahan.trn_rincian_sub_kegiatan.updated_by IS 'ID pengguna yang memperbarui data.';
COMMENT ON COLUMN penetapan_perubahan.trn_rincian_sub_kegiatan.deleted_at IS 'Tanggal dan waktu data dihapus (soft delete).';
COMMENT ON COLUMN penetapan_perubahan.trn_rincian_sub_kegiatan.deleted_by IS 'ID pengguna yang menghapus data.';

CREATE INDEX trn_rincian_sub_kegiatan_id_unik_rincian_sub_kegiatan_idx ON penetapan_perubahan.trn_rincian_sub_kegiatan USING btree (id_unik_rincian_sub_kegiatan);
CREATE INDEX trn_rincian_sub_kegiatan_tahun_idx ON penetapan_perubahan.trn_rincian_sub_kegiatan USING btree (tahun);
CREATE INDEX trn_rincian_sub_kegiatan_id_daerah_idx ON penetapan_perubahan.trn_rincian_sub_kegiatan USING btree (id_daerah);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_jadwal_idx ON penetapan_perubahan.trn_rincian_sub_kegiatan USING btree (id_unik_jadwal);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_skpd_idx ON penetapan_perubahan.trn_rincian_sub_kegiatan USING btree (id_unik_skpd);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_sub_skpd_idx ON penetapan_perubahan.trn_rincian_sub_kegiatan USING btree (id_unik_sub_skpd);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_sub_kegiatan_idx ON penetapan_perubahan.trn_rincian_sub_kegiatan USING btree (id_unik_sub_kegiatan);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_aktivitas_sub_kegiatan_idx ON penetapan_perubahan.trn_rincian_sub_kegiatan USING btree (id_unik_aktivitas_sub_kegiatan);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_keterangan_sub_kegiatan_idx ON penetapan_perubahan.trn_rincian_sub_kegiatan USING btree (id_unik_keterangan_sub_kegiatan);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_sumber_dana_sub_kegiatan_idx ON penetapan_perubahan.trn_rincian_sub_kegiatan USING btree (id_unik_sumber_dana_sub_kegiatan);
CREATE INDEX trn_rincian_sub_kegiatan_id_akun_idx ON penetapan_perubahan.trn_rincian_sub_kegiatan USING btree (id_akun);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_profil_penerima_bantuan_idx ON penetapan_perubahan.trn_rincian_sub_kegiatan USING btree (id_unik_profil_penerima_bantuan);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_standar_harga_idx ON penetapan_perubahan.trn_rincian_sub_kegiatan USING btree (id_unik_standar_harga);


-- SCHEMA rancangan_pergeseran_perubahan;
CREATE TABLE IF NOT EXISTS rancangan_pergeseran_perubahan.trn_rincian_sub_kegiatan (
    id_unik_rincian_sub_kegiatan uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
    tahun integer DEFAULT 0 NOT NULL,
	id_daerah integer DEFAULT 0 NOT NULL,
	id_unik_jadwal uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
	id_unik_skpd uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
	id_unik_sub_skpd uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
	id_unik_sub_kegiatan uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
	id_unik_aktivitas_sub_kegiatan uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
    id_unik_keterangan_sub_kegiatan uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
    id_unik_sumber_dana_sub_kegiatan uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
    id_akun integer DEFAULT 0 NOT NULL,
	lokus_akun text DEFAULT ''::text NOT NULL,
    id_unik_profil_penerima_bantuan uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
	set_form_input integer DEFAULT 0 NOT NULL,
    set_sisa_lelang boolean DEFAULT false NOT NULL,
	id_unik_standar_harga uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
	satuan character varying(100) DEFAULT ''::character varying NOT NULL,
	pajak integer DEFAULT 0 NOT NULL,
	harga_satuan numeric(17,2) DEFAULT 0 NOT NULL,
    volume numeric(17,2) DEFAULT 0 NOT NULL,
    koefisien text DEFAULT ''::text NOT NULL,
	total_harga numeric(17,2) DEFAULT 0 NOT NULL,
    vol_1 numeric(17,2) DEFAULT 0 NOT NULL,
    sat_1 character varying(100) DEFAULT ''::character varying NOT NULL,
    vol_2 numeric(17,2) DEFAULT 0 NOT NULL,
    sat_2 character varying(100) DEFAULT ''::character varying NOT NULL,
    vol_3 numeric(17,2) DEFAULT 0 NOT NULL,
    sat_3 character varying(100) DEFAULT ''::character varying NOT NULL,
    vol_4 numeric(17,2) DEFAULT 0 NOT NULL,
    sat_4 character varying(100) DEFAULT ''::character varying NOT NULL,
	pajak_murni integer DEFAULT 0 NOT NULL,
	harga_satuan_murni numeric(17,2) DEFAULT 0 NOT NULL,
    volume_murni numeric(17,2) DEFAULT 0 NOT NULL,
    koefisien_murni text DEFAULT ''::text NOT NULL,
	total_harga_murni numeric(17,2) DEFAULT 0 NOT NULL,
    vol_1_murni numeric(17,2) DEFAULT 0 NOT NULL,
    sat_1_murni character varying(100) DEFAULT ''::character varying NOT NULL,
    vol_2_murni numeric(17,2) DEFAULT 0 NOT NULL,
    sat_2_murni character varying(100) DEFAULT ''::character varying NOT NULL,
    vol_3_murni numeric(17,2) DEFAULT 0 NOT NULL,
    sat_3_murni character varying(100) DEFAULT ''::character varying NOT NULL,
    vol_4_murni numeric(17,2) DEFAULT 0 NOT NULL,
    sat_4_murni character varying(100) DEFAULT ''::character varying NOT NULL,
    id_bl_lama integer DEFAULT 0 NOT NULL,
	id_sub_bl_lama integer DEFAULT 0 NOT NULL,
	id_rinci_sub_bl_lama integer DEFAULT 0 NOT NULL,
	id_subs_sub_bl_lama integer DEFAULT 0 NOT NULL,
    id_ket_sub_bl_lama integer DEFAULT 0 NOT NULL,
	id_dana_sub_bl_lama integer DEFAULT 0 NOT NULL,
    id_penerima_bantuan_lama integer DEFAULT 0 NOT NULL,
    id_profil_penerima_bantuan_lama integer DEFAULT 0 NOT NULL,
    harga_satuan_lama double precision DEFAULT 0 NOT NULL,
    volume_lama double precision DEFAULT 0 NOT NULL,
    total_harga_lama double precision DEFAULT 0 NOT NULL,
    vol_1_lama double precision DEFAULT 0 NOT NULL,
    vol_2_lama double precision DEFAULT 0 NOT NULL,
    vol_3_lama double precision DEFAULT 0 NOT NULL,
    vol_4_lama double precision DEFAULT 0 NOT NULL,
    harga_satuan_murni_lama double precision DEFAULT 0 NOT NULL,
    volume_murni_lama double precision DEFAULT 0 NOT NULL,
    total_harga_murni_lama double precision DEFAULT 0 NOT NULL,
    [REDACTED] double precision DEFAULT 0 NOT NULL,
    [REDACTED] double precision DEFAULT 0 NOT NULL,
    [REDACTED] double precision DEFAULT 0 NOT NULL,
    [REDACTED] double precision DEFAULT 0 NOT NULL,
    created_at timestamp(6) without time zone DEFAULT now() NOT NULL,
    created_by integer DEFAULT 0 NOT NULL,
    updated_at timestamp(6) without time zone DEFAULT '0001-01-01 00:00:00'::timestamp without time zone NOT NULL,
    updated_by integer DEFAULT 0 NOT NULL,
    deleted_at timestamp(6) without time zone DEFAULT '0001-01-01 00:00:00'::timestamp without time zone NOT NULL,
    deleted_by integer DEFAULT 0 NOT NULL
);

ALTER TABLE rancangan_pergeseran_perubahan.trn_rincian_sub_kegiatan ADD CONSTRAINT trn_rincian_sub_kegiatan_pkey PRIMARY KEY (id_unik_rincian_sub_kegiatan, tahun, id_daerah);
ALTER TABLE rancangan_pergeseran_perubahan.trn_rincian_sub_kegiatan ADD CONSTRAINT trn_rincian_sub_kegiatan_unique_key UNIQUE (tahun, id_daerah, id_unik_jadwal, id_unik_skpd, id_unik_sub_skpd, id_unik_sub_kegiatan, id_unik_aktivitas_sub_kegiatan, id_unik_keterangan_sub_kegiatan, id_unik_sumber_dana_sub_kegiatan, id_akun, id_unik_standar_harga);

COMMENT ON TABLE rancangan_pergeseran_perubahan.trn_rincian_sub_kegiatan IS 'Tabel transaksi yang menyimpan rincian belanja dalam suatu sub kegiatan.';
COMMENT ON COLUMN rancangan_pergeseran_perubahan.trn_rincian_sub_kegiatan.id_unik_rincian_sub_kegiatan IS 'ID unik UUID sebagai ID primary key.';

COMMENT ON COLUMN rancangan_pergeseran_perubahan.trn_rincian_sub_kegiatan.tahun IS 'Tahun anggaran sub kegiatan.';
COMMENT ON COLUMN rancangan_pergeseran_perubahan.trn_rincian_sub_kegiatan.id_daerah IS 'Pemerintah daerah pelaksana sub kegiatan.';
COMMENT ON COLUMN rancangan_pergeseran_perubahan.trn_rincian_sub_kegiatan.id_unik_jadwal IS 'ID jadwal tahapan anggaran.';
COMMENT ON COLUMN rancangan_pergeseran_perubahan.trn_rincian_sub_kegiatan.id_unik_skpd IS 'ID SKPD induk yang membawahi pelaksana kegiatan.';
COMMENT ON COLUMN rancangan_pergeseran_perubahan.trn_rincian_sub_kegiatan.id_unik_sub_skpd IS 'ID SKPD pelaksana kegiatan.';
COMMENT ON COLUMN rancangan_pergeseran_perubahan.trn_rincian_sub_kegiatan.id_unik_sub_kegiatan IS 'ID sub kegiatan yang sudah diinput dalam rencana kerja.';
COMMENT ON COLUMN rancangan_pergeseran_perubahan.trn_rincian_sub_kegiatan.id_unik_aktivitas_sub_kegiatan IS 'ID aktvitas sub kegiatan yang sudah diinput.';
COMMENT ON COLUMN rancangan_pergeseran_perubahan.trn_rincian_sub_kegiatan.id_unik_keterangan_sub_kegiatan IS 'ID keterangan sub kegiatan yang sudah diinput.';
COMMENT ON COLUMN rancangan_pergeseran_perubahan.trn_rincian_sub_kegiatan.id_unik_sumber_dana_sub_kegiatan IS 'ID sumber dana yang sudah dipilih.';
COMMENT ON COLUMN rancangan_pergeseran_perubahan.trn_rincian_sub_kegiatan.id_akun IS 'ID akun belanja.';
COMMENT ON COLUMN rancangan_pergeseran_perubahan.trn_rincian_sub_kegiatan.lokus_akun IS 'Lokasi atau akun spesifik untuk belanja.';
COMMENT ON COLUMN rancangan_pergeseran_perubahan.trn_rincian_sub_kegiatan.id_unik_profil_penerima_bantuan IS 'ID profil penerima bantuan apabila belanja yang diinput adalah belanja bantuan.';
COMMENT ON COLUMN rancangan_pergeseran_perubahan.trn_rincian_sub_kegiatan.set_form_input IS 'Status penggunaan form input tertentu.';
COMMENT ON COLUMN rancangan_pergeseran_perubahan.trn_rincian_sub_kegiatan.set_sisa_lelang IS 'Penanda apakah merupakan sisa anggaran.';
COMMENT ON COLUMN rancangan_pergeseran_perubahan.trn_rincian_sub_kegiatan.id_unik_standar_harga IS 'ID standar harga yang digunakan.';
COMMENT ON COLUMN rancangan_pergeseran_perubahan.trn_rincian_sub_kegiatan.satuan IS 'Satuan volume belanja.';
COMMENT ON COLUMN rancangan_pergeseran_perubahan.trn_rincian_sub_kegiatan.pajak IS 'Persentase pajak yang dikenakan.';
COMMENT ON COLUMN rancangan_pergeseran_perubahan.trn_rincian_sub_kegiatan.harga_satuan IS 'Harga satuan belanja.';
COMMENT ON COLUMN rancangan_pergeseran_perubahan.trn_rincian_sub_kegiatan.volume IS 'Volume total belanja.';
COMMENT ON COLUMN rancangan_pergeseran_perubahan.trn_rincian_sub_kegiatan.koefisien IS 'Detail koefisien volume dan satuan.';
COMMENT ON COLUMN rancangan_pergeseran_perubahan.trn_rincian_sub_kegiatan.total_harga IS 'Total harga belanja.';
COMMENT ON COLUMN rancangan_pergeseran_perubahan.trn_rincian_sub_kegiatan.vol_1 IS 'Volume 1.';
COMMENT ON COLUMN rancangan_pergeseran_perubahan.trn_rincian_sub_kegiatan.sat_1 IS 'Satuan volume 1.';
COMMENT ON COLUMN rancangan_pergeseran_perubahan.trn_rincian_sub_kegiatan.vol_2 IS 'Volume 2.';
COMMENT ON COLUMN rancangan_pergeseran_perubahan.trn_rincian_sub_kegiatan.sat_2 IS 'Satuan volume 2.';
COMMENT ON COLUMN rancangan_pergeseran_perubahan.trn_rincian_sub_kegiatan.vol_3 IS 'Volume 3.';
COMMENT ON COLUMN rancangan_pergeseran_perubahan.trn_rincian_sub_kegiatan.sat_3 IS 'Satuan volume 3.';
COMMENT ON COLUMN rancangan_pergeseran_perubahan.trn_rincian_sub_kegiatan.vol_4 IS 'Volume 4.';
COMMENT ON COLUMN rancangan_pergeseran_perubahan.trn_rincian_sub_kegiatan.sat_4 IS 'Satuan volume 4.';
COMMENT ON COLUMN rancangan_pergeseran_perubahan.trn_rincian_sub_kegiatan.id_bl_lama IS 'Primary key tabel d_bl lama.';
COMMENT ON COLUMN rancangan_pergeseran_perubahan.trn_rincian_sub_kegiatan.id_sub_bl_lama IS 'Primary key tabel d_sub_bl lama.';
COMMENT ON COLUMN rancangan_pergeseran_perubahan.trn_rincian_sub_kegiatan.id_rinci_sub_bl_lama IS 'Primary key tabel d_rinci_sub_bl lama.';
COMMENT ON COLUMN rancangan_pergeseran_perubahan.trn_rincian_sub_kegiatan.id_subs_sub_bl_lama IS 'Primary key tabel d_subs_sub_bl lama.';
COMMENT ON COLUMN rancangan_pergeseran_perubahan.trn_rincian_sub_kegiatan.id_ket_sub_bl_lama IS 'Primary key tabel d_ket_sub_bl lama.';
COMMENT ON COLUMN rancangan_pergeseran_perubahan.trn_rincian_sub_kegiatan.id_dana_sub_bl_lama IS 'Primary key tabel d_dana_sub_bl lama.';
COMMENT ON COLUMN rancangan_pergeseran_perubahan.trn_rincian_sub_kegiatan.id_penerima_bantuan_lama IS 'Primary key tabel d_penerima_bantuan lama.';
COMMENT ON COLUMN rancangan_pergeseran_perubahan.trn_rincian_sub_kegiatan.id_profil_penerima_bantuan_lama IS 'Primary key tabel r_profil_user lama.';
COMMENT ON COLUMN rancangan_pergeseran_perubahan.trn_rincian_sub_kegiatan.created_at IS 'Tanggal dan waktu data dibuat.';
COMMENT ON COLUMN rancangan_pergeseran_perubahan.trn_rincian_sub_kegiatan.created_by IS 'ID pengguna yang membuat data.';
COMMENT ON COLUMN rancangan_pergeseran_perubahan.trn_rincian_sub_kegiatan.updated_at IS 'Tanggal dan waktu terakhir data diperbarui.';
COMMENT ON COLUMN rancangan_pergeseran_perubahan.trn_rincian_sub_kegiatan.updated_by IS 'ID pengguna yang memperbarui data.';
COMMENT ON COLUMN rancangan_pergeseran_perubahan.trn_rincian_sub_kegiatan.deleted_at IS 'Tanggal dan waktu data dihapus (soft delete).';
COMMENT ON COLUMN rancangan_pergeseran_perubahan.trn_rincian_sub_kegiatan.deleted_by IS 'ID pengguna yang menghapus data.';

CREATE INDEX trn_rincian_sub_kegiatan_id_unik_rincian_sub_kegiatan_idx ON rancangan_pergeseran_perubahan.trn_rincian_sub_kegiatan USING btree (id_unik_rincian_sub_kegiatan);
CREATE INDEX trn_rincian_sub_kegiatan_tahun_idx ON rancangan_pergeseran_perubahan.trn_rincian_sub_kegiatan USING btree (tahun);
CREATE INDEX trn_rincian_sub_kegiatan_id_daerah_idx ON rancangan_pergeseran_perubahan.trn_rincian_sub_kegiatan USING btree (id_daerah);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_jadwal_idx ON rancangan_pergeseran_perubahan.trn_rincian_sub_kegiatan USING btree (id_unik_jadwal);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_skpd_idx ON rancangan_pergeseran_perubahan.trn_rincian_sub_kegiatan USING btree (id_unik_skpd);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_sub_skpd_idx ON rancangan_pergeseran_perubahan.trn_rincian_sub_kegiatan USING btree (id_unik_sub_skpd);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_sub_kegiatan_idx ON rancangan_pergeseran_perubahan.trn_rincian_sub_kegiatan USING btree (id_unik_sub_kegiatan);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_aktivitas_sub_kegiatan_idx ON rancangan_pergeseran_perubahan.trn_rincian_sub_kegiatan USING btree (id_unik_aktivitas_sub_kegiatan);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_keterangan_sub_kegiatan_idx ON rancangan_pergeseran_perubahan.trn_rincian_sub_kegiatan USING btree (id_unik_keterangan_sub_kegiatan);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_sumber_dana_sub_kegiatan_idx ON rancangan_pergeseran_perubahan.trn_rincian_sub_kegiatan USING btree (id_unik_sumber_dana_sub_kegiatan);
CREATE INDEX trn_rincian_sub_kegiatan_id_akun_idx ON rancangan_pergeseran_perubahan.trn_rincian_sub_kegiatan USING btree (id_akun);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_profil_penerima_bantuan_idx ON rancangan_pergeseran_perubahan.trn_rincian_sub_kegiatan USING btree (id_unik_profil_penerima_bantuan);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_standar_harga_idx ON rancangan_pergeseran_perubahan.trn_rincian_sub_kegiatan USING btree (id_unik_standar_harga);


-- SCHEMA penetapan_pergeseran_perubahan;
CREATE TABLE IF NOT EXISTS penetapan_pergeseran_perubahan.trn_rincian_sub_kegiatan (
    id_unik_rincian_sub_kegiatan uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
    tahun integer DEFAULT 0 NOT NULL,
	id_daerah integer DEFAULT 0 NOT NULL,
	id_unik_jadwal uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
	id_unik_skpd uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
	id_unik_sub_skpd uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
	id_unik_sub_kegiatan uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
	id_unik_aktivitas_sub_kegiatan uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
    id_unik_keterangan_sub_kegiatan uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
    id_unik_sumber_dana_sub_kegiatan uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
    id_akun integer DEFAULT 0 NOT NULL,
	lokus_akun text DEFAULT ''::text NOT NULL,
    id_unik_profil_penerima_bantuan uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
	set_form_input integer DEFAULT 0 NOT NULL,
    set_sisa_lelang boolean DEFAULT false NOT NULL,
	id_unik_standar_harga uuid DEFAULT '00000000-0000-0000-0000-000000000000' NOT NULL,
	satuan character varying(100) DEFAULT ''::character varying NOT NULL,
	pajak integer DEFAULT 0 NOT NULL,
	harga_satuan numeric(17,2) DEFAULT 0 NOT NULL,
    volume numeric(17,2) DEFAULT 0 NOT NULL,
    koefisien text DEFAULT ''::text NOT NULL,
	total_harga numeric(17,2) DEFAULT 0 NOT NULL,
    vol_1 numeric(17,2) DEFAULT 0 NOT NULL,
    sat_1 character varying(100) DEFAULT ''::character varying NOT NULL,
    vol_2 numeric(17,2) DEFAULT 0 NOT NULL,
    sat_2 character varying(100) DEFAULT ''::character varying NOT NULL,
    vol_3 numeric(17,2) DEFAULT 0 NOT NULL,
    sat_3 character varying(100) DEFAULT ''::character varying NOT NULL,
    vol_4 numeric(17,2) DEFAULT 0 NOT NULL,
    sat_4 character varying(100) DEFAULT ''::character varying NOT NULL,
	pajak_murni integer DEFAULT 0 NOT NULL,
	harga_satuan_murni numeric(17,2) DEFAULT 0 NOT NULL,
    volume_murni numeric(17,2) DEFAULT 0 NOT NULL,
    koefisien_murni text DEFAULT ''::text NOT NULL,
	total_harga_murni numeric(17,2) DEFAULT 0 NOT NULL,
    vol_1_murni numeric(17,2) DEFAULT 0 NOT NULL,
    sat_1_murni character varying(100) DEFAULT ''::character varying NOT NULL,
    vol_2_murni numeric(17,2) DEFAULT 0 NOT NULL,
    sat_2_murni character varying(100) DEFAULT ''::character varying NOT NULL,
    vol_3_murni numeric(17,2) DEFAULT 0 NOT NULL,
    sat_3_murni character varying(100) DEFAULT ''::character varying NOT NULL,
    vol_4_murni numeric(17,2) DEFAULT 0 NOT NULL,
    sat_4_murni character varying(100) DEFAULT ''::character varying NOT NULL,
    id_bl_lama integer DEFAULT 0 NOT NULL,
	id_sub_bl_lama integer DEFAULT 0 NOT NULL,
	id_rinci_sub_bl_lama integer DEFAULT 0 NOT NULL,
	id_subs_sub_bl_lama integer DEFAULT 0 NOT NULL,
    id_ket_sub_bl_lama integer DEFAULT 0 NOT NULL,
	id_dana_sub_bl_lama integer DEFAULT 0 NOT NULL,
    id_penerima_bantuan_lama integer DEFAULT 0 NOT NULL,
    id_profil_penerima_bantuan_lama integer DEFAULT 0 NOT NULL,
    harga_satuan_lama double precision DEFAULT 0 NOT NULL,
    volume_lama double precision DEFAULT 0 NOT NULL,
    total_harga_lama double precision DEFAULT 0 NOT NULL,
    vol_1_lama double precision DEFAULT 0 NOT NULL,
    vol_2_lama double precision DEFAULT 0 NOT NULL,
    vol_3_lama double precision DEFAULT 0 NOT NULL,
    vol_4_lama double precision DEFAULT 0 NOT NULL,
    harga_satuan_murni_lama double precision DEFAULT 0 NOT NULL,
    volume_murni_lama double precision DEFAULT 0 NOT NULL,
    total_harga_murni_lama double precision DEFAULT 0 NOT NULL,
    [REDACTED] double precision DEFAULT 0 NOT NULL,
    [REDACTED] double precision DEFAULT 0 NOT NULL,
    [REDACTED] double precision DEFAULT 0 NOT NULL,
    [REDACTED] double precision DEFAULT 0 NOT NULL,
    created_at timestamp(6) without time zone DEFAULT now() NOT NULL,
    created_by integer DEFAULT 0 NOT NULL,
    updated_at timestamp(6) without time zone DEFAULT '0001-01-01 00:00:00'::timestamp without time zone NOT NULL,
    updated_by integer DEFAULT 0 NOT NULL,
    deleted_at timestamp(6) without time zone DEFAULT '0001-01-01 00:00:00'::timestamp without time zone NOT NULL,
    deleted_by integer DEFAULT 0 NOT NULL
);

ALTER TABLE penetapan_pergeseran_perubahan.trn_rincian_sub_kegiatan ADD CONSTRAINT trn_rincian_sub_kegiatan_pkey PRIMARY KEY (id_unik_rincian_sub_kegiatan, tahun, id_daerah);
ALTER TABLE penetapan_pergeseran_perubahan.trn_rincian_sub_kegiatan ADD CONSTRAINT trn_rincian_sub_kegiatan_unique_key UNIQUE (tahun, id_daerah, id_unik_jadwal, id_unik_skpd, id_unik_sub_skpd, id_unik_sub_kegiatan, id_unik_aktivitas_sub_kegiatan, id_unik_keterangan_sub_kegiatan, id_unik_sumber_dana_sub_kegiatan, id_akun, id_unik_standar_harga);

COMMENT ON TABLE penetapan_pergeseran_perubahan.trn_rincian_sub_kegiatan IS 'Tabel transaksi yang menyimpan rincian belanja dalam suatu sub kegiatan.';
COMMENT ON COLUMN penetapan_pergeseran_perubahan.trn_rincian_sub_kegiatan.id_unik_rincian_sub_kegiatan IS 'ID unik UUID sebagai ID primary key.';

COMMENT ON COLUMN penetapan_pergeseran_perubahan.trn_rincian_sub_kegiatan.tahun IS 'Tahun anggaran sub kegiatan.';
COMMENT ON COLUMN penetapan_pergeseran_perubahan.trn_rincian_sub_kegiatan.id_daerah IS 'Pemerintah daerah pelaksana sub kegiatan.';
COMMENT ON COLUMN penetapan_pergeseran_perubahan.trn_rincian_sub_kegiatan.id_unik_jadwal IS 'ID jadwal tahapan anggaran.';
COMMENT ON COLUMN penetapan_pergeseran_perubahan.trn_rincian_sub_kegiatan.id_unik_skpd IS 'ID SKPD induk yang membawahi pelaksana kegiatan.';
COMMENT ON COLUMN penetapan_pergeseran_perubahan.trn_rincian_sub_kegiatan.id_unik_sub_skpd IS 'ID SKPD pelaksana kegiatan.';
COMMENT ON COLUMN penetapan_pergeseran_perubahan.trn_rincian_sub_kegiatan.id_unik_sub_kegiatan IS 'ID sub kegiatan yang sudah diinput dalam rencana kerja.';
COMMENT ON COLUMN penetapan_pergeseran_perubahan.trn_rincian_sub_kegiatan.id_unik_aktivitas_sub_kegiatan IS 'ID aktvitas sub kegiatan yang sudah diinput.';
COMMENT ON COLUMN penetapan_pergeseran_perubahan.trn_rincian_sub_kegiatan.id_unik_keterangan_sub_kegiatan IS 'ID keterangan sub kegiatan yang sudah diinput.';
COMMENT ON COLUMN penetapan_pergeseran_perubahan.trn_rincian_sub_kegiatan.id_unik_sumber_dana_sub_kegiatan IS 'ID sumber dana yang sudah dipilih.';
COMMENT ON COLUMN penetapan_pergeseran_perubahan.trn_rincian_sub_kegiatan.id_akun IS 'ID akun belanja.';
COMMENT ON COLUMN penetapan_pergeseran_perubahan.trn_rincian_sub_kegiatan.lokus_akun IS 'Lokasi atau akun spesifik untuk belanja.';
COMMENT ON COLUMN penetapan_pergeseran_perubahan.trn_rincian_sub_kegiatan.id_unik_profil_penerima_bantuan IS 'ID profil penerima bantuan apabila belanja yang diinput adalah belanja bantuan.';
COMMENT ON COLUMN penetapan_pergeseran_perubahan.trn_rincian_sub_kegiatan.set_form_input IS 'Status penggunaan form input tertentu.';
COMMENT ON COLUMN penetapan_pergeseran_perubahan.trn_rincian_sub_kegiatan.set_sisa_lelang IS 'Penanda apakah merupakan sisa anggaran.';
COMMENT ON COLUMN penetapan_pergeseran_perubahan.trn_rincian_sub_kegiatan.id_unik_standar_harga IS 'ID standar harga yang digunakan.';
COMMENT ON COLUMN penetapan_pergeseran_perubahan.trn_rincian_sub_kegiatan.satuan IS 'Satuan volume belanja.';
COMMENT ON COLUMN penetapan_pergeseran_perubahan.trn_rincian_sub_kegiatan.pajak IS 'Persentase pajak yang dikenakan.';
COMMENT ON COLUMN penetapan_pergeseran_perubahan.trn_rincian_sub_kegiatan.harga_satuan IS 'Harga satuan belanja.';
COMMENT ON COLUMN penetapan_pergeseran_perubahan.trn_rincian_sub_kegiatan.volume IS 'Volume total belanja.';
COMMENT ON COLUMN penetapan_pergeseran_perubahan.trn_rincian_sub_kegiatan.koefisien IS 'Detail koefisien volume dan satuan.';
COMMENT ON COLUMN penetapan_pergeseran_perubahan.trn_rincian_sub_kegiatan.total_harga IS 'Total harga belanja.';
COMMENT ON COLUMN penetapan_pergeseran_perubahan.trn_rincian_sub_kegiatan.vol_1 IS 'Volume 1.';
COMMENT ON COLUMN penetapan_pergeseran_perubahan.trn_rincian_sub_kegiatan.sat_1 IS 'Satuan volume 1.';
COMMENT ON COLUMN penetapan_pergeseran_perubahan.trn_rincian_sub_kegiatan.vol_2 IS 'Volume 2.';
COMMENT ON COLUMN penetapan_pergeseran_perubahan.trn_rincian_sub_kegiatan.sat_2 IS 'Satuan volume 2.';
COMMENT ON COLUMN penetapan_pergeseran_perubahan.trn_rincian_sub_kegiatan.vol_3 IS 'Volume 3.';
COMMENT ON COLUMN penetapan_pergeseran_perubahan.trn_rincian_sub_kegiatan.sat_3 IS 'Satuan volume 3.';
COMMENT ON COLUMN penetapan_pergeseran_perubahan.trn_rincian_sub_kegiatan.vol_4 IS 'Volume 4.';
COMMENT ON COLUMN penetapan_pergeseran_perubahan.trn_rincian_sub_kegiatan.sat_4 IS 'Satuan volume 4.';
COMMENT ON COLUMN penetapan_pergeseran_perubahan.trn_rincian_sub_kegiatan.id_bl_lama IS 'Primary key tabel d_bl lama.';
COMMENT ON COLUMN penetapan_pergeseran_perubahan.trn_rincian_sub_kegiatan.id_sub_bl_lama IS 'Primary key tabel d_sub_bl lama.';
COMMENT ON COLUMN penetapan_pergeseran_perubahan.trn_rincian_sub_kegiatan.id_rinci_sub_bl_lama IS 'Primary key tabel d_rinci_sub_bl lama.';
COMMENT ON COLUMN penetapan_pergeseran_perubahan.trn_rincian_sub_kegiatan.id_subs_sub_bl_lama IS 'Primary key tabel d_subs_sub_bl lama.';
COMMENT ON COLUMN penetapan_pergeseran_perubahan.trn_rincian_sub_kegiatan.id_ket_sub_bl_lama IS 'Primary key tabel d_ket_sub_bl lama.';
COMMENT ON COLUMN penetapan_pergeseran_perubahan.trn_rincian_sub_kegiatan.id_dana_sub_bl_lama IS 'Primary key tabel d_dana_sub_bl lama.';
COMMENT ON COLUMN penetapan_pergeseran_perubahan.trn_rincian_sub_kegiatan.id_penerima_bantuan_lama IS 'Primary key tabel d_penerima_bantuan lama.';
COMMENT ON COLUMN penetapan_pergeseran_perubahan.trn_rincian_sub_kegiatan.id_profil_penerima_bantuan_lama IS 'Primary key tabel r_profil_user lama.';
COMMENT ON COLUMN penetapan_pergeseran_perubahan.trn_rincian_sub_kegiatan.created_at IS 'Tanggal dan waktu data dibuat.';
COMMENT ON COLUMN penetapan_pergeseran_perubahan.trn_rincian_sub_kegiatan.created_by IS 'ID pengguna yang membuat data.';
COMMENT ON COLUMN penetapan_pergeseran_perubahan.trn_rincian_sub_kegiatan.updated_at IS 'Tanggal dan waktu terakhir data diperbarui.';
COMMENT ON COLUMN penetapan_pergeseran_perubahan.trn_rincian_sub_kegiatan.updated_by IS 'ID pengguna yang memperbarui data.';
COMMENT ON COLUMN penetapan_pergeseran_perubahan.trn_rincian_sub_kegiatan.deleted_at IS 'Tanggal dan waktu data dihapus (soft delete).';
COMMENT ON COLUMN penetapan_pergeseran_perubahan.trn_rincian_sub_kegiatan.deleted_by IS 'ID pengguna yang menghapus data.';

CREATE INDEX trn_rincian_sub_kegiatan_id_unik_rincian_sub_kegiatan_idx ON penetapan_pergeseran_perubahan.trn_rincian_sub_kegiatan USING btree (id_unik_rincian_sub_kegiatan);
CREATE INDEX trn_rincian_sub_kegiatan_tahun_idx ON penetapan_pergeseran_perubahan.trn_rincian_sub_kegiatan USING btree (tahun);
CREATE INDEX trn_rincian_sub_kegiatan_id_daerah_idx ON penetapan_pergeseran_perubahan.trn_rincian_sub_kegiatan USING btree (id_daerah);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_jadwal_idx ON penetapan_pergeseran_perubahan.trn_rincian_sub_kegiatan USING btree (id_unik_jadwal);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_skpd_idx ON penetapan_pergeseran_perubahan.trn_rincian_sub_kegiatan USING btree (id_unik_skpd);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_sub_skpd_idx ON penetapan_pergeseran_perubahan.trn_rincian_sub_kegiatan USING btree (id_unik_sub_skpd);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_sub_kegiatan_idx ON penetapan_pergeseran_perubahan.trn_rincian_sub_kegiatan USING btree (id_unik_sub_kegiatan);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_aktivitas_sub_kegiatan_idx ON penetapan_pergeseran_perubahan.trn_rincian_sub_kegiatan USING btree (id_unik_aktivitas_sub_kegiatan);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_keterangan_sub_kegiatan_idx ON penetapan_pergeseran_perubahan.trn_rincian_sub_kegiatan USING btree (id_unik_keterangan_sub_kegiatan);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_sumber_dana_sub_kegiatan_idx ON penetapan_pergeseran_perubahan.trn_rincian_sub_kegiatan USING btree (id_unik_sumber_dana_sub_kegiatan);
CREATE INDEX trn_rincian_sub_kegiatan_id_akun_idx ON penetapan_pergeseran_perubahan.trn_rincian_sub_kegiatan USING btree (id_akun);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_profil_penerima_bantuan_idx ON penetapan_pergeseran_perubahan.trn_rincian_sub_kegiatan USING btree (id_unik_profil_penerima_bantuan);
CREATE INDEX trn_rincian_sub_kegiatan_id_unik_standar_harga_idx ON penetapan_pergeseran_perubahan.trn_rincian_sub_kegiatan USING btree (id_unik_standar_harga);