--   Crea la tabla de sistema que asocia cuentas contables con cuentas 
--   de sistema.

CREATE TABLE sys_account2account_plan (
    id serial NOT NULL,
    PRIMARY KEY (id)
);

CREATE TABLE _sys_account2account_plan_data (
    account int,
    _start_t timestamp DEFAULT '1970/1/1 00:00:00 UTC' NOT NULL,
    _end_t timestamp,
    _table int NOT NULL,
    id bigserial NOT NULL,
    name varchar(40) NOT NULL,
    PRIMARY KEY (id)
);
CREATE INDEX account_plan_account_idx ON _sys_account2account_plan_data(account);

