CREATE TABLE public.mst_prioritas_pusat (
    id_prioritas_pusat serial NOT NULL,
    id_unik_prioritas_pusat uuid DEFAULT public.uuid_generate_v7() NOT NULL,
    tahun_awal integer DEFAULT 0 NOT NULL,
    tahun_akhir integer DEFAULT 0 NOT NULL,
    locked boolean DEFAULT false NOT NULL,
    disable boolean DEFAULT false NOT NULL,
    urutan_prioritas integer DEFAULT 0 NOT NULL,
    kelompok_prioritas character varying (100) DEFAULT ''::character varying NOT NULL,
    nama_prioritas text DEFAULT ''::text 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,
	id_label_pusat_lama integer DEFAULT 0 NOT NULL
);

COMMENT ON TABLE public.mst_prioritas_pusat IS 'Tabel referensi prioritas pembangunan nasional.';
COMMENT ON COLUMN public.mst_prioritas_pusat.kelompok_prioritas	 IS 'Kolom berisi kelompok prioritas pembangunan seperti nawacita / astacita.';

ALTER TABLE public.mst_prioritas_pusat ADD CONSTRAINT mst_prioritas_pusat_pkey UNIQUE (id_prioritas_pusat);
ALTER TABLE public.mst_prioritas_pusat ADD CONSTRAINT mst_prioritas_pusat_unique_key UNIQUE (tahun_awal, tahun_akhir, kelompok_prioritas, nama_prioritas);

CREATE INDEX mst_prioritas_pusat_id_prioritas_pusat_idx ON public.mst_prioritas_pusat USING btree (id_prioritas_pusat);
CREATE INDEX mst_prioritas_pusat_tahun_awal_idx ON public.mst_prioritas_pusat USING btree (tahun_awal);
CREATE INDEX mst_prioritas_pusat_tahun_akhir_idx ON public.mst_prioritas_pusat USING btree (tahun_akhir);
CREATE INDEX mst_prioritas_pusat_nama_prioritas_idx ON public.mst_prioritas_pusat USING btree (nama_prioritas);