+ALTER TABLE prepay_credit ADD agentnum integer NULL;
+ALTER TABLE h_prepay_credit ADD agentnum integer NULL;
+
+ALTER TABLE type_pkgs ADD typepkgnum int;
+ALTER TABLE type_pkgs ALTER COLUMN typepkgnum SET DEFAULT nextval('public.type_pkgs_typepkgnum_seq'::text);
+CREATE SEQUENCE type_pkgs_typepkgnum_seq;
+UPDATE type_pkgs SET typepkgnum = nextval('public.type_pkgs_typepkgnum_seq'::text) WHERE typepkgnum IS NULL;
+ALTER TABLE type_pkgs ALTER typepkgnum SET NOT NULL;
+ALTER TABLE type_pkgs ADD PRIMARY KEY (typepkgnum);
+ALTER TABLE h_type_pkgs ADD typepkgnum int;
+
+ALTER TABLE cust_bill_pkg ADD billpkgnum int;
+ALTER TABLE cust_bill_pkg ALTER COLUMN billpkgnum SET DEFAULT nextval('public.cust_bill_pkg_billpkgnum_seq'::text);
+CREATE SEQUENCE cust_bill_pkg_billpkgnum_seq;
+UPDATE cust_bill_pkg SET billpkgnum = nextval('public.cust_bill_pkg_billpkgnum_seq'::text) WHERE billpkgnum IS NULL;
+ALTER TABLE cust_bill_pkg ALTER billpkgnum SET NOT NULL;
+ALTER TABLE cust_bill_pkg ADD PRIMARY KEY (billpkgnum);
+ALTER TABLE h_cust_bill_pkg ADD billpkgnum int;
+
+ALTER TABLE pkg_svc ADD pkgsvcnum int;
+ALTER TABLE pkg_svc ALTER COLUMN pkgsvcnum SET DEFAULT nextval('public.pkg_svc_pkgsvcnum_seq'::text);
+CREATE SEQUENCE pkg_svc_pkgsvcnum_seq;
+UPDATE pkg_svc SET pkgsvcnum = nextval('public.pkg_svc_pkgsvcnum_seq'::text) WHERE pkgsvcnum IS NULL;
+ALTER TABLE pkg_svc ALTER pkgsvcnum SET NOT NULL;
+ALTER TABLE pkg_svc ADD PRIMARY KEY (pkgsvcnum);
+ALTER TABLE h_pkg_svc ADD pkgsvcnum int;
+
+On recent Pg versions:
+
+ALTER TABLE cust_main ALTER COLUMN payinfo varchar(512) NULL;
+ALTER TABLE h_cust_main ALTER COLUMN payinfo varchar(512) NULL;
+
+Or on older Pg versions that don't support altering columns directly:
+