
CREATE SEQUENCE netsuite_balance_id_seq
  INCREMENT 1
  MINVALUE 1
  MAXVALUE 2147483647
  START 1
  CACHE 1;
ALTER TABLE netsuite_balance_id_seq
  OWNER TO admin;
GRANT ALL ON TABLE netsuite_balance_id_seq TO admin;
GRANT ALL ON TABLE netsuite_balance_id_seq TO xtrole;


CREATE TABLE netsuite_balance
(
    id integer NOT NULL DEFAULT nextval(('netsuite_balance_id_seq'::text)::regclass),
    period_id integer,
    accnt_id integer,
    beginning numeric(14,2),
    ending numeric(14,2),
    hkd_beginning numeric(14,2),
    hkd_ending numeric(14,2),
    curr_id integer,
     CONSTRAINT netsuite_balance_id_pkey PRIMARY KEY (id )
)
WITH (
  OIDS=FALSE
); 

GRANT ALL ON TABLE netsuite_balance TO admin;
GRANT ALL ON TABLE netsuite_balance TO xtrole;

ALTER TABLE          netsuite_balance ADD COLUMN base_beginning  numeric(14,2);
ALTER TABLE          netsuite_balance ADD COLUMN base_ending numeric(14,2);
ALTER TABLE          netsuite_balance ADD COLUMN base_close numeric(14,2);
