
DBSCHEMA Schema Utility       INFORMIX-SQL Version 7.12.TC3  
Copyright (C) Informix Software, Inc., 1984-1996
Software Serial Number AAB#J556877
grant dba to "Administ";
grant dba to "informix";



{ TABLE "informix".traspaso_ctas row size = 24 number of columns = 3 index size = 
              0 }
create table "informix".traspaso_ctas 
  (
    cta_contable char(12) not null constraint "informix".n109_28,
    importe decimal(20,0) not null constraint "informix".n109_29,
    es_nueva char(1) not null constraint "informix".n109_30
  );
revoke all on "informix".traspaso_ctas from "public";

{ TABLE "informix".proveedores row size = 511 number of columns = 17 index size = 
              90 }
create table "informix".proveedores 
  (
    nif char(12) not null constraint "informix".n102_3,
    razon_social char(40) not null constraint "informix".n102_4,
    cta_contable char(12) not null constraint "informix".n102_5,
    cond_pago char(4),
    domicilio char(40),
    localidad char(30),
    cod_postal char(7),
    attn_envio char(40),
    direccion_envio char(40),
    localidad_envio char(30),
    cod_postal_envio char(7),
    telefono_1 char(14),
    telefono_2 char(14),
    fax char(14),
    e_mail char(30),
    observaciones varchar(120),
    expediente text,
    primary key (nif) constraint "informix"._102_prom1
  );
revoke all on "informix".proveedores from "public";

create index "informix".ix_razonsocial on "informix".proveedores (razon_social);
    
{ TABLE "informix".centros row size = 64 number of columns = 3 index size = 24 }
create table "informix".centros 
  (
    cod_centro char(12) not null constraint "informix".n103_8,
    cod_departamento char(12),
    descripcion char(40),
    primary key (cod_centro) constraint "informix"._103_prom1
  );
revoke all on "informix".centros from "public";

{ TABLE "informix".cond_pago row size = 28 number of columns = 3 index size = 12 
              }
create table "informix".cond_pago 
  (
    cond_pago char(4) not null constraint "informix".n104_10,
    descripcion char(20),
    vencimiento integer,
    primary key (cond_pago) constraint "informix"._104_prom1
  );
revoke all on "informix".cond_pago from "public";

{ TABLE "informix".pedidos row size = 282 number of columns = 10 index size = 0 }
create table "informix".pedidos 
  (
    nro_pedido char(20) not null constraint "informix".n106_20,
    descripcion char(40),
    nif_proveedor char(12),
    cod_centro char(12),
    cond_pago char(4),
    fecha_pedido date,
    fecha_entrega date,
    importe decimal(16,2),
    observaciones varchar(120),
    expediente text
  );
revoke all on "informix".pedidos from "public";

{ TABLE "informix".ctas_contables row size = 53 number of columns = 3 index size 
              = 24 }
create table "informix".ctas_contables 
  (
    cta_contable char(12) not null constraint "informix".n101_1,
    descripcion char(40),
    es_nueva char(1),
    primary key (cta_contable) constraint "informix"._101_prom1
  );
revoke all on "informix".ctas_contables from "public";

{ TABLE "informix".localidades row size = 32 number of columns = 2 index size = 9 
              }
create table "informix".localidades 
  (
    cod_localidad char(2) not null constraint "informix".n120_86,
    descripcion char(30),
    primary key (cod_localidad) constraint "informix"._120_prom1
  );
revoke all on "informix".localidades from "public";

{ TABLE "informix".registros row size = 16 number of columns = 2 index size = 12 
              }
create table "informix".registros 
  (
    tipo_reg char(4) not null constraint "informix".n122_95,
    nro_reg char(12) not null constraint "informix".n122_96,
    primary key (tipo_reg) constraint "informix"._122_prom1
  );
revoke all on "informix".registros from "public";

{ TABLE "informix".albafras row size = 151 number of columns = 4 index size = 0 }
create table "informix".albafras 
  (
    nroreg_albafact char(10) not null constraint "informix".n125_98,
    nroreg_factura char(10),
    nroreg_albaran char(10),
    observaciones varchar(120)
  );
revoke all on "informix".albafras from "public";

{ TABLE "informix".bancos row size = 139 number of columns = 9 index size = 0 }
create table "informix".bancos 
  (
    cod_banco char(4) not null constraint "informix".n122_104,
    nombre char(40) not null constraint "informix".n111_45,
    domicilio char(40),
    localidad char(25),
    cod_postal char(5),
    entidad char(4) not null constraint "informix".n111_46,
    sucursal char(4) not null constraint "informix".n111_47,
    cod_control char(2),
    nro_cc char(15) not null constraint "informix".n111_49
  );
revoke all on "informix".bancos from "public";

{ TABLE "informix".plan_contable row size = 53 number of columns = 3 index size = 
              24 }
create table "informix".plan_contable 
  (
    cta_contable char(12) not null constraint "informix".n111_32,
    descirpcion char(40) not null constraint "informix".n111_33,
    es_nueva char(1),
    primary key (cta_contable) constraint "informix"._111_prom1
  );
revoke all on "informix".plan_contable from "public";

{ TABLE "informix".user row size = 298 number of columns = 15 index size = 12 }
create table "informix".user 
  (
    id serial not null constraint "informix".n100_1,
    login varchar(10,1) not null constraint "informix".n100_2,
    password varchar(10,1) not null constraint "informix".n100_3,
    firstname varchar(20,1),
    lastname varchar(20,1),
    fullname varchar(40,1),
    title varchar(80,1),
    phone varchar(14,1),
    email varchar(80,1),
    active char(1) not null constraint "informix".n100_4,
    status char(1),
    admin char(1),
    def_project integer,
    def_category integer,
    acl char(1)
  );
revoke all on "informix".user from "public";

create unique index "informix".ix100_1 on "informix".user (id);
alter table "informix".user add constraint primary key (id) constraint 
    "informix".u100_5  ;
{ TABLE "informix".albalineas row size = 74 number of columns = 6 index size = 48 
              }
create table "informix".albalineas 
  (
    nro_lin integer not null constraint "informix".n113_58,
    nro_reg char(10) not null constraint "informix".n113_59,
    cantidad integer,
    referencia char(12),
    descripcion char(40),
    precio_und integer
  );
revoke all on "informix".albalineas from "public";

create unique cluster index "informix".ix_alblin on "informix".albalineas (nro_reg,
    nro_lin);
{ TABLE "informix".aptecuentas row size = 84 number of columns = 8 index size = 27 
              }
create table "informix".aptecuentas 
  (
    nro_reg char(10) not null constraint "informix".n115_66,
    nro_lin integer not null constraint "informix".n114_62,
    cod_cta char(12) not null constraint "informix".n114_63,
    clave char(3),
    concepto char(35),
    importe decimal(16,0) not null constraint "informix".n114_64,
    tipo_apte char(1),
    fecha char(10)
  );
revoke all on "informix".aptecuentas from "public";

create unique cluster index "informix".ix_albctas on "informix".aptecuentas (nro_reg,
    nro_lin);
{ TABLE "informix".claves row size = 33 number of columns = 2 index size = 0 }
create table "informix".claves 
  (
    cod_clave char(3),
    descripcion char(30)
  );
revoke all on "informix".claves from "public";

{ TABLE "informix".albaranes row size = 250 number of columns = 13 index size = 21 
              }
create table "informix".albaranes 
  (
    nro_reg char(10) not null constraint "informix".n112_50,
    is_locked char(1),
    fecha_emision date not null constraint "informix".n112_51,
    cod_centro char(12) not null constraint "informix".n112_52,
    nif char(12) not null constraint "informix".n112_53,
    por_reten char(2),
    importe_reten decimal(16,0),
    nro_pedido char(20),
    vto_jefe_obra char(1),
    vto_jefe_grupo char(1),
    vto_proveedor char(1),
    observaciones varchar(120),
    expediente text,
    primary key (nro_reg) constraint "informix"._112_prom1
  );
revoke all on "informix".albaranes from "public";

{ TABLE "informix".parametros row size = 190 number of columns = 28 index size = 
              12 }
create table "informix".parametros 
  (
    id serial not null constraint "informix".n148_105,
    nro_reg char(10),
    ultimo_actual date,
    iva_1 integer,
    iva_2 integer,
    iva_3 integer,
    reten_1 integer,
    cta_reten_1 char(12),
    clave_reten_1 char(3),
    reten_2 integer,
    cta_reten_2 char(12),
    clave_reten_2 char(3),
    dia_pago_1 integer,
    dia_pago_2 integer,
    ex_dia_pago char(20),
    longcta integer,
    cta_iva char(12),
    clave_iva char(3),
    cta_cont char(12),
    clave_cont char(3),
    cta_comp char(12),
    clave_comp char(3),
    cta_coniva char(12),
    clave_coniva char(3),
    cta_siniva char(12),
    clave_siniva char(3),
    cta_dev char(12),
    clave_dev char(3)
  );
revoke all on "informix".parametros from "public";

create unique index "informix".ix145_1 on "informix".parametros (id);
{ TABLE "informix".facturas row size = 383 number of columns = 48 index size = 139 
              }
create table "informix".facturas 
  (
    nro_reg char(10) not null constraint "informix".n117_68,
    is_locked char(1),
    mes char(2),
    nro_fra char(20) not null constraint "informix".n118_65,
    f_emision date,
    f_recepcion date,
    f_pago date,
    tipo_fra char(1),
    tipo_calc_iva char(1),
    importe_total decimal(20,2),
    nif char(12),
    cod_centro char(12),
    nro_pedido char(20),
    cond_pago char(4),
    tipo_doc_pago char(1),
    nro_doc_pago char(8),
    f_emision_pago date,
    cod_localidad char(12),
    cod_banco char(2),
    base_1 decimal(16,0),
    por_ret1 decimal(16,2),
    ret_1 decimal(16,2),
    por_iva1 smallint,
    iva_1 decimal(16,2),
    base_2 decimal(16,2),
    por_ret2 decimal(16,2),
    ret_2 decimal(16,2),
    por_iva2 smallint,
    iva_2 decimal(16,2),
    base_3 decimal(16,2),
    por_ret3 decimal(16,2),
    ret_3 decimal(16,2),
    por_iva3 smallint,
    iva_3 decimal(16,2),
    canexen decimal(16,2),
    base_imponible decimal(20,2),
    tipo_retencion char(1),
    por_retencion smallint,
    retencion decimal(16,0),
    tipo_deduccion char(1),
    deducciones decimal(16,2),
    sin_pedido char(1),
    traspaso_ctable char(1),
    traspaso_pago char(1),
    nro_reg_pago char(10),
    vto_pago date,
    observaciones varchar(20),
    expediente text,
    primary key (nro_reg) constraint "informix"._119_prom1
  );
revoke all on "informix".facturas from "public";

create index "informix".ix_facturas_nif on "informix".facturas (nif);
create index "informix".ix_facturas_nro on "informix".facturas (nro_fra);
create index "informix".ix_facturas_vtopag on "informix".facturas (vto_pago);
create index "informix".ix_facturas_fpago on "informix".facturas (f_emision_pago);
    
create index "informix".ix_facturas_frecep on "informix".facturas (f_recepcion);
    
create index "informix".ix_facturas_import on "informix".facturas (importe_total);
    
{ TABLE "informix".aptectasfra row size = 84 number of columns = 9 index size = 27 
              }
create table "informix".aptectasfra 
  (
    nro_reg char(10) not null constraint "informix".n104_12,
    nro_lin integer not null constraint "informix".n104_13,
    tipolin char(1),
    cod_cta char(12) not null constraint "informix".n104_14,
    clave char(2),
    concepto char(35),
    importe decimal(16,0) not null constraint "informix".n104_15,
    tipo_apte char(1),
    fecha char(10)
  );
revoke all on "informix".aptectasfra from "public";

create unique cluster index "informix".ix_fractas on "informix".aptectasfra (nro_reg,
    nro_lin);

alter table "informix".albalineas add constraint (foreign key (nro_reg) 
    references "informix".albaranes  constraint "informix".fk_alblin_nroreg);


grant select on "informix".traspaso_ctas to "public" as "informix";
grant update on "informix".traspaso_ctas to "public" as "informix";
grant insert on "informix".traspaso_ctas to "public" as "informix";
grant delete on "informix".traspaso_ctas to "public" as "informix";
grant index on "informix".traspaso_ctas to "public" as "informix";
grant select on "informix".proveedores to "public" as "informix";
grant update on "informix".proveedores to "public" as "informix";
grant insert on "informix".proveedores to "public" as "informix";
grant delete on "informix".proveedores to "public" as "informix";
grant index on "informix".proveedores to "public" as "informix";
grant select on "informix".centros to "public" as "informix";
grant update on "informix".centros to "public" as "informix";
grant insert on "informix".centros to "public" as "informix";
grant delete on "informix".centros to "public" as "informix";
grant index on "informix".centros to "public" as "informix";
grant select on "informix".cond_pago to "public" as "informix";
grant update on "informix".cond_pago to "public" as "informix";
grant insert on "informix".cond_pago to "public" as "informix";
grant delete on "informix".cond_pago to "public" as "informix";
grant index on "informix".cond_pago to "public" as "informix";
grant select on "informix".pedidos to "public" as "informix";
grant update on "informix".pedidos to "public" as "informix";
grant insert on "informix".pedidos to "public" as "informix";
grant delete on "informix".pedidos to "public" as "informix";
grant index on "informix".pedidos to "public" as "informix";
grant select on "informix".ctas_contables to "public" as "informix";
grant update on "informix".ctas_contables to "public" as "informix";
grant insert on "informix".ctas_contables to "public" as "informix";
grant delete on "informix".ctas_contables to "public" as "informix";
grant index on "informix".ctas_contables to "public" as "informix";
grant select on "informix".localidades to "public" as "informix";
grant update on "informix".localidades to "public" as "informix";
grant insert on "informix".localidades to "public" as "informix";
grant delete on "informix".localidades to "public" as "informix";
grant index on "informix".localidades to "public" as "informix";
grant select on "informix".registros to "public" as "informix";
grant update on "informix".registros to "public" as "informix";
grant insert on "informix".registros to "public" as "informix";
grant delete on "informix".registros to "public" as "informix";
grant index on "informix".registros to "public" as "informix";
grant select on "informix".albafras to "public" as "informix";
grant update on "informix".albafras to "public" as "informix";
grant insert on "informix".albafras to "public" as "informix";
grant delete on "informix".albafras to "public" as "informix";
grant index on "informix".albafras to "public" as "informix";
grant select on "informix".bancos to "public" as "informix";
grant update on "informix".bancos to "public" as "informix";
grant insert on "informix".bancos to "public" as "informix";
grant delete on "informix".bancos to "public" as "informix";
grant index on "informix".bancos to "public" as "informix";
grant select on "informix".plan_contable to "public" as "informix";
grant update on "informix".plan_contable to "public" as "informix";
grant insert on "informix".plan_contable to "public" as "informix";
grant delete on "informix".plan_contable to "public" as "informix";
grant index on "informix".plan_contable to "public" as "informix";
grant select on "informix".user to "public" as "informix";
grant update on "informix".user to "public" as "informix";
grant insert on "informix".user to "public" as "informix";
grant delete on "informix".user to "public" as "informix";
grant index on "informix".user to "public" as "informix";
grant select on "informix".albalineas to "public" as "informix";
grant update on "informix".albalineas to "public" as "informix";
grant insert on "informix".albalineas to "public" as "informix";
grant delete on "informix".albalineas to "public" as "informix";
grant index on "informix".albalineas to "public" as "informix";
grant select on "informix".aptecuentas to "public" as "informix";
grant update on "informix".aptecuentas to "public" as "informix";
grant insert on "informix".aptecuentas to "public" as "informix";
grant delete on "informix".aptecuentas to "public" as "informix";
grant index on "informix".aptecuentas to "public" as "informix";
grant select on "informix".claves to "public" as "informix";
grant update on "informix".claves to "public" as "informix";
grant insert on "informix".claves to "public" as "informix";
grant delete on "informix".claves to "public" as "informix";
grant index on "informix".claves to "public" as "informix";
grant select on "informix".albaranes to "public" as "informix";
grant update on "informix".albaranes to "public" as "informix";
grant insert on "informix".albaranes to "public" as "informix";
grant delete on "informix".albaranes to "public" as "informix";
grant index on "informix".albaranes to "public" as "informix";
grant select on "informix".parametros to "public" as "informix";
grant update on "informix".parametros to "public" as "informix";
grant insert on "informix".parametros to "public" as "informix";
grant delete on "informix".parametros to "public" as "informix";
grant index on "informix".parametros to "public" as "informix";
grant select on "informix".facturas to "public" as "informix";
grant update on "informix".facturas to "public" as "informix";
grant insert on "informix".facturas to "public" as "informix";
grant delete on "informix".facturas to "public" as "informix";
grant index on "informix".facturas to "public" as "informix";
grant select on "informix".aptectasfra to "public" as "informix";
grant update on "informix".aptectasfra to "public" as "informix";
grant insert on "informix".aptectasfra to "public" as "informix";
grant delete on "informix".aptectasfra to "public" as "informix";
grant index on "informix".aptectasfra to "public" as "informix";


 







