· 8 years ago · Feb 01, 2018, 02:26 PM
1--
2-- PostgreSQL database dump
3--
4
5-- Dumped from database version 9.3.5
6-- Dumped by pg_dump version 9.4.4
7-- Started on 2018-01-31 14:48:55 -03
8
9SET statement_timeout = 0;
10SET lock_timeout = 0;
11SET client_encoding = 'UTF8';
12SET standard_conforming_strings = on;
13SET check_function_bodies = false;
14SET client_min_messages = warning;
15
16--
17-- TOC entry 251 (class 3079 OID 12018)
18-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner:
19--
20
21CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
22
23
24--
25-- TOC entry 2733 (class 0 OID 0)
26-- Dependencies: 251
27-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner:
28--
29
30COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
31
32
33SET search_path = public, pg_catalog;
34
35SET default_tablespace = '';
36
37SET default_with_oids = false;
38
39--
40-- TOC entry 172 (class 1259 OID 241987)
41-- Name: almacenes; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
42--
43
44CREATE TABLE almacenes (
45 id integer NOT NULL,
46 nombre character varying(255),
47 abreviatura character varying(255),
48 activo boolean,
49 created_at timestamp with time zone NOT NULL,
50 updated_at timestamp with time zone NOT NULL
51);
52
53
54ALTER TABLE almacenes OWNER TO postgres;
55
56--
57-- TOC entry 173 (class 1259 OID 241993)
58-- Name: almacenes_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
59--
60
61CREATE SEQUENCE almacenes_id_seq
62 START WITH 1
63 INCREMENT BY 1
64 NO MINVALUE
65 NO MAXVALUE
66 CACHE 1;
67
68
69ALTER TABLE almacenes_id_seq OWNER TO postgres;
70
71--
72-- TOC entry 2734 (class 0 OID 0)
73-- Dependencies: 173
74-- Name: almacenes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
75--
76
77ALTER SEQUENCE almacenes_id_seq OWNED BY almacenes.id;
78
79
80--
81-- TOC entry 174 (class 1259 OID 241995)
82-- Name: almacenes_productos; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
83--
84
85CREATE TABLE almacenes_productos (
86 cantidad integer DEFAULT 0,
87 activo boolean DEFAULT true,
88 created_at timestamp with time zone NOT NULL,
89 updated_at timestamp with time zone NOT NULL,
90 almacen_id integer NOT NULL,
91 producto_id integer NOT NULL
92);
93
94
95ALTER TABLE almacenes_productos OWNER TO postgres;
96
97--
98-- TOC entry 244 (class 1259 OID 242710)
99-- Name: aperturas; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
100--
101
102CREATE TABLE aperturas (
103 id integer NOT NULL,
104 fecha character varying(255),
105 fecha_cierre timestamp with time zone,
106 monto_efectivo character varying(255),
107 esta_abierta boolean,
108 activo boolean,
109 created_at timestamp with time zone NOT NULL,
110 updated_at timestamp with time zone NOT NULL,
111 caja_id integer,
112 cajero_id integer
113);
114
115
116ALTER TABLE aperturas OWNER TO postgres;
117
118--
119-- TOC entry 243 (class 1259 OID 242708)
120-- Name: aperturas_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
121--
122
123CREATE SEQUENCE aperturas_id_seq
124 START WITH 1
125 INCREMENT BY 1
126 NO MINVALUE
127 NO MAXVALUE
128 CACHE 1;
129
130
131ALTER TABLE aperturas_id_seq OWNER TO postgres;
132
133--
134-- TOC entry 2735 (class 0 OID 0)
135-- Dependencies: 243
136-- Name: aperturas_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
137--
138
139ALTER SEQUENCE aperturas_id_seq OWNED BY aperturas.id;
140
141
142--
143-- TOC entry 175 (class 1259 OID 242008)
144-- Name: bancos; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
145--
146
147CREATE TABLE bancos (
148 id integer NOT NULL,
149 nombre character varying(255),
150 activo boolean,
151 created_at timestamp with time zone NOT NULL,
152 updated_at timestamp with time zone NOT NULL
153);
154
155
156ALTER TABLE bancos OWNER TO postgres;
157
158--
159-- TOC entry 176 (class 1259 OID 242011)
160-- Name: bancos_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
161--
162
163CREATE SEQUENCE bancos_id_seq
164 START WITH 1
165 INCREMENT BY 1
166 NO MINVALUE
167 NO MAXVALUE
168 CACHE 1;
169
170
171ALTER TABLE bancos_id_seq OWNER TO postgres;
172
173--
174-- TOC entry 2736 (class 0 OID 0)
175-- Dependencies: 176
176-- Name: bancos_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
177--
178
179ALTER SEQUENCE bancos_id_seq OWNED BY bancos.id;
180
181
182--
183-- TOC entry 177 (class 1259 OID 242013)
184-- Name: cajas; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
185--
186
187CREATE TABLE cajas (
188 id integer NOT NULL,
189 numero character varying(255) NOT NULL,
190 nombre character varying(255) NOT NULL,
191 activo boolean,
192 created_at timestamp with time zone NOT NULL,
193 updated_at timestamp with time zone NOT NULL,
194 punto_emision_id integer NOT NULL,
195 almacen_id integer
196);
197
198
199ALTER TABLE cajas OWNER TO postgres;
200
201--
202-- TOC entry 178 (class 1259 OID 242019)
203-- Name: cajas_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
204--
205
206CREATE SEQUENCE cajas_id_seq
207 START WITH 1
208 INCREMENT BY 1
209 NO MINVALUE
210 NO MAXVALUE
211 CACHE 1;
212
213
214ALTER TABLE cajas_id_seq OWNER TO postgres;
215
216--
217-- TOC entry 2737 (class 0 OID 0)
218-- Dependencies: 178
219-- Name: cajas_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
220--
221
222ALTER SEQUENCE cajas_id_seq OWNED BY cajas.id;
223
224
225--
226-- TOC entry 179 (class 1259 OID 242021)
227-- Name: clientes; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
228--
229
230CREATE TABLE clientes (
231 id integer NOT NULL,
232 razon_social character varying(255),
233 numero_documento character varying(255),
234 direccion character varying(255),
235 mail character varying(255),
236 activo boolean,
237 created_at timestamp with time zone NOT NULL,
238 updated_at timestamp with time zone NOT NULL,
239 tipo_persona_id integer,
240 tipo_documento_id integer
241);
242
243
244ALTER TABLE clientes OWNER TO postgres;
245
246--
247-- TOC entry 180 (class 1259 OID 242027)
248-- Name: clientes_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
249--
250
251CREATE SEQUENCE clientes_id_seq
252 START WITH 1
253 INCREMENT BY 1
254 NO MINVALUE
255 NO MAXVALUE
256 CACHE 1;
257
258
259ALTER TABLE clientes_id_seq OWNER TO postgres;
260
261--
262-- TOC entry 2738 (class 0 OID 0)
263-- Dependencies: 180
264-- Name: clientes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
265--
266
267ALTER SEQUENCE clientes_id_seq OWNED BY clientes.id;
268
269
270--
271-- TOC entry 181 (class 1259 OID 242029)
272-- Name: comprobantes; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
273--
274
275CREATE TABLE comprobantes (
276 id integer NOT NULL,
277 descripcion character varying(255),
278 activo boolean,
279 created_at timestamp with time zone NOT NULL,
280 updated_at timestamp with time zone NOT NULL,
281 accion_id integer NOT NULL,
282 clase_id integer NOT NULL,
283 es_editable boolean
284);
285
286
287ALTER TABLE comprobantes OWNER TO postgres;
288
289--
290-- TOC entry 182 (class 1259 OID 242032)
291-- Name: comprobantes_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
292--
293
294CREATE SEQUENCE comprobantes_id_seq
295 START WITH 1
296 INCREMENT BY 1
297 NO MINVALUE
298 NO MAXVALUE
299 CACHE 1;
300
301
302ALTER TABLE comprobantes_id_seq OWNER TO postgres;
303
304--
305-- TOC entry 2739 (class 0 OID 0)
306-- Dependencies: 182
307-- Name: comprobantes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
308--
309
310ALTER SEQUENCE comprobantes_id_seq OWNED BY comprobantes.id;
311
312
313--
314-- TOC entry 183 (class 1259 OID 242034)
315-- Name: cotizaciones; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
316--
317
318CREATE TABLE cotizaciones (
319 id integer NOT NULL,
320 fecha character varying(255) NOT NULL,
321 compra character varying(255),
322 venta character varying(255),
323 activo boolean,
324 created_at timestamp with time zone NOT NULL,
325 updated_at timestamp with time zone NOT NULL,
326 moneda_id integer NOT NULL
327);
328
329
330ALTER TABLE cotizaciones OWNER TO postgres;
331
332--
333-- TOC entry 184 (class 1259 OID 242040)
334-- Name: cotizaciones_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
335--
336
337CREATE SEQUENCE cotizaciones_id_seq
338 START WITH 1
339 INCREMENT BY 1
340 NO MINVALUE
341 NO MAXVALUE
342 CACHE 1;
343
344
345ALTER TABLE cotizaciones_id_seq OWNER TO postgres;
346
347--
348-- TOC entry 2740 (class 0 OID 0)
349-- Dependencies: 184
350-- Name: cotizaciones_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
351--
352
353ALTER SEQUENCE cotizaciones_id_seq OWNED BY cotizaciones.id;
354
355
356--
357-- TOC entry 185 (class 1259 OID 242042)
358-- Name: credito_nota; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
359--
360
361CREATE TABLE credito_nota (
362 id integer NOT NULL,
363 fecha character varying(255),
364 total character varying(255),
365 activo boolean,
366 "numeroDocumento" character varying(255),
367 "razonSocial" character varying(255),
368 "numeroFactura" character varying(255),
369 created_at timestamp with time zone NOT NULL,
370 updated_at timestamp with time zone NOT NULL,
371 cajero_id integer,
372 cliente_id integer,
373 punto_emision_id integer,
374 sucursal_id integer,
375 timbrado_id integer
376);
377
378
379ALTER TABLE credito_nota OWNER TO postgres;
380
381--
382-- TOC entry 186 (class 1259 OID 242048)
383-- Name: credito_nota_aplicada; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
384--
385
386CREATE TABLE credito_nota_aplicada (
387 id integer NOT NULL,
388 fecha character varying(255),
389 total character varying(255),
390 "numeroFactura" character varying(255),
391 created_at timestamp with time zone NOT NULL,
392 updated_at timestamp with time zone NOT NULL,
393 timbrado_id integer
394);
395
396
397ALTER TABLE credito_nota_aplicada OWNER TO postgres;
398
399--
400-- TOC entry 187 (class 1259 OID 242054)
401-- Name: credito_nota_aplicada_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
402--
403
404CREATE SEQUENCE credito_nota_aplicada_id_seq
405 START WITH 1
406 INCREMENT BY 1
407 NO MINVALUE
408 NO MAXVALUE
409 CACHE 1;
410
411
412ALTER TABLE credito_nota_aplicada_id_seq OWNER TO postgres;
413
414--
415-- TOC entry 2741 (class 0 OID 0)
416-- Dependencies: 187
417-- Name: credito_nota_aplicada_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
418--
419
420ALTER SEQUENCE credito_nota_aplicada_id_seq OWNED BY credito_nota_aplicada.id;
421
422
423--
424-- TOC entry 188 (class 1259 OID 242056)
425-- Name: credito_nota_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
426--
427
428CREATE SEQUENCE credito_nota_id_seq
429 START WITH 1
430 INCREMENT BY 1
431 NO MINVALUE
432 NO MAXVALUE
433 CACHE 1;
434
435
436ALTER TABLE credito_nota_id_seq OWNER TO postgres;
437
438--
439-- TOC entry 2742 (class 0 OID 0)
440-- Dependencies: 188
441-- Name: credito_nota_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
442--
443
444ALTER SEQUENCE credito_nota_id_seq OWNED BY credito_nota.id;
445
446
447--
448-- TOC entry 189 (class 1259 OID 242058)
449-- Name: denominaciones; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
450--
451
452CREATE TABLE denominaciones (
453 id integer NOT NULL,
454 nombre character varying(255) NOT NULL,
455 valor character varying(255),
456 activo boolean,
457 created_at timestamp with time zone NOT NULL,
458 updated_at timestamp with time zone NOT NULL,
459 moneda_id integer NOT NULL
460);
461
462
463ALTER TABLE denominaciones OWNER TO postgres;
464
465--
466-- TOC entry 190 (class 1259 OID 242064)
467-- Name: denominaciones_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
468--
469
470CREATE SEQUENCE denominaciones_id_seq
471 START WITH 1
472 INCREMENT BY 1
473 NO MINVALUE
474 NO MAXVALUE
475 CACHE 1;
476
477
478ALTER TABLE denominaciones_id_seq OWNER TO postgres;
479
480--
481-- TOC entry 2743 (class 0 OID 0)
482-- Dependencies: 190
483-- Name: denominaciones_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
484--
485
486ALTER SEQUENCE denominaciones_id_seq OWNED BY denominaciones.id;
487
488
489--
490-- TOC entry 191 (class 1259 OID 242066)
491-- Name: emisores; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
492--
493
494CREATE TABLE emisores (
495 id integer NOT NULL,
496 nombre character varying(255) NOT NULL,
497 activo boolean,
498 created_at timestamp with time zone NOT NULL,
499 updated_at timestamp with time zone NOT NULL
500);
501
502
503ALTER TABLE emisores OWNER TO postgres;
504
505--
506-- TOC entry 192 (class 1259 OID 242069)
507-- Name: emisores_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
508--
509
510CREATE SEQUENCE emisores_id_seq
511 START WITH 1
512 INCREMENT BY 1
513 NO MINVALUE
514 NO MAXVALUE
515 CACHE 1;
516
517
518ALTER TABLE emisores_id_seq OWNER TO postgres;
519
520--
521-- TOC entry 2744 (class 0 OID 0)
522-- Dependencies: 192
523-- Name: emisores_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
524--
525
526ALTER SEQUENCE emisores_id_seq OWNED BY emisores.id;
527
528
529--
530-- TOC entry 193 (class 1259 OID 242071)
531-- Name: extracciones; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
532--
533
534CREATE TABLE extracciones (
535 id integer NOT NULL,
536 fecha character varying(255),
537 total character varying(255),
538 activo boolean,
539 numero character varying(255),
540 created_at timestamp with time zone NOT NULL,
541 updated_at timestamp with time zone NOT NULL,
542 caja_id integer,
543 cajero_id integer,
544 tipo_extraccion_id integer,
545 moneda_id integer
546);
547
548
549ALTER TABLE extracciones OWNER TO postgres;
550
551--
552-- TOC entry 194 (class 1259 OID 242077)
553-- Name: extracciones_detalles; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
554--
555
556CREATE TABLE extracciones_detalles (
557 id integer NOT NULL,
558 cantidad character varying(255),
559 nombre character varying(255),
560 valor character varying(255),
561 activo boolean,
562 created_at timestamp with time zone NOT NULL,
563 updated_at timestamp with time zone NOT NULL,
564 extraccion_id integer
565);
566
567
568ALTER TABLE extracciones_detalles OWNER TO postgres;
569
570--
571-- TOC entry 195 (class 1259 OID 242083)
572-- Name: extracciones_detalles_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
573--
574
575CREATE SEQUENCE extracciones_detalles_id_seq
576 START WITH 1
577 INCREMENT BY 1
578 NO MINVALUE
579 NO MAXVALUE
580 CACHE 1;
581
582
583ALTER TABLE extracciones_detalles_id_seq OWNER TO postgres;
584
585--
586-- TOC entry 2745 (class 0 OID 0)
587-- Dependencies: 195
588-- Name: extracciones_detalles_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
589--
590
591ALTER SEQUENCE extracciones_detalles_id_seq OWNED BY extracciones_detalles.id;
592
593
594--
595-- TOC entry 196 (class 1259 OID 242085)
596-- Name: extracciones_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
597--
598
599CREATE SEQUENCE extracciones_id_seq
600 START WITH 1
601 INCREMENT BY 1
602 NO MINVALUE
603 NO MAXVALUE
604 CACHE 1;
605
606
607ALTER TABLE extracciones_id_seq OWNER TO postgres;
608
609--
610-- TOC entry 2746 (class 0 OID 0)
611-- Dependencies: 196
612-- Name: extracciones_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
613--
614
615ALTER SEQUENCE extracciones_id_seq OWNED BY extracciones.id;
616
617
618--
619-- TOC entry 197 (class 1259 OID 242087)
620-- Name: familias; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
621--
622
623CREATE TABLE familias (
624 id integer NOT NULL,
625 nombre character varying(255),
626 activo boolean,
627 imagen character varying(255),
628 created_at timestamp with time zone NOT NULL,
629 updated_at timestamp with time zone NOT NULL,
630 padre_id integer,
631 familium_id integer
632);
633
634
635ALTER TABLE familias OWNER TO postgres;
636
637--
638-- TOC entry 198 (class 1259 OID 242093)
639-- Name: familias_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
640--
641
642CREATE SEQUENCE familias_id_seq
643 START WITH 1
644 INCREMENT BY 1
645 NO MINVALUE
646 NO MAXVALUE
647 CACHE 1;
648
649
650ALTER TABLE familias_id_seq OWNER TO postgres;
651
652--
653-- TOC entry 2747 (class 0 OID 0)
654-- Dependencies: 198
655-- Name: familias_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
656--
657
658ALTER SEQUENCE familias_id_seq OWNED BY familias.id;
659
660
661--
662-- TOC entry 199 (class 1259 OID 242095)
663-- Name: historicos_precios; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
664--
665
666CREATE TABLE historicos_precios (
667 id integer NOT NULL,
668 fecha character varying(255),
669 tipo character varying(255),
670 precio double precision DEFAULT 0,
671 activo boolean,
672 created_at timestamp with time zone NOT NULL,
673 updated_at timestamp with time zone NOT NULL,
674 producto_id integer,
675 movimiento_id integer
676);
677
678
679ALTER TABLE historicos_precios OWNER TO postgres;
680
681--
682-- TOC entry 200 (class 1259 OID 242102)
683-- Name: historicos_precios_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
684--
685
686CREATE SEQUENCE historicos_precios_id_seq
687 START WITH 1
688 INCREMENT BY 1
689 NO MINVALUE
690 NO MAXVALUE
691 CACHE 1;
692
693
694ALTER TABLE historicos_precios_id_seq OWNER TO postgres;
695
696--
697-- TOC entry 2748 (class 0 OID 0)
698-- Dependencies: 200
699-- Name: historicos_precios_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
700--
701
702ALTER SEQUENCE historicos_precios_id_seq OWNED BY historicos_precios.id;
703
704
705--
706-- TOC entry 201 (class 1259 OID 242104)
707-- Name: impuestos; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
708--
709
710CREATE TABLE impuestos (
711 id integer NOT NULL,
712 nombre character varying(255) NOT NULL,
713 porcentaje character varying(255) NOT NULL,
714 activo boolean,
715 created_at timestamp with time zone NOT NULL,
716 updated_at timestamp with time zone NOT NULL
717);
718
719
720ALTER TABLE impuestos OWNER TO postgres;
721
722--
723-- TOC entry 202 (class 1259 OID 242110)
724-- Name: impuestos_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
725--
726
727CREATE SEQUENCE impuestos_id_seq
728 START WITH 1
729 INCREMENT BY 1
730 NO MINVALUE
731 NO MAXVALUE
732 CACHE 1;
733
734
735ALTER TABLE impuestos_id_seq OWNER TO postgres;
736
737--
738-- TOC entry 2749 (class 0 OID 0)
739-- Dependencies: 202
740-- Name: impuestos_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
741--
742
743ALTER SEQUENCE impuestos_id_seq OWNED BY impuestos.id;
744
745
746--
747-- TOC entry 203 (class 1259 OID 242112)
748-- Name: mensajes; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
749--
750
751CREATE TABLE mensajes (
752 id integer NOT NULL,
753 descripcion character varying(255) NOT NULL,
754 fecha_inicial character varying(255),
755 fecha_final character varying(255),
756 por_defecto boolean,
757 activo boolean,
758 created_at timestamp with time zone NOT NULL,
759 updated_at timestamp with time zone NOT NULL
760);
761
762
763ALTER TABLE mensajes OWNER TO postgres;
764
765--
766-- TOC entry 204 (class 1259 OID 242118)
767-- Name: mensajes_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
768--
769
770CREATE SEQUENCE mensajes_id_seq
771 START WITH 1
772 INCREMENT BY 1
773 NO MINVALUE
774 NO MAXVALUE
775 CACHE 1;
776
777
778ALTER TABLE mensajes_id_seq OWNER TO postgres;
779
780--
781-- TOC entry 2750 (class 0 OID 0)
782-- Dependencies: 204
783-- Name: mensajes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
784--
785
786ALTER SEQUENCE mensajes_id_seq OWNED BY mensajes.id;
787
788
789--
790-- TOC entry 205 (class 1259 OID 242120)
791-- Name: monedas; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
792--
793
794CREATE TABLE monedas (
795 id integer NOT NULL,
796 moneda character varying(255),
797 abreviatura character varying(255),
798 moneda_local boolean,
799 activo boolean,
800 created_at timestamp with time zone NOT NULL,
801 updated_at timestamp with time zone NOT NULL
802);
803
804
805ALTER TABLE monedas OWNER TO postgres;
806
807--
808-- TOC entry 206 (class 1259 OID 242126)
809-- Name: monedas_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
810--
811
812CREATE SEQUENCE monedas_id_seq
813 START WITH 1
814 INCREMENT BY 1
815 NO MINVALUE
816 NO MAXVALUE
817 CACHE 1;
818
819
820ALTER TABLE monedas_id_seq OWNER TO postgres;
821
822--
823-- TOC entry 2751 (class 0 OID 0)
824-- Dependencies: 206
825-- Name: monedas_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
826--
827
828ALTER SEQUENCE monedas_id_seq OWNED BY monedas.id;
829
830
831--
832-- TOC entry 207 (class 1259 OID 242128)
833-- Name: movimientos; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
834--
835
836CREATE TABLE movimientos (
837 id integer NOT NULL,
838 fecha character varying(255),
839 activo boolean,
840 descripcion character varying(255),
841 cantidad character varying(255),
842 "costoUnitario" character varying(255),
843 created_at timestamp with time zone NOT NULL,
844 updated_at timestamp with time zone NOT NULL,
845 tipo_movimiento_id integer,
846 producto_id integer,
847 almacen_id integer,
848 almacen_destino_id integer
849);
850
851
852ALTER TABLE movimientos OWNER TO postgres;
853
854--
855-- TOC entry 208 (class 1259 OID 242134)
856-- Name: movimientos_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
857--
858
859CREATE SEQUENCE movimientos_id_seq
860 START WITH 1
861 INCREMENT BY 1
862 NO MINVALUE
863 NO MAXVALUE
864 CACHE 1;
865
866
867ALTER TABLE movimientos_id_seq OWNER TO postgres;
868
869--
870-- TOC entry 2752 (class 0 OID 0)
871-- Dependencies: 208
872-- Name: movimientos_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
873--
874
875ALTER SEQUENCE movimientos_id_seq OWNED BY movimientos.id;
876
877
878--
879-- TOC entry 209 (class 1259 OID 242136)
880-- Name: pagos; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
881--
882
883CREATE TABLE pagos (
884 id integer NOT NULL,
885 descripcion character varying(255),
886 importe double precision NOT NULL,
887 activo boolean,
888 created_at timestamp with time zone NOT NULL,
889 updated_at timestamp with time zone NOT NULL,
890 clase_id integer,
891 venta_id integer,
892 moneda_id integer,
893 credito_nota_aplicada_id integer
894);
895
896
897ALTER TABLE pagos OWNER TO postgres;
898
899--
900-- TOC entry 210 (class 1259 OID 242139)
901-- Name: pagos_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
902--
903
904CREATE SEQUENCE pagos_id_seq
905 START WITH 1
906 INCREMENT BY 1
907 NO MINVALUE
908 NO MAXVALUE
909 CACHE 1;
910
911
912ALTER TABLE pagos_id_seq OWNER TO postgres;
913
914--
915-- TOC entry 2753 (class 0 OID 0)
916-- Dependencies: 210
917-- Name: pagos_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
918--
919
920ALTER SEQUENCE pagos_id_seq OWNED BY pagos.id;
921
922
923--
924-- TOC entry 211 (class 1259 OID 242141)
925-- Name: permisos; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
926--
927
928CREATE TABLE permisos (
929 id integer NOT NULL,
930 nombre character varying(255),
931 descripcion character varying(255),
932 activo boolean,
933 created_at timestamp with time zone NOT NULL,
934 updated_at timestamp with time zone NOT NULL
935);
936
937
938ALTER TABLE permisos OWNER TO postgres;
939
940--
941-- TOC entry 212 (class 1259 OID 242147)
942-- Name: permisos_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
943--
944
945CREATE SEQUENCE permisos_id_seq
946 START WITH 1
947 INCREMENT BY 1
948 NO MINVALUE
949 NO MAXVALUE
950 CACHE 1;
951
952
953ALTER TABLE permisos_id_seq OWNER TO postgres;
954
955--
956-- TOC entry 2754 (class 0 OID 0)
957-- Dependencies: 212
958-- Name: permisos_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
959--
960
961ALTER SEQUENCE permisos_id_seq OWNED BY permisos.id;
962
963
964--
965-- TOC entry 213 (class 1259 OID 242149)
966-- Name: permisos_roles; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
967--
968
969CREATE TABLE permisos_roles (
970 created_at timestamp with time zone NOT NULL,
971 updated_at timestamp with time zone NOT NULL,
972 permiso_id integer NOT NULL,
973 rol_id integer NOT NULL
974);
975
976
977ALTER TABLE permisos_roles OWNER TO postgres;
978
979--
980-- TOC entry 214 (class 1259 OID 242152)
981-- Name: posts; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
982--
983
984CREATE TABLE posts (
985 id integer NOT NULL,
986 title character varying(255),
987 created_at timestamp with time zone NOT NULL,
988 updated_at timestamp with time zone NOT NULL,
989 usuario_id integer,
990 timbrado_id integer
991);
992
993
994ALTER TABLE posts OWNER TO postgres;
995
996--
997-- TOC entry 215 (class 1259 OID 242155)
998-- Name: posts_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
999--
1000
1001CREATE SEQUENCE posts_id_seq
1002 START WITH 1
1003 INCREMENT BY 1
1004 NO MINVALUE
1005 NO MAXVALUE
1006 CACHE 1;
1007
1008
1009ALTER TABLE posts_id_seq OWNER TO postgres;
1010
1011--
1012-- TOC entry 2755 (class 0 OID 0)
1013-- Dependencies: 215
1014-- Name: posts_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
1015--
1016
1017ALTER SEQUENCE posts_id_seq OWNED BY posts.id;
1018
1019
1020--
1021-- TOC entry 216 (class 1259 OID 242157)
1022-- Name: procesadoras; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
1023--
1024
1025CREATE TABLE procesadoras (
1026 id integer NOT NULL,
1027 nombre character varying(255) NOT NULL,
1028 activo boolean,
1029 created_at timestamp with time zone NOT NULL,
1030 updated_at timestamp with time zone NOT NULL
1031);
1032
1033
1034ALTER TABLE procesadoras OWNER TO postgres;
1035
1036--
1037-- TOC entry 217 (class 1259 OID 242160)
1038-- Name: procesadoras_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
1039--
1040
1041CREATE SEQUENCE procesadoras_id_seq
1042 START WITH 1
1043 INCREMENT BY 1
1044 NO MINVALUE
1045 NO MAXVALUE
1046 CACHE 1;
1047
1048
1049ALTER TABLE procesadoras_id_seq OWNER TO postgres;
1050
1051--
1052-- TOC entry 2756 (class 0 OID 0)
1053-- Dependencies: 217
1054-- Name: procesadoras_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
1055--
1056
1057ALTER SEQUENCE procesadoras_id_seq OWNED BY procesadoras.id;
1058
1059
1060--
1061-- TOC entry 218 (class 1259 OID 242162)
1062-- Name: productos; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
1063--
1064
1065CREATE TABLE productos (
1066 id integer NOT NULL,
1067 codigo_interno character varying(255) NOT NULL,
1068 codigo_de_barra character varying(255) NOT NULL,
1069 nombre character varying(255),
1070 precio_venta double precision DEFAULT 0,
1071 costo_unitario double precision DEFAULT 0,
1072 control_de_peso boolean,
1073 imagen character varying(255),
1074 activo boolean,
1075 created_at timestamp with time zone NOT NULL,
1076 updated_at timestamp with time zone NOT NULL,
1077 clase_id integer NOT NULL,
1078 tipo_impuesto_id integer NOT NULL,
1079 unidad_id integer
1080);
1081
1082
1083ALTER TABLE productos OWNER TO postgres;
1084
1085--
1086-- TOC entry 246 (class 1259 OID 251898)
1087-- Name: productos_favoritos; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
1088--
1089
1090CREATE TABLE productos_favoritos (
1091 id integer NOT NULL,
1092 descripcion character varying(255),
1093 fecha character varying(255),
1094 orden integer,
1095 activo boolean,
1096 created_at timestamp with time zone NOT NULL,
1097 updated_at timestamp with time zone NOT NULL,
1098 producto_id integer
1099);
1100
1101
1102ALTER TABLE productos_favoritos OWNER TO postgres;
1103
1104--
1105-- TOC entry 245 (class 1259 OID 251896)
1106-- Name: productos_favoritos_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
1107--
1108
1109CREATE SEQUENCE productos_favoritos_id_seq
1110 START WITH 1
1111 INCREMENT BY 1
1112 NO MINVALUE
1113 NO MAXVALUE
1114 CACHE 1;
1115
1116
1117ALTER TABLE productos_favoritos_id_seq OWNER TO postgres;
1118
1119--
1120-- TOC entry 2757 (class 0 OID 0)
1121-- Dependencies: 245
1122-- Name: productos_favoritos_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
1123--
1124
1125ALTER SEQUENCE productos_favoritos_id_seq OWNED BY productos_favoritos.id;
1126
1127
1128--
1129-- TOC entry 219 (class 1259 OID 242170)
1130-- Name: productos_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
1131--
1132
1133CREATE SEQUENCE productos_id_seq
1134 START WITH 1
1135 INCREMENT BY 1
1136 NO MINVALUE
1137 NO MAXVALUE
1138 CACHE 1;
1139
1140
1141ALTER TABLE productos_id_seq OWNER TO postgres;
1142
1143--
1144-- TOC entry 2758 (class 0 OID 0)
1145-- Dependencies: 219
1146-- Name: productos_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
1147--
1148
1149ALTER SEQUENCE productos_id_seq OWNED BY productos.id;
1150
1151
1152--
1153-- TOC entry 220 (class 1259 OID 242172)
1154-- Name: puntos_emision; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
1155--
1156
1157CREATE TABLE puntos_emision (
1158 id integer NOT NULL,
1159 codigo character varying(255) NOT NULL,
1160 descripcion character varying(255),
1161 activo boolean,
1162 created_at timestamp with time zone NOT NULL,
1163 updated_at timestamp with time zone NOT NULL,
1164 sucursal_id integer
1165);
1166
1167
1168ALTER TABLE puntos_emision OWNER TO postgres;
1169
1170--
1171-- TOC entry 221 (class 1259 OID 242178)
1172-- Name: puntos_emision_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
1173--
1174
1175CREATE SEQUENCE puntos_emision_id_seq
1176 START WITH 1
1177 INCREMENT BY 1
1178 NO MINVALUE
1179 NO MAXVALUE
1180 CACHE 1;
1181
1182
1183ALTER TABLE puntos_emision_id_seq OWNER TO postgres;
1184
1185--
1186-- TOC entry 2759 (class 0 OID 0)
1187-- Dependencies: 221
1188-- Name: puntos_emision_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
1189--
1190
1191ALTER SEQUENCE puntos_emision_id_seq OWNED BY puntos_emision.id;
1192
1193
1194--
1195-- TOC entry 222 (class 1259 OID 242180)
1196-- Name: puntos_venta; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
1197--
1198
1199CREATE TABLE puntos_venta (
1200 id integer NOT NULL,
1201 descripcion character varying(255),
1202 numero_desde integer,
1203 numero_hasta integer,
1204 numero_actual integer,
1205 activo boolean,
1206 created_at timestamp with time zone NOT NULL,
1207 updated_at timestamp with time zone NOT NULL,
1208 comprobante_id integer,
1209 punto_emision_id integer,
1210 timbrado_id integer
1211);
1212
1213
1214ALTER TABLE puntos_venta OWNER TO postgres;
1215
1216--
1217-- TOC entry 223 (class 1259 OID 242183)
1218-- Name: puntos_venta_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
1219--
1220
1221CREATE SEQUENCE puntos_venta_id_seq
1222 START WITH 1
1223 INCREMENT BY 1
1224 NO MINVALUE
1225 NO MAXVALUE
1226 CACHE 1;
1227
1228
1229ALTER TABLE puntos_venta_id_seq OWNER TO postgres;
1230
1231--
1232-- TOC entry 2760 (class 0 OID 0)
1233-- Dependencies: 223
1234-- Name: puntos_venta_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
1235--
1236
1237ALTER SEQUENCE puntos_venta_id_seq OWNED BY puntos_venta.id;
1238
1239
1240--
1241-- TOC entry 224 (class 1259 OID 242185)
1242-- Name: roles; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
1243--
1244
1245CREATE TABLE roles (
1246 id integer NOT NULL,
1247 nombre character varying(255),
1248 descripcion character varying(255),
1249 activo boolean,
1250 created_at timestamp with time zone NOT NULL,
1251 updated_at timestamp with time zone NOT NULL
1252);
1253
1254
1255ALTER TABLE roles OWNER TO postgres;
1256
1257--
1258-- TOC entry 225 (class 1259 OID 242191)
1259-- Name: roles_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
1260--
1261
1262CREATE SEQUENCE roles_id_seq
1263 START WITH 1
1264 INCREMENT BY 1
1265 NO MINVALUE
1266 NO MAXVALUE
1267 CACHE 1;
1268
1269
1270ALTER TABLE roles_id_seq OWNER TO postgres;
1271
1272--
1273-- TOC entry 2761 (class 0 OID 0)
1274-- Dependencies: 225
1275-- Name: roles_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
1276--
1277
1278ALTER SEQUENCE roles_id_seq OWNED BY roles.id;
1279
1280
1281--
1282-- TOC entry 226 (class 1259 OID 242193)
1283-- Name: roles_usuarios; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
1284--
1285
1286CREATE TABLE roles_usuarios (
1287 created_at timestamp with time zone NOT NULL,
1288 updated_at timestamp with time zone NOT NULL,
1289 rol_id integer NOT NULL,
1290 usuario_id integer NOT NULL
1291);
1292
1293
1294ALTER TABLE roles_usuarios OWNER TO postgres;
1295
1296--
1297-- TOC entry 227 (class 1259 OID 242196)
1298-- Name: sucursales; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
1299--
1300
1301CREATE TABLE sucursales (
1302 id integer NOT NULL,
1303 codigo character varying(255) NOT NULL,
1304 nombre character varying(255),
1305 activo boolean,
1306 created_at timestamp with time zone NOT NULL,
1307 updated_at timestamp with time zone NOT NULL
1308);
1309
1310
1311ALTER TABLE sucursales OWNER TO postgres;
1312
1313--
1314-- TOC entry 228 (class 1259 OID 242202)
1315-- Name: sucursales_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
1316--
1317
1318CREATE SEQUENCE sucursales_id_seq
1319 START WITH 1
1320 INCREMENT BY 1
1321 NO MINVALUE
1322 NO MAXVALUE
1323 CACHE 1;
1324
1325
1326ALTER TABLE sucursales_id_seq OWNER TO postgres;
1327
1328--
1329-- TOC entry 2762 (class 0 OID 0)
1330-- Dependencies: 228
1331-- Name: sucursales_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
1332--
1333
1334ALTER SEQUENCE sucursales_id_seq OWNED BY sucursales.id;
1335
1336
1337--
1338-- TOC entry 229 (class 1259 OID 242204)
1339-- Name: tarjetas; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
1340--
1341
1342CREATE TABLE tarjetas (
1343 id integer NOT NULL,
1344 nombre character varying(255),
1345 activo boolean,
1346 created_at timestamp with time zone NOT NULL,
1347 updated_at timestamp with time zone NOT NULL
1348);
1349
1350
1351ALTER TABLE tarjetas OWNER TO postgres;
1352
1353--
1354-- TOC entry 230 (class 1259 OID 242207)
1355-- Name: tarjetas_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
1356--
1357
1358CREATE SEQUENCE tarjetas_id_seq
1359 START WITH 1
1360 INCREMENT BY 1
1361 NO MINVALUE
1362 NO MAXVALUE
1363 CACHE 1;
1364
1365
1366ALTER TABLE tarjetas_id_seq OWNER TO postgres;
1367
1368--
1369-- TOC entry 2763 (class 0 OID 0)
1370-- Dependencies: 230
1371-- Name: tarjetas_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
1372--
1373
1374ALTER SEQUENCE tarjetas_id_seq OWNED BY tarjetas.id;
1375
1376
1377--
1378-- TOC entry 231 (class 1259 OID 242209)
1379-- Name: timbrados; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
1380--
1381
1382CREATE TABLE timbrados (
1383 id integer NOT NULL,
1384 numero character varying(255) NOT NULL,
1385 fecha_inicial character varying(255),
1386 fecha_final character varying(255),
1387 activo boolean,
1388 created_at timestamp with time zone NOT NULL,
1389 updated_at timestamp with time zone NOT NULL,
1390 clase_id integer,
1391 sucursal_id integer
1392);
1393
1394
1395ALTER TABLE timbrados OWNER TO postgres;
1396
1397--
1398-- TOC entry 232 (class 1259 OID 242215)
1399-- Name: timbrados_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
1400--
1401
1402CREATE SEQUENCE timbrados_id_seq
1403 START WITH 1
1404 INCREMENT BY 1
1405 NO MINVALUE
1406 NO MAXVALUE
1407 CACHE 1;
1408
1409
1410ALTER TABLE timbrados_id_seq OWNER TO postgres;
1411
1412--
1413-- TOC entry 2764 (class 0 OID 0)
1414-- Dependencies: 232
1415-- Name: timbrados_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
1416--
1417
1418ALTER SEQUENCE timbrados_id_seq OWNED BY timbrados.id;
1419
1420
1421--
1422-- TOC entry 233 (class 1259 OID 242217)
1423-- Name: tipo_tipos; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
1424--
1425
1426CREATE TABLE tipo_tipos (
1427 id integer NOT NULL,
1428 nombre character varying(255),
1429 activo boolean,
1430 created_at timestamp with time zone NOT NULL,
1431 updated_at timestamp with time zone NOT NULL
1432);
1433
1434
1435ALTER TABLE tipo_tipos OWNER TO postgres;
1436
1437--
1438-- TOC entry 234 (class 1259 OID 242220)
1439-- Name: tipo_tipos_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
1440--
1441
1442CREATE SEQUENCE tipo_tipos_id_seq
1443 START WITH 1
1444 INCREMENT BY 1
1445 NO MINVALUE
1446 NO MAXVALUE
1447 CACHE 1;
1448
1449
1450ALTER TABLE tipo_tipos_id_seq OWNER TO postgres;
1451
1452--
1453-- TOC entry 2765 (class 0 OID 0)
1454-- Dependencies: 234
1455-- Name: tipo_tipos_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
1456--
1457
1458ALTER SEQUENCE tipo_tipos_id_seq OWNED BY tipo_tipos.id;
1459
1460
1461--
1462-- TOC entry 235 (class 1259 OID 242222)
1463-- Name: tipos; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
1464--
1465
1466CREATE TABLE tipos (
1467 id integer NOT NULL,
1468 valor character varying(255),
1469 activo boolean,
1470 created_at timestamp with time zone NOT NULL,
1471 updated_at timestamp with time zone NOT NULL,
1472 tipo_tipo_id integer
1473);
1474
1475
1476ALTER TABLE tipos OWNER TO postgres;
1477
1478--
1479-- TOC entry 236 (class 1259 OID 242225)
1480-- Name: tipos_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
1481--
1482
1483CREATE SEQUENCE tipos_id_seq
1484 START WITH 1
1485 INCREMENT BY 1
1486 NO MINVALUE
1487 NO MAXVALUE
1488 CACHE 1;
1489
1490
1491ALTER TABLE tipos_id_seq OWNER TO postgres;
1492
1493--
1494-- TOC entry 2766 (class 0 OID 0)
1495-- Dependencies: 236
1496-- Name: tipos_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
1497--
1498
1499ALTER SEQUENCE tipos_id_seq OWNED BY tipos.id;
1500
1501
1502--
1503-- TOC entry 250 (class 1259 OID 251945)
1504-- Name: unidades; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
1505--
1506
1507CREATE TABLE unidades (
1508 id integer NOT NULL,
1509 nombre character varying(255),
1510 conversion double precision,
1511 created_at timestamp with time zone NOT NULL,
1512 updated_at timestamp with time zone NOT NULL,
1513 unidad_base_id integer
1514);
1515
1516
1517ALTER TABLE unidades OWNER TO postgres;
1518
1519--
1520-- TOC entry 249 (class 1259 OID 251943)
1521-- Name: unidades_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
1522--
1523
1524CREATE SEQUENCE unidades_id_seq
1525 START WITH 1
1526 INCREMENT BY 1
1527 NO MINVALUE
1528 NO MAXVALUE
1529 CACHE 1;
1530
1531
1532ALTER TABLE unidades_id_seq OWNER TO postgres;
1533
1534--
1535-- TOC entry 2767 (class 0 OID 0)
1536-- Dependencies: 249
1537-- Name: unidades_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
1538--
1539
1540ALTER SEQUENCE unidades_id_seq OWNED BY unidades.id;
1541
1542
1543--
1544-- TOC entry 237 (class 1259 OID 242227)
1545-- Name: usuarios; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
1546--
1547
1548CREATE TABLE usuarios (
1549 id integer NOT NULL,
1550 username character varying(255) NOT NULL,
1551 password character varying(255) NOT NULL,
1552 activo boolean,
1553 nombre character varying(255) NOT NULL,
1554 apellido character varying(255) NOT NULL,
1555 mail character varying(255),
1556 foto character varying(255),
1557 created_at timestamp with time zone NOT NULL,
1558 updated_at timestamp with time zone NOT NULL
1559);
1560
1561
1562ALTER TABLE usuarios OWNER TO postgres;
1563
1564--
1565-- TOC entry 238 (class 1259 OID 242233)
1566-- Name: usuarios_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
1567--
1568
1569CREATE SEQUENCE usuarios_id_seq
1570 START WITH 1
1571 INCREMENT BY 1
1572 NO MINVALUE
1573 NO MAXVALUE
1574 CACHE 1;
1575
1576
1577ALTER TABLE usuarios_id_seq OWNER TO postgres;
1578
1579--
1580-- TOC entry 2768 (class 0 OID 0)
1581-- Dependencies: 238
1582-- Name: usuarios_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
1583--
1584
1585ALTER SEQUENCE usuarios_id_seq OWNED BY usuarios.id;
1586
1587
1588--
1589-- TOC entry 239 (class 1259 OID 242235)
1590-- Name: ventas; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
1591--
1592
1593CREATE TABLE ventas (
1594 id integer NOT NULL,
1595 fecha character varying(255),
1596 total double precision DEFAULT 0,
1597 activo boolean,
1598 numero_documento character varying(255),
1599 razon_social character varying(255),
1600 numero_factura character varying(255),
1601 numero_venta integer,
1602 estado character varying(255),
1603 created_at timestamp with time zone NOT NULL,
1604 updated_at timestamp with time zone NOT NULL,
1605 apertura_id integer,
1606 almacen_id integer,
1607 cajero_id integer,
1608 cliente_id integer,
1609 punto_emision_id integer,
1610 sucursal_id integer,
1611 timbrado_id integer,
1612 vuelto double precision
1613);
1614
1615
1616ALTER TABLE ventas OWNER TO postgres;
1617
1618--
1619-- TOC entry 240 (class 1259 OID 242242)
1620-- Name: ventas_detalles; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
1621--
1622
1623CREATE TABLE ventas_detalles (
1624 id integer NOT NULL,
1625 cantidad double precision,
1626 devuelto boolean,
1627 activo boolean,
1628 identificador_compra character varying(255),
1629 total double precision,
1630 created_at timestamp with time zone NOT NULL,
1631 updated_at timestamp with time zone NOT NULL,
1632 credito_notum_id integer,
1633 ventum_id integer,
1634 producto_id integer,
1635 venta_id integer
1636);
1637
1638
1639ALTER TABLE ventas_detalles OWNER TO postgres;
1640
1641--
1642-- TOC entry 241 (class 1259 OID 242245)
1643-- Name: ventas_detalles_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
1644--
1645
1646CREATE SEQUENCE ventas_detalles_id_seq
1647 START WITH 1
1648 INCREMENT BY 1
1649 NO MINVALUE
1650 NO MAXVALUE
1651 CACHE 1;
1652
1653
1654ALTER TABLE ventas_detalles_id_seq OWNER TO postgres;
1655
1656--
1657-- TOC entry 2769 (class 0 OID 0)
1658-- Dependencies: 241
1659-- Name: ventas_detalles_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
1660--
1661
1662ALTER SEQUENCE ventas_detalles_id_seq OWNED BY ventas_detalles.id;
1663
1664
1665--
1666-- TOC entry 242 (class 1259 OID 242247)
1667-- Name: ventas_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
1668--
1669
1670CREATE SEQUENCE ventas_id_seq
1671 START WITH 1
1672 INCREMENT BY 1
1673 NO MINVALUE
1674 NO MAXVALUE
1675 CACHE 1;
1676
1677
1678ALTER TABLE ventas_id_seq OWNER TO postgres;
1679
1680--
1681-- TOC entry 2770 (class 0 OID 0)
1682-- Dependencies: 242
1683-- Name: ventas_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
1684--
1685
1686ALTER SEQUENCE ventas_id_seq OWNED BY ventas.id;
1687
1688
1689--
1690-- TOC entry 248 (class 1259 OID 251917)
1691-- Name: ventas_impuestos; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
1692--
1693
1694CREATE TABLE ventas_impuestos (
1695 id integer NOT NULL,
1696 monto double precision,
1697 created_at timestamp with time zone NOT NULL,
1698 updated_at timestamp with time zone NOT NULL,
1699 venta_id integer,
1700 tipo_impuesto_id integer,
1701 gravada double precision
1702);
1703
1704
1705ALTER TABLE ventas_impuestos OWNER TO postgres;
1706
1707--
1708-- TOC entry 247 (class 1259 OID 251915)
1709-- Name: ventas_impuestos_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
1710--
1711
1712CREATE SEQUENCE ventas_impuestos_id_seq
1713 START WITH 1
1714 INCREMENT BY 1
1715 NO MINVALUE
1716 NO MAXVALUE
1717 CACHE 1;
1718
1719
1720ALTER TABLE ventas_impuestos_id_seq OWNER TO postgres;
1721
1722--
1723-- TOC entry 2771 (class 0 OID 0)
1724-- Dependencies: 247
1725-- Name: ventas_impuestos_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
1726--
1727
1728ALTER SEQUENCE ventas_impuestos_id_seq OWNED BY ventas_impuestos.id;
1729
1730
1731--
1732-- TOC entry 2350 (class 2604 OID 242249)
1733-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
1734--
1735
1736ALTER TABLE ONLY almacenes ALTER COLUMN id SET DEFAULT nextval('almacenes_id_seq'::regclass);
1737
1738
1739--
1740-- TOC entry 2390 (class 2604 OID 242713)
1741-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
1742--
1743
1744ALTER TABLE ONLY aperturas ALTER COLUMN id SET DEFAULT nextval('aperturas_id_seq'::regclass);
1745
1746
1747--
1748-- TOC entry 2353 (class 2604 OID 242251)
1749-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
1750--
1751
1752ALTER TABLE ONLY bancos ALTER COLUMN id SET DEFAULT nextval('bancos_id_seq'::regclass);
1753
1754
1755--
1756-- TOC entry 2354 (class 2604 OID 242252)
1757-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
1758--
1759
1760ALTER TABLE ONLY cajas ALTER COLUMN id SET DEFAULT nextval('cajas_id_seq'::regclass);
1761
1762
1763--
1764-- TOC entry 2355 (class 2604 OID 242253)
1765-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
1766--
1767
1768ALTER TABLE ONLY clientes ALTER COLUMN id SET DEFAULT nextval('clientes_id_seq'::regclass);
1769
1770
1771--
1772-- TOC entry 2356 (class 2604 OID 242254)
1773-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
1774--
1775
1776ALTER TABLE ONLY comprobantes ALTER COLUMN id SET DEFAULT nextval('comprobantes_id_seq'::regclass);
1777
1778
1779--
1780-- TOC entry 2357 (class 2604 OID 242255)
1781-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
1782--
1783
1784ALTER TABLE ONLY cotizaciones ALTER COLUMN id SET DEFAULT nextval('cotizaciones_id_seq'::regclass);
1785
1786
1787--
1788-- TOC entry 2358 (class 2604 OID 242256)
1789-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
1790--
1791
1792ALTER TABLE ONLY credito_nota ALTER COLUMN id SET DEFAULT nextval('credito_nota_id_seq'::regclass);
1793
1794
1795--
1796-- TOC entry 2359 (class 2604 OID 242257)
1797-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
1798--
1799
1800ALTER TABLE ONLY credito_nota_aplicada ALTER COLUMN id SET DEFAULT nextval('credito_nota_aplicada_id_seq'::regclass);
1801
1802
1803--
1804-- TOC entry 2360 (class 2604 OID 242258)
1805-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
1806--
1807
1808ALTER TABLE ONLY denominaciones ALTER COLUMN id SET DEFAULT nextval('denominaciones_id_seq'::regclass);
1809
1810
1811--
1812-- TOC entry 2361 (class 2604 OID 242259)
1813-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
1814--
1815
1816ALTER TABLE ONLY emisores ALTER COLUMN id SET DEFAULT nextval('emisores_id_seq'::regclass);
1817
1818
1819--
1820-- TOC entry 2362 (class 2604 OID 242260)
1821-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
1822--
1823
1824ALTER TABLE ONLY extracciones ALTER COLUMN id SET DEFAULT nextval('extracciones_id_seq'::regclass);
1825
1826
1827--
1828-- TOC entry 2363 (class 2604 OID 242261)
1829-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
1830--
1831
1832ALTER TABLE ONLY extracciones_detalles ALTER COLUMN id SET DEFAULT nextval('extracciones_detalles_id_seq'::regclass);
1833
1834
1835--
1836-- TOC entry 2364 (class 2604 OID 242262)
1837-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
1838--
1839
1840ALTER TABLE ONLY familias ALTER COLUMN id SET DEFAULT nextval('familias_id_seq'::regclass);
1841
1842
1843--
1844-- TOC entry 2366 (class 2604 OID 242263)
1845-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
1846--
1847
1848ALTER TABLE ONLY historicos_precios ALTER COLUMN id SET DEFAULT nextval('historicos_precios_id_seq'::regclass);
1849
1850
1851--
1852-- TOC entry 2367 (class 2604 OID 242264)
1853-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
1854--
1855
1856ALTER TABLE ONLY impuestos ALTER COLUMN id SET DEFAULT nextval('impuestos_id_seq'::regclass);
1857
1858
1859--
1860-- TOC entry 2368 (class 2604 OID 242265)
1861-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
1862--
1863
1864ALTER TABLE ONLY mensajes ALTER COLUMN id SET DEFAULT nextval('mensajes_id_seq'::regclass);
1865
1866
1867--
1868-- TOC entry 2369 (class 2604 OID 242266)
1869-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
1870--
1871
1872ALTER TABLE ONLY monedas ALTER COLUMN id SET DEFAULT nextval('monedas_id_seq'::regclass);
1873
1874
1875--
1876-- TOC entry 2370 (class 2604 OID 242267)
1877-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
1878--
1879
1880ALTER TABLE ONLY movimientos ALTER COLUMN id SET DEFAULT nextval('movimientos_id_seq'::regclass);
1881
1882
1883--
1884-- TOC entry 2371 (class 2604 OID 242268)
1885-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
1886--
1887
1888ALTER TABLE ONLY pagos ALTER COLUMN id SET DEFAULT nextval('pagos_id_seq'::regclass);
1889
1890
1891--
1892-- TOC entry 2372 (class 2604 OID 242269)
1893-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
1894--
1895
1896ALTER TABLE ONLY permisos ALTER COLUMN id SET DEFAULT nextval('permisos_id_seq'::regclass);
1897
1898
1899--
1900-- TOC entry 2373 (class 2604 OID 242270)
1901-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
1902--
1903
1904ALTER TABLE ONLY posts ALTER COLUMN id SET DEFAULT nextval('posts_id_seq'::regclass);
1905
1906
1907--
1908-- TOC entry 2374 (class 2604 OID 242271)
1909-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
1910--
1911
1912ALTER TABLE ONLY procesadoras ALTER COLUMN id SET DEFAULT nextval('procesadoras_id_seq'::regclass);
1913
1914
1915--
1916-- TOC entry 2377 (class 2604 OID 242272)
1917-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
1918--
1919
1920ALTER TABLE ONLY productos ALTER COLUMN id SET DEFAULT nextval('productos_id_seq'::regclass);
1921
1922
1923--
1924-- TOC entry 2391 (class 2604 OID 251901)
1925-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
1926--
1927
1928ALTER TABLE ONLY productos_favoritos ALTER COLUMN id SET DEFAULT nextval('productos_favoritos_id_seq'::regclass);
1929
1930
1931--
1932-- TOC entry 2378 (class 2604 OID 242273)
1933-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
1934--
1935
1936ALTER TABLE ONLY puntos_emision ALTER COLUMN id SET DEFAULT nextval('puntos_emision_id_seq'::regclass);
1937
1938
1939--
1940-- TOC entry 2379 (class 2604 OID 242274)
1941-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
1942--
1943
1944ALTER TABLE ONLY puntos_venta ALTER COLUMN id SET DEFAULT nextval('puntos_venta_id_seq'::regclass);
1945
1946
1947--
1948-- TOC entry 2380 (class 2604 OID 242275)
1949-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
1950--
1951
1952ALTER TABLE ONLY roles ALTER COLUMN id SET DEFAULT nextval('roles_id_seq'::regclass);
1953
1954
1955--
1956-- TOC entry 2381 (class 2604 OID 242276)
1957-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
1958--
1959
1960ALTER TABLE ONLY sucursales ALTER COLUMN id SET DEFAULT nextval('sucursales_id_seq'::regclass);
1961
1962
1963--
1964-- TOC entry 2382 (class 2604 OID 242277)
1965-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
1966--
1967
1968ALTER TABLE ONLY tarjetas ALTER COLUMN id SET DEFAULT nextval('tarjetas_id_seq'::regclass);
1969
1970
1971--
1972-- TOC entry 2383 (class 2604 OID 242278)
1973-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
1974--
1975
1976ALTER TABLE ONLY timbrados ALTER COLUMN id SET DEFAULT nextval('timbrados_id_seq'::regclass);
1977
1978
1979--
1980-- TOC entry 2384 (class 2604 OID 242279)
1981-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
1982--
1983
1984ALTER TABLE ONLY tipo_tipos ALTER COLUMN id SET DEFAULT nextval('tipo_tipos_id_seq'::regclass);
1985
1986
1987--
1988-- TOC entry 2385 (class 2604 OID 242280)
1989-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
1990--
1991
1992ALTER TABLE ONLY tipos ALTER COLUMN id SET DEFAULT nextval('tipos_id_seq'::regclass);
1993
1994
1995--
1996-- TOC entry 2393 (class 2604 OID 251948)
1997-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
1998--
1999
2000ALTER TABLE ONLY unidades ALTER COLUMN id SET DEFAULT nextval('unidades_id_seq'::regclass);
2001
2002
2003--
2004-- TOC entry 2386 (class 2604 OID 242281)
2005-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
2006--
2007
2008ALTER TABLE ONLY usuarios ALTER COLUMN id SET DEFAULT nextval('usuarios_id_seq'::regclass);
2009
2010
2011--
2012-- TOC entry 2388 (class 2604 OID 242282)
2013-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
2014--
2015
2016ALTER TABLE ONLY ventas ALTER COLUMN id SET DEFAULT nextval('ventas_id_seq'::regclass);
2017
2018
2019--
2020-- TOC entry 2389 (class 2604 OID 242283)
2021-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
2022--
2023
2024ALTER TABLE ONLY ventas_detalles ALTER COLUMN id SET DEFAULT nextval('ventas_detalles_id_seq'::regclass);
2025
2026
2027--
2028-- TOC entry 2392 (class 2604 OID 251920)
2029-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
2030--
2031
2032ALTER TABLE ONLY ventas_impuestos ALTER COLUMN id SET DEFAULT nextval('ventas_impuestos_id_seq'::regclass);
2033
2034
2035--
2036-- TOC entry 2647 (class 0 OID 241987)
2037-- Dependencies: 172
2038-- Data for Name: almacenes; Type: TABLE DATA; Schema: public; Owner: postgres
2039--
2040
2041INSERT INTO almacenes VALUES (1, 'Almacen Limpio', 'ALMLIMP', true, '2017-10-09 18:30:34.495-03', '2017-10-09 18:30:34.495-03');
2042INSERT INTO almacenes VALUES (2, 'Almacen 2', 'a', true, '2018-01-29 14:42:20.084-03', '2018-01-29 14:42:20.084-03');
2043
2044
2045--
2046-- TOC entry 2772 (class 0 OID 0)
2047-- Dependencies: 173
2048-- Name: almacenes_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
2049--
2050
2051SELECT pg_catalog.setval('almacenes_id_seq', 2, true);
2052
2053
2054--
2055-- TOC entry 2649 (class 0 OID 241995)
2056-- Dependencies: 174
2057-- Data for Name: almacenes_productos; Type: TABLE DATA; Schema: public; Owner: postgres
2058--
2059
2060INSERT INTO almacenes_productos VALUES (873, true, '2017-10-09 11:07:11.821-03', '2018-01-30 22:14:00.254-03', 1, 1);
2061INSERT INTO almacenes_productos VALUES (298, true, '2018-01-15 20:19:08.138-03', '2018-01-31 13:55:28.293-03', 1, 3);
2062
2063
2064--
2065-- TOC entry 2719 (class 0 OID 242710)
2066-- Dependencies: 244
2067-- Data for Name: aperturas; Type: TABLE DATA; Schema: public; Owner: postgres
2068--
2069
2070INSERT INTO aperturas VALUES (1, '2017/10/12 21:10:15', '2017-10-12 21:23:22.899-03', '10000', false, NULL, '2017-10-12 21:23:15.189-03', '2017-10-12 21:23:22.899-03', 1, 1);
2071INSERT INTO aperturas VALUES (17, '2018/01/22 12:22:06', '2018-01-22 14:50:25.4-03', '10000', false, NULL, '2018-01-22 12:22:06.474-03', '2018-01-22 14:50:25.401-03', 1, 1);
2072INSERT INTO aperturas VALUES (18, '2018/01/22 14:50:40', NULL, '10000', true, NULL, '2018-01-22 14:50:40.717-03', '2018-01-22 14:50:40.726-03', 1, 1);
2073INSERT INTO aperturas VALUES (2, '2017/10/12 21:10:41', '2017-10-12 21:32:56.212-03', '10000', false, NULL, '2017-10-12 21:24:41.173-03', '2017-10-12 21:32:56.213-03', 1, 1);
2074INSERT INTO aperturas VALUES (3, '2017/10/12 21:10:26', '2017-10-12 21:36:30.239-03', '10000', false, NULL, '2017-10-12 21:36:26.198-03', '2017-10-12 21:36:30.239-03', 1, 1);
2075INSERT INTO aperturas VALUES (4, '2017/10/12 21:10:31', '2017-10-12 23:25:58.231-03', '10000', false, NULL, '2017-10-12 21:42:31.836-03', '2017-10-12 23:25:58.232-03', 1, 1);
2076INSERT INTO aperturas VALUES (5, '2017/10/12 23:10:05', '2017-10-13 10:45:41.567-03', '10000', false, NULL, '2017-10-12 23:26:05.035-03', '2017-10-13 10:45:41.568-03', 1, 1);
2077INSERT INTO aperturas VALUES (6, '2017/10/13 10:10:52', '2017-10-14 12:38:27.254-03', '10000', false, NULL, '2017-10-13 10:45:52.387-03', '2017-10-14 12:38:27.256-03', 1, 1);
2078INSERT INTO aperturas VALUES (7, '2017/10/14 13:03:45', '2017-10-16 14:07:44.496-03', '10000', false, NULL, '2017-10-14 13:03:45.575-03', '2017-10-16 14:07:44.496-03', 1, 1);
2079INSERT INTO aperturas VALUES (8, '2017/10/16 14:16:57', '2017-10-16 14:31:45.771-03', '100000', false, NULL, '2017-10-16 14:16:57.933-03', '2017-10-16 14:31:45.771-03', 1, 1);
2080INSERT INTO aperturas VALUES (9, '2017/10/16 14:32:30', '2017-10-29 23:55:54.195-03', '10000', false, NULL, '2017-10-16 14:32:30.028-03', '2017-10-29 23:55:54.196-03', 1, 1);
2081INSERT INTO aperturas VALUES (10, '2017/10/29 23:57:10', '2017-12-26 13:53:52.146-03', '10000', false, NULL, '2017-10-29 23:57:10.834-03', '2017-12-26 13:53:52.147-03', 1, 1);
2082INSERT INTO aperturas VALUES (11, '2017/12/26 13:53:57', '2017-12-30 17:51:29.661-03', '10000', false, NULL, '2017-12-26 13:53:57.995-03', '2017-12-30 17:51:29.666-03', 1, 1);
2083INSERT INTO aperturas VALUES (12, '2017/12/30 17:51:49', '2018-01-04 13:33:24.658-03', '10000', false, NULL, '2017-12-30 17:51:49.112-03', '2018-01-04 13:33:24.662-03', 1, 1);
2084INSERT INTO aperturas VALUES (13, '2018/01/04 18:19:23', '2018-01-22 12:17:59.881-03', '10000', false, NULL, '2018-01-04 18:19:23.345-03', '2018-01-22 12:17:59.882-03', 1, 1);
2085INSERT INTO aperturas VALUES (14, '2018/01/22 12:18:06', '2018-01-22 12:20:12.826-03', '10000', false, NULL, '2018-01-22 12:18:06.978-03', '2018-01-22 12:20:12.826-03', 1, 1);
2086INSERT INTO aperturas VALUES (15, '2018/01/22 12:20:18', '2018-01-22 12:20:48.157-03', '10000', false, NULL, '2018-01-22 12:20:18.294-03', '2018-01-22 12:20:48.157-03', 1, 1);
2087INSERT INTO aperturas VALUES (16, '2018/01/22 12:21:49', '2018-01-22 12:21:59.444-03', '10000', false, NULL, '2018-01-22 12:21:49.624-03', '2018-01-22 12:21:59.444-03', 1, 1);
2088
2089
2090--
2091-- TOC entry 2773 (class 0 OID 0)
2092-- Dependencies: 243
2093-- Name: aperturas_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
2094--
2095
2096SELECT pg_catalog.setval('aperturas_id_seq', 18, true);
2097
2098
2099--
2100-- TOC entry 2650 (class 0 OID 242008)
2101-- Dependencies: 175
2102-- Data for Name: bancos; Type: TABLE DATA; Schema: public; Owner: postgres
2103--
2104
2105
2106
2107--
2108-- TOC entry 2774 (class 0 OID 0)
2109-- Dependencies: 176
2110-- Name: bancos_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
2111--
2112
2113SELECT pg_catalog.setval('bancos_id_seq', 1, false);
2114
2115
2116--
2117-- TOC entry 2652 (class 0 OID 242013)
2118-- Dependencies: 177
2119-- Data for Name: cajas; Type: TABLE DATA; Schema: public; Owner: postgres
2120--
2121
2122INSERT INTO cajas VALUES (1, '1', 'caja-1', true, '2017-10-09 18:34:18.935-03', '2017-10-09 18:34:18.935-03', 1, 1);
2123
2124
2125--
2126-- TOC entry 2775 (class 0 OID 0)
2127-- Dependencies: 178
2128-- Name: cajas_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
2129--
2130
2131SELECT pg_catalog.setval('cajas_id_seq', 1, true);
2132
2133
2134--
2135-- TOC entry 2654 (class 0 OID 242021)
2136-- Dependencies: 179
2137-- Data for Name: clientes; Type: TABLE DATA; Schema: public; Owner: postgres
2138--
2139
2140INSERT INTO clientes VALUES (2, 'Javier Perez', '4759528', 'Mi casa', 'javierppf@gmail.com', true, '2017-10-16 14:26:48.989896-03', '2017-10-16 14:26:48.989896-03', 14, 12);
2141INSERT INTO clientes VALUES (1, 'SIN NOMBRE', 'XXX', NULL, NULL, true, '2017-03-17 11:11:27.213-03', '2017-03-17 11:11:27.213-03', 14, 12);
2142
2143
2144--
2145-- TOC entry 2776 (class 0 OID 0)
2146-- Dependencies: 180
2147-- Name: clientes_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
2148--
2149
2150SELECT pg_catalog.setval('clientes_id_seq', 1, true);
2151
2152
2153--
2154-- TOC entry 2656 (class 0 OID 242029)
2155-- Dependencies: 181
2156-- Data for Name: comprobantes; Type: TABLE DATA; Schema: public; Owner: postgres
2157--
2158
2159INSERT INTO comprobantes VALUES (1, 'Comprobante factura (1)', true, '2017-10-09 18:12:33.085-03', '2017-10-09 18:12:33.085-03', 2, 3, NULL);
2160
2161
2162--
2163-- TOC entry 2777 (class 0 OID 0)
2164-- Dependencies: 182
2165-- Name: comprobantes_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
2166--
2167
2168SELECT pg_catalog.setval('comprobantes_id_seq', 1, true);
2169
2170
2171--
2172-- TOC entry 2658 (class 0 OID 242034)
2173-- Dependencies: 183
2174-- Data for Name: cotizaciones; Type: TABLE DATA; Schema: public; Owner: postgres
2175--
2176
2177
2178
2179--
2180-- TOC entry 2778 (class 0 OID 0)
2181-- Dependencies: 184
2182-- Name: cotizaciones_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
2183--
2184
2185SELECT pg_catalog.setval('cotizaciones_id_seq', 1, false);
2186
2187
2188--
2189-- TOC entry 2660 (class 0 OID 242042)
2190-- Dependencies: 185
2191-- Data for Name: credito_nota; Type: TABLE DATA; Schema: public; Owner: postgres
2192--
2193
2194
2195
2196--
2197-- TOC entry 2661 (class 0 OID 242048)
2198-- Dependencies: 186
2199-- Data for Name: credito_nota_aplicada; Type: TABLE DATA; Schema: public; Owner: postgres
2200--
2201
2202
2203
2204--
2205-- TOC entry 2779 (class 0 OID 0)
2206-- Dependencies: 187
2207-- Name: credito_nota_aplicada_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
2208--
2209
2210SELECT pg_catalog.setval('credito_nota_aplicada_id_seq', 1, false);
2211
2212
2213--
2214-- TOC entry 2780 (class 0 OID 0)
2215-- Dependencies: 188
2216-- Name: credito_nota_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
2217--
2218
2219SELECT pg_catalog.setval('credito_nota_id_seq', 1, false);
2220
2221
2222--
2223-- TOC entry 2664 (class 0 OID 242058)
2224-- Dependencies: 189
2225-- Data for Name: denominaciones; Type: TABLE DATA; Schema: public; Owner: postgres
2226--
2227
2228INSERT INTO denominaciones VALUES (1, 'Cincuenta', '50', true, '2017-10-13 10:38:20.119042-03', '2017-10-13 10:38:20.119042-03', 1);
2229INSERT INTO denominaciones VALUES (2, 'Cien', '100', true, '2017-10-13 10:38:46.390831-03', '2017-10-13 10:38:46.390831-03', 1);
2230INSERT INTO denominaciones VALUES (3, 'Quinientos', '500', true, '2017-10-13 10:38:54.965761-03', '2017-10-13 10:38:54.965761-03', 1);
2231INSERT INTO denominaciones VALUES (4, 'Mil', '1.000', true, '2017-10-13 10:39:03.390449-03', '2017-10-13 10:39:03.390449-03', 1);
2232INSERT INTO denominaciones VALUES (5, 'Dos mil', '2.000', true, '2017-10-13 10:39:15.886314-03', '2017-10-13 10:39:15.886314-03', 1);
2233INSERT INTO denominaciones VALUES (6, 'Cinco mil', ' 5.000', true, '2017-10-13 10:39:29.461418-03', '2017-10-13 10:39:29.461418-03', 1);
2234INSERT INTO denominaciones VALUES (7, 'Diez mil', '10.000', true, '2017-10-13 10:39:40.596593-03', '2017-10-13 10:39:40.596593-03', 1);
2235INSERT INTO denominaciones VALUES (8, 'Veinte mil', '20.000', true, '2017-10-13 10:39:52.540914-03', '2017-10-13 10:39:52.540914-03', 1);
2236INSERT INTO denominaciones VALUES (9, 'Cincuenta mil', '50.000', true, '2017-10-13 10:40:04.972634-03', '2017-10-13 10:40:04.972634-03', 1);
2237INSERT INTO denominaciones VALUES (10, 'Cien mil', '100.000', true, '2017-10-13 10:40:18.011882-03', '2017-10-13 10:40:18.011882-03', 1);
2238
2239
2240--
2241-- TOC entry 2781 (class 0 OID 0)
2242-- Dependencies: 190
2243-- Name: denominaciones_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
2244--
2245
2246SELECT pg_catalog.setval('denominaciones_id_seq', 1, false);
2247
2248
2249--
2250-- TOC entry 2666 (class 0 OID 242066)
2251-- Dependencies: 191
2252-- Data for Name: emisores; Type: TABLE DATA; Schema: public; Owner: postgres
2253--
2254
2255
2256
2257--
2258-- TOC entry 2782 (class 0 OID 0)
2259-- Dependencies: 192
2260-- Name: emisores_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
2261--
2262
2263SELECT pg_catalog.setval('emisores_id_seq', 1, false);
2264
2265
2266--
2267-- TOC entry 2668 (class 0 OID 242071)
2268-- Dependencies: 193
2269-- Data for Name: extracciones; Type: TABLE DATA; Schema: public; Owner: postgres
2270--
2271
2272INSERT INTO extracciones VALUES (1, '2017/10/10 14:10:15 206', '1200000', true, '1', '2017-10-10 06:01:14.265-03', '2017-10-10 06:01:14.281-03', 1, 1, 23, 1);
2273INSERT INTO extracciones VALUES (2, '2017/10/10 14:10:27 293', '1000', true, '2', '2017-10-10 06:20:26.347-03', '2017-10-10 06:20:26.354-03', 1, 1, 20, 1);
2274INSERT INTO extracciones VALUES (3, '2018/01/02 16:01:28 854', '10000', true, '3', '2018-01-02 16:58:28.898-03', '2018-01-02 16:58:28.945-03', NULL, 1, 20, 1);
2275INSERT INTO extracciones VALUES (4, '2018/01/22 12:01:59 884', '10000', true, '4', '2018-01-22 12:11:59.895-03', '2018-01-22 12:11:59.923-03', NULL, 1, 20, 1);
2276
2277
2278--
2279-- TOC entry 2669 (class 0 OID 242077)
2280-- Dependencies: 194
2281-- Data for Name: extracciones_detalles; Type: TABLE DATA; Schema: public; Owner: postgres
2282--
2283
2284
2285
2286--
2287-- TOC entry 2783 (class 0 OID 0)
2288-- Dependencies: 195
2289-- Name: extracciones_detalles_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
2290--
2291
2292SELECT pg_catalog.setval('extracciones_detalles_id_seq', 1, false);
2293
2294
2295--
2296-- TOC entry 2784 (class 0 OID 0)
2297-- Dependencies: 196
2298-- Name: extracciones_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
2299--
2300
2301SELECT pg_catalog.setval('extracciones_id_seq', 4, true);
2302
2303
2304--
2305-- TOC entry 2672 (class 0 OID 242087)
2306-- Dependencies: 197
2307-- Data for Name: familias; Type: TABLE DATA; Schema: public; Owner: postgres
2308--
2309
2310
2311
2312--
2313-- TOC entry 2785 (class 0 OID 0)
2314-- Dependencies: 198
2315-- Name: familias_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
2316--
2317
2318SELECT pg_catalog.setval('familias_id_seq', 1, false);
2319
2320
2321--
2322-- TOC entry 2674 (class 0 OID 242095)
2323-- Dependencies: 199
2324-- Data for Name: historicos_precios; Type: TABLE DATA; Schema: public; Owner: postgres
2325--
2326
2327INSERT INTO historicos_precios VALUES (1, '2017/10/09 19:10:45', 'COSTO', 8000, NULL, '2017-10-09 11:07:11.841-03', '2017-10-09 11:07:11.849-03', 1, 1);
2328INSERT INTO historicos_precios VALUES (2, '2018/01/15 20:01:28', 'COSTO', 4500, NULL, '2018-01-15 20:16:47.512-03', '2018-01-15 20:16:47.52-03', 1, 2);
2329INSERT INTO historicos_precios VALUES (3, '2018/01/15 20:18:34', 'PRECIO', 4500, NULL, '2018-01-15 20:18:34.629-03', '2018-01-15 20:18:34.632-03', 3, NULL);
2330INSERT INTO historicos_precios VALUES (4, '2018/01/15 20:01:40', 'COSTO', 1000, NULL, '2018-01-15 20:19:08.235-03', '2018-01-15 20:19:08.24-03', 3, 3);
2331
2332
2333--
2334-- TOC entry 2786 (class 0 OID 0)
2335-- Dependencies: 200
2336-- Name: historicos_precios_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
2337--
2338
2339SELECT pg_catalog.setval('historicos_precios_id_seq', 4, true);
2340
2341
2342--
2343-- TOC entry 2676 (class 0 OID 242104)
2344-- Dependencies: 201
2345-- Data for Name: impuestos; Type: TABLE DATA; Schema: public; Owner: postgres
2346--
2347
2348INSERT INTO impuestos VALUES (1, 'IVA+', '10', true, '2017-03-10 11:07:17.14-03', '2017-03-10 11:07:17.14-03');
2349
2350
2351--
2352-- TOC entry 2787 (class 0 OID 0)
2353-- Dependencies: 202
2354-- Name: impuestos_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
2355--
2356
2357SELECT pg_catalog.setval('impuestos_id_seq', 1, true);
2358
2359
2360--
2361-- TOC entry 2678 (class 0 OID 242112)
2362-- Dependencies: 203
2363-- Data for Name: mensajes; Type: TABLE DATA; Schema: public; Owner: postgres
2364--
2365
2366
2367
2368--
2369-- TOC entry 2788 (class 0 OID 0)
2370-- Dependencies: 204
2371-- Name: mensajes_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
2372--
2373
2374SELECT pg_catalog.setval('mensajes_id_seq', 1, false);
2375
2376
2377--
2378-- TOC entry 2680 (class 0 OID 242120)
2379-- Dependencies: 205
2380-- Data for Name: monedas; Type: TABLE DATA; Schema: public; Owner: postgres
2381--
2382
2383INSERT INTO monedas VALUES (1, 'GuaranÃ', '₲', true, true, '2017-03-26 15:32:13.045-04', '2017-03-26 21:33:21.491-04');
2384INSERT INTO monedas VALUES (2, 'Dólar', '$', false, true, '2017-03-26 15:32:33.065-04', '2017-03-26 21:33:27.588-04');
2385INSERT INTO monedas VALUES (3, 'Euro', '€', false, true, '2017-03-26 15:32:56.968-04', '2017-03-26 15:32:56.968-04');
2386INSERT INTO monedas VALUES (4, 'Yen', 'Â¥', false, true, '2017-03-26 21:41:54.743-04', '2017-03-26 21:42:20.033-04');
2387INSERT INTO monedas VALUES (5, 'Libra esterlina', '£', false, true, '2017-03-26 21:45:53.125-04', '2017-03-26 21:46:08.152-04');
2388
2389
2390--
2391-- TOC entry 2789 (class 0 OID 0)
2392-- Dependencies: 206
2393-- Name: monedas_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
2394--
2395
2396SELECT pg_catalog.setval('monedas_id_seq', 5, true);
2397
2398
2399--
2400-- TOC entry 2682 (class 0 OID 242128)
2401-- Dependencies: 207
2402-- Data for Name: movimientos; Type: TABLE DATA; Schema: public; Owner: postgres
2403--
2404
2405INSERT INTO movimientos VALUES (1, '2017/10/09 19:10:45', true, 'Ingreso de Harina', '105', '8000', '2017-10-09 11:07:11.776-03', '2017-10-09 11:07:11.81-03', 10, 1, 1, NULL);
2406INSERT INTO movimientos VALUES (2, '2018/01/15 20:01:28', true, '', '1000', '4500', '2018-01-15 20:16:47.472-03', '2018-01-15 20:16:47.498-03', 10, 1, 1, NULL);
2407INSERT INTO movimientos VALUES (3, '2018/01/15 20:01:40', true, 'Ingreso de tomate', '300', '1000', '2018-01-15 20:19:08.103-03', '2018-01-15 20:19:08.126-03', 10, 3, 1, NULL);
2408
2409
2410--
2411-- TOC entry 2790 (class 0 OID 0)
2412-- Dependencies: 208
2413-- Name: movimientos_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
2414--
2415
2416SELECT pg_catalog.setval('movimientos_id_seq', 3, true);
2417
2418
2419--
2420-- TOC entry 2684 (class 0 OID 242136)
2421-- Dependencies: 209
2422-- Data for Name: pagos; Type: TABLE DATA; Schema: public; Owner: postgres
2423--
2424
2425INSERT INTO pagos VALUES (33, NULL, 30000, NULL, '2018-01-30 22:14:00.291-03', '2018-01-30 22:14:00.294-03', 16, 3461, 1, NULL);
2426INSERT INTO pagos VALUES (34, NULL, 5000, NULL, '2018-01-31 13:55:28.335-03', '2018-01-31 13:55:28.338-03', 16, 3462, 1, NULL);
2427
2428
2429--
2430-- TOC entry 2791 (class 0 OID 0)
2431-- Dependencies: 210
2432-- Name: pagos_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
2433--
2434
2435SELECT pg_catalog.setval('pagos_id_seq', 34, true);
2436
2437
2438--
2439-- TOC entry 2686 (class 0 OID 242141)
2440-- Dependencies: 211
2441-- Data for Name: permisos; Type: TABLE DATA; Schema: public; Owner: postgres
2442--
2443
2444INSERT INTO permisos VALUES (1, 'Permiso de cajero', 'Permiso de cajero', true, '2017-03-26 00:15:11.646-04', '2017-03-26 00:41:08.062-04');
2445INSERT INTO permisos VALUES (2, 'Permiso de administrador', 'Permiso de administrador', true, '2017-03-26 00:15:09.148-04', '2017-03-26 15:08:31.183-04');
2446INSERT INTO permisos VALUES (3, 'Permiso de usuario', 'Permiso de usuario', true, '2017-03-26 00:15:11.646-04', '2017-03-26 00:41:08.062-04');
2447INSERT INTO permisos VALUES (4, 'Cancelacion de Venta', 'Cancelacion de Venta', true, '2017-10-15 14:35:18.005287-03', '2017-10-15 14:35:18.005287-03');
2448INSERT INTO permisos VALUES (5, 'Extraccion', 'Extraccion', true, '2018-01-22 12:11:03.624717-03', '2018-01-22 12:11:03.624717-03');
2449INSERT INTO permisos VALUES (6, 'Cerrar Caja', 'Cerrar Caja', true, '2018-01-22 12:15:54.087121-03', '2018-01-22 12:15:54.087121-03');
2450INSERT INTO permisos VALUES (7, 'Abrir Caja', 'Abrir Caja', true, '2018-01-22 12:16:04.046753-03', '2018-01-22 12:16:04.046753-03');
2451INSERT INTO permisos VALUES (8, 'Nota de Credito', 'Nota de Credito', true, '2018-01-22 12:26:01.410849-03', '2018-01-22 12:26:01.410849-03');
2452
2453
2454--
2455-- TOC entry 2792 (class 0 OID 0)
2456-- Dependencies: 212
2457-- Name: permisos_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
2458--
2459
2460SELECT pg_catalog.setval('permisos_id_seq', 8, true);
2461
2462
2463--
2464-- TOC entry 2688 (class 0 OID 242149)
2465-- Dependencies: 213
2466-- Data for Name: permisos_roles; Type: TABLE DATA; Schema: public; Owner: postgres
2467--
2468
2469INSERT INTO permisos_roles VALUES ('2017-03-26 00:15:11.646-04', '2017-03-26 00:41:08.062-04', 1, 1);
2470INSERT INTO permisos_roles VALUES ('2017-03-26 00:15:11.646-04', '2017-03-26 00:41:08.062-04', 2, 1);
2471INSERT INTO permisos_roles VALUES ('2017-03-26 00:15:11.646-04', '2017-03-26 00:41:08.062-04', 3, 1);
2472INSERT INTO permisos_roles VALUES ('2017-10-15 14:35:49.852418-03', '2017-10-15 14:35:49.852418-03', 1, 2);
2473INSERT INTO permisos_roles VALUES ('2017-10-15 14:35:55.156008-03', '2017-10-15 14:35:55.156008-03', 2, 2);
2474INSERT INTO permisos_roles VALUES ('2017-10-15 14:36:00.107868-03', '2017-10-15 14:36:00.107868-03', 3, 2);
2475INSERT INTO permisos_roles VALUES ('2017-10-15 14:36:05.19561-03', '2017-10-15 14:36:05.19561-03', 4, 2);
2476INSERT INTO permisos_roles VALUES ('2018-01-22 12:11:29.651559-03', '2018-01-22 12:11:29.651559-03', 5, 2);
2477INSERT INTO permisos_roles VALUES ('2018-01-22 12:16:46.310707-03', '2018-01-22 12:16:46.310707-03', 6, 2);
2478INSERT INTO permisos_roles VALUES ('2018-01-22 12:16:50.086537-03', '2018-01-22 12:16:50.086537-03', 7, 2);
2479INSERT INTO permisos_roles VALUES ('2018-01-22 12:26:10.107638-03', '2018-01-22 12:26:10.107638-03', 8, 2);
2480
2481
2482--
2483-- TOC entry 2689 (class 0 OID 242152)
2484-- Dependencies: 214
2485-- Data for Name: posts; Type: TABLE DATA; Schema: public; Owner: postgres
2486--
2487
2488
2489
2490--
2491-- TOC entry 2793 (class 0 OID 0)
2492-- Dependencies: 215
2493-- Name: posts_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
2494--
2495
2496SELECT pg_catalog.setval('posts_id_seq', 1, false);
2497
2498
2499--
2500-- TOC entry 2691 (class 0 OID 242157)
2501-- Dependencies: 216
2502-- Data for Name: procesadoras; Type: TABLE DATA; Schema: public; Owner: postgres
2503--
2504
2505INSERT INTO procesadoras VALUES (1, 'Bancard', true, '2017-10-11 18:27:09.428-03', '2017-10-11 18:27:09.428-03');
2506INSERT INTO procesadoras VALUES (2, 'Infonet', true, '2017-10-11 18:27:14.686-03', '2017-10-11 18:27:14.686-03');
2507
2508
2509--
2510-- TOC entry 2794 (class 0 OID 0)
2511-- Dependencies: 217
2512-- Name: procesadoras_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
2513--
2514
2515SELECT pg_catalog.setval('procesadoras_id_seq', 2, true);
2516
2517
2518--
2519-- TOC entry 2693 (class 0 OID 242162)
2520-- Dependencies: 218
2521-- Data for Name: productos; Type: TABLE DATA; Schema: public; Owner: postgres
2522--
2523
2524INSERT INTO productos VALUES (3, '000002', '123456789', 'Tomate', 4500, 4500, false, '', true, '2018-01-15 20:18:34.609-03', '2018-01-29 21:54:14.009-03', 8, 1, 1);
2525INSERT INTO productos VALUES (1, '000001', '2000001000000', 'Harina', 5000, 4500, false, 'upload_82e88623ffc4de9ab38ea63129f5ffe1.jpg', true, '2017-10-09 17:55:23.273-03', '2018-01-29 12:58:23.968-03', 8, 1, 1);
2526
2527
2528--
2529-- TOC entry 2721 (class 0 OID 251898)
2530-- Dependencies: 246
2531-- Data for Name: productos_favoritos; Type: TABLE DATA; Schema: public; Owner: postgres
2532--
2533
2534
2535
2536--
2537-- TOC entry 2795 (class 0 OID 0)
2538-- Dependencies: 245
2539-- Name: productos_favoritos_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
2540--
2541
2542SELECT pg_catalog.setval('productos_favoritos_id_seq', 1, false);
2543
2544
2545--
2546-- TOC entry 2796 (class 0 OID 0)
2547-- Dependencies: 219
2548-- Name: productos_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
2549--
2550
2551SELECT pg_catalog.setval('productos_id_seq', 4, true);
2552
2553
2554--
2555-- TOC entry 2695 (class 0 OID 242172)
2556-- Dependencies: 220
2557-- Data for Name: puntos_emision; Type: TABLE DATA; Schema: public; Owner: postgres
2558--
2559
2560INSERT INTO puntos_emision VALUES (1, '001', 'Sucursal: Limpio - Punto Emisión: 001', true, '2017-10-09 18:07:49.223-03', '2017-10-09 18:07:49.242-03', 1);
2561
2562
2563--
2564-- TOC entry 2797 (class 0 OID 0)
2565-- Dependencies: 221
2566-- Name: puntos_emision_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
2567--
2568
2569SELECT pg_catalog.setval('puntos_emision_id_seq', 1, true);
2570
2571
2572--
2573-- TOC entry 2697 (class 0 OID 242180)
2574-- Dependencies: 222
2575-- Data for Name: puntos_venta; Type: TABLE DATA; Schema: public; Owner: postgres
2576--
2577
2578INSERT INTO puntos_venta VALUES (1, 'Timbrado: 00000001 - Sucursal: Limpio - Punto Emisión: 001', 1, 1000, 101, true, '2017-10-09 18:17:30.314-03', '2018-01-31 13:06:35.656-03', 1, 1, 1);
2579
2580
2581--
2582-- TOC entry 2798 (class 0 OID 0)
2583-- Dependencies: 223
2584-- Name: puntos_venta_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
2585--
2586
2587SELECT pg_catalog.setval('puntos_venta_id_seq', 1, true);
2588
2589
2590--
2591-- TOC entry 2699 (class 0 OID 242185)
2592-- Dependencies: 224
2593-- Data for Name: roles; Type: TABLE DATA; Schema: public; Owner: postgres
2594--
2595
2596INSERT INTO roles VALUES (1, 'Cajero', 'Rol de cajero', true, '2017-03-26 00:15:11.646-04', '2017-03-26 00:41:08.062-04');
2597INSERT INTO roles VALUES (2, 'Supervisor', 'Rol de supervisor', true, '2017-10-15 14:35:31.835509-03', '2017-10-15 14:35:31.835509-03');
2598
2599
2600--
2601-- TOC entry 2799 (class 0 OID 0)
2602-- Dependencies: 225
2603-- Name: roles_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
2604--
2605
2606SELECT pg_catalog.setval('roles_id_seq', 1, true);
2607
2608
2609--
2610-- TOC entry 2701 (class 0 OID 242193)
2611-- Dependencies: 226
2612-- Data for Name: roles_usuarios; Type: TABLE DATA; Schema: public; Owner: postgres
2613--
2614
2615INSERT INTO roles_usuarios VALUES ('2017-03-26 00:15:11.646-04', '2017-03-26 00:41:08.062-04', 1, 1);
2616INSERT INTO roles_usuarios VALUES ('2017-10-15 14:36:17.187336-03', '2017-10-15 14:36:17.187336-03', 2, 3);
2617
2618
2619--
2620-- TOC entry 2702 (class 0 OID 242196)
2621-- Dependencies: 227
2622-- Data for Name: sucursales; Type: TABLE DATA; Schema: public; Owner: postgres
2623--
2624
2625INSERT INTO sucursales VALUES (1, '001', 'Limpio', true, '2017-10-09 17:49:16.569-03', '2017-10-09 17:49:16.569-03');
2626
2627
2628--
2629-- TOC entry 2800 (class 0 OID 0)
2630-- Dependencies: 228
2631-- Name: sucursales_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
2632--
2633
2634SELECT pg_catalog.setval('sucursales_id_seq', 1, true);
2635
2636
2637--
2638-- TOC entry 2704 (class 0 OID 242204)
2639-- Dependencies: 229
2640-- Data for Name: tarjetas; Type: TABLE DATA; Schema: public; Owner: postgres
2641--
2642
2643INSERT INTO tarjetas VALUES (1, 'Visa', true, '2017-10-11 18:27:22.781-03', '2017-10-11 18:27:22.781-03');
2644INSERT INTO tarjetas VALUES (2, 'Mastercard', true, '2017-10-11 18:27:28.392-03', '2017-10-11 18:27:28.392-03');
2645
2646
2647--
2648-- TOC entry 2801 (class 0 OID 0)
2649-- Dependencies: 230
2650-- Name: tarjetas_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
2651--
2652
2653SELECT pg_catalog.setval('tarjetas_id_seq', 2, true);
2654
2655
2656--
2657-- TOC entry 2706 (class 0 OID 242209)
2658-- Dependencies: 231
2659-- Data for Name: timbrados; Type: TABLE DATA; Schema: public; Owner: postgres
2660--
2661
2662INSERT INTO timbrados VALUES (1, '00000001', '2017/10/09', '2018/10/09', true, '2017-10-09 18:17:30.29-03', '2017-10-09 18:17:30.313-03', 5, 1);
2663
2664
2665--
2666-- TOC entry 2802 (class 0 OID 0)
2667-- Dependencies: 232
2668-- Name: timbrados_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
2669--
2670
2671SELECT pg_catalog.setval('timbrados_id_seq', 1, true);
2672
2673
2674--
2675-- TOC entry 2708 (class 0 OID 242217)
2676-- Dependencies: 233
2677-- Data for Name: tipo_tipos; Type: TABLE DATA; Schema: public; Owner: postgres
2678--
2679
2680INSERT INTO tipo_tipos VALUES (1, 'accion', true, '2017-02-19 00:42:00.694-03', '2017-02-19 00:46:36.118-03');
2681INSERT INTO tipo_tipos VALUES (2, 'clase', true, '2017-02-19 00:42:17.539-03', '2017-02-19 00:53:44.37-03');
2682INSERT INTO tipo_tipos VALUES (3, 'clase_timbrado', true, '2017-02-19 22:05:53.078-03', '2017-02-20 16:03:50.222-03');
2683INSERT INTO tipo_tipos VALUES (4, 'clase_producto', true, '2017-02-24 11:07:43.496-03', '2017-02-24 11:07:43.496-03');
2684INSERT INTO tipo_tipos VALUES (5, 'tipo_movimiento', true, '2017-03-02 00:06:55.037-03', '2017-03-02 00:07:33.607-03');
2685INSERT INTO tipo_tipos VALUES (6, 'TIPO_DOCUMENTO', true, '2017-03-02 00:06:55.037-03', '2017-03-02 00:07:33.607-03');
2686INSERT INTO tipo_tipos VALUES (7, 'TIPO_PERSONA', true, '2017-03-02 00:06:55.037-03', '2017-03-02 00:07:33.607-03');
2687INSERT INTO tipo_tipos VALUES (8, 'CLASE_PAGO', true, '2017-03-02 00:06:55.037-03', '2017-03-02 00:07:33.607-03');
2688INSERT INTO tipo_tipos VALUES (9, 'EXTRACCION', true, '2017-03-02 00:06:55.037-03', '2017-03-02 00:07:33.607-03');
2689
2690
2691--
2692-- TOC entry 2803 (class 0 OID 0)
2693-- Dependencies: 234
2694-- Name: tipo_tipos_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
2695--
2696
2697SELECT pg_catalog.setval('tipo_tipos_id_seq', 9, true);
2698
2699
2700--
2701-- TOC entry 2710 (class 0 OID 242222)
2702-- Dependencies: 235
2703-- Data for Name: tipos; Type: TABLE DATA; Schema: public; Owner: postgres
2704--
2705
2706INSERT INTO tipos VALUES (1, 'Crédito', true, '2017-02-19 00:40:12.712-03', '2017-02-19 00:42:00.74-03', 1);
2707INSERT INTO tipos VALUES (2, 'Dédito', true, '2017-02-19 00:40:21.253-03', '2017-02-19 00:42:00.74-03', 1);
2708INSERT INTO tipos VALUES (3, 'Factura', true, '2017-02-19 00:40:34.234-03', '2017-02-19 00:42:17.574-03', 2);
2709INSERT INTO tipos VALUES (4, 'Nota de crédito', true, '2017-02-19 00:40:46.08-03', '2017-02-19 00:42:17.574-03', 2);
2710INSERT INTO tipos VALUES (5, 'Autoimpreso', true, '2017-02-19 22:04:22.868-03', '2017-02-20 21:50:03.623-03', 3);
2711INSERT INTO tipos VALUES (6, 'Preimpreso', true, '2017-02-19 22:04:35.194-03', '2017-02-20 21:50:03.623-03', 3);
2712INSERT INTO tipos VALUES (7, 'Virtual', true, '2017-02-19 22:04:50.958-03', '2017-02-20 21:50:03.623-03', 3);
2713INSERT INTO tipos VALUES (8, 'Normal', true, '2017-02-24 11:07:08.541-03', '2017-02-24 11:07:43.539-03', 4);
2714INSERT INTO tipos VALUES (9, 'Pesable', true, '2017-02-24 11:07:16.121-03', '2017-02-24 11:07:43.539-03', 4);
2715INSERT INTO tipos VALUES (10, 'Ingreso', true, '2017-03-02 00:05:49.404-03', '2017-03-02 00:06:55.081-03', 5);
2716INSERT INTO tipos VALUES (11, 'Transferencia', true, '2017-03-02 00:05:57.473-03', '2017-03-02 00:06:55.081-03', 5);
2717INSERT INTO tipos VALUES (12, 'RUC', true, '2017-03-02 00:05:57.473-03', '2017-03-02 00:06:55.081-03', 6);
2718INSERT INTO tipos VALUES (13, 'Cédula de Identidad', true, '2017-03-02 00:05:57.473-03', '2017-03-02 00:06:55.081-03', 6);
2719INSERT INTO tipos VALUES (14, 'FÃsica', true, '2017-03-02 00:05:57.473-03', '2017-03-02 00:06:55.081-03', 7);
2720INSERT INTO tipos VALUES (15, 'JurÃdica', true, '2017-03-02 00:05:57.473-03', '2017-03-02 00:06:55.081-03', 7);
2721INSERT INTO tipos VALUES (16, 'Efectivo', true, '2017-03-02 00:05:57.473-03', '2017-03-02 00:06:55.081-03', 8);
2722INSERT INTO tipos VALUES (17, 'Cheque', true, '2017-03-02 00:05:57.473-03', '2017-03-02 00:06:55.081-03', 8);
2723INSERT INTO tipos VALUES (18, 'Tarjeta de crédito', true, '2017-03-02 00:05:57.473-03', '2017-03-02 00:06:55.081-03', 8);
2724INSERT INTO tipos VALUES (20, 'Devolución de efectivo', true, '2017-03-02 00:05:57.473-03', '2017-03-02 00:06:55.081-03', 9);
2725INSERT INTO tipos VALUES (21, 'Normal', true, '2017-03-02 00:05:57.473-03', '2017-03-02 00:06:55.081-03', 9);
2726INSERT INTO tipos VALUES (22, 'Reembolse al cliente', true, '2017-03-02 00:05:57.473-03', '2017-03-02 00:06:55.081-03', 9);
2727INSERT INTO tipos VALUES (23, 'Pagos varios', true, '2017-03-02 00:05:57.473-03', '2017-03-02 00:06:55.081-03', 9);
2728INSERT INTO tipos VALUES (19, 'Tarjeta de débito', true, '2017-03-02 00:05:57.473-03', '2017-03-02 00:06:55.081-03', 8);
2729INSERT INTO tipos VALUES (24, 'Nota de crédito', true, '2017-10-11 03:35:27.912484-03', '2017-10-11 03:35:27.912484-03', 8);
2730
2731
2732--
2733-- TOC entry 2804 (class 0 OID 0)
2734-- Dependencies: 236
2735-- Name: tipos_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
2736--
2737
2738SELECT pg_catalog.setval('tipos_id_seq', 23, true);
2739
2740
2741--
2742-- TOC entry 2725 (class 0 OID 251945)
2743-- Dependencies: 250
2744-- Data for Name: unidades; Type: TABLE DATA; Schema: public; Owner: postgres
2745--
2746
2747INSERT INTO unidades VALUES (1, 'GRAMO', 1, '2018-01-28 22:06:41.100421-03', '2018-01-28 22:06:41.100421-03', NULL);
2748INSERT INTO unidades VALUES (2, 'KILOGRAMO', 1000, '2018-01-28 22:06:52.389594-03', '2018-01-28 22:06:52.389594-03', 1);
2749
2750
2751--
2752-- TOC entry 2805 (class 0 OID 0)
2753-- Dependencies: 249
2754-- Name: unidades_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
2755--
2756
2757SELECT pg_catalog.setval('unidades_id_seq', 2, true);
2758
2759
2760--
2761-- TOC entry 2712 (class 0 OID 242227)
2762-- Dependencies: 237
2763-- Data for Name: usuarios; Type: TABLE DATA; Schema: public; Owner: postgres
2764--
2765
2766INSERT INTO usuarios VALUES (2, 'cajero', 'cajero', true, 'Cajero', '-', 'cajero@tdn.com.py', NULL, '2017-10-12 21:25:32.214238-03', '2017-10-12 21:25:32.214238-03');
2767INSERT INTO usuarios VALUES (3, 'supervisor', 'supervisor', true, 'Supervisor', '-', 'supervisor@tdn.com.py', NULL, '2017-10-15 14:34:33.522036-03', '2017-10-15 14:34:33.522036-03');
2768INSERT INTO usuarios VALUES (1, 'admin', 'admin', true, 'Javier', 'Perez', 'admin@tdn.com.py', NULL, '2017-03-26 00:15:11.646-04', '2017-03-26 00:41:08.062-04');
2769
2770
2771--
2772-- TOC entry 2806 (class 0 OID 0)
2773-- Dependencies: 238
2774-- Name: usuarios_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
2775--
2776
2777SELECT pg_catalog.setval('usuarios_id_seq', 1, true);
2778
2779
2780--
2781-- TOC entry 2714 (class 0 OID 242235)
2782-- Dependencies: 239
2783-- Data for Name: ventas; Type: TABLE DATA; Schema: public; Owner: postgres
2784--
2785
2786INSERT INTO ventas VALUES (3461, '2018/01/30 22:14:00 207 2', 15000, true, NULL, NULL, '001-001-0000100', NULL, 'EMITIDA', '2018-01-30 22:13:47.679-03', '2018-01-30 22:14:00.286-03', 18, 1, 1, 1, 1, 1, 1, 15000);
2787INSERT INTO ventas VALUES (3462, '2018/01/31 13:55:28 234 3', 4500, true, NULL, NULL, '001-001-0000101', NULL, 'EMITIDA', '2018-01-31 13:06:35.579-03', '2018-01-31 13:55:28.329-03', 18, 1, 1, 1, 1, 1, 1, 0);
2788
2789
2790--
2791-- TOC entry 2715 (class 0 OID 242242)
2792-- Dependencies: 240
2793-- Data for Name: ventas_detalles; Type: TABLE DATA; Schema: public; Owner: postgres
2794--
2795
2796INSERT INTO ventas_detalles VALUES (318, 1, false, true, '2018/01/30 22:13:47 849 0', 5000, '2018-01-30 22:13:47.858-03', '2018-01-30 22:13:47.886-03', NULL, 3461, 1, 3461);
2797INSERT INTO ventas_detalles VALUES (319, 1, false, true, '2018/01/30 22:13:51 600 0', 5000, '2018-01-30 22:13:51.609-03', '2018-01-30 22:13:51.628-03', NULL, 3461, 1, 3461);
2798INSERT INTO ventas_detalles VALUES (320, 1, false, true, '2018/01/30 22:13:52 404 0', 5000, '2018-01-30 22:13:52.413-03', '2018-01-30 22:13:52.436-03', NULL, 3461, 1, 3461);
2799INSERT INTO ventas_detalles VALUES (321, 1, false, true, '2018/01/31 13:06:35 698 0', 4500, '2018-01-31 13:06:35.706-03', '2018-01-31 13:06:35.757-03', NULL, 3462, 3, 3462);
2800INSERT INTO ventas_detalles VALUES (322, 1, false, true, '2018/01/31 13:06:41 384 0', 4500, '2018-01-31 13:06:41.392-03', '2018-01-31 13:06:41.43-03', NULL, 3462, 3, 3462);
2801INSERT INTO ventas_detalles VALUES (325, 1, true, true, '2018/01/31 13:28:20 932 0', 4500, '2018-01-31 13:28:20.988-03', '2018-01-31 13:28:21.036-03', NULL, 3462, 3, 3462);
2802
2803
2804--
2805-- TOC entry 2807 (class 0 OID 0)
2806-- Dependencies: 241
2807-- Name: ventas_detalles_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
2808--
2809
2810SELECT pg_catalog.setval('ventas_detalles_id_seq', 326, true);
2811
2812
2813--
2814-- TOC entry 2808 (class 0 OID 0)
2815-- Dependencies: 242
2816-- Name: ventas_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
2817--
2818
2819SELECT pg_catalog.setval('ventas_id_seq', 3462, true);
2820
2821
2822--
2823-- TOC entry 2723 (class 0 OID 251917)
2824-- Dependencies: 248
2825-- Data for Name: ventas_impuestos; Type: TABLE DATA; Schema: public; Owner: postgres
2826--
2827
2828INSERT INTO ventas_impuestos VALUES (70, 1363.63636363636374, '2018-01-30 22:13:47.893-03', '2018-01-30 22:13:52.446-03', 3461, 1, 15000);
2829INSERT INTO ventas_impuestos VALUES (71, 0, '2018-01-31 13:06:35.772-03', '2018-01-31 13:40:54.913-03', 3462, 1, 0);
2830
2831
2832--
2833-- TOC entry 2809 (class 0 OID 0)
2834-- Dependencies: 247
2835-- Name: ventas_impuestos_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
2836--
2837
2838SELECT pg_catalog.setval('ventas_impuestos_id_seq', 71, true);
2839
2840
2841--
2842-- TOC entry 2395 (class 2606 OID 242285)
2843-- Name: almacenes_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
2844--
2845
2846ALTER TABLE ONLY almacenes
2847 ADD CONSTRAINT almacenes_pkey PRIMARY KEY (id);
2848
2849
2850--
2851-- TOC entry 2397 (class 2606 OID 242287)
2852-- Name: almacenes_productos_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
2853--
2854
2855ALTER TABLE ONLY almacenes_productos
2856 ADD CONSTRAINT almacenes_productos_pkey PRIMARY KEY (almacen_id, producto_id);
2857
2858
2859--
2860-- TOC entry 2469 (class 2606 OID 242718)
2861-- Name: aperturas_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
2862--
2863
2864ALTER TABLE ONLY aperturas
2865 ADD CONSTRAINT aperturas_pkey PRIMARY KEY (id);
2866
2867
2868--
2869-- TOC entry 2399 (class 2606 OID 242291)
2870-- Name: bancos_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
2871--
2872
2873ALTER TABLE ONLY bancos
2874 ADD CONSTRAINT bancos_pkey PRIMARY KEY (id);
2875
2876
2877--
2878-- TOC entry 2401 (class 2606 OID 242293)
2879-- Name: cajas_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
2880--
2881
2882ALTER TABLE ONLY cajas
2883 ADD CONSTRAINT cajas_pkey PRIMARY KEY (id);
2884
2885
2886--
2887-- TOC entry 2403 (class 2606 OID 242295)
2888-- Name: clientes_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
2889--
2890
2891ALTER TABLE ONLY clientes
2892 ADD CONSTRAINT clientes_pkey PRIMARY KEY (id);
2893
2894
2895--
2896-- TOC entry 2405 (class 2606 OID 242297)
2897-- Name: comprobantes_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
2898--
2899
2900ALTER TABLE ONLY comprobantes
2901 ADD CONSTRAINT comprobantes_pkey PRIMARY KEY (id);
2902
2903
2904--
2905-- TOC entry 2407 (class 2606 OID 242299)
2906-- Name: cotizaciones_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
2907--
2908
2909ALTER TABLE ONLY cotizaciones
2910 ADD CONSTRAINT cotizaciones_pkey PRIMARY KEY (id);
2911
2912
2913--
2914-- TOC entry 2411 (class 2606 OID 242301)
2915-- Name: credito_nota_aplicada_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
2916--
2917
2918ALTER TABLE ONLY credito_nota_aplicada
2919 ADD CONSTRAINT credito_nota_aplicada_pkey PRIMARY KEY (id);
2920
2921
2922--
2923-- TOC entry 2409 (class 2606 OID 242303)
2924-- Name: credito_nota_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
2925--
2926
2927ALTER TABLE ONLY credito_nota
2928 ADD CONSTRAINT credito_nota_pkey PRIMARY KEY (id);
2929
2930
2931--
2932-- TOC entry 2413 (class 2606 OID 242305)
2933-- Name: denominaciones_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
2934--
2935
2936ALTER TABLE ONLY denominaciones
2937 ADD CONSTRAINT denominaciones_pkey PRIMARY KEY (id);
2938
2939
2940--
2941-- TOC entry 2415 (class 2606 OID 242307)
2942-- Name: emisores_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
2943--
2944
2945ALTER TABLE ONLY emisores
2946 ADD CONSTRAINT emisores_pkey PRIMARY KEY (id);
2947
2948
2949--
2950-- TOC entry 2419 (class 2606 OID 242309)
2951-- Name: extracciones_detalles_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
2952--
2953
2954ALTER TABLE ONLY extracciones_detalles
2955 ADD CONSTRAINT extracciones_detalles_pkey PRIMARY KEY (id);
2956
2957
2958--
2959-- TOC entry 2417 (class 2606 OID 242311)
2960-- Name: extracciones_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
2961--
2962
2963ALTER TABLE ONLY extracciones
2964 ADD CONSTRAINT extracciones_pkey PRIMARY KEY (id);
2965
2966
2967--
2968-- TOC entry 2421 (class 2606 OID 242313)
2969-- Name: familias_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
2970--
2971
2972ALTER TABLE ONLY familias
2973 ADD CONSTRAINT familias_pkey PRIMARY KEY (id);
2974
2975
2976--
2977-- TOC entry 2423 (class 2606 OID 242315)
2978-- Name: historicos_precios_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
2979--
2980
2981ALTER TABLE ONLY historicos_precios
2982 ADD CONSTRAINT historicos_precios_pkey PRIMARY KEY (id);
2983
2984
2985--
2986-- TOC entry 2425 (class 2606 OID 242317)
2987-- Name: impuestos_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
2988--
2989
2990ALTER TABLE ONLY impuestos
2991 ADD CONSTRAINT impuestos_pkey PRIMARY KEY (id);
2992
2993
2994--
2995-- TOC entry 2427 (class 2606 OID 242319)
2996-- Name: mensajes_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
2997--
2998
2999ALTER TABLE ONLY mensajes
3000 ADD CONSTRAINT mensajes_pkey PRIMARY KEY (id);
3001
3002
3003--
3004-- TOC entry 2429 (class 2606 OID 242321)
3005-- Name: monedas_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
3006--
3007
3008ALTER TABLE ONLY monedas
3009 ADD CONSTRAINT monedas_pkey PRIMARY KEY (id);
3010
3011
3012--
3013-- TOC entry 2431 (class 2606 OID 242323)
3014-- Name: movimientos_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
3015--
3016
3017ALTER TABLE ONLY movimientos
3018 ADD CONSTRAINT movimientos_pkey PRIMARY KEY (id);
3019
3020
3021--
3022-- TOC entry 2433 (class 2606 OID 242325)
3023-- Name: pagos_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
3024--
3025
3026ALTER TABLE ONLY pagos
3027 ADD CONSTRAINT pagos_pkey PRIMARY KEY (id);
3028
3029
3030--
3031-- TOC entry 2435 (class 2606 OID 242327)
3032-- Name: permisos_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
3033--
3034
3035ALTER TABLE ONLY permisos
3036 ADD CONSTRAINT permisos_pkey PRIMARY KEY (id);
3037
3038
3039--
3040-- TOC entry 2437 (class 2606 OID 242329)
3041-- Name: permisos_roles_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
3042--
3043
3044ALTER TABLE ONLY permisos_roles
3045 ADD CONSTRAINT permisos_roles_pkey PRIMARY KEY (permiso_id, rol_id);
3046
3047
3048--
3049-- TOC entry 2439 (class 2606 OID 242331)
3050-- Name: posts_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
3051--
3052
3053ALTER TABLE ONLY posts
3054 ADD CONSTRAINT posts_pkey PRIMARY KEY (id);
3055
3056
3057--
3058-- TOC entry 2441 (class 2606 OID 242333)
3059-- Name: procesadoras_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
3060--
3061
3062ALTER TABLE ONLY procesadoras
3063 ADD CONSTRAINT procesadoras_pkey PRIMARY KEY (id);
3064
3065
3066--
3067-- TOC entry 2471 (class 2606 OID 251906)
3068-- Name: productos_favoritos_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
3069--
3070
3071ALTER TABLE ONLY productos_favoritos
3072 ADD CONSTRAINT productos_favoritos_pkey PRIMARY KEY (id);
3073
3074
3075--
3076-- TOC entry 2443 (class 2606 OID 242335)
3077-- Name: productos_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
3078--
3079
3080ALTER TABLE ONLY productos
3081 ADD CONSTRAINT productos_pkey PRIMARY KEY (id);
3082
3083
3084--
3085-- TOC entry 2445 (class 2606 OID 242337)
3086-- Name: puntos_emision_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
3087--
3088
3089ALTER TABLE ONLY puntos_emision
3090 ADD CONSTRAINT puntos_emision_pkey PRIMARY KEY (id);
3091
3092
3093--
3094-- TOC entry 2447 (class 2606 OID 242339)
3095-- Name: puntos_venta_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
3096--
3097
3098ALTER TABLE ONLY puntos_venta
3099 ADD CONSTRAINT puntos_venta_pkey PRIMARY KEY (id);
3100
3101
3102--
3103-- TOC entry 2449 (class 2606 OID 242341)
3104-- Name: roles_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
3105--
3106
3107ALTER TABLE ONLY roles
3108 ADD CONSTRAINT roles_pkey PRIMARY KEY (id);
3109
3110
3111--
3112-- TOC entry 2451 (class 2606 OID 242343)
3113-- Name: roles_usuarios_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
3114--
3115
3116ALTER TABLE ONLY roles_usuarios
3117 ADD CONSTRAINT roles_usuarios_pkey PRIMARY KEY (rol_id, usuario_id);
3118
3119
3120--
3121-- TOC entry 2453 (class 2606 OID 242345)
3122-- Name: sucursales_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
3123--
3124
3125ALTER TABLE ONLY sucursales
3126 ADD CONSTRAINT sucursales_pkey PRIMARY KEY (id);
3127
3128
3129--
3130-- TOC entry 2455 (class 2606 OID 242347)
3131-- Name: tarjetas_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
3132--
3133
3134ALTER TABLE ONLY tarjetas
3135 ADD CONSTRAINT tarjetas_pkey PRIMARY KEY (id);
3136
3137
3138--
3139-- TOC entry 2457 (class 2606 OID 242349)
3140-- Name: timbrados_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
3141--
3142
3143ALTER TABLE ONLY timbrados
3144 ADD CONSTRAINT timbrados_pkey PRIMARY KEY (id);
3145
3146
3147--
3148-- TOC entry 2459 (class 2606 OID 242351)
3149-- Name: tipo_tipos_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
3150--
3151
3152ALTER TABLE ONLY tipo_tipos
3153 ADD CONSTRAINT tipo_tipos_pkey PRIMARY KEY (id);
3154
3155
3156--
3157-- TOC entry 2461 (class 2606 OID 242353)
3158-- Name: tipos_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
3159--
3160
3161ALTER TABLE ONLY tipos
3162 ADD CONSTRAINT tipos_pkey PRIMARY KEY (id);
3163
3164
3165--
3166-- TOC entry 2475 (class 2606 OID 251950)
3167-- Name: unidades_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
3168--
3169
3170ALTER TABLE ONLY unidades
3171 ADD CONSTRAINT unidades_pkey PRIMARY KEY (id);
3172
3173
3174--
3175-- TOC entry 2463 (class 2606 OID 242355)
3176-- Name: usuarios_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
3177--
3178
3179ALTER TABLE ONLY usuarios
3180 ADD CONSTRAINT usuarios_pkey PRIMARY KEY (id);
3181
3182
3183--
3184-- TOC entry 2467 (class 2606 OID 242357)
3185-- Name: ventas_detalles_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
3186--
3187
3188ALTER TABLE ONLY ventas_detalles
3189 ADD CONSTRAINT ventas_detalles_pkey PRIMARY KEY (id);
3190
3191
3192--
3193-- TOC entry 2473 (class 2606 OID 251922)
3194-- Name: ventas_impuestos_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
3195--
3196
3197ALTER TABLE ONLY ventas_impuestos
3198 ADD CONSTRAINT ventas_impuestos_pkey PRIMARY KEY (id);
3199
3200
3201--
3202-- TOC entry 2465 (class 2606 OID 242359)
3203-- Name: ventas_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
3204--
3205
3206ALTER TABLE ONLY ventas
3207 ADD CONSTRAINT ventas_pkey PRIMARY KEY (id);
3208
3209
3210--
3211-- TOC entry 2476 (class 2606 OID 242360)
3212-- Name: almacenes_productos_almacen_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
3213--
3214
3215ALTER TABLE ONLY almacenes_productos
3216 ADD CONSTRAINT almacenes_productos_almacen_id_fkey FOREIGN KEY (almacen_id) REFERENCES almacenes(id) ON UPDATE CASCADE ON DELETE CASCADE;
3217
3218
3219--
3220-- TOC entry 2477 (class 2606 OID 242365)
3221-- Name: almacenes_productos_producto_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
3222--
3223
3224ALTER TABLE ONLY almacenes_productos
3225 ADD CONSTRAINT almacenes_productos_producto_id_fkey FOREIGN KEY (producto_id) REFERENCES productos(id) ON UPDATE CASCADE ON DELETE CASCADE;
3226
3227
3228--
3229-- TOC entry 2534 (class 2606 OID 242719)
3230-- Name: aperturas_caja_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
3231--
3232
3233ALTER TABLE ONLY aperturas
3234 ADD CONSTRAINT aperturas_caja_id_fkey FOREIGN KEY (caja_id) REFERENCES cajas(id) ON UPDATE CASCADE ON DELETE SET NULL;
3235
3236
3237--
3238-- TOC entry 2535 (class 2606 OID 242724)
3239-- Name: aperturas_cajero_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
3240--
3241
3242ALTER TABLE ONLY aperturas
3243 ADD CONSTRAINT aperturas_cajero_id_fkey FOREIGN KEY (cajero_id) REFERENCES usuarios(id) ON UPDATE CASCADE ON DELETE SET NULL;
3244
3245
3246--
3247-- TOC entry 2478 (class 2606 OID 242380)
3248-- Name: cajas_almacen_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
3249--
3250
3251ALTER TABLE ONLY cajas
3252 ADD CONSTRAINT cajas_almacen_id_fkey FOREIGN KEY (almacen_id) REFERENCES almacenes(id) ON UPDATE CASCADE ON DELETE SET NULL;
3253
3254
3255--
3256-- TOC entry 2479 (class 2606 OID 242385)
3257-- Name: cajas_punto_emision_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
3258--
3259
3260ALTER TABLE ONLY cajas
3261 ADD CONSTRAINT cajas_punto_emision_id_fkey FOREIGN KEY (punto_emision_id) REFERENCES puntos_emision(id) ON UPDATE CASCADE;
3262
3263
3264--
3265-- TOC entry 2480 (class 2606 OID 242390)
3266-- Name: clientes_tipo_documento_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
3267--
3268
3269ALTER TABLE ONLY clientes
3270 ADD CONSTRAINT clientes_tipo_documento_id_fkey FOREIGN KEY (tipo_documento_id) REFERENCES tipos(id) ON UPDATE CASCADE ON DELETE SET NULL;
3271
3272
3273--
3274-- TOC entry 2481 (class 2606 OID 242395)
3275-- Name: clientes_tipo_persona_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
3276--
3277
3278ALTER TABLE ONLY clientes
3279 ADD CONSTRAINT clientes_tipo_persona_id_fkey FOREIGN KEY (tipo_persona_id) REFERENCES tipos(id) ON UPDATE CASCADE ON DELETE SET NULL;
3280
3281
3282--
3283-- TOC entry 2482 (class 2606 OID 242400)
3284-- Name: comprobantes_accion_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
3285--
3286
3287ALTER TABLE ONLY comprobantes
3288 ADD CONSTRAINT comprobantes_accion_id_fkey FOREIGN KEY (accion_id) REFERENCES tipos(id) ON UPDATE CASCADE;
3289
3290
3291--
3292-- TOC entry 2483 (class 2606 OID 242405)
3293-- Name: comprobantes_clase_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
3294--
3295
3296ALTER TABLE ONLY comprobantes
3297 ADD CONSTRAINT comprobantes_clase_id_fkey FOREIGN KEY (clase_id) REFERENCES tipos(id) ON UPDATE CASCADE;
3298
3299
3300--
3301-- TOC entry 2484 (class 2606 OID 242410)
3302-- Name: cotizaciones_moneda_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
3303--
3304
3305ALTER TABLE ONLY cotizaciones
3306 ADD CONSTRAINT cotizaciones_moneda_id_fkey FOREIGN KEY (moneda_id) REFERENCES monedas(id) ON UPDATE CASCADE;
3307
3308
3309--
3310-- TOC entry 2490 (class 2606 OID 242415)
3311-- Name: credito_nota_aplicada_timbrado_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
3312--
3313
3314ALTER TABLE ONLY credito_nota_aplicada
3315 ADD CONSTRAINT credito_nota_aplicada_timbrado_id_fkey FOREIGN KEY (timbrado_id) REFERENCES timbrados(id) ON UPDATE CASCADE ON DELETE SET NULL;
3316
3317
3318--
3319-- TOC entry 2485 (class 2606 OID 242420)
3320-- Name: credito_nota_cajero_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
3321--
3322
3323ALTER TABLE ONLY credito_nota
3324 ADD CONSTRAINT credito_nota_cajero_id_fkey FOREIGN KEY (cajero_id) REFERENCES usuarios(id) ON UPDATE CASCADE ON DELETE SET NULL;
3325
3326
3327--
3328-- TOC entry 2486 (class 2606 OID 242425)
3329-- Name: credito_nota_cliente_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
3330--
3331
3332ALTER TABLE ONLY credito_nota
3333 ADD CONSTRAINT credito_nota_cliente_id_fkey FOREIGN KEY (cliente_id) REFERENCES clientes(id) ON UPDATE CASCADE ON DELETE SET NULL;
3334
3335
3336--
3337-- TOC entry 2487 (class 2606 OID 242430)
3338-- Name: credito_nota_punto_emision_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
3339--
3340
3341ALTER TABLE ONLY credito_nota
3342 ADD CONSTRAINT credito_nota_punto_emision_id_fkey FOREIGN KEY (punto_emision_id) REFERENCES puntos_emision(id) ON UPDATE CASCADE ON DELETE SET NULL;
3343
3344
3345--
3346-- TOC entry 2488 (class 2606 OID 242435)
3347-- Name: credito_nota_sucursal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
3348--
3349
3350ALTER TABLE ONLY credito_nota
3351 ADD CONSTRAINT credito_nota_sucursal_id_fkey FOREIGN KEY (sucursal_id) REFERENCES sucursales(id) ON UPDATE CASCADE ON DELETE SET NULL;
3352
3353
3354--
3355-- TOC entry 2489 (class 2606 OID 242440)
3356-- Name: credito_nota_timbrado_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
3357--
3358
3359ALTER TABLE ONLY credito_nota
3360 ADD CONSTRAINT credito_nota_timbrado_id_fkey FOREIGN KEY (timbrado_id) REFERENCES timbrados(id) ON UPDATE CASCADE ON DELETE SET NULL;
3361
3362
3363--
3364-- TOC entry 2491 (class 2606 OID 242445)
3365-- Name: denominaciones_moneda_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
3366--
3367
3368ALTER TABLE ONLY denominaciones
3369 ADD CONSTRAINT denominaciones_moneda_id_fkey FOREIGN KEY (moneda_id) REFERENCES monedas(id) ON UPDATE CASCADE;
3370
3371
3372--
3373-- TOC entry 2492 (class 2606 OID 242450)
3374-- Name: extracciones_caja_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
3375--
3376
3377ALTER TABLE ONLY extracciones
3378 ADD CONSTRAINT extracciones_caja_id_fkey FOREIGN KEY (caja_id) REFERENCES cajas(id) ON UPDATE CASCADE ON DELETE SET NULL;
3379
3380
3381--
3382-- TOC entry 2493 (class 2606 OID 242455)
3383-- Name: extracciones_cajero_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
3384--
3385
3386ALTER TABLE ONLY extracciones
3387 ADD CONSTRAINT extracciones_cajero_id_fkey FOREIGN KEY (cajero_id) REFERENCES usuarios(id) ON UPDATE CASCADE ON DELETE SET NULL;
3388
3389
3390--
3391-- TOC entry 2496 (class 2606 OID 242460)
3392-- Name: extracciones_detalles_extraccion_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
3393--
3394
3395ALTER TABLE ONLY extracciones_detalles
3396 ADD CONSTRAINT extracciones_detalles_extraccion_id_fkey FOREIGN KEY (extraccion_id) REFERENCES extracciones(id) ON UPDATE CASCADE ON DELETE SET NULL;
3397
3398
3399--
3400-- TOC entry 2494 (class 2606 OID 242465)
3401-- Name: extracciones_moneda_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
3402--
3403
3404ALTER TABLE ONLY extracciones
3405 ADD CONSTRAINT extracciones_moneda_id_fkey FOREIGN KEY (moneda_id) REFERENCES monedas(id) ON UPDATE CASCADE ON DELETE SET NULL;
3406
3407
3408--
3409-- TOC entry 2495 (class 2606 OID 242470)
3410-- Name: extracciones_tipo_extraccion_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
3411--
3412
3413ALTER TABLE ONLY extracciones
3414 ADD CONSTRAINT extracciones_tipo_extraccion_id_fkey FOREIGN KEY (tipo_extraccion_id) REFERENCES tipos(id) ON UPDATE CASCADE ON DELETE SET NULL;
3415
3416
3417--
3418-- TOC entry 2497 (class 2606 OID 242475)
3419-- Name: familias_familium_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
3420--
3421
3422ALTER TABLE ONLY familias
3423 ADD CONSTRAINT familias_familium_id_fkey FOREIGN KEY (familium_id) REFERENCES familias(id) ON UPDATE CASCADE ON DELETE SET NULL;
3424
3425
3426--
3427-- TOC entry 2498 (class 2606 OID 242480)
3428-- Name: familias_padre_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
3429--
3430
3431ALTER TABLE ONLY familias
3432 ADD CONSTRAINT familias_padre_id_fkey FOREIGN KEY (padre_id) REFERENCES familias(id) ON UPDATE CASCADE ON DELETE SET NULL;
3433
3434
3435--
3436-- TOC entry 2499 (class 2606 OID 242485)
3437-- Name: historicos_precios_movimiento_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
3438--
3439
3440ALTER TABLE ONLY historicos_precios
3441 ADD CONSTRAINT historicos_precios_movimiento_id_fkey FOREIGN KEY (movimiento_id) REFERENCES movimientos(id) ON UPDATE CASCADE ON DELETE SET NULL;
3442
3443
3444--
3445-- TOC entry 2500 (class 2606 OID 242490)
3446-- Name: historicos_precios_producto_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
3447--
3448
3449ALTER TABLE ONLY historicos_precios
3450 ADD CONSTRAINT historicos_precios_producto_id_fkey FOREIGN KEY (producto_id) REFERENCES productos(id) ON UPDATE CASCADE ON DELETE SET NULL;
3451
3452
3453--
3454-- TOC entry 2501 (class 2606 OID 242495)
3455-- Name: movimientos_almacen_destino_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
3456--
3457
3458ALTER TABLE ONLY movimientos
3459 ADD CONSTRAINT movimientos_almacen_destino_id_fkey FOREIGN KEY (almacen_destino_id) REFERENCES almacenes(id) ON UPDATE CASCADE ON DELETE SET NULL;
3460
3461
3462--
3463-- TOC entry 2502 (class 2606 OID 242500)
3464-- Name: movimientos_almacen_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
3465--
3466
3467ALTER TABLE ONLY movimientos
3468 ADD CONSTRAINT movimientos_almacen_id_fkey FOREIGN KEY (almacen_id) REFERENCES almacenes(id) ON UPDATE CASCADE ON DELETE SET NULL;
3469
3470
3471--
3472-- TOC entry 2503 (class 2606 OID 242505)
3473-- Name: movimientos_producto_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
3474--
3475
3476ALTER TABLE ONLY movimientos
3477 ADD CONSTRAINT movimientos_producto_id_fkey FOREIGN KEY (producto_id) REFERENCES productos(id) ON UPDATE CASCADE ON DELETE SET NULL;
3478
3479
3480--
3481-- TOC entry 2504 (class 2606 OID 242510)
3482-- Name: movimientos_tipo_movimiento_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
3483--
3484
3485ALTER TABLE ONLY movimientos
3486 ADD CONSTRAINT movimientos_tipo_movimiento_id_fkey FOREIGN KEY (tipo_movimiento_id) REFERENCES tipos(id) ON UPDATE CASCADE ON DELETE SET NULL;
3487
3488
3489--
3490-- TOC entry 2505 (class 2606 OID 242515)
3491-- Name: pagos_clase_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
3492--
3493
3494ALTER TABLE ONLY pagos
3495 ADD CONSTRAINT pagos_clase_id_fkey FOREIGN KEY (clase_id) REFERENCES tipos(id) ON UPDATE CASCADE ON DELETE SET NULL;
3496
3497
3498--
3499-- TOC entry 2506 (class 2606 OID 242520)
3500-- Name: pagos_credito_nota_aplicada_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
3501--
3502
3503ALTER TABLE ONLY pagos
3504 ADD CONSTRAINT pagos_credito_nota_aplicada_id_fkey FOREIGN KEY (credito_nota_aplicada_id) REFERENCES credito_nota_aplicada(id) ON UPDATE CASCADE ON DELETE SET NULL;
3505
3506
3507--
3508-- TOC entry 2507 (class 2606 OID 242525)
3509-- Name: pagos_moneda_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
3510--
3511
3512ALTER TABLE ONLY pagos
3513 ADD CONSTRAINT pagos_moneda_id_fkey FOREIGN KEY (moneda_id) REFERENCES monedas(id) ON UPDATE CASCADE ON DELETE SET NULL;
3514
3515
3516--
3517-- TOC entry 2508 (class 2606 OID 242530)
3518-- Name: pagos_venta_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
3519--
3520
3521ALTER TABLE ONLY pagos
3522 ADD CONSTRAINT pagos_venta_id_fkey FOREIGN KEY (venta_id) REFERENCES ventas(id) ON UPDATE CASCADE ON DELETE SET NULL;
3523
3524
3525--
3526-- TOC entry 2509 (class 2606 OID 242535)
3527-- Name: permisos_roles_permiso_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
3528--
3529
3530ALTER TABLE ONLY permisos_roles
3531 ADD CONSTRAINT permisos_roles_permiso_id_fkey FOREIGN KEY (permiso_id) REFERENCES permisos(id) ON UPDATE CASCADE ON DELETE CASCADE;
3532
3533
3534--
3535-- TOC entry 2510 (class 2606 OID 242540)
3536-- Name: permisos_roles_rol_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
3537--
3538
3539ALTER TABLE ONLY permisos_roles
3540 ADD CONSTRAINT permisos_roles_rol_id_fkey FOREIGN KEY (rol_id) REFERENCES roles(id) ON UPDATE CASCADE ON DELETE CASCADE;
3541
3542
3543--
3544-- TOC entry 2511 (class 2606 OID 242545)
3545-- Name: posts_timbrado_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
3546--
3547
3548ALTER TABLE ONLY posts
3549 ADD CONSTRAINT posts_timbrado_id_fkey FOREIGN KEY (timbrado_id) REFERENCES timbrados(id) ON UPDATE CASCADE ON DELETE SET NULL;
3550
3551
3552--
3553-- TOC entry 2512 (class 2606 OID 242550)
3554-- Name: posts_usuario_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
3555--
3556
3557ALTER TABLE ONLY posts
3558 ADD CONSTRAINT posts_usuario_id_fkey FOREIGN KEY (usuario_id) REFERENCES usuarios(id) ON UPDATE CASCADE ON DELETE SET NULL;
3559
3560
3561--
3562-- TOC entry 2513 (class 2606 OID 242555)
3563-- Name: productos_clase_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
3564--
3565
3566ALTER TABLE ONLY productos
3567 ADD CONSTRAINT productos_clase_id_fkey FOREIGN KEY (clase_id) REFERENCES tipos(id) ON UPDATE CASCADE;
3568
3569
3570--
3571-- TOC entry 2536 (class 2606 OID 251907)
3572-- Name: productos_favoritos_producto_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
3573--
3574
3575ALTER TABLE ONLY productos_favoritos
3576 ADD CONSTRAINT productos_favoritos_producto_id_fkey FOREIGN KEY (producto_id) REFERENCES productos(id) ON UPDATE CASCADE ON DELETE SET NULL;
3577
3578
3579--
3580-- TOC entry 2514 (class 2606 OID 242560)
3581-- Name: productos_tipo_impuesto_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
3582--
3583
3584ALTER TABLE ONLY productos
3585 ADD CONSTRAINT productos_tipo_impuesto_id_fkey FOREIGN KEY (tipo_impuesto_id) REFERENCES impuestos(id) ON UPDATE CASCADE;
3586
3587
3588--
3589-- TOC entry 2515 (class 2606 OID 242565)
3590-- Name: puntos_emision_sucursal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
3591--
3592
3593ALTER TABLE ONLY puntos_emision
3594 ADD CONSTRAINT puntos_emision_sucursal_id_fkey FOREIGN KEY (sucursal_id) REFERENCES sucursales(id) ON UPDATE CASCADE ON DELETE SET NULL;
3595
3596
3597--
3598-- TOC entry 2516 (class 2606 OID 242570)
3599-- Name: puntos_venta_comprobante_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
3600--
3601
3602ALTER TABLE ONLY puntos_venta
3603 ADD CONSTRAINT puntos_venta_comprobante_id_fkey FOREIGN KEY (comprobante_id) REFERENCES comprobantes(id) ON UPDATE CASCADE ON DELETE SET NULL;
3604
3605
3606--
3607-- TOC entry 2517 (class 2606 OID 242575)
3608-- Name: puntos_venta_punto_emision_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
3609--
3610
3611ALTER TABLE ONLY puntos_venta
3612 ADD CONSTRAINT puntos_venta_punto_emision_id_fkey FOREIGN KEY (punto_emision_id) REFERENCES puntos_emision(id) ON UPDATE CASCADE ON DELETE SET NULL;
3613
3614
3615--
3616-- TOC entry 2518 (class 2606 OID 242580)
3617-- Name: puntos_venta_timbrado_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
3618--
3619
3620ALTER TABLE ONLY puntos_venta
3621 ADD CONSTRAINT puntos_venta_timbrado_id_fkey FOREIGN KEY (timbrado_id) REFERENCES timbrados(id) ON UPDATE CASCADE ON DELETE SET NULL;
3622
3623
3624--
3625-- TOC entry 2519 (class 2606 OID 242585)
3626-- Name: roles_usuarios_rol_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
3627--
3628
3629ALTER TABLE ONLY roles_usuarios
3630 ADD CONSTRAINT roles_usuarios_rol_id_fkey FOREIGN KEY (rol_id) REFERENCES roles(id) ON UPDATE CASCADE ON DELETE CASCADE;
3631
3632
3633--
3634-- TOC entry 2520 (class 2606 OID 242590)
3635-- Name: roles_usuarios_usuario_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
3636--
3637
3638ALTER TABLE ONLY roles_usuarios
3639 ADD CONSTRAINT roles_usuarios_usuario_id_fkey FOREIGN KEY (usuario_id) REFERENCES usuarios(id) ON UPDATE CASCADE ON DELETE CASCADE;
3640
3641
3642--
3643-- TOC entry 2521 (class 2606 OID 242595)
3644-- Name: timbrados_clase_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
3645--
3646
3647ALTER TABLE ONLY timbrados
3648 ADD CONSTRAINT timbrados_clase_id_fkey FOREIGN KEY (clase_id) REFERENCES tipos(id) ON UPDATE CASCADE ON DELETE SET NULL;
3649
3650
3651--
3652-- TOC entry 2522 (class 2606 OID 242600)
3653-- Name: timbrados_sucursal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
3654--
3655
3656ALTER TABLE ONLY timbrados
3657 ADD CONSTRAINT timbrados_sucursal_id_fkey FOREIGN KEY (sucursal_id) REFERENCES sucursales(id) ON UPDATE CASCADE ON DELETE SET NULL;
3658
3659
3660--
3661-- TOC entry 2523 (class 2606 OID 242605)
3662-- Name: tipos_tipo_tipo_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
3663--
3664
3665ALTER TABLE ONLY tipos
3666 ADD CONSTRAINT tipos_tipo_tipo_id_fkey FOREIGN KEY (tipo_tipo_id) REFERENCES tipo_tipos(id) ON UPDATE CASCADE ON DELETE SET NULL;
3667
3668
3669--
3670-- TOC entry 2539 (class 2606 OID 251951)
3671-- Name: unidades_unidad_base_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
3672--
3673
3674ALTER TABLE ONLY unidades
3675 ADD CONSTRAINT unidades_unidad_base_id_fkey FOREIGN KEY (unidad_base_id) REFERENCES unidades(id) ON UPDATE CASCADE ON DELETE SET NULL;
3676
3677
3678--
3679-- TOC entry 2524 (class 2606 OID 242610)
3680-- Name: ventas_almacen_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
3681--
3682
3683ALTER TABLE ONLY ventas
3684 ADD CONSTRAINT ventas_almacen_id_fkey FOREIGN KEY (almacen_id) REFERENCES almacenes(id) ON UPDATE CASCADE ON DELETE SET NULL;
3685
3686
3687--
3688-- TOC entry 2525 (class 2606 OID 242620)
3689-- Name: ventas_cajero_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
3690--
3691
3692ALTER TABLE ONLY ventas
3693 ADD CONSTRAINT ventas_cajero_id_fkey FOREIGN KEY (cajero_id) REFERENCES usuarios(id) ON UPDATE CASCADE ON DELETE SET NULL;
3694
3695
3696--
3697-- TOC entry 2526 (class 2606 OID 242625)
3698-- Name: ventas_cliente_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
3699--
3700
3701ALTER TABLE ONLY ventas
3702 ADD CONSTRAINT ventas_cliente_id_fkey FOREIGN KEY (cliente_id) REFERENCES clientes(id) ON UPDATE CASCADE ON DELETE SET NULL;
3703
3704
3705--
3706-- TOC entry 2530 (class 2606 OID 242630)
3707-- Name: ventas_detalles_credito_notum_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
3708--
3709
3710ALTER TABLE ONLY ventas_detalles
3711 ADD CONSTRAINT ventas_detalles_credito_notum_id_fkey FOREIGN KEY (credito_notum_id) REFERENCES credito_nota(id) ON UPDATE CASCADE ON DELETE SET NULL;
3712
3713
3714--
3715-- TOC entry 2531 (class 2606 OID 242635)
3716-- Name: ventas_detalles_producto_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
3717--
3718
3719ALTER TABLE ONLY ventas_detalles
3720 ADD CONSTRAINT ventas_detalles_producto_id_fkey FOREIGN KEY (producto_id) REFERENCES productos(id) ON UPDATE CASCADE ON DELETE SET NULL;
3721
3722
3723--
3724-- TOC entry 2532 (class 2606 OID 242640)
3725-- Name: ventas_detalles_venta_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
3726--
3727
3728ALTER TABLE ONLY ventas_detalles
3729 ADD CONSTRAINT ventas_detalles_venta_id_fkey FOREIGN KEY (venta_id) REFERENCES ventas(id) ON UPDATE CASCADE ON DELETE SET NULL;
3730
3731
3732--
3733-- TOC entry 2533 (class 2606 OID 242645)
3734-- Name: ventas_detalles_ventum_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
3735--
3736
3737ALTER TABLE ONLY ventas_detalles
3738 ADD CONSTRAINT ventas_detalles_ventum_id_fkey FOREIGN KEY (ventum_id) REFERENCES ventas(id) ON UPDATE CASCADE ON DELETE SET NULL;
3739
3740
3741--
3742-- TOC entry 2538 (class 2606 OID 251928)
3743-- Name: ventas_impuestos_tipo_impuesto_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
3744--
3745
3746ALTER TABLE ONLY ventas_impuestos
3747 ADD CONSTRAINT ventas_impuestos_tipo_impuesto_id_fkey FOREIGN KEY (tipo_impuesto_id) REFERENCES impuestos(id) ON UPDATE CASCADE ON DELETE SET NULL;
3748
3749
3750--
3751-- TOC entry 2537 (class 2606 OID 251923)
3752-- Name: ventas_impuestos_venta_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
3753--
3754
3755ALTER TABLE ONLY ventas_impuestos
3756 ADD CONSTRAINT ventas_impuestos_venta_id_fkey FOREIGN KEY (venta_id) REFERENCES ventas(id) ON UPDATE CASCADE ON DELETE SET NULL;
3757
3758
3759--
3760-- TOC entry 2527 (class 2606 OID 242650)
3761-- Name: ventas_punto_emision_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
3762--
3763
3764ALTER TABLE ONLY ventas
3765 ADD CONSTRAINT ventas_punto_emision_id_fkey FOREIGN KEY (punto_emision_id) REFERENCES puntos_emision(id) ON UPDATE CASCADE ON DELETE SET NULL;
3766
3767
3768--
3769-- TOC entry 2528 (class 2606 OID 242655)
3770-- Name: ventas_sucursal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
3771--
3772
3773ALTER TABLE ONLY ventas
3774 ADD CONSTRAINT ventas_sucursal_id_fkey FOREIGN KEY (sucursal_id) REFERENCES sucursales(id) ON UPDATE CASCADE ON DELETE SET NULL;
3775
3776
3777--
3778-- TOC entry 2529 (class 2606 OID 242660)
3779-- Name: ventas_timbrado_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
3780--
3781
3782ALTER TABLE ONLY ventas
3783 ADD CONSTRAINT ventas_timbrado_id_fkey FOREIGN KEY (timbrado_id) REFERENCES timbrados(id) ON UPDATE CASCADE ON DELETE SET NULL;
3784
3785
3786--
3787-- TOC entry 2732 (class 0 OID 0)
3788-- Dependencies: 6
3789-- Name: public; Type: ACL; Schema: -; Owner: postgres
3790--
3791
3792REVOKE ALL ON SCHEMA public FROM PUBLIC;
3793REVOKE ALL ON SCHEMA public FROM postgres;
3794GRANT ALL ON SCHEMA public TO postgres;
3795GRANT ALL ON SCHEMA public TO PUBLIC;
3796
3797
3798-- Completed on 2018-01-31 14:48:56 -03
3799
3800--
3801-- PostgreSQL database dump complete
3802--