· 8 years ago · Nov 15, 2017, 07:54 PM
1--
2-- PostgreSQL database dump
3--
4
5SET statement_timeout = 0;
6SET lock_timeout = 0;
7SET client_encoding = 'UTF8';
8SET standard_conforming_strings = on;
9SET check_function_bodies = false;
10SET client_min_messages = warning;
11
12--
13-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner:
14--
15
16CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
17
18
19--
20-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner:
21--
22
23COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
24
25
26SET search_path = public, pg_catalog;
27
28SET default_tablespace = '';
29
30SET default_with_oids = false;
31
32--
33-- Name: acl_lists; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
34--
35
36CREATE TABLE acl_lists (
37 id integer NOT NULL,
38 acl_name character varying(128) NOT NULL,
39 default_policy character varying(10) NOT NULL,
40 date_added timestamp with time zone NOT NULL,
41 date_modified timestamp with time zone NOT NULL
42);
43
44
45ALTER TABLE acl_lists OWNER TO pyfreebilling;
46
47--
48-- Name: acl_lists_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
49--
50
51CREATE SEQUENCE acl_lists_id_seq
52 START WITH 1
53 INCREMENT BY 1
54 NO MINVALUE
55 NO MAXVALUE
56 CACHE 1;
57
58
59ALTER TABLE acl_lists_id_seq OWNER TO pyfreebilling;
60
61--
62-- Name: acl_lists_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
63--
64
65ALTER SEQUENCE acl_lists_id_seq OWNED BY acl_lists.id;
66
67
68--
69-- Name: acl_nodes; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
70--
71
72CREATE TABLE acl_nodes (
73 id integer NOT NULL,
74 cidr character varying(100) NOT NULL,
75 policy character varying(10) NOT NULL,
76 date_added timestamp with time zone NOT NULL,
77 date_modified timestamp with time zone NOT NULL,
78 acllist_id integer NOT NULL,
79 company_id integer NOT NULL
80);
81
82
83ALTER TABLE acl_nodes OWNER TO pyfreebilling;
84
85--
86-- Name: acl_nodes_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
87--
88
89CREATE SEQUENCE acl_nodes_id_seq
90 START WITH 1
91 INCREMENT BY 1
92 NO MINVALUE
93 NO MAXVALUE
94 CACHE 1;
95
96
97ALTER TABLE acl_nodes_id_seq OWNER TO pyfreebilling;
98
99--
100-- Name: acl_nodes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
101--
102
103ALTER SEQUENCE acl_nodes_id_seq OWNED BY acl_nodes.id;
104
105
106--
107-- Name: customer_directory; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
108--
109
110CREATE TABLE customer_directory (
111 id integer NOT NULL,
112 registration boolean NOT NULL,
113 password character varying(100) NOT NULL,
114 description text NOT NULL,
115 name character varying(50) NOT NULL,
116 rtp_ip character varying(100) NOT NULL,
117 sip_ip character varying(100),
118 sip_port integer NOT NULL,
119 max_calls integer NOT NULL,
120 calls_per_second integer NOT NULL,
121 log_auth_failures boolean NOT NULL,
122 codecs character varying(100) NOT NULL,
123 multiple_registrations character varying(100) NOT NULL,
124 outbound_caller_id_name character varying(50) NOT NULL,
125 outbound_caller_id_number character varying(80) NOT NULL,
126 ignore_early_media character varying(20) NOT NULL,
127 enabled boolean NOT NULL,
128 fake_ring boolean NOT NULL,
129 cli_debug boolean NOT NULL,
130 vmd boolean NOT NULL,
131 date_added timestamp with time zone NOT NULL,
132 date_modified timestamp with time zone NOT NULL,
133 company_id integer NOT NULL,
134 callee_norm_id integer,
135 callerid_norm_id integer,
136 domain_id integer NOT NULL,
137 force_caller_id boolean NOT NULL,
138 insee_code character varying(10),
139 masq_caller_id boolean NOT NULL,
140 urgency_numbr boolean NOT NULL,
141 callee_norm_in_id integer,
142 callerid_norm_in_id integer,
143 CONSTRAINT customer_directory_calls_per_second_check CHECK ((calls_per_second >= 0)),
144 CONSTRAINT customer_directory_max_calls_check CHECK ((max_calls >= 0)),
145 CONSTRAINT customer_directory_sip_port_check CHECK ((sip_port >= 0))
146);
147
148
149ALTER TABLE customer_directory OWNER TO pyfreebilling;
150
151--
152-- Name: sofia_gateway; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
153--
154
155CREATE TABLE sofia_gateway (
156 id integer NOT NULL,
157 name character varying(100) NOT NULL,
158 channels integer NOT NULL,
159 enabled boolean NOT NULL,
160 prefix character varying(15) NOT NULL,
161 suffix character varying(15) NOT NULL,
162 codec character varying(30) NOT NULL,
163 username character varying(35) NOT NULL,
164 password character varying(35) NOT NULL,
165 register boolean NOT NULL,
166 proxy character varying(48) NOT NULL,
167 extension character varying(50) NOT NULL,
168 realm character varying(50) NOT NULL,
169 from_domain character varying(50) NOT NULL,
170 expire_seconds integer,
171 retry_seconds integer,
172 caller_id_in_from boolean NOT NULL,
173 sip_cid_type character varying(10) NOT NULL,
174 date_added timestamp with time zone NOT NULL,
175 date_modified timestamp with time zone NOT NULL,
176 company_id integer NOT NULL,
177 sip_profile_id integer NOT NULL,
178 domain_id integer NOT NULL,
179 transport character varying(15) NOT NULL,
180 CONSTRAINT sofia_gateway_channels_check CHECK ((channels >= 0)),
181 CONSTRAINT sofia_gateway_expire_seconds_check CHECK ((expire_seconds >= 0)),
182 CONSTRAINT sofia_gateway_retry_seconds_check CHECK ((retry_seconds >= 0))
183);
184
185
186ALTER TABLE sofia_gateway OWNER TO pyfreebilling;
187
188--
189-- Name: address; Type: VIEW; Schema: public; Owner: pyfreebilling
190--
191
192CREATE VIEW address AS
193 SELECT row_number() OVER () AS id,
194 v.grp,
195 v.ip_addr,
196 v.mask,
197 v.port,
198 v.tag
199 FROM ( SELECT 1 AS grp,
200 ("left"((c.sip_ip)::text, (length((c.sip_ip)::text) - 3)))::character varying AS ip_addr,
201 ("right"((c.sip_ip)::text, 2))::integer AS mask,
202 c.sip_port AS port,
203 c.name AS tag
204 FROM customer_directory c
205 WHERE ((c.enabled = true) AND (c.registration = false))
206 UNION ALL
207 SELECT 10 AS grp,
208 sg.proxy AS ip_addr,
209 32 AS mask,
210 5060 AS port,
211 sg.name AS tag
212 FROM sofia_gateway sg
213 WHERE ((sg.enabled = true) AND (sg.register = false))) v;
214
215
216ALTER TABLE address OWNER TO pyfreebilling;
217
218--
219-- Name: admin_honeypot_loginattempt; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
220--
221
222CREATE TABLE admin_honeypot_loginattempt (
223 id integer NOT NULL,
224 username character varying(255),
225 ip_address inet,
226 session_key character varying(50),
227 user_agent text,
228 "timestamp" timestamp with time zone NOT NULL,
229 path text
230);
231
232
233ALTER TABLE admin_honeypot_loginattempt OWNER TO pyfreebilling;
234
235--
236-- Name: admin_honeypot_loginattempt_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
237--
238
239CREATE SEQUENCE admin_honeypot_loginattempt_id_seq
240 START WITH 1
241 INCREMENT BY 1
242 NO MINVALUE
243 NO MAXVALUE
244 CACHE 1;
245
246
247ALTER TABLE admin_honeypot_loginattempt_id_seq OWNER TO pyfreebilling;
248
249--
250-- Name: admin_honeypot_loginattempt_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
251--
252
253ALTER SEQUENCE admin_honeypot_loginattempt_id_seq OWNED BY admin_honeypot_loginattempt.id;
254
255
256--
257-- Name: admin_tools_menu_bookmark; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
258--
259
260CREATE TABLE admin_tools_menu_bookmark (
261 id integer NOT NULL,
262 url character varying(255) NOT NULL,
263 title character varying(255) NOT NULL,
264 user_id integer NOT NULL
265);
266
267
268ALTER TABLE admin_tools_menu_bookmark OWNER TO pyfreebilling;
269
270--
271-- Name: admin_tools_menu_bookmark_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
272--
273
274CREATE SEQUENCE admin_tools_menu_bookmark_id_seq
275 START WITH 1
276 INCREMENT BY 1
277 NO MINVALUE
278 NO MAXVALUE
279 CACHE 1;
280
281
282ALTER TABLE admin_tools_menu_bookmark_id_seq OWNER TO pyfreebilling;
283
284--
285-- Name: admin_tools_menu_bookmark_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
286--
287
288ALTER SEQUENCE admin_tools_menu_bookmark_id_seq OWNED BY admin_tools_menu_bookmark.id;
289
290
291--
292-- Name: aliases; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
293--
294
295CREATE TABLE aliases (
296 id integer NOT NULL,
297 ruid character varying(64) DEFAULT ''::character varying NOT NULL,
298 username character varying(64) DEFAULT ''::character varying NOT NULL,
299 domain character varying(64) DEFAULT NULL::character varying,
300 contact character varying(255) DEFAULT ''::character varying NOT NULL,
301 received character varying(128) DEFAULT NULL::character varying,
302 path character varying(512) DEFAULT NULL::character varying,
303 expires timestamp without time zone DEFAULT '2030-05-28 21:32:15'::timestamp without time zone NOT NULL,
304 q real DEFAULT 1.0 NOT NULL,
305 callid character varying(255) DEFAULT 'Default-Call-ID'::character varying NOT NULL,
306 cseq integer DEFAULT 1 NOT NULL,
307 last_modified timestamp without time zone DEFAULT '2000-01-01 00:00:01'::timestamp without time zone NOT NULL,
308 flags integer DEFAULT 0 NOT NULL,
309 cflags integer DEFAULT 0 NOT NULL,
310 user_agent character varying(255) DEFAULT ''::character varying NOT NULL,
311 socket character varying(64) DEFAULT NULL::character varying,
312 methods integer,
313 instance character varying(255) DEFAULT NULL::character varying,
314 reg_id integer DEFAULT 0 NOT NULL,
315 server_id integer DEFAULT 0 NOT NULL,
316 connection_id integer DEFAULT 0 NOT NULL,
317 keepalive integer DEFAULT 0 NOT NULL,
318 partition integer DEFAULT 0 NOT NULL
319);
320
321
322ALTER TABLE aliases OWNER TO pyfreebilling;
323
324--
325-- Name: aliases_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
326--
327
328CREATE SEQUENCE aliases_id_seq
329 START WITH 1
330 INCREMENT BY 1
331 NO MINVALUE
332 NO MAXVALUE
333 CACHE 1;
334
335
336ALTER TABLE aliases_id_seq OWNER TO pyfreebilling;
337
338--
339-- Name: aliases_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
340--
341
342ALTER SEQUENCE aliases_id_seq OWNED BY aliases.id;
343
344
345--
346-- Name: auth_group; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
347--
348
349CREATE TABLE auth_group (
350 id integer NOT NULL,
351 name character varying(80) NOT NULL
352);
353
354
355ALTER TABLE auth_group OWNER TO pyfreebilling;
356
357--
358-- Name: auth_group_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
359--
360
361CREATE SEQUENCE auth_group_id_seq
362 START WITH 1
363 INCREMENT BY 1
364 NO MINVALUE
365 NO MAXVALUE
366 CACHE 1;
367
368
369ALTER TABLE auth_group_id_seq OWNER TO pyfreebilling;
370
371--
372-- Name: auth_group_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
373--
374
375ALTER SEQUENCE auth_group_id_seq OWNED BY auth_group.id;
376
377
378--
379-- Name: auth_group_permissions; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
380--
381
382CREATE TABLE auth_group_permissions (
383 id integer NOT NULL,
384 group_id integer NOT NULL,
385 permission_id integer NOT NULL
386);
387
388
389ALTER TABLE auth_group_permissions OWNER TO pyfreebilling;
390
391--
392-- Name: auth_group_permissions_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
393--
394
395CREATE SEQUENCE auth_group_permissions_id_seq
396 START WITH 1
397 INCREMENT BY 1
398 NO MINVALUE
399 NO MAXVALUE
400 CACHE 1;
401
402
403ALTER TABLE auth_group_permissions_id_seq OWNER TO pyfreebilling;
404
405--
406-- Name: auth_group_permissions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
407--
408
409ALTER SEQUENCE auth_group_permissions_id_seq OWNED BY auth_group_permissions.id;
410
411
412--
413-- Name: auth_permission; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
414--
415
416CREATE TABLE auth_permission (
417 id integer NOT NULL,
418 name character varying(255) NOT NULL,
419 content_type_id integer NOT NULL,
420 codename character varying(100) NOT NULL
421);
422
423
424ALTER TABLE auth_permission OWNER TO pyfreebilling;
425
426--
427-- Name: auth_permission_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
428--
429
430CREATE SEQUENCE auth_permission_id_seq
431 START WITH 1
432 INCREMENT BY 1
433 NO MINVALUE
434 NO MAXVALUE
435 CACHE 1;
436
437
438ALTER TABLE auth_permission_id_seq OWNER TO pyfreebilling;
439
440--
441-- Name: auth_permission_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
442--
443
444ALTER SEQUENCE auth_permission_id_seq OWNED BY auth_permission.id;
445
446
447--
448-- Name: auth_user; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
449--
450
451CREATE TABLE auth_user (
452 id integer NOT NULL,
453 password character varying(128) NOT NULL,
454 last_login timestamp with time zone,
455 is_superuser boolean NOT NULL,
456 username character varying(150) NOT NULL,
457 first_name character varying(30) NOT NULL,
458 last_name character varying(30) NOT NULL,
459 email character varying(254) NOT NULL,
460 is_staff boolean NOT NULL,
461 is_active boolean NOT NULL,
462 date_joined timestamp with time zone NOT NULL
463);
464
465
466ALTER TABLE auth_user OWNER TO pyfreebilling;
467
468--
469-- Name: auth_user_groups; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
470--
471
472CREATE TABLE auth_user_groups (
473 id integer NOT NULL,
474 user_id integer NOT NULL,
475 group_id integer NOT NULL
476);
477
478
479ALTER TABLE auth_user_groups OWNER TO pyfreebilling;
480
481--
482-- Name: auth_user_groups_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
483--
484
485CREATE SEQUENCE auth_user_groups_id_seq
486 START WITH 1
487 INCREMENT BY 1
488 NO MINVALUE
489 NO MAXVALUE
490 CACHE 1;
491
492
493ALTER TABLE auth_user_groups_id_seq OWNER TO pyfreebilling;
494
495--
496-- Name: auth_user_groups_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
497--
498
499ALTER SEQUENCE auth_user_groups_id_seq OWNED BY auth_user_groups.id;
500
501
502--
503-- Name: auth_user_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
504--
505
506CREATE SEQUENCE auth_user_id_seq
507 START WITH 1
508 INCREMENT BY 1
509 NO MINVALUE
510 NO MAXVALUE
511 CACHE 1;
512
513
514ALTER TABLE auth_user_id_seq OWNER TO pyfreebilling;
515
516--
517-- Name: auth_user_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
518--
519
520ALTER SEQUENCE auth_user_id_seq OWNED BY auth_user.id;
521
522
523--
524-- Name: auth_user_user_permissions; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
525--
526
527CREATE TABLE auth_user_user_permissions (
528 id integer NOT NULL,
529 user_id integer NOT NULL,
530 permission_id integer NOT NULL
531);
532
533
534ALTER TABLE auth_user_user_permissions OWNER TO pyfreebilling;
535
536--
537-- Name: auth_user_user_permissions_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
538--
539
540CREATE SEQUENCE auth_user_user_permissions_id_seq
541 START WITH 1
542 INCREMENT BY 1
543 NO MINVALUE
544 NO MAXVALUE
545 CACHE 1;
546
547
548ALTER TABLE auth_user_user_permissions_id_seq OWNER TO pyfreebilling;
549
550--
551-- Name: auth_user_user_permissions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
552--
553
554ALTER SEQUENCE auth_user_user_permissions_id_seq OWNED BY auth_user_user_permissions.id;
555
556
557--
558-- Name: axes_accessattempt; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
559--
560
561CREATE TABLE axes_accessattempt (
562 id integer NOT NULL,
563 user_agent character varying(255) NOT NULL,
564 ip_address inet,
565 username character varying(255),
566 trusted boolean NOT NULL,
567 http_accept character varying(1025) NOT NULL,
568 path_info character varying(255) NOT NULL,
569 attempt_time timestamp with time zone NOT NULL,
570 get_data text NOT NULL,
571 post_data text NOT NULL,
572 failures_since_start integer NOT NULL,
573 CONSTRAINT axes_accessattempt_failures_since_start_check CHECK ((failures_since_start >= 0))
574);
575
576
577ALTER TABLE axes_accessattempt OWNER TO pyfreebilling;
578
579--
580-- Name: axes_accessattempt_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
581--
582
583CREATE SEQUENCE axes_accessattempt_id_seq
584 START WITH 1
585 INCREMENT BY 1
586 NO MINVALUE
587 NO MAXVALUE
588 CACHE 1;
589
590
591ALTER TABLE axes_accessattempt_id_seq OWNER TO pyfreebilling;
592
593--
594-- Name: axes_accessattempt_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
595--
596
597ALTER SEQUENCE axes_accessattempt_id_seq OWNED BY axes_accessattempt.id;
598
599
600--
601-- Name: axes_accesslog; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
602--
603
604CREATE TABLE axes_accesslog (
605 id integer NOT NULL,
606 user_agent character varying(255) NOT NULL,
607 ip_address inet,
608 username character varying(255),
609 trusted boolean NOT NULL,
610 http_accept character varying(1025) NOT NULL,
611 path_info character varying(255) NOT NULL,
612 attempt_time timestamp with time zone NOT NULL,
613 logout_time timestamp with time zone
614);
615
616
617ALTER TABLE axes_accesslog OWNER TO pyfreebilling;
618
619--
620-- Name: axes_accesslog_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
621--
622
623CREATE SEQUENCE axes_accesslog_id_seq
624 START WITH 1
625 INCREMENT BY 1
626 NO MINVALUE
627 NO MAXVALUE
628 CACHE 1;
629
630
631ALTER TABLE axes_accesslog_id_seq OWNER TO pyfreebilling;
632
633--
634-- Name: axes_accesslog_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
635--
636
637ALTER SEQUENCE axes_accesslog_id_seq OWNED BY axes_accesslog.id;
638
639
640--
641-- Name: call_mapping_rule; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
642--
643
644CREATE TABLE call_mapping_rule (
645 id integer NOT NULL,
646 name character varying(30) NOT NULL,
647 dpid integer NOT NULL,
648 pr integer NOT NULL,
649 match_op integer NOT NULL,
650 match_exp character varying(64) NOT NULL,
651 match_len integer NOT NULL,
652 subst_exp character varying(64) NOT NULL,
653 repl_exp character varying(64) NOT NULL,
654 attrs character varying(64) NOT NULL,
655 description text NOT NULL,
656 date_added timestamp with time zone NOT NULL,
657 date_modified timestamp with time zone NOT NULL
658);
659
660
661ALTER TABLE call_mapping_rule OWNER TO pyfreebilling;
662
663--
664-- Name: call_mapping_rule_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
665--
666
667CREATE SEQUENCE call_mapping_rule_id_seq
668 START WITH 1
669 INCREMENT BY 1
670 NO MINVALUE
671 NO MAXVALUE
672 CACHE 1;
673
674
675ALTER TABLE call_mapping_rule_id_seq OWNER TO pyfreebilling;
676
677--
678-- Name: call_mapping_rule_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
679--
680
681ALTER SEQUENCE call_mapping_rule_id_seq OWNED BY call_mapping_rule.id;
682
683
684--
685-- Name: caller_id_prefix; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
686--
687
688CREATE TABLE caller_id_prefix (
689 id integer NOT NULL,
690 prefix character varying(30) NOT NULL,
691 date_added timestamp with time zone NOT NULL,
692 date_modified timestamp with time zone NOT NULL,
693 calleridprefixlist_id integer NOT NULL
694);
695
696
697ALTER TABLE caller_id_prefix OWNER TO pyfreebilling;
698
699--
700-- Name: caller_id_prefix_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
701--
702
703CREATE SEQUENCE caller_id_prefix_id_seq
704 START WITH 1
705 INCREMENT BY 1
706 NO MINVALUE
707 NO MAXVALUE
708 CACHE 1;
709
710
711ALTER TABLE caller_id_prefix_id_seq OWNER TO pyfreebilling;
712
713--
714-- Name: caller_id_prefix_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
715--
716
717ALTER SEQUENCE caller_id_prefix_id_seq OWNED BY caller_id_prefix.id;
718
719
720--
721-- Name: callerid_prefix_list; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
722--
723
724CREATE TABLE callerid_prefix_list (
725 id integer NOT NULL,
726 name character varying(128) NOT NULL,
727 description text NOT NULL,
728 date_added timestamp with time zone NOT NULL,
729 date_modified timestamp with time zone NOT NULL
730);
731
732
733ALTER TABLE callerid_prefix_list OWNER TO pyfreebilling;
734
735--
736-- Name: callerid_prefix_list_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
737--
738
739CREATE SEQUENCE callerid_prefix_list_id_seq
740 START WITH 1
741 INCREMENT BY 1
742 NO MINVALUE
743 NO MAXVALUE
744 CACHE 1;
745
746
747ALTER TABLE callerid_prefix_list_id_seq OWNER TO pyfreebilling;
748
749--
750-- Name: callerid_prefix_list_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
751--
752
753ALTER SEQUENCE callerid_prefix_list_id_seq OWNED BY callerid_prefix_list.id;
754
755
756--
757-- Name: carrier_cid_norm_rules; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
758--
759
760CREATE TABLE carrier_cid_norm_rules (
761 id integer NOT NULL,
762 prefix character varying(30) NOT NULL,
763 description text NOT NULL,
764 remove_prefix character varying(15) NOT NULL,
765 add_prefix character varying(15) NOT NULL,
766 date_added timestamp with time zone NOT NULL,
767 date_modified timestamp with time zone NOT NULL,
768 company_id integer NOT NULL
769);
770
771
772ALTER TABLE carrier_cid_norm_rules OWNER TO pyfreebilling;
773
774--
775-- Name: carrier_cid_norm_rules_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
776--
777
778CREATE SEQUENCE carrier_cid_norm_rules_id_seq
779 START WITH 1
780 INCREMENT BY 1
781 NO MINVALUE
782 NO MAXVALUE
783 CACHE 1;
784
785
786ALTER TABLE carrier_cid_norm_rules_id_seq OWNER TO pyfreebilling;
787
788--
789-- Name: carrier_cid_norm_rules_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
790--
791
792ALTER SEQUENCE carrier_cid_norm_rules_id_seq OWNED BY carrier_cid_norm_rules.id;
793
794
795--
796-- Name: carrier_norm_rules; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
797--
798
799CREATE TABLE carrier_norm_rules (
800 id integer NOT NULL,
801 prefix character varying(30) NOT NULL,
802 description text NOT NULL,
803 remove_prefix character varying(15) NOT NULL,
804 add_prefix character varying(15) NOT NULL,
805 date_added timestamp with time zone NOT NULL,
806 date_modified timestamp with time zone NOT NULL,
807 company_id integer NOT NULL
808);
809
810
811ALTER TABLE carrier_norm_rules OWNER TO pyfreebilling;
812
813--
814-- Name: carrier_norm_rules_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
815--
816
817CREATE SEQUENCE carrier_norm_rules_id_seq
818 START WITH 1
819 INCREMENT BY 1
820 NO MINVALUE
821 NO MAXVALUE
822 CACHE 1;
823
824
825ALTER TABLE carrier_norm_rules_id_seq OWNER TO pyfreebilling;
826
827--
828-- Name: carrier_norm_rules_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
829--
830
831ALTER SEQUENCE carrier_norm_rules_id_seq OWNED BY carrier_norm_rules.id;
832
833
834--
835-- Name: cdr; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
836--
837
838CREATE TABLE cdr (
839 id integer NOT NULL,
840 customer_ip character varying(100),
841 uuid character varying(100),
842 bleg_uuid character varying(100),
843 caller_id_number character varying(100),
844 destination_number character varying(100),
845 chan_name character varying(100),
846 start_stamp timestamp with time zone,
847 answered_stamp timestamp with time zone,
848 end_stamp timestamp with time zone,
849 duration integer,
850 effectiv_duration integer,
851 effective_duration integer,
852 billsec integer,
853 read_codec character varying(20),
854 write_codec character varying(20),
855 hangup_cause character varying(50),
856 hangup_cause_q850 integer,
857 cost_rate numeric(11,5),
858 total_sell numeric(11,5),
859 total_cost numeric(11,5),
860 prefix character varying(30),
861 country character varying(100),
862 rate numeric(11,5),
863 init_block numeric(11,5),
864 block_min_duration integer,
865 sip_user_agent character varying(100),
866 sip_rtp_rxstat character varying(30),
867 sip_rtp_txstat character varying(30),
868 switchname character varying(100),
869 switch_ipv4 character varying(100),
870 hangup_disposition character varying(100),
871 sip_hangup_cause character varying(100),
872 sell_destination character varying(128),
873 cost_destination character varying(128),
874 customer_id integer,
875 gateway_id integer,
876 lcr_carrier_id_id integer,
877 lcr_group_id_id integer,
878 ratecard_id_id integer,
879 customerdirectory_id_id integer,
880 insee_code character varying(10),
881 kam_uuid character varying(100),
882 rctype character varying(10),
883 sipserver_name character varying(100)
884);
885
886
887ALTER TABLE cdr OWNER TO pyfreebilling;
888
889--
890-- Name: cdr_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
891--
892
893CREATE SEQUENCE cdr_id_seq
894 START WITH 1
895 INCREMENT BY 1
896 NO MINVALUE
897 NO MAXVALUE
898 CACHE 1;
899
900
901ALTER TABLE cdr_id_seq OWNER TO pyfreebilling;
902
903--
904-- Name: cdr_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
905--
906
907ALTER SEQUENCE cdr_id_seq OWNED BY cdr.id;
908
909
910--
911-- Name: chroniker_job; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
912--
913
914CREATE TABLE chroniker_job (
915 id integer NOT NULL,
916 name character varying(200) NOT NULL,
917 frequency character varying(10) NOT NULL,
918 params text,
919 command character varying(200) NOT NULL,
920 args character varying(200) NOT NULL,
921 raw_command character varying(1000),
922 enabled boolean NOT NULL,
923 next_run timestamp with time zone,
924 last_run_start_timestamp timestamp with time zone,
925 last_run timestamp with time zone,
926 last_heartbeat timestamp with time zone,
927 is_running boolean NOT NULL,
928 last_run_successful boolean,
929 email_errors_to_subscribers boolean NOT NULL,
930 email_success_to_subscribers boolean NOT NULL,
931 lock_file character varying(255) NOT NULL,
932 force_run boolean NOT NULL,
933 force_stop boolean NOT NULL,
934 timeout_seconds integer NOT NULL,
935 hostname character varying(700),
936 current_hostname character varying(700),
937 current_pid character varying(50),
938 total_parts_complete integer NOT NULL,
939 total_parts integer NOT NULL,
940 is_monitor boolean NOT NULL,
941 monitor_url character varying(255),
942 monitor_error_template text,
943 monitor_description text,
944 monitor_records integer,
945 maximum_log_entries integer NOT NULL,
946 log_stdout boolean NOT NULL,
947 log_stderr boolean NOT NULL,
948 CONSTRAINT chroniker_job_maximum_log_entries_check CHECK ((maximum_log_entries >= 0)),
949 CONSTRAINT chroniker_job_timeout_seconds_check CHECK ((timeout_seconds >= 0)),
950 CONSTRAINT chroniker_job_total_parts_check CHECK ((total_parts >= 0)),
951 CONSTRAINT chroniker_job_total_parts_complete_check CHECK ((total_parts_complete >= 0))
952);
953
954
955ALTER TABLE chroniker_job OWNER TO pyfreebilling;
956
957--
958-- Name: chroniker_job_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
959--
960
961CREATE SEQUENCE chroniker_job_id_seq
962 START WITH 1
963 INCREMENT BY 1
964 NO MINVALUE
965 NO MAXVALUE
966 CACHE 1;
967
968
969ALTER TABLE chroniker_job_id_seq OWNER TO pyfreebilling;
970
971--
972-- Name: chroniker_job_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
973--
974
975ALTER SEQUENCE chroniker_job_id_seq OWNED BY chroniker_job.id;
976
977
978--
979-- Name: chroniker_job_subscribers; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
980--
981
982CREATE TABLE chroniker_job_subscribers (
983 id integer NOT NULL,
984 job_id integer NOT NULL,
985 user_id integer NOT NULL
986);
987
988
989ALTER TABLE chroniker_job_subscribers OWNER TO pyfreebilling;
990
991--
992-- Name: chroniker_job_subscribers_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
993--
994
995CREATE SEQUENCE chroniker_job_subscribers_id_seq
996 START WITH 1
997 INCREMENT BY 1
998 NO MINVALUE
999 NO MAXVALUE
1000 CACHE 1;
1001
1002
1003ALTER TABLE chroniker_job_subscribers_id_seq OWNER TO pyfreebilling;
1004
1005--
1006-- Name: chroniker_job_subscribers_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
1007--
1008
1009ALTER SEQUENCE chroniker_job_subscribers_id_seq OWNED BY chroniker_job_subscribers.id;
1010
1011
1012--
1013-- Name: chroniker_jobdependency; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
1014--
1015
1016CREATE TABLE chroniker_jobdependency (
1017 id integer NOT NULL,
1018 wait_for_completion boolean NOT NULL,
1019 wait_for_success boolean NOT NULL,
1020 wait_for_next_run boolean NOT NULL,
1021 dependee_id integer NOT NULL,
1022 dependent_id integer NOT NULL
1023);
1024
1025
1026ALTER TABLE chroniker_jobdependency OWNER TO pyfreebilling;
1027
1028--
1029-- Name: chroniker_jobdependency_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
1030--
1031
1032CREATE SEQUENCE chroniker_jobdependency_id_seq
1033 START WITH 1
1034 INCREMENT BY 1
1035 NO MINVALUE
1036 NO MAXVALUE
1037 CACHE 1;
1038
1039
1040ALTER TABLE chroniker_jobdependency_id_seq OWNER TO pyfreebilling;
1041
1042--
1043-- Name: chroniker_jobdependency_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
1044--
1045
1046ALTER SEQUENCE chroniker_jobdependency_id_seq OWNED BY chroniker_jobdependency.id;
1047
1048
1049--
1050-- Name: chroniker_log; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
1051--
1052
1053CREATE TABLE chroniker_log (
1054 id integer NOT NULL,
1055 run_start_datetime timestamp with time zone NOT NULL,
1056 run_end_datetime timestamp with time zone,
1057 duration_seconds integer,
1058 stdout text NOT NULL,
1059 stderr text NOT NULL,
1060 hostname character varying(700),
1061 success boolean NOT NULL,
1062 on_time boolean NOT NULL,
1063 job_id integer NOT NULL,
1064 CONSTRAINT chroniker_log_duration_seconds_check CHECK ((duration_seconds >= 0))
1065);
1066
1067
1068ALTER TABLE chroniker_log OWNER TO pyfreebilling;
1069
1070--
1071-- Name: chroniker_log_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
1072--
1073
1074CREATE SEQUENCE chroniker_log_id_seq
1075 START WITH 1
1076 INCREMENT BY 1
1077 NO MINVALUE
1078 NO MAXVALUE
1079 CACHE 1;
1080
1081
1082ALTER TABLE chroniker_log_id_seq OWNER TO pyfreebilling;
1083
1084--
1085-- Name: chroniker_log_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
1086--
1087
1088ALTER SEQUENCE chroniker_log_id_seq OWNED BY chroniker_log.id;
1089
1090
1091--
1092-- Name: company; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
1093--
1094
1095CREATE TABLE company (
1096 id integer NOT NULL,
1097 name character varying(200) NOT NULL,
1098 nickname character varying(50),
1099 slug character varying(50) NOT NULL,
1100 about character varying(250),
1101 account_number integer,
1102 vat boolean NOT NULL,
1103 vat_number character varying(30) NOT NULL,
1104 vat_number_validated boolean NOT NULL,
1105 prepaid boolean NOT NULL,
1106 credit_limit numeric(12,4) NOT NULL,
1107 low_credit_alert numeric(12,4) NOT NULL,
1108 low_credit_alert_sent boolean NOT NULL,
1109 account_blocked_alert_sent boolean NOT NULL,
1110 email_alert character varying(254),
1111 customer_balance numeric(12,6) NOT NULL,
1112 supplier_balance numeric(12,6) NOT NULL,
1113 max_calls integer NOT NULL,
1114 calls_per_second integer NOT NULL,
1115 billing_cycle character varying(10) NOT NULL,
1116 customer_enabled boolean NOT NULL,
1117 supplier_enabled boolean NOT NULL,
1118 date_added timestamp with time zone NOT NULL,
1119 date_modified timestamp with time zone NOT NULL,
1120 cb_currency_id integer NOT NULL,
1121 CONSTRAINT company_calls_per_second_check CHECK ((calls_per_second >= 0)),
1122 CONSTRAINT company_max_calls_check CHECK ((max_calls >= 0))
1123);
1124
1125
1126ALTER TABLE company OWNER TO pyfreebilling;
1127
1128--
1129-- Name: company_balance_history; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
1130--
1131
1132CREATE TABLE company_balance_history (
1133 id integer NOT NULL,
1134 amount_debited numeric(12,4) NOT NULL,
1135 amount_refund numeric(12,4) NOT NULL,
1136 customer_balance numeric(12,4) NOT NULL,
1137 supplier_balance numeric(12,4) NOT NULL,
1138 operation_type character varying(10) NOT NULL,
1139 reference character varying(255) NOT NULL,
1140 description character varying(255) NOT NULL,
1141 date_added timestamp with time zone NOT NULL,
1142 date_modified timestamp with time zone NOT NULL,
1143 company_id integer NOT NULL
1144);
1145
1146
1147ALTER TABLE company_balance_history OWNER TO pyfreebilling;
1148
1149--
1150-- Name: company_balance_history_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
1151--
1152
1153CREATE SEQUENCE company_balance_history_id_seq
1154 START WITH 1
1155 INCREMENT BY 1
1156 NO MINVALUE
1157 NO MAXVALUE
1158 CACHE 1;
1159
1160
1161ALTER TABLE company_balance_history_id_seq OWNER TO pyfreebilling;
1162
1163--
1164-- Name: company_balance_history_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
1165--
1166
1167ALTER SEQUENCE company_balance_history_id_seq OWNED BY company_balance_history.id;
1168
1169
1170--
1171-- Name: company_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
1172--
1173
1174CREATE SEQUENCE company_id_seq
1175 START WITH 1
1176 INCREMENT BY 1
1177 NO MINVALUE
1178 NO MAXVALUE
1179 CACHE 1;
1180
1181
1182ALTER TABLE company_id_seq OWNER TO pyfreebilling;
1183
1184--
1185-- Name: company_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
1186--
1187
1188ALTER SEQUENCE company_id_seq OWNED BY company.id;
1189
1190
1191--
1192-- Name: contacts_email_addresses; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
1193--
1194
1195CREATE TABLE contacts_email_addresses (
1196 id integer NOT NULL,
1197 object_id integer NOT NULL,
1198 email_address character varying(254) NOT NULL,
1199 location character varying(6) NOT NULL,
1200 date_added timestamp with time zone NOT NULL,
1201 date_modified timestamp with time zone NOT NULL,
1202 content_type_id integer NOT NULL
1203);
1204
1205
1206ALTER TABLE contacts_email_addresses OWNER TO pyfreebilling;
1207
1208--
1209-- Name: contacts_email_addresses_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
1210--
1211
1212CREATE SEQUENCE contacts_email_addresses_id_seq
1213 START WITH 1
1214 INCREMENT BY 1
1215 NO MINVALUE
1216 NO MAXVALUE
1217 CACHE 1;
1218
1219
1220ALTER TABLE contacts_email_addresses_id_seq OWNER TO pyfreebilling;
1221
1222--
1223-- Name: contacts_email_addresses_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
1224--
1225
1226ALTER SEQUENCE contacts_email_addresses_id_seq OWNED BY contacts_email_addresses.id;
1227
1228
1229--
1230-- Name: contacts_groups; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
1231--
1232
1233CREATE TABLE contacts_groups (
1234 id integer NOT NULL,
1235 name character varying(200) NOT NULL,
1236 slug character varying(50) NOT NULL,
1237 about text NOT NULL,
1238 date_added timestamp with time zone NOT NULL,
1239 date_modified timestamp with time zone NOT NULL
1240);
1241
1242
1243ALTER TABLE contacts_groups OWNER TO pyfreebilling;
1244
1245--
1246-- Name: contacts_groups_companies; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
1247--
1248
1249CREATE TABLE contacts_groups_companies (
1250 id integer NOT NULL,
1251 group_id integer NOT NULL,
1252 company_id integer NOT NULL
1253);
1254
1255
1256ALTER TABLE contacts_groups_companies OWNER TO pyfreebilling;
1257
1258--
1259-- Name: contacts_groups_companies_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
1260--
1261
1262CREATE SEQUENCE contacts_groups_companies_id_seq
1263 START WITH 1
1264 INCREMENT BY 1
1265 NO MINVALUE
1266 NO MAXVALUE
1267 CACHE 1;
1268
1269
1270ALTER TABLE contacts_groups_companies_id_seq OWNER TO pyfreebilling;
1271
1272--
1273-- Name: contacts_groups_companies_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
1274--
1275
1276ALTER SEQUENCE contacts_groups_companies_id_seq OWNED BY contacts_groups_companies.id;
1277
1278
1279--
1280-- Name: contacts_groups_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
1281--
1282
1283CREATE SEQUENCE contacts_groups_id_seq
1284 START WITH 1
1285 INCREMENT BY 1
1286 NO MINVALUE
1287 NO MAXVALUE
1288 CACHE 1;
1289
1290
1291ALTER TABLE contacts_groups_id_seq OWNER TO pyfreebilling;
1292
1293--
1294-- Name: contacts_groups_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
1295--
1296
1297ALTER SEQUENCE contacts_groups_id_seq OWNED BY contacts_groups.id;
1298
1299
1300--
1301-- Name: contacts_groups_people; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
1302--
1303
1304CREATE TABLE contacts_groups_people (
1305 id integer NOT NULL,
1306 group_id integer NOT NULL,
1307 person_id integer NOT NULL
1308);
1309
1310
1311ALTER TABLE contacts_groups_people OWNER TO pyfreebilling;
1312
1313--
1314-- Name: contacts_groups_people_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
1315--
1316
1317CREATE SEQUENCE contacts_groups_people_id_seq
1318 START WITH 1
1319 INCREMENT BY 1
1320 NO MINVALUE
1321 NO MAXVALUE
1322 CACHE 1;
1323
1324
1325ALTER TABLE contacts_groups_people_id_seq OWNER TO pyfreebilling;
1326
1327--
1328-- Name: contacts_groups_people_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
1329--
1330
1331ALTER SEQUENCE contacts_groups_people_id_seq OWNED BY contacts_groups_people.id;
1332
1333
1334--
1335-- Name: contacts_people; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
1336--
1337
1338CREATE TABLE contacts_people (
1339 id integer NOT NULL,
1340 first_name character varying(100) NOT NULL,
1341 last_name character varying(200) NOT NULL,
1342 middle_name character varying(200),
1343 suffix character varying(50),
1344 nickname character varying(100) NOT NULL,
1345 slug character varying(50) NOT NULL,
1346 title character varying(200) NOT NULL,
1347 about text NOT NULL,
1348 date_added timestamp with time zone NOT NULL,
1349 date_modified timestamp with time zone NOT NULL,
1350 company_id integer,
1351 user_id integer
1352);
1353
1354
1355ALTER TABLE contacts_people OWNER TO pyfreebilling;
1356
1357--
1358-- Name: contacts_people_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
1359--
1360
1361CREATE SEQUENCE contacts_people_id_seq
1362 START WITH 1
1363 INCREMENT BY 1
1364 NO MINVALUE
1365 NO MAXVALUE
1366 CACHE 1;
1367
1368
1369ALTER TABLE contacts_people_id_seq OWNER TO pyfreebilling;
1370
1371--
1372-- Name: contacts_people_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
1373--
1374
1375ALTER SEQUENCE contacts_people_id_seq OWNED BY contacts_people.id;
1376
1377
1378--
1379-- Name: contacts_phone_numbers; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
1380--
1381
1382CREATE TABLE contacts_phone_numbers (
1383 id integer NOT NULL,
1384 object_id integer NOT NULL,
1385 phone_number character varying(50) NOT NULL,
1386 location character varying(6) NOT NULL,
1387 date_added timestamp with time zone NOT NULL,
1388 date_modified timestamp with time zone NOT NULL,
1389 content_type_id integer NOT NULL
1390);
1391
1392
1393ALTER TABLE contacts_phone_numbers OWNER TO pyfreebilling;
1394
1395--
1396-- Name: contacts_phone_numbers_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
1397--
1398
1399CREATE SEQUENCE contacts_phone_numbers_id_seq
1400 START WITH 1
1401 INCREMENT BY 1
1402 NO MINVALUE
1403 NO MAXVALUE
1404 CACHE 1;
1405
1406
1407ALTER TABLE contacts_phone_numbers_id_seq OWNER TO pyfreebilling;
1408
1409--
1410-- Name: contacts_phone_numbers_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
1411--
1412
1413ALTER SEQUENCE contacts_phone_numbers_id_seq OWNED BY contacts_phone_numbers.id;
1414
1415
1416--
1417-- Name: contacts_street_addresses; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
1418--
1419
1420CREATE TABLE contacts_street_addresses (
1421 id integer NOT NULL,
1422 object_id integer NOT NULL,
1423 street text NOT NULL,
1424 city character varying(200) NOT NULL,
1425 province character varying(200) NOT NULL,
1426 postal_code character varying(10) NOT NULL,
1427 country character varying(2) NOT NULL,
1428 location character varying(6) NOT NULL,
1429 date_added timestamp with time zone NOT NULL,
1430 date_modified timestamp with time zone NOT NULL,
1431 content_type_id integer NOT NULL
1432);
1433
1434
1435ALTER TABLE contacts_street_addresses OWNER TO pyfreebilling;
1436
1437--
1438-- Name: contacts_street_addresses_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
1439--
1440
1441CREATE SEQUENCE contacts_street_addresses_id_seq
1442 START WITH 1
1443 INCREMENT BY 1
1444 NO MINVALUE
1445 NO MAXVALUE
1446 CACHE 1;
1447
1448
1449ALTER TABLE contacts_street_addresses_id_seq OWNER TO pyfreebilling;
1450
1451--
1452-- Name: contacts_street_addresses_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
1453--
1454
1455ALTER SEQUENCE contacts_street_addresses_id_seq OWNED BY contacts_street_addresses.id;
1456
1457
1458--
1459-- Name: contacts_web_sites; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
1460--
1461
1462CREATE TABLE contacts_web_sites (
1463 id integer NOT NULL,
1464 object_id integer NOT NULL,
1465 url character varying(200) NOT NULL,
1466 location character varying(6) NOT NULL,
1467 date_added timestamp with time zone NOT NULL,
1468 date_modified timestamp with time zone NOT NULL,
1469 content_type_id integer NOT NULL
1470);
1471
1472
1473ALTER TABLE contacts_web_sites OWNER TO pyfreebilling;
1474
1475--
1476-- Name: contacts_web_sites_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
1477--
1478
1479CREATE SEQUENCE contacts_web_sites_id_seq
1480 START WITH 1
1481 INCREMENT BY 1
1482 NO MINVALUE
1483 NO MAXVALUE
1484 CACHE 1;
1485
1486
1487ALTER TABLE contacts_web_sites_id_seq OWNER TO pyfreebilling;
1488
1489--
1490-- Name: contacts_web_sites_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
1491--
1492
1493ALTER SEQUENCE contacts_web_sites_id_seq OWNED BY contacts_web_sites.id;
1494
1495
1496--
1497-- Name: currencies_currency; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
1498--
1499
1500CREATE TABLE currencies_currency (
1501 id integer NOT NULL,
1502 code character varying(3) NOT NULL,
1503 name character varying(35) NOT NULL,
1504 symbol character varying(4) NOT NULL,
1505 factor numeric(30,10) NOT NULL,
1506 is_active boolean NOT NULL,
1507 is_base boolean NOT NULL,
1508 is_default boolean NOT NULL
1509);
1510
1511
1512ALTER TABLE currencies_currency OWNER TO pyfreebilling;
1513
1514--
1515-- Name: currencies_currency_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
1516--
1517
1518CREATE SEQUENCE currencies_currency_id_seq
1519 START WITH 1
1520 INCREMENT BY 1
1521 NO MINVALUE
1522 NO MAXVALUE
1523 CACHE 1;
1524
1525
1526ALTER TABLE currencies_currency_id_seq OWNER TO pyfreebilling;
1527
1528--
1529-- Name: currencies_currency_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
1530--
1531
1532ALTER SEQUENCE currencies_currency_id_seq OWNED BY currencies_currency.id;
1533
1534
1535--
1536-- Name: customer_cid_norm_rules; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
1537--
1538
1539CREATE TABLE customer_cid_norm_rules (
1540 id integer NOT NULL,
1541 prefix character varying(30) NOT NULL,
1542 description text NOT NULL,
1543 remove_prefix character varying(15) NOT NULL,
1544 add_prefix character varying(15) NOT NULL,
1545 date_added timestamp with time zone NOT NULL,
1546 date_modified timestamp with time zone NOT NULL,
1547 company_id integer NOT NULL
1548);
1549
1550
1551ALTER TABLE customer_cid_norm_rules OWNER TO pyfreebilling;
1552
1553--
1554-- Name: customer_cid_norm_rules_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
1555--
1556
1557CREATE SEQUENCE customer_cid_norm_rules_id_seq
1558 START WITH 1
1559 INCREMENT BY 1
1560 NO MINVALUE
1561 NO MAXVALUE
1562 CACHE 1;
1563
1564
1565ALTER TABLE customer_cid_norm_rules_id_seq OWNER TO pyfreebilling;
1566
1567--
1568-- Name: customer_cid_norm_rules_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
1569--
1570
1571ALTER SEQUENCE customer_cid_norm_rules_id_seq OWNED BY customer_cid_norm_rules.id;
1572
1573
1574--
1575-- Name: customer_directory_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
1576--
1577
1578CREATE SEQUENCE customer_directory_id_seq
1579 START WITH 1
1580 INCREMENT BY 1
1581 NO MINVALUE
1582 NO MAXVALUE
1583 CACHE 1;
1584
1585
1586ALTER TABLE customer_directory_id_seq OWNER TO pyfreebilling;
1587
1588--
1589-- Name: customer_directory_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
1590--
1591
1592ALTER SEQUENCE customer_directory_id_seq OWNED BY customer_directory.id;
1593
1594
1595--
1596-- Name: customer_norm_rules; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
1597--
1598
1599CREATE TABLE customer_norm_rules (
1600 id integer NOT NULL,
1601 prefix character varying(30) NOT NULL,
1602 description text NOT NULL,
1603 remove_prefix character varying(15) NOT NULL,
1604 add_prefix character varying(15) NOT NULL,
1605 date_added timestamp with time zone NOT NULL,
1606 date_modified timestamp with time zone NOT NULL,
1607 company_id integer NOT NULL
1608);
1609
1610
1611ALTER TABLE customer_norm_rules OWNER TO pyfreebilling;
1612
1613--
1614-- Name: customer_norm_rules_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
1615--
1616
1617CREATE SEQUENCE customer_norm_rules_id_seq
1618 START WITH 1
1619 INCREMENT BY 1
1620 NO MINVALUE
1621 NO MAXVALUE
1622 CACHE 1;
1623
1624
1625ALTER TABLE customer_norm_rules_id_seq OWNER TO pyfreebilling;
1626
1627--
1628-- Name: customer_norm_rules_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
1629--
1630
1631ALTER SEQUENCE customer_norm_rules_id_seq OWNED BY customer_norm_rules.id;
1632
1633
1634--
1635-- Name: customer_ratecards; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
1636--
1637
1638CREATE TABLE customer_ratecards (
1639 id integer NOT NULL,
1640 description character varying(30) NOT NULL,
1641 tech_prefix character varying(7),
1642 priority integer NOT NULL,
1643 discount numeric(3,2) NOT NULL,
1644 allow_negative_margin boolean NOT NULL,
1645 date_added timestamp with time zone NOT NULL,
1646 date_modified timestamp with time zone NOT NULL,
1647 company_id integer NOT NULL,
1648 ratecard_id integer NOT NULL
1649);
1650
1651
1652ALTER TABLE customer_ratecards OWNER TO pyfreebilling;
1653
1654--
1655-- Name: customer_ratecards_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
1656--
1657
1658CREATE SEQUENCE customer_ratecards_id_seq
1659 START WITH 1
1660 INCREMENT BY 1
1661 NO MINVALUE
1662 NO MAXVALUE
1663 CACHE 1;
1664
1665
1666ALTER TABLE customer_ratecards_id_seq OWNER TO pyfreebilling;
1667
1668--
1669-- Name: customer_ratecards_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
1670--
1671
1672ALTER SEQUENCE customer_ratecards_id_seq OWNED BY customer_ratecards.id;
1673
1674
1675--
1676-- Name: customer_rates; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
1677--
1678
1679CREATE TABLE customer_rates (
1680 id integer NOT NULL,
1681 destination character varying(128),
1682 prefix character varying(30) NOT NULL,
1683 rate numeric(11,5) NOT NULL,
1684 block_min_duration integer NOT NULL,
1685 minimal_time integer NOT NULL,
1686 init_block numeric(11,5) NOT NULL,
1687 enabled boolean NOT NULL,
1688 date_added timestamp with time zone NOT NULL,
1689 date_modified timestamp with time zone NOT NULL,
1690 ratecard_id integer NOT NULL,
1691 destnum_length integer NOT NULL
1692);
1693
1694
1695ALTER TABLE customer_rates OWNER TO pyfreebilling;
1696
1697--
1698-- Name: customer_rates_did; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
1699--
1700
1701CREATE TABLE customer_rates_did (
1702 id integer NOT NULL,
1703 name character varying(128) NOT NULL,
1704 rate numeric(11,5) NOT NULL,
1705 block_min_duration integer NOT NULL,
1706 interval_duration integer NOT NULL,
1707 enabled boolean NOT NULL,
1708 date_added timestamp with time zone NOT NULL,
1709 date_modified timestamp with time zone NOT NULL
1710);
1711
1712
1713ALTER TABLE customer_rates_did OWNER TO pyfreebilling;
1714
1715--
1716-- Name: customer_rates_did_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
1717--
1718
1719CREATE SEQUENCE customer_rates_did_id_seq
1720 START WITH 1
1721 INCREMENT BY 1
1722 NO MINVALUE
1723 NO MAXVALUE
1724 CACHE 1;
1725
1726
1727ALTER TABLE customer_rates_did_id_seq OWNER TO pyfreebilling;
1728
1729--
1730-- Name: customer_rates_did_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
1731--
1732
1733ALTER SEQUENCE customer_rates_did_id_seq OWNED BY customer_rates_did.id;
1734
1735
1736--
1737-- Name: customer_rates_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
1738--
1739
1740CREATE SEQUENCE customer_rates_id_seq
1741 START WITH 1
1742 INCREMENT BY 1
1743 NO MINVALUE
1744 NO MAXVALUE
1745 CACHE 1;
1746
1747
1748ALTER TABLE customer_rates_id_seq OWNER TO pyfreebilling;
1749
1750--
1751-- Name: customer_rates_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
1752--
1753
1754ALTER SEQUENCE customer_rates_id_seq OWNED BY customer_rates.id;
1755
1756
1757--
1758-- Name: date_dimension; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
1759--
1760
1761CREATE TABLE date_dimension (
1762 id integer NOT NULL,
1763 date timestamp with time zone NOT NULL,
1764 day character varying(2) NOT NULL,
1765 day_of_week character varying(30) NOT NULL,
1766 hour character varying(2),
1767 month character varying(2) NOT NULL,
1768 quarter character varying(2) NOT NULL,
1769 year character varying(4) NOT NULL
1770);
1771
1772
1773ALTER TABLE date_dimension OWNER TO pyfreebilling;
1774
1775--
1776-- Name: date_dimension_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
1777--
1778
1779CREATE SEQUENCE date_dimension_id_seq
1780 START WITH 1
1781 INCREMENT BY 1
1782 NO MINVALUE
1783 NO MAXVALUE
1784 CACHE 1;
1785
1786
1787ALTER TABLE date_dimension_id_seq OWNER TO pyfreebilling;
1788
1789--
1790-- Name: date_dimension_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
1791--
1792
1793ALTER SEQUENCE date_dimension_id_seq OWNED BY date_dimension.id;
1794
1795
1796--
1797-- Name: did; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
1798--
1799
1800CREATE TABLE did (
1801 id integer NOT NULL,
1802 number character varying(30) NOT NULL,
1803 prov_max_channels integer NOT NULL,
1804 cust_max_channels integer,
1805 description text NOT NULL,
1806 date_added timestamp with time zone NOT NULL,
1807 date_modified timestamp with time zone NOT NULL,
1808 customer_id integer,
1809 provider_id integer NOT NULL,
1810 cust_ratecard_id integer,
1811 prov_ratecard_id integer,
1812 insee_code character varying(10),
1813 CONSTRAINT did_cust_max_channels_check CHECK ((cust_max_channels >= 0)),
1814 CONSTRAINT did_prov_max_channels_check CHECK ((prov_max_channels >= 0))
1815);
1816
1817
1818ALTER TABLE did OWNER TO pyfreebilling;
1819
1820--
1821-- Name: did_routes; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
1822--
1823
1824CREATE TABLE did_routes (
1825 id integer NOT NULL,
1826 "order" integer NOT NULL,
1827 type character varying(2) NOT NULL,
1828 number character varying(30),
1829 description text NOT NULL,
1830 date_added timestamp with time zone NOT NULL,
1831 date_modified timestamp with time zone NOT NULL,
1832 contract_did_id integer NOT NULL,
1833 trunk_id integer
1834);
1835
1836
1837ALTER TABLE did_routes OWNER TO pyfreebilling;
1838
1839--
1840-- Name: uid_domain; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
1841--
1842
1843CREATE TABLE uid_domain (
1844 id integer NOT NULL,
1845 domain character varying(64) NOT NULL,
1846 did character varying(64) NOT NULL,
1847 flags integer NOT NULL,
1848 date_added timestamp with time zone NOT NULL,
1849 date_modified timestamp with time zone NOT NULL
1850);
1851
1852
1853ALTER TABLE uid_domain OWNER TO pyfreebilling;
1854
1855--
1856-- Name: dbaliases; Type: VIEW; Schema: public; Owner: pyfreebilling
1857--
1858
1859CREATE VIEW dbaliases AS
1860 SELECT row_number() OVER () AS id,
1861 d.number AS alias_username,
1862 '' AS alias_domain,
1863 cd.name AS username,
1864 ud.domain
1865 FROM (((did_routes dr
1866 LEFT JOIN did d ON (((dr.contract_did_id = d.id) AND ((dr.type)::text = 's'::text))))
1867 LEFT JOIN customer_directory cd ON ((dr.trunk_id = cd.id)))
1868 LEFT JOIN uid_domain ud ON ((ud.id = cd.domain_id)));
1869
1870
1871ALTER TABLE dbaliases OWNER TO pyfreebilling;
1872
1873--
1874-- Name: destination_norm_rules; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
1875--
1876
1877CREATE TABLE destination_norm_rules (
1878 id integer NOT NULL,
1879 prefix character varying(30) NOT NULL,
1880 description text NOT NULL,
1881 format_num character varying(150) NOT NULL,
1882 date_added timestamp with time zone NOT NULL,
1883 date_modified timestamp with time zone NOT NULL
1884);
1885
1886
1887ALTER TABLE destination_norm_rules OWNER TO pyfreebilling;
1888
1889--
1890-- Name: destination_norm_rules_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
1891--
1892
1893CREATE SEQUENCE destination_norm_rules_id_seq
1894 START WITH 1
1895 INCREMENT BY 1
1896 NO MINVALUE
1897 NO MAXVALUE
1898 CACHE 1;
1899
1900
1901ALTER TABLE destination_norm_rules_id_seq OWNER TO pyfreebilling;
1902
1903--
1904-- Name: destination_norm_rules_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
1905--
1906
1907ALTER SEQUENCE destination_norm_rules_id_seq OWNED BY destination_norm_rules.id;
1908
1909
1910--
1911-- Name: normalization_rule; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
1912--
1913
1914CREATE TABLE normalization_rule (
1915 id integer NOT NULL,
1916 name character varying(30) NOT NULL,
1917 match_op integer NOT NULL,
1918 match_exp character varying(64) NOT NULL,
1919 match_len integer NOT NULL,
1920 subst_exp character varying(64) NOT NULL,
1921 repl_exp character varying(64) NOT NULL,
1922 attrs character varying(64) NOT NULL,
1923 description text NOT NULL,
1924 date_added timestamp with time zone NOT NULL,
1925 date_modified timestamp with time zone NOT NULL
1926);
1927
1928
1929ALTER TABLE normalization_rule OWNER TO pyfreebilling;
1930
1931--
1932-- Name: normalization_rule_grp; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
1933--
1934
1935CREATE TABLE normalization_rule_grp (
1936 id integer NOT NULL,
1937 pr integer NOT NULL,
1938 description text NOT NULL,
1939 date_added timestamp with time zone NOT NULL,
1940 date_modified timestamp with time zone NOT NULL,
1941 dpid_id integer NOT NULL,
1942 rule_id integer NOT NULL
1943);
1944
1945
1946ALTER TABLE normalization_rule_grp OWNER TO pyfreebilling;
1947
1948--
1949-- Name: dialplan; Type: VIEW; Schema: public; Owner: pyfreebilling
1950--
1951
1952CREATE VIEW dialplan AS
1953 SELECT row_number() OVER () AS id,
1954 v.name,
1955 v.dpid,
1956 v.pr,
1957 v.match_op,
1958 v.match_exp,
1959 v.match_len,
1960 v.subst_exp,
1961 v.repl_exp,
1962 v.attrs,
1963 v.description
1964 FROM ( SELECT n.name,
1965 nrp.dpid_id AS dpid,
1966 nrp.pr,
1967 n.match_op,
1968 n.match_exp,
1969 n.match_len,
1970 n.subst_exp,
1971 n.repl_exp,
1972 n.attrs,
1973 n.description
1974 FROM (normalization_rule n
1975 LEFT JOIN normalization_rule_grp nrp ON ((n.id = nrp.rule_id)))
1976 UNION ALL
1977 SELECT c.name,
1978 c.dpid,
1979 c.pr,
1980 c.match_op,
1981 c.match_exp,
1982 c.match_len,
1983 c.subst_exp,
1984 c.repl_exp,
1985 c.attrs,
1986 c.description
1987 FROM call_mapping_rule c) v;
1988
1989
1990ALTER TABLE dialplan OWNER TO pyfreebilling;
1991
1992--
1993-- Name: did_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
1994--
1995
1996CREATE SEQUENCE did_id_seq
1997 START WITH 1
1998 INCREMENT BY 1
1999 NO MINVALUE
2000 NO MAXVALUE
2001 CACHE 1;
2002
2003
2004ALTER TABLE did_id_seq OWNER TO pyfreebilling;
2005
2006--
2007-- Name: did_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
2008--
2009
2010ALTER SEQUENCE did_id_seq OWNED BY did.id;
2011
2012
2013--
2014-- Name: did_routes_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
2015--
2016
2017CREATE SEQUENCE did_routes_id_seq
2018 START WITH 1
2019 INCREMENT BY 1
2020 NO MINVALUE
2021 NO MAXVALUE
2022 CACHE 1;
2023
2024
2025ALTER TABLE did_routes_id_seq OWNER TO pyfreebilling;
2026
2027--
2028-- Name: did_routes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
2029--
2030
2031ALTER SEQUENCE did_routes_id_seq OWNED BY did_routes.id;
2032
2033
2034--
2035-- Name: dim_customer_destination; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
2036--
2037
2038CREATE TABLE dim_customer_destination (
2039 id integer NOT NULL,
2040 destination character varying(250),
2041 total_calls integer NOT NULL,
2042 success_calls integer NOT NULL,
2043 total_duration integer NOT NULL,
2044 avg_duration integer NOT NULL,
2045 max_duration integer NOT NULL,
2046 min_duration integer NOT NULL,
2047 total_sell numeric(12,2) NOT NULL,
2048 total_cost numeric(12,2) NOT NULL,
2049 customer_id integer NOT NULL,
2050 date_id integer NOT NULL
2051);
2052
2053
2054ALTER TABLE dim_customer_destination OWNER TO pyfreebilling;
2055
2056--
2057-- Name: dim_customer_destination_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
2058--
2059
2060CREATE SEQUENCE dim_customer_destination_id_seq
2061 START WITH 1
2062 INCREMENT BY 1
2063 NO MINVALUE
2064 NO MAXVALUE
2065 CACHE 1;
2066
2067
2068ALTER TABLE dim_customer_destination_id_seq OWNER TO pyfreebilling;
2069
2070--
2071-- Name: dim_customer_destination_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
2072--
2073
2074ALTER SEQUENCE dim_customer_destination_id_seq OWNED BY dim_customer_destination.id;
2075
2076
2077--
2078-- Name: dim_customer_hangupcause; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
2079--
2080
2081CREATE TABLE dim_customer_hangupcause (
2082 id integer NOT NULL,
2083 destination character varying(250),
2084 hangupcause character varying(100),
2085 total_calls integer NOT NULL,
2086 customer_id integer NOT NULL,
2087 date_id integer NOT NULL
2088);
2089
2090
2091ALTER TABLE dim_customer_hangupcause OWNER TO pyfreebilling;
2092
2093--
2094-- Name: dim_customer_hangupcause_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
2095--
2096
2097CREATE SEQUENCE dim_customer_hangupcause_id_seq
2098 START WITH 1
2099 INCREMENT BY 1
2100 NO MINVALUE
2101 NO MAXVALUE
2102 CACHE 1;
2103
2104
2105ALTER TABLE dim_customer_hangupcause_id_seq OWNER TO pyfreebilling;
2106
2107--
2108-- Name: dim_customer_hangupcause_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
2109--
2110
2111ALTER SEQUENCE dim_customer_hangupcause_id_seq OWNED BY dim_customer_hangupcause.id;
2112
2113
2114--
2115-- Name: dim_customer_sip_hangupcause; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
2116--
2117
2118CREATE TABLE dim_customer_sip_hangupcause (
2119 id integer NOT NULL,
2120 destination character varying(250),
2121 sip_hangupcause character varying(100),
2122 total_calls integer NOT NULL,
2123 customer_id integer NOT NULL,
2124 date_id integer NOT NULL
2125);
2126
2127
2128ALTER TABLE dim_customer_sip_hangupcause OWNER TO pyfreebilling;
2129
2130--
2131-- Name: dim_customer_sip_hangupcause_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
2132--
2133
2134CREATE SEQUENCE dim_customer_sip_hangupcause_id_seq
2135 START WITH 1
2136 INCREMENT BY 1
2137 NO MINVALUE
2138 NO MAXVALUE
2139 CACHE 1;
2140
2141
2142ALTER TABLE dim_customer_sip_hangupcause_id_seq OWNER TO pyfreebilling;
2143
2144--
2145-- Name: dim_customer_sip_hangupcause_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
2146--
2147
2148ALTER SEQUENCE dim_customer_sip_hangupcause_id_seq OWNED BY dim_customer_sip_hangupcause.id;
2149
2150
2151--
2152-- Name: dim_provider_destination; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
2153--
2154
2155CREATE TABLE dim_provider_destination (
2156 id integer NOT NULL,
2157 destination character varying(250),
2158 total_calls integer NOT NULL,
2159 success_calls integer NOT NULL,
2160 total_duration integer NOT NULL,
2161 avg_duration integer NOT NULL,
2162 max_duration integer NOT NULL,
2163 min_duration integer NOT NULL,
2164 total_sell numeric(12,2) NOT NULL,
2165 total_cost numeric(12,2) NOT NULL,
2166 date_id integer NOT NULL,
2167 provider_id integer NOT NULL
2168);
2169
2170
2171ALTER TABLE dim_provider_destination OWNER TO pyfreebilling;
2172
2173--
2174-- Name: dim_provider_destination_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
2175--
2176
2177CREATE SEQUENCE dim_provider_destination_id_seq
2178 START WITH 1
2179 INCREMENT BY 1
2180 NO MINVALUE
2181 NO MAXVALUE
2182 CACHE 1;
2183
2184
2185ALTER TABLE dim_provider_destination_id_seq OWNER TO pyfreebilling;
2186
2187--
2188-- Name: dim_provider_destination_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
2189--
2190
2191ALTER SEQUENCE dim_provider_destination_id_seq OWNED BY dim_provider_destination.id;
2192
2193
2194--
2195-- Name: dim_provider_hangupcause; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
2196--
2197
2198CREATE TABLE dim_provider_hangupcause (
2199 id integer NOT NULL,
2200 destination character varying(250),
2201 hangupcause character varying(100),
2202 total_calls integer NOT NULL,
2203 date_id integer NOT NULL,
2204 provider_id integer NOT NULL
2205);
2206
2207
2208ALTER TABLE dim_provider_hangupcause OWNER TO pyfreebilling;
2209
2210--
2211-- Name: dim_provider_hangupcause_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
2212--
2213
2214CREATE SEQUENCE dim_provider_hangupcause_id_seq
2215 START WITH 1
2216 INCREMENT BY 1
2217 NO MINVALUE
2218 NO MAXVALUE
2219 CACHE 1;
2220
2221
2222ALTER TABLE dim_provider_hangupcause_id_seq OWNER TO pyfreebilling;
2223
2224--
2225-- Name: dim_provider_hangupcause_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
2226--
2227
2228ALTER SEQUENCE dim_provider_hangupcause_id_seq OWNED BY dim_provider_hangupcause.id;
2229
2230
2231--
2232-- Name: dim_provider_sip_hangupcause; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
2233--
2234
2235CREATE TABLE dim_provider_sip_hangupcause (
2236 id integer NOT NULL,
2237 destination character varying(250),
2238 sip_hangupcause character varying(100),
2239 total_calls integer NOT NULL,
2240 date_id integer NOT NULL,
2241 provider_id integer NOT NULL
2242);
2243
2244
2245ALTER TABLE dim_provider_sip_hangupcause OWNER TO pyfreebilling;
2246
2247--
2248-- Name: dim_provider_sip_hangupcause_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
2249--
2250
2251CREATE SEQUENCE dim_provider_sip_hangupcause_id_seq
2252 START WITH 1
2253 INCREMENT BY 1
2254 NO MINVALUE
2255 NO MAXVALUE
2256 CACHE 1;
2257
2258
2259ALTER TABLE dim_provider_sip_hangupcause_id_seq OWNER TO pyfreebilling;
2260
2261--
2262-- Name: dim_provider_sip_hangupcause_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
2263--
2264
2265ALTER SEQUENCE dim_provider_sip_hangupcause_id_seq OWNED BY dim_provider_sip_hangupcause.id;
2266
2267
2268--
2269-- Name: fs_switch; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
2270--
2271
2272CREATE TABLE fs_switch (
2273 id integer NOT NULL,
2274 name character varying(50) NOT NULL,
2275 ip character varying(100) NOT NULL,
2276 esl_listen_ip character varying(100) NOT NULL,
2277 esl_listen_port integer NOT NULL,
2278 esl_password character varying(30) NOT NULL,
2279 date_added timestamp with time zone NOT NULL,
2280 date_modified timestamp with time zone NOT NULL,
2281 enabled boolean NOT NULL,
2282 attrs character varying(128) NOT NULL,
2283 description character varying(64) NOT NULL,
2284 flags integer NOT NULL,
2285 priority integer NOT NULL,
2286 setid integer NOT NULL,
2287 CONSTRAINT fs_switch_esl_listen_port_check CHECK ((esl_listen_port >= 0)),
2288 CONSTRAINT fs_switch_flags_check CHECK ((flags >= 0)),
2289 CONSTRAINT fs_switch_priority_check CHECK ((priority >= 0))
2290);
2291
2292
2293ALTER TABLE fs_switch OWNER TO pyfreebilling;
2294
2295--
2296-- Name: fs_switch_profile; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
2297--
2298
2299CREATE TABLE fs_switch_profile (
2300 id integer NOT NULL,
2301 description character varying(64) NOT NULL,
2302 date_added timestamp with time zone NOT NULL,
2303 date_modified timestamp with time zone NOT NULL,
2304 fsswitch_id integer NOT NULL,
2305 sipprofile_id integer NOT NULL,
2306 direction integer NOT NULL,
2307 ip character varying(100) NOT NULL,
2308 priority integer NOT NULL,
2309 outbound_proxy_id integer,
2310 CONSTRAINT fs_switch_profile_priority_check CHECK ((priority >= 0))
2311);
2312
2313
2314ALTER TABLE fs_switch_profile OWNER TO pyfreebilling;
2315
2316--
2317-- Name: sip_profile; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
2318--
2319
2320CREATE TABLE sip_profile (
2321 id integer NOT NULL,
2322 name character varying(50) NOT NULL,
2323 user_agent character varying(50) NOT NULL,
2324 ext_rtp_ip character varying(100) NOT NULL,
2325 ext_sip_ip character varying(100) NOT NULL,
2326 rtp_ip character varying(100) NOT NULL,
2327 sip_ip character varying(100) NOT NULL,
2328 sip_port integer NOT NULL,
2329 disable_transcoding boolean NOT NULL,
2330 accept_blind_reg boolean NOT NULL,
2331 disable_register boolean NOT NULL,
2332 apply_inbound_acl boolean NOT NULL,
2333 auth_calls boolean NOT NULL,
2334 log_auth_failures boolean NOT NULL,
2335 inbound_codec_prefs character varying(100) NOT NULL,
2336 outbound_codec_prefs character varying(100) NOT NULL,
2337 aggressive_nat_detection boolean NOT NULL,
2338 "NDLB_rec_in_nat_reg_c" boolean NOT NULL,
2339 "NDLB_force_rport" character varying(10),
2340 "NDLB_broken_auth_hash" boolean NOT NULL,
2341 enable_timer boolean NOT NULL,
2342 session_timeout integer NOT NULL,
2343 rtp_rewrite_timestamps boolean NOT NULL,
2344 pass_rfc2833 boolean NOT NULL,
2345 date_added timestamp with time zone NOT NULL,
2346 date_modified timestamp with time zone NOT NULL,
2347 enabled boolean NOT NULL,
2348 CONSTRAINT sip_profile_session_timeout_check CHECK ((session_timeout >= 0)),
2349 CONSTRAINT sip_profile_sip_port_check CHECK ((sip_port >= 0))
2350);
2351
2352
2353ALTER TABLE sip_profile OWNER TO pyfreebilling;
2354
2355--
2356-- Name: dispatcher; Type: VIEW; Schema: public; Owner: pyfreebilling
2357--
2358
2359CREATE VIEW dispatcher AS
2360 SELECT row_number() OVER () AS id,
2361 fsp.direction AS setid,
2362 (concat('sip:', fsp.ip, ':', sp.sip_port))::character varying AS destination,
2363 0 AS flags,
2364 fsp.priority,
2365 ''::character varying AS attrs,
2366 fsp.description
2367 FROM ((fs_switch_profile fsp
2368 LEFT JOIN fs_switch f ON (((((fsp.fsswitch_id = f.id) AND (fsp.direction = 1)) AND (f.setid = 10)) AND (f.enabled = true))))
2369 LEFT JOIN sip_profile sp ON (((sp.enabled = true) AND (sp.id = fsp.sipprofile_id))));
2370
2371
2372ALTER TABLE dispatcher OWNER TO pyfreebilling;
2373
2374--
2375-- Name: django_admin_log; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
2376--
2377
2378CREATE TABLE django_admin_log (
2379 id integer NOT NULL,
2380 action_time timestamp with time zone NOT NULL,
2381 object_id text,
2382 object_repr character varying(200) NOT NULL,
2383 action_flag smallint NOT NULL,
2384 change_message text NOT NULL,
2385 content_type_id integer,
2386 user_id integer NOT NULL,
2387 CONSTRAINT django_admin_log_action_flag_check CHECK ((action_flag >= 0))
2388);
2389
2390
2391ALTER TABLE django_admin_log OWNER TO pyfreebilling;
2392
2393--
2394-- Name: django_admin_log_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
2395--
2396
2397CREATE SEQUENCE django_admin_log_id_seq
2398 START WITH 1
2399 INCREMENT BY 1
2400 NO MINVALUE
2401 NO MAXVALUE
2402 CACHE 1;
2403
2404
2405ALTER TABLE django_admin_log_id_seq OWNER TO pyfreebilling;
2406
2407--
2408-- Name: django_admin_log_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
2409--
2410
2411ALTER SEQUENCE django_admin_log_id_seq OWNED BY django_admin_log.id;
2412
2413
2414--
2415-- Name: django_content_type; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
2416--
2417
2418CREATE TABLE django_content_type (
2419 id integer NOT NULL,
2420 app_label character varying(100) NOT NULL,
2421 model character varying(100) NOT NULL
2422);
2423
2424
2425ALTER TABLE django_content_type OWNER TO pyfreebilling;
2426
2427--
2428-- Name: django_content_type_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
2429--
2430
2431CREATE SEQUENCE django_content_type_id_seq
2432 START WITH 1
2433 INCREMENT BY 1
2434 NO MINVALUE
2435 NO MAXVALUE
2436 CACHE 1;
2437
2438
2439ALTER TABLE django_content_type_id_seq OWNER TO pyfreebilling;
2440
2441--
2442-- Name: django_content_type_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
2443--
2444
2445ALTER SEQUENCE django_content_type_id_seq OWNED BY django_content_type.id;
2446
2447
2448--
2449-- Name: django_migrations; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
2450--
2451
2452CREATE TABLE django_migrations (
2453 id integer NOT NULL,
2454 app character varying(255) NOT NULL,
2455 name character varying(255) NOT NULL,
2456 applied timestamp with time zone NOT NULL
2457);
2458
2459
2460ALTER TABLE django_migrations OWNER TO pyfreebilling;
2461
2462--
2463-- Name: django_migrations_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
2464--
2465
2466CREATE SEQUENCE django_migrations_id_seq
2467 START WITH 1
2468 INCREMENT BY 1
2469 NO MINVALUE
2470 NO MAXVALUE
2471 CACHE 1;
2472
2473
2474ALTER TABLE django_migrations_id_seq OWNER TO pyfreebilling;
2475
2476--
2477-- Name: django_migrations_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
2478--
2479
2480ALTER SEQUENCE django_migrations_id_seq OWNED BY django_migrations.id;
2481
2482
2483--
2484-- Name: django_session; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
2485--
2486
2487CREATE TABLE django_session (
2488 session_key character varying(40) NOT NULL,
2489 session_data text NOT NULL,
2490 expire_date timestamp with time zone NOT NULL
2491);
2492
2493
2494ALTER TABLE django_session OWNER TO pyfreebilling;
2495
2496--
2497-- Name: django_site; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
2498--
2499
2500CREATE TABLE django_site (
2501 id integer NOT NULL,
2502 domain character varying(100) NOT NULL,
2503 name character varying(50) NOT NULL
2504);
2505
2506
2507ALTER TABLE django_site OWNER TO pyfreebilling;
2508
2509--
2510-- Name: django_site_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
2511--
2512
2513CREATE SEQUENCE django_site_id_seq
2514 START WITH 1
2515 INCREMENT BY 1
2516 NO MINVALUE
2517 NO MAXVALUE
2518 CACHE 1;
2519
2520
2521ALTER TABLE django_site_id_seq OWNER TO pyfreebilling;
2522
2523--
2524-- Name: django_site_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
2525--
2526
2527ALTER SEQUENCE django_site_id_seq OWNED BY django_site.id;
2528
2529
2530--
2531-- Name: domain; Type: VIEW; Schema: public; Owner: pyfreebilling
2532--
2533
2534CREATE VIEW domain AS
2535 SELECT row_number() OVER () AS id,
2536 ud.domain,
2537 ud.did,
2538 ud.date_modified AS last_modified
2539 FROM uid_domain ud;
2540
2541
2542ALTER TABLE domain OWNER TO pyfreebilling;
2543
2544--
2545-- Name: domain_attrs; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
2546--
2547
2548CREATE TABLE domain_attrs (
2549 id integer NOT NULL,
2550 did character varying(64) NOT NULL,
2551 name character varying(32) NOT NULL,
2552 type integer NOT NULL,
2553 value character varying(255) NOT NULL,
2554 last_modified timestamp without time zone DEFAULT '2000-01-01 00:00:01'::timestamp without time zone NOT NULL
2555);
2556
2557
2558ALTER TABLE domain_attrs OWNER TO pyfreebilling;
2559
2560--
2561-- Name: domain_attrs_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
2562--
2563
2564CREATE SEQUENCE domain_attrs_id_seq
2565 START WITH 1
2566 INCREMENT BY 1
2567 NO MINVALUE
2568 NO MAXVALUE
2569 CACHE 1;
2570
2571
2572ALTER TABLE domain_attrs_id_seq OWNER TO pyfreebilling;
2573
2574--
2575-- Name: domain_attrs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
2576--
2577
2578ALTER SEQUENCE domain_attrs_id_seq OWNED BY domain_attrs.id;
2579
2580
2581--
2582-- Name: fraud_alert; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
2583--
2584
2585CREATE TABLE fraud_alert (
2586 id integer NOT NULL,
2587 amount_fraud boolean NOT NULL,
2588 amount_limit_alert numeric(12,4) NOT NULL,
2589 amount_block_alert numeric(12,4) NOT NULL,
2590 high_amount_alert_sent boolean NOT NULL,
2591 minutes_fraud boolean NOT NULL,
2592 minutes_limit_alert integer NOT NULL,
2593 minutes_block_alert integer NOT NULL,
2594 high_minutes_alert_sent boolean NOT NULL,
2595 account_blocked_alert_sent boolean NOT NULL,
2596 date_added timestamp with time zone NOT NULL,
2597 date_modified timestamp with time zone NOT NULL,
2598 company_id integer,
2599 customerdirectory_id integer
2600);
2601
2602
2603ALTER TABLE fraud_alert OWNER TO pyfreebilling;
2604
2605--
2606-- Name: fraud_alert_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
2607--
2608
2609CREATE SEQUENCE fraud_alert_id_seq
2610 START WITH 1
2611 INCREMENT BY 1
2612 NO MINVALUE
2613 NO MAXVALUE
2614 CACHE 1;
2615
2616
2617ALTER TABLE fraud_alert_id_seq OWNER TO pyfreebilling;
2618
2619--
2620-- Name: fraud_alert_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
2621--
2622
2623ALTER SEQUENCE fraud_alert_id_seq OWNED BY fraud_alert.id;
2624
2625
2626--
2627-- Name: fs_switch_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
2628--
2629
2630CREATE SEQUENCE fs_switch_id_seq
2631 START WITH 1
2632 INCREMENT BY 1
2633 NO MINVALUE
2634 NO MAXVALUE
2635 CACHE 1;
2636
2637
2638ALTER TABLE fs_switch_id_seq OWNER TO pyfreebilling;
2639
2640--
2641-- Name: fs_switch_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
2642--
2643
2644ALTER SEQUENCE fs_switch_id_seq OWNED BY fs_switch.id;
2645
2646
2647--
2648-- Name: fs_switch_profile_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
2649--
2650
2651CREATE SEQUENCE fs_switch_profile_id_seq
2652 START WITH 1
2653 INCREMENT BY 1
2654 NO MINVALUE
2655 NO MAXVALUE
2656 CACHE 1;
2657
2658
2659ALTER TABLE fs_switch_profile_id_seq OWNER TO pyfreebilling;
2660
2661--
2662-- Name: fs_switch_profile_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
2663--
2664
2665ALTER SEQUENCE fs_switch_profile_id_seq OWNED BY fs_switch_profile.id;
2666
2667
2668--
2669-- Name: hangup_cause; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
2670--
2671
2672CREATE TABLE hangup_cause (
2673 id integer NOT NULL,
2674 code integer NOT NULL,
2675 enumeration character varying(100),
2676 cause character varying(100),
2677 description text NOT NULL,
2678 date_added timestamp with time zone NOT NULL,
2679 date_modified timestamp with time zone NOT NULL,
2680 CONSTRAINT hangup_cause_code_check CHECK ((code >= 0))
2681);
2682
2683
2684ALTER TABLE hangup_cause OWNER TO pyfreebilling;
2685
2686--
2687-- Name: hangup_cause_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
2688--
2689
2690CREATE SEQUENCE hangup_cause_id_seq
2691 START WITH 1
2692 INCREMENT BY 1
2693 NO MINVALUE
2694 NO MAXVALUE
2695 CACHE 1;
2696
2697
2698ALTER TABLE hangup_cause_id_seq OWNER TO pyfreebilling;
2699
2700--
2701-- Name: hangup_cause_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
2702--
2703
2704ALTER SEQUENCE hangup_cause_id_seq OWNED BY hangup_cause.id;
2705
2706
2707--
2708-- Name: lcr_group; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
2709--
2710
2711CREATE TABLE lcr_group (
2712 id integer NOT NULL,
2713 name character varying(128) NOT NULL,
2714 description text NOT NULL,
2715 lcrtype character varying(10) NOT NULL,
2716 date_added timestamp with time zone NOT NULL,
2717 date_modified timestamp with time zone NOT NULL
2718);
2719
2720
2721ALTER TABLE lcr_group OWNER TO pyfreebilling;
2722
2723--
2724-- Name: lcr_group_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
2725--
2726
2727CREATE SEQUENCE lcr_group_id_seq
2728 START WITH 1
2729 INCREMENT BY 1
2730 NO MINVALUE
2731 NO MAXVALUE
2732 CACHE 1;
2733
2734
2735ALTER TABLE lcr_group_id_seq OWNER TO pyfreebilling;
2736
2737--
2738-- Name: lcr_group_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
2739--
2740
2741ALTER SEQUENCE lcr_group_id_seq OWNED BY lcr_group.id;
2742
2743
2744--
2745-- Name: lcr_providers; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
2746--
2747
2748CREATE TABLE lcr_providers (
2749 id integer NOT NULL,
2750 date_added timestamp with time zone NOT NULL,
2751 date_modified timestamp with time zone NOT NULL,
2752 lcr_id integer NOT NULL,
2753 provider_tariff_id integer NOT NULL
2754);
2755
2756
2757ALTER TABLE lcr_providers OWNER TO pyfreebilling;
2758
2759--
2760-- Name: lcr_providers_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
2761--
2762
2763CREATE SEQUENCE lcr_providers_id_seq
2764 START WITH 1
2765 INCREMENT BY 1
2766 NO MINVALUE
2767 NO MAXVALUE
2768 CACHE 1;
2769
2770
2771ALTER TABLE lcr_providers_id_seq OWNER TO pyfreebilling;
2772
2773--
2774-- Name: lcr_providers_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
2775--
2776
2777ALTER SEQUENCE lcr_providers_id_seq OWNED BY lcr_providers.id;
2778
2779
2780--
2781-- Name: location; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
2782--
2783
2784CREATE TABLE location (
2785 id integer NOT NULL,
2786 ruid character varying(64) DEFAULT ''::character varying NOT NULL,
2787 username character varying(64) DEFAULT ''::character varying NOT NULL,
2788 domain character varying(64) DEFAULT NULL::character varying,
2789 contact character varying(255) DEFAULT ''::character varying NOT NULL,
2790 received character varying(128) DEFAULT NULL::character varying,
2791 path character varying(512) DEFAULT NULL::character varying,
2792 expires timestamp without time zone DEFAULT '2030-05-28 21:32:15'::timestamp without time zone NOT NULL,
2793 q real DEFAULT 1.0 NOT NULL,
2794 callid character varying(255) DEFAULT 'Default-Call-ID'::character varying NOT NULL,
2795 cseq integer DEFAULT 1 NOT NULL,
2796 last_modified timestamp without time zone DEFAULT '2000-01-01 00:00:01'::timestamp without time zone NOT NULL,
2797 flags integer DEFAULT 0 NOT NULL,
2798 cflags integer DEFAULT 0 NOT NULL,
2799 user_agent character varying(255) DEFAULT ''::character varying NOT NULL,
2800 socket character varying(64) DEFAULT NULL::character varying,
2801 methods integer,
2802 instance character varying(255) DEFAULT NULL::character varying,
2803 reg_id integer DEFAULT 0 NOT NULL,
2804 server_id integer DEFAULT 0 NOT NULL,
2805 connection_id integer DEFAULT 0 NOT NULL,
2806 keepalive integer DEFAULT 0 NOT NULL,
2807 partition integer DEFAULT 0 NOT NULL
2808);
2809
2810
2811ALTER TABLE location OWNER TO pyfreebilling;
2812
2813--
2814-- Name: location_attrs; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
2815--
2816
2817CREATE TABLE location_attrs (
2818 id integer NOT NULL,
2819 ruid character varying(64) DEFAULT ''::character varying NOT NULL,
2820 username character varying(64) DEFAULT ''::character varying NOT NULL,
2821 domain character varying(64) DEFAULT NULL::character varying,
2822 aname character varying(64) DEFAULT ''::character varying NOT NULL,
2823 atype integer DEFAULT 0 NOT NULL,
2824 avalue character varying(255) DEFAULT ''::character varying NOT NULL,
2825 last_modified timestamp without time zone DEFAULT '2000-01-01 00:00:01'::timestamp without time zone NOT NULL
2826);
2827
2828
2829ALTER TABLE location_attrs OWNER TO pyfreebilling;
2830
2831--
2832-- Name: location_attrs_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
2833--
2834
2835CREATE SEQUENCE location_attrs_id_seq
2836 START WITH 1
2837 INCREMENT BY 1
2838 NO MINVALUE
2839 NO MAXVALUE
2840 CACHE 1;
2841
2842
2843ALTER TABLE location_attrs_id_seq OWNER TO pyfreebilling;
2844
2845--
2846-- Name: location_attrs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
2847--
2848
2849ALTER SEQUENCE location_attrs_id_seq OWNED BY location_attrs.id;
2850
2851
2852--
2853-- Name: location_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
2854--
2855
2856CREATE SEQUENCE location_id_seq
2857 START WITH 1
2858 INCREMENT BY 1
2859 NO MINVALUE
2860 NO MAXVALUE
2861 CACHE 1;
2862
2863
2864ALTER TABLE location_id_seq OWNER TO pyfreebilling;
2865
2866--
2867-- Name: location_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
2868--
2869
2870ALTER SEQUENCE location_id_seq OWNED BY location.id;
2871
2872
2873--
2874-- Name: normalization_grp; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
2875--
2876
2877CREATE TABLE normalization_grp (
2878 id integer NOT NULL,
2879 name character varying(30) NOT NULL,
2880 description text NOT NULL,
2881 date_added timestamp with time zone NOT NULL,
2882 date_modified timestamp with time zone NOT NULL
2883);
2884
2885
2886ALTER TABLE normalization_grp OWNER TO pyfreebilling;
2887
2888--
2889-- Name: normalization_grp_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
2890--
2891
2892CREATE SEQUENCE normalization_grp_id_seq
2893 START WITH 1
2894 INCREMENT BY 1
2895 NO MINVALUE
2896 NO MAXVALUE
2897 CACHE 1;
2898
2899
2900ALTER TABLE normalization_grp_id_seq OWNER TO pyfreebilling;
2901
2902--
2903-- Name: normalization_grp_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
2904--
2905
2906ALTER SEQUENCE normalization_grp_id_seq OWNED BY normalization_grp.id;
2907
2908
2909--
2910-- Name: normalization_rule_grp_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
2911--
2912
2913CREATE SEQUENCE normalization_rule_grp_id_seq
2914 START WITH 1
2915 INCREMENT BY 1
2916 NO MINVALUE
2917 NO MAXVALUE
2918 CACHE 1;
2919
2920
2921ALTER TABLE normalization_rule_grp_id_seq OWNER TO pyfreebilling;
2922
2923--
2924-- Name: normalization_rule_grp_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
2925--
2926
2927ALTER SEQUENCE normalization_rule_grp_id_seq OWNED BY normalization_rule_grp.id;
2928
2929
2930--
2931-- Name: normalization_rule_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
2932--
2933
2934CREATE SEQUENCE normalization_rule_id_seq
2935 START WITH 1
2936 INCREMENT BY 1
2937 NO MINVALUE
2938 NO MAXVALUE
2939 CACHE 1;
2940
2941
2942ALTER TABLE normalization_rule_id_seq OWNER TO pyfreebilling;
2943
2944--
2945-- Name: normalization_rule_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
2946--
2947
2948ALTER SEQUENCE normalization_rule_id_seq OWNED BY normalization_rule.id;
2949
2950
2951--
2952-- Name: provider_rates; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
2953--
2954
2955CREATE TABLE provider_rates (
2956 id integer NOT NULL,
2957 destination character varying(128),
2958 digits character varying(30) NOT NULL,
2959 cost_rate numeric(11,5) NOT NULL,
2960 block_min_duration integer NOT NULL,
2961 init_block numeric(11,5) NOT NULL,
2962 enabled boolean NOT NULL,
2963 date_added timestamp with time zone NOT NULL,
2964 date_modified timestamp with time zone NOT NULL,
2965 provider_tariff_id integer NOT NULL
2966);
2967
2968
2969ALTER TABLE provider_rates OWNER TO pyfreebilling;
2970
2971--
2972-- Name: provider_rates_did; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
2973--
2974
2975CREATE TABLE provider_rates_did (
2976 id integer NOT NULL,
2977 name character varying(128) NOT NULL,
2978 rate numeric(11,5) NOT NULL,
2979 block_min_duration integer NOT NULL,
2980 interval_duration integer NOT NULL,
2981 enabled boolean NOT NULL,
2982 date_added timestamp with time zone NOT NULL,
2983 date_modified timestamp with time zone NOT NULL,
2984 provider_id integer NOT NULL
2985);
2986
2987
2988ALTER TABLE provider_rates_did OWNER TO pyfreebilling;
2989
2990--
2991-- Name: provider_rates_did_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
2992--
2993
2994CREATE SEQUENCE provider_rates_did_id_seq
2995 START WITH 1
2996 INCREMENT BY 1
2997 NO MINVALUE
2998 NO MAXVALUE
2999 CACHE 1;
3000
3001
3002ALTER TABLE provider_rates_did_id_seq OWNER TO pyfreebilling;
3003
3004--
3005-- Name: provider_rates_did_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
3006--
3007
3008ALTER SEQUENCE provider_rates_did_id_seq OWNED BY provider_rates_did.id;
3009
3010
3011--
3012-- Name: provider_rates_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
3013--
3014
3015CREATE SEQUENCE provider_rates_id_seq
3016 START WITH 1
3017 INCREMENT BY 1
3018 NO MINVALUE
3019 NO MAXVALUE
3020 CACHE 1;
3021
3022
3023ALTER TABLE provider_rates_id_seq OWNER TO pyfreebilling;
3024
3025--
3026-- Name: provider_rates_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
3027--
3028
3029ALTER SEQUENCE provider_rates_id_seq OWNED BY provider_rates.id;
3030
3031
3032--
3033-- Name: provider_tariff; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
3034--
3035
3036CREATE TABLE provider_tariff (
3037 id integer NOT NULL,
3038 name character varying(128) NOT NULL,
3039 lead_strip character varying(15) NOT NULL,
3040 tail_strip character varying(15) NOT NULL,
3041 prefix character varying(15) NOT NULL,
3042 suffix character varying(15) NOT NULL,
3043 description text NOT NULL,
3044 callerid_filter character varying(2) NOT NULL,
3045 date_start timestamp with time zone NOT NULL,
3046 date_end timestamp with time zone NOT NULL,
3047 quality integer NOT NULL,
3048 reliability integer NOT NULL,
3049 cid character varying(25) NOT NULL,
3050 enabled boolean NOT NULL,
3051 date_added timestamp with time zone NOT NULL,
3052 date_modified timestamp with time zone NOT NULL,
3053 callerid_list_id integer,
3054 carrier_id integer NOT NULL,
3055 currency_id integer NOT NULL
3056);
3057
3058
3059ALTER TABLE provider_tariff OWNER TO pyfreebilling;
3060
3061--
3062-- Name: provider_tariff_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
3063--
3064
3065CREATE SEQUENCE provider_tariff_id_seq
3066 START WITH 1
3067 INCREMENT BY 1
3068 NO MINVALUE
3069 NO MAXVALUE
3070 CACHE 1;
3071
3072
3073ALTER TABLE provider_tariff_id_seq OWNER TO pyfreebilling;
3074
3075--
3076-- Name: provider_tariff_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
3077--
3078
3079ALTER SEQUENCE provider_tariff_id_seq OWNED BY provider_tariff.id;
3080
3081
3082--
3083-- Name: ratecard; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
3084--
3085
3086CREATE TABLE ratecard (
3087 id integer NOT NULL,
3088 name character varying(128) NOT NULL,
3089 description text NOT NULL,
3090 callerid_filter character varying(2) NOT NULL,
3091 enabled boolean NOT NULL,
3092 date_added timestamp with time zone NOT NULL,
3093 date_modified timestamp with time zone NOT NULL,
3094 callerid_list_id integer,
3095 currency_id integer NOT NULL,
3096 lcrgroup_id integer NOT NULL,
3097 rctype character varying(10) NOT NULL,
3098 date_end timestamp with time zone NOT NULL,
3099 date_start timestamp with time zone NOT NULL
3100);
3101
3102
3103ALTER TABLE ratecard OWNER TO pyfreebilling;
3104
3105--
3106-- Name: ratecard_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
3107--
3108
3109CREATE SEQUENCE ratecard_id_seq
3110 START WITH 1
3111 INCREMENT BY 1
3112 NO MINVALUE
3113 NO MAXVALUE
3114 CACHE 1;
3115
3116
3117ALTER TABLE ratecard_id_seq OWNER TO pyfreebilling;
3118
3119--
3120-- Name: ratecard_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
3121--
3122
3123ALTER SEQUENCE ratecard_id_seq OWNED BY ratecard.id;
3124
3125
3126--
3127-- Name: sip_profile_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
3128--
3129
3130CREATE SEQUENCE sip_profile_id_seq
3131 START WITH 1
3132 INCREMENT BY 1
3133 NO MINVALUE
3134 NO MAXVALUE
3135 CACHE 1;
3136
3137
3138ALTER TABLE sip_profile_id_seq OWNER TO pyfreebilling;
3139
3140--
3141-- Name: sip_profile_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
3142--
3143
3144ALTER SEQUENCE sip_profile_id_seq OWNED BY sip_profile.id;
3145
3146
3147--
3148-- Name: sofia_gateway_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
3149--
3150
3151CREATE SEQUENCE sofia_gateway_id_seq
3152 START WITH 1
3153 INCREMENT BY 1
3154 NO MINVALUE
3155 NO MAXVALUE
3156 CACHE 1;
3157
3158
3159ALTER TABLE sofia_gateway_id_seq OWNER TO pyfreebilling;
3160
3161--
3162-- Name: sofia_gateway_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
3163--
3164
3165ALTER SEQUENCE sofia_gateway_id_seq OWNED BY sofia_gateway.id;
3166
3167
3168--
3169-- Name: subscriber; Type: VIEW; Schema: public; Owner: pyfreebilling
3170--
3171
3172CREATE VIEW subscriber AS
3173 SELECT row_number() OVER () AS id,
3174 c.name AS username,
3175 ud.domain,
3176 c.password
3177 FROM (customer_directory c
3178 LEFT JOIN uid_domain ud ON ((c.domain_id = ud.id)))
3179 WHERE ((c.enabled = true) AND (c.registration = true));
3180
3181
3182ALTER TABLE subscriber OWNER TO pyfreebilling;
3183
3184--
3185-- Name: trusted; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
3186--
3187
3188CREATE TABLE trusted (
3189 id integer NOT NULL,
3190 src_ip character varying(50) NOT NULL,
3191 proto character varying(4) NOT NULL,
3192 from_pattern character varying(64) DEFAULT NULL::character varying,
3193 ruri_pattern character varying(64) DEFAULT NULL::character varying,
3194 tag character varying(64),
3195 priority integer DEFAULT 0 NOT NULL
3196);
3197
3198
3199ALTER TABLE trusted OWNER TO pyfreebilling;
3200
3201--
3202-- Name: trusted_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
3203--
3204
3205CREATE SEQUENCE trusted_id_seq
3206 START WITH 1
3207 INCREMENT BY 1
3208 NO MINVALUE
3209 NO MAXVALUE
3210 CACHE 1;
3211
3212
3213ALTER TABLE trusted_id_seq OWNER TO pyfreebilling;
3214
3215--
3216-- Name: trusted_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
3217--
3218
3219ALTER SEQUENCE trusted_id_seq OWNED BY trusted.id;
3220
3221
3222--
3223-- Name: uid_domain_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
3224--
3225
3226CREATE SEQUENCE uid_domain_id_seq
3227 START WITH 1
3228 INCREMENT BY 1
3229 NO MINVALUE
3230 NO MAXVALUE
3231 CACHE 1;
3232
3233
3234ALTER TABLE uid_domain_id_seq OWNER TO pyfreebilling;
3235
3236--
3237-- Name: uid_domain_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
3238--
3239
3240ALTER SEQUENCE uid_domain_id_seq OWNED BY uid_domain.id;
3241
3242
3243--
3244-- Name: usr_preferences; Type: VIEW; Schema: public; Owner: pyfreebilling
3245--
3246
3247CREATE VIEW usr_preferences AS
3248 SELECT row_number() OVER () AS id,
3249 v.uuid,
3250 v.username,
3251 v.domain,
3252 v.attribute,
3253 v.type,
3254 v.value,
3255 v.last_modified
3256 FROM ( SELECT DISTINCT c.name AS uuid,
3257 c.name AS username,
3258 ''::character varying AS domain,
3259 'grpnormcallee'::character varying AS attribute,
3260 1 AS type,
3261 (nrg.dpid_id)::character varying AS value,
3262 (now())::timestamp without time zone AS last_modified
3263 FROM ((customer_directory c
3264 JOIN normalization_grp ng ON ((ng.id = c.callee_norm_id)))
3265 JOIN normalization_rule_grp nrg ON ((nrg.dpid_id = ng.id)))
3266 WHERE (c.enabled = true)
3267 UNION ALL
3268 SELECT DISTINCT c.name AS uuid,
3269 c.name AS username,
3270 ''::character varying AS domain,
3271 'grpnormcaller'::character varying AS attribute,
3272 1 AS type,
3273 (nrg.dpid_id)::character varying AS value,
3274 (now())::timestamp without time zone AS last_modified
3275 FROM ((customer_directory c
3276 JOIN normalization_grp ng ON ((ng.id = c.callerid_norm_id)))
3277 JOIN normalization_rule_grp nrg ON ((nrg.dpid_id = ng.id)))
3278 WHERE (c.enabled = true)
3279 UNION ALL
3280 SELECT DISTINCT c.name AS uuid,
3281 c.name AS username,
3282 ''::character varying AS domain,
3283 'grpnormcalleein'::character varying AS attribute,
3284 1 AS type,
3285 (nrg.dpid_id)::character varying AS value,
3286 (now())::timestamp without time zone AS last_modified
3287 FROM ((customer_directory c
3288 JOIN normalization_grp ng ON ((ng.id = c.callee_norm_in_id)))
3289 JOIN normalization_rule_grp nrg ON ((nrg.dpid_id = ng.id)))
3290 WHERE (c.enabled = true)
3291 UNION ALL
3292 SELECT DISTINCT c.name AS uuid,
3293 c.name AS username,
3294 ''::character varying AS domain,
3295 'grpnormcallerin'::character varying AS attribute,
3296 1 AS type,
3297 (nrg.dpid_id)::character varying AS value,
3298 (now())::timestamp without time zone AS last_modified
3299 FROM ((customer_directory c
3300 JOIN normalization_grp ng ON ((ng.id = c.callerid_norm_in_id)))
3301 JOIN normalization_rule_grp nrg ON ((nrg.dpid_id = ng.id)))
3302 WHERE (c.enabled = true)) v;
3303
3304
3305ALTER TABLE usr_preferences OWNER TO pyfreebilling;
3306
3307--
3308-- Name: version; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
3309--
3310
3311CREATE TABLE version (
3312 table_name character varying(32) NOT NULL,
3313 table_version integer DEFAULT 0 NOT NULL
3314);
3315
3316
3317ALTER TABLE version OWNER TO pyfreebilling;
3318
3319--
3320-- Name: voip_switch; Type: TABLE; Schema: public; Owner: pyfreebilling; Tablespace:
3321--
3322
3323CREATE TABLE voip_switch (
3324 id integer NOT NULL,
3325 name character varying(50) NOT NULL,
3326 ip character varying(100) NOT NULL,
3327 esl_listen_ip character varying(100) NOT NULL,
3328 esl_listen_port integer NOT NULL,
3329 esl_password character varying(30) NOT NULL,
3330 date_added timestamp with time zone NOT NULL,
3331 date_modified timestamp with time zone NOT NULL,
3332 CONSTRAINT voip_switch_esl_listen_port_check CHECK ((esl_listen_port >= 0))
3333);
3334
3335
3336ALTER TABLE voip_switch OWNER TO pyfreebilling;
3337
3338--
3339-- Name: voip_switch_id_seq; Type: SEQUENCE; Schema: public; Owner: pyfreebilling
3340--
3341
3342CREATE SEQUENCE voip_switch_id_seq
3343 START WITH 1
3344 INCREMENT BY 1
3345 NO MINVALUE
3346 NO MAXVALUE
3347 CACHE 1;
3348
3349
3350ALTER TABLE voip_switch_id_seq OWNER TO pyfreebilling;
3351
3352--
3353-- Name: voip_switch_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pyfreebilling
3354--
3355
3356ALTER SEQUENCE voip_switch_id_seq OWNED BY voip_switch.id;
3357
3358
3359--
3360-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3361--
3362
3363ALTER TABLE ONLY acl_lists ALTER COLUMN id SET DEFAULT nextval('acl_lists_id_seq'::regclass);
3364
3365
3366--
3367-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3368--
3369
3370ALTER TABLE ONLY acl_nodes ALTER COLUMN id SET DEFAULT nextval('acl_nodes_id_seq'::regclass);
3371
3372
3373--
3374-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3375--
3376
3377ALTER TABLE ONLY admin_honeypot_loginattempt ALTER COLUMN id SET DEFAULT nextval('admin_honeypot_loginattempt_id_seq'::regclass);
3378
3379
3380--
3381-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3382--
3383
3384ALTER TABLE ONLY admin_tools_menu_bookmark ALTER COLUMN id SET DEFAULT nextval('admin_tools_menu_bookmark_id_seq'::regclass);
3385
3386
3387--
3388-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3389--
3390
3391ALTER TABLE ONLY aliases ALTER COLUMN id SET DEFAULT nextval('aliases_id_seq'::regclass);
3392
3393
3394--
3395-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3396--
3397
3398ALTER TABLE ONLY auth_group ALTER COLUMN id SET DEFAULT nextval('auth_group_id_seq'::regclass);
3399
3400
3401--
3402-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3403--
3404
3405ALTER TABLE ONLY auth_group_permissions ALTER COLUMN id SET DEFAULT nextval('auth_group_permissions_id_seq'::regclass);
3406
3407
3408--
3409-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3410--
3411
3412ALTER TABLE ONLY auth_permission ALTER COLUMN id SET DEFAULT nextval('auth_permission_id_seq'::regclass);
3413
3414
3415--
3416-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3417--
3418
3419ALTER TABLE ONLY auth_user ALTER COLUMN id SET DEFAULT nextval('auth_user_id_seq'::regclass);
3420
3421
3422--
3423-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3424--
3425
3426ALTER TABLE ONLY auth_user_groups ALTER COLUMN id SET DEFAULT nextval('auth_user_groups_id_seq'::regclass);
3427
3428
3429--
3430-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3431--
3432
3433ALTER TABLE ONLY auth_user_user_permissions ALTER COLUMN id SET DEFAULT nextval('auth_user_user_permissions_id_seq'::regclass);
3434
3435
3436--
3437-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3438--
3439
3440ALTER TABLE ONLY axes_accessattempt ALTER COLUMN id SET DEFAULT nextval('axes_accessattempt_id_seq'::regclass);
3441
3442
3443--
3444-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3445--
3446
3447ALTER TABLE ONLY axes_accesslog ALTER COLUMN id SET DEFAULT nextval('axes_accesslog_id_seq'::regclass);
3448
3449
3450--
3451-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3452--
3453
3454ALTER TABLE ONLY call_mapping_rule ALTER COLUMN id SET DEFAULT nextval('call_mapping_rule_id_seq'::regclass);
3455
3456
3457--
3458-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3459--
3460
3461ALTER TABLE ONLY caller_id_prefix ALTER COLUMN id SET DEFAULT nextval('caller_id_prefix_id_seq'::regclass);
3462
3463
3464--
3465-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3466--
3467
3468ALTER TABLE ONLY callerid_prefix_list ALTER COLUMN id SET DEFAULT nextval('callerid_prefix_list_id_seq'::regclass);
3469
3470
3471--
3472-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3473--
3474
3475ALTER TABLE ONLY carrier_cid_norm_rules ALTER COLUMN id SET DEFAULT nextval('carrier_cid_norm_rules_id_seq'::regclass);
3476
3477
3478--
3479-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3480--
3481
3482ALTER TABLE ONLY carrier_norm_rules ALTER COLUMN id SET DEFAULT nextval('carrier_norm_rules_id_seq'::regclass);
3483
3484
3485--
3486-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3487--
3488
3489ALTER TABLE ONLY cdr ALTER COLUMN id SET DEFAULT nextval('cdr_id_seq'::regclass);
3490
3491
3492--
3493-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3494--
3495
3496ALTER TABLE ONLY chroniker_job ALTER COLUMN id SET DEFAULT nextval('chroniker_job_id_seq'::regclass);
3497
3498
3499--
3500-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3501--
3502
3503ALTER TABLE ONLY chroniker_job_subscribers ALTER COLUMN id SET DEFAULT nextval('chroniker_job_subscribers_id_seq'::regclass);
3504
3505
3506--
3507-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3508--
3509
3510ALTER TABLE ONLY chroniker_jobdependency ALTER COLUMN id SET DEFAULT nextval('chroniker_jobdependency_id_seq'::regclass);
3511
3512
3513--
3514-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3515--
3516
3517ALTER TABLE ONLY chroniker_log ALTER COLUMN id SET DEFAULT nextval('chroniker_log_id_seq'::regclass);
3518
3519
3520--
3521-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3522--
3523
3524ALTER TABLE ONLY company ALTER COLUMN id SET DEFAULT nextval('company_id_seq'::regclass);
3525
3526
3527--
3528-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3529--
3530
3531ALTER TABLE ONLY company_balance_history ALTER COLUMN id SET DEFAULT nextval('company_balance_history_id_seq'::regclass);
3532
3533
3534--
3535-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3536--
3537
3538ALTER TABLE ONLY contacts_email_addresses ALTER COLUMN id SET DEFAULT nextval('contacts_email_addresses_id_seq'::regclass);
3539
3540
3541--
3542-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3543--
3544
3545ALTER TABLE ONLY contacts_groups ALTER COLUMN id SET DEFAULT nextval('contacts_groups_id_seq'::regclass);
3546
3547
3548--
3549-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3550--
3551
3552ALTER TABLE ONLY contacts_groups_companies ALTER COLUMN id SET DEFAULT nextval('contacts_groups_companies_id_seq'::regclass);
3553
3554
3555--
3556-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3557--
3558
3559ALTER TABLE ONLY contacts_groups_people ALTER COLUMN id SET DEFAULT nextval('contacts_groups_people_id_seq'::regclass);
3560
3561
3562--
3563-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3564--
3565
3566ALTER TABLE ONLY contacts_people ALTER COLUMN id SET DEFAULT nextval('contacts_people_id_seq'::regclass);
3567
3568
3569--
3570-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3571--
3572
3573ALTER TABLE ONLY contacts_phone_numbers ALTER COLUMN id SET DEFAULT nextval('contacts_phone_numbers_id_seq'::regclass);
3574
3575
3576--
3577-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3578--
3579
3580ALTER TABLE ONLY contacts_street_addresses ALTER COLUMN id SET DEFAULT nextval('contacts_street_addresses_id_seq'::regclass);
3581
3582
3583--
3584-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3585--
3586
3587ALTER TABLE ONLY contacts_web_sites ALTER COLUMN id SET DEFAULT nextval('contacts_web_sites_id_seq'::regclass);
3588
3589
3590--
3591-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3592--
3593
3594ALTER TABLE ONLY currencies_currency ALTER COLUMN id SET DEFAULT nextval('currencies_currency_id_seq'::regclass);
3595
3596
3597--
3598-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3599--
3600
3601ALTER TABLE ONLY customer_cid_norm_rules ALTER COLUMN id SET DEFAULT nextval('customer_cid_norm_rules_id_seq'::regclass);
3602
3603
3604--
3605-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3606--
3607
3608ALTER TABLE ONLY customer_directory ALTER COLUMN id SET DEFAULT nextval('customer_directory_id_seq'::regclass);
3609
3610
3611--
3612-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3613--
3614
3615ALTER TABLE ONLY customer_norm_rules ALTER COLUMN id SET DEFAULT nextval('customer_norm_rules_id_seq'::regclass);
3616
3617
3618--
3619-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3620--
3621
3622ALTER TABLE ONLY customer_ratecards ALTER COLUMN id SET DEFAULT nextval('customer_ratecards_id_seq'::regclass);
3623
3624
3625--
3626-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3627--
3628
3629ALTER TABLE ONLY customer_rates ALTER COLUMN id SET DEFAULT nextval('customer_rates_id_seq'::regclass);
3630
3631
3632--
3633-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3634--
3635
3636ALTER TABLE ONLY customer_rates_did ALTER COLUMN id SET DEFAULT nextval('customer_rates_did_id_seq'::regclass);
3637
3638
3639--
3640-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3641--
3642
3643ALTER TABLE ONLY date_dimension ALTER COLUMN id SET DEFAULT nextval('date_dimension_id_seq'::regclass);
3644
3645
3646--
3647-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3648--
3649
3650ALTER TABLE ONLY destination_norm_rules ALTER COLUMN id SET DEFAULT nextval('destination_norm_rules_id_seq'::regclass);
3651
3652
3653--
3654-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3655--
3656
3657ALTER TABLE ONLY did ALTER COLUMN id SET DEFAULT nextval('did_id_seq'::regclass);
3658
3659
3660--
3661-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3662--
3663
3664ALTER TABLE ONLY did_routes ALTER COLUMN id SET DEFAULT nextval('did_routes_id_seq'::regclass);
3665
3666
3667--
3668-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3669--
3670
3671ALTER TABLE ONLY dim_customer_destination ALTER COLUMN id SET DEFAULT nextval('dim_customer_destination_id_seq'::regclass);
3672
3673
3674--
3675-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3676--
3677
3678ALTER TABLE ONLY dim_customer_hangupcause ALTER COLUMN id SET DEFAULT nextval('dim_customer_hangupcause_id_seq'::regclass);
3679
3680
3681--
3682-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3683--
3684
3685ALTER TABLE ONLY dim_customer_sip_hangupcause ALTER COLUMN id SET DEFAULT nextval('dim_customer_sip_hangupcause_id_seq'::regclass);
3686
3687
3688--
3689-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3690--
3691
3692ALTER TABLE ONLY dim_provider_destination ALTER COLUMN id SET DEFAULT nextval('dim_provider_destination_id_seq'::regclass);
3693
3694
3695--
3696-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3697--
3698
3699ALTER TABLE ONLY dim_provider_hangupcause ALTER COLUMN id SET DEFAULT nextval('dim_provider_hangupcause_id_seq'::regclass);
3700
3701
3702--
3703-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3704--
3705
3706ALTER TABLE ONLY dim_provider_sip_hangupcause ALTER COLUMN id SET DEFAULT nextval('dim_provider_sip_hangupcause_id_seq'::regclass);
3707
3708
3709--
3710-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3711--
3712
3713ALTER TABLE ONLY django_admin_log ALTER COLUMN id SET DEFAULT nextval('django_admin_log_id_seq'::regclass);
3714
3715
3716--
3717-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3718--
3719
3720ALTER TABLE ONLY django_content_type ALTER COLUMN id SET DEFAULT nextval('django_content_type_id_seq'::regclass);
3721
3722
3723--
3724-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3725--
3726
3727ALTER TABLE ONLY django_migrations ALTER COLUMN id SET DEFAULT nextval('django_migrations_id_seq'::regclass);
3728
3729
3730--
3731-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3732--
3733
3734ALTER TABLE ONLY django_site ALTER COLUMN id SET DEFAULT nextval('django_site_id_seq'::regclass);
3735
3736
3737--
3738-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3739--
3740
3741ALTER TABLE ONLY domain_attrs ALTER COLUMN id SET DEFAULT nextval('domain_attrs_id_seq'::regclass);
3742
3743
3744--
3745-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3746--
3747
3748ALTER TABLE ONLY fraud_alert ALTER COLUMN id SET DEFAULT nextval('fraud_alert_id_seq'::regclass);
3749
3750
3751--
3752-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3753--
3754
3755ALTER TABLE ONLY fs_switch ALTER COLUMN id SET DEFAULT nextval('fs_switch_id_seq'::regclass);
3756
3757
3758--
3759-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3760--
3761
3762ALTER TABLE ONLY fs_switch_profile ALTER COLUMN id SET DEFAULT nextval('fs_switch_profile_id_seq'::regclass);
3763
3764
3765--
3766-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3767--
3768
3769ALTER TABLE ONLY hangup_cause ALTER COLUMN id SET DEFAULT nextval('hangup_cause_id_seq'::regclass);
3770
3771
3772--
3773-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3774--
3775
3776ALTER TABLE ONLY lcr_group ALTER COLUMN id SET DEFAULT nextval('lcr_group_id_seq'::regclass);
3777
3778
3779--
3780-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3781--
3782
3783ALTER TABLE ONLY lcr_providers ALTER COLUMN id SET DEFAULT nextval('lcr_providers_id_seq'::regclass);
3784
3785
3786--
3787-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3788--
3789
3790ALTER TABLE ONLY location ALTER COLUMN id SET DEFAULT nextval('location_id_seq'::regclass);
3791
3792
3793--
3794-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3795--
3796
3797ALTER TABLE ONLY location_attrs ALTER COLUMN id SET DEFAULT nextval('location_attrs_id_seq'::regclass);
3798
3799
3800--
3801-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3802--
3803
3804ALTER TABLE ONLY normalization_grp ALTER COLUMN id SET DEFAULT nextval('normalization_grp_id_seq'::regclass);
3805
3806
3807--
3808-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3809--
3810
3811ALTER TABLE ONLY normalization_rule ALTER COLUMN id SET DEFAULT nextval('normalization_rule_id_seq'::regclass);
3812
3813
3814--
3815-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3816--
3817
3818ALTER TABLE ONLY normalization_rule_grp ALTER COLUMN id SET DEFAULT nextval('normalization_rule_grp_id_seq'::regclass);
3819
3820
3821--
3822-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3823--
3824
3825ALTER TABLE ONLY provider_rates ALTER COLUMN id SET DEFAULT nextval('provider_rates_id_seq'::regclass);
3826
3827
3828--
3829-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3830--
3831
3832ALTER TABLE ONLY provider_rates_did ALTER COLUMN id SET DEFAULT nextval('provider_rates_did_id_seq'::regclass);
3833
3834
3835--
3836-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3837--
3838
3839ALTER TABLE ONLY provider_tariff ALTER COLUMN id SET DEFAULT nextval('provider_tariff_id_seq'::regclass);
3840
3841
3842--
3843-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3844--
3845
3846ALTER TABLE ONLY ratecard ALTER COLUMN id SET DEFAULT nextval('ratecard_id_seq'::regclass);
3847
3848
3849--
3850-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3851--
3852
3853ALTER TABLE ONLY sip_profile ALTER COLUMN id SET DEFAULT nextval('sip_profile_id_seq'::regclass);
3854
3855
3856--
3857-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3858--
3859
3860ALTER TABLE ONLY sofia_gateway ALTER COLUMN id SET DEFAULT nextval('sofia_gateway_id_seq'::regclass);
3861
3862
3863--
3864-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3865--
3866
3867ALTER TABLE ONLY trusted ALTER COLUMN id SET DEFAULT nextval('trusted_id_seq'::regclass);
3868
3869
3870--
3871-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3872--
3873
3874ALTER TABLE ONLY uid_domain ALTER COLUMN id SET DEFAULT nextval('uid_domain_id_seq'::regclass);
3875
3876
3877--
3878-- Name: id; Type: DEFAULT; Schema: public; Owner: pyfreebilling
3879--
3880
3881ALTER TABLE ONLY voip_switch ALTER COLUMN id SET DEFAULT nextval('voip_switch_id_seq'::regclass);
3882
3883
3884--
3885-- Name: acl_lists_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
3886--
3887
3888ALTER TABLE ONLY acl_lists
3889 ADD CONSTRAINT acl_lists_pkey PRIMARY KEY (id);
3890
3891
3892--
3893-- Name: acl_nodes_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
3894--
3895
3896ALTER TABLE ONLY acl_nodes
3897 ADD CONSTRAINT acl_nodes_pkey PRIMARY KEY (id);
3898
3899
3900--
3901-- Name: admin_honeypot_loginattempt_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
3902--
3903
3904ALTER TABLE ONLY admin_honeypot_loginattempt
3905 ADD CONSTRAINT admin_honeypot_loginattempt_pkey PRIMARY KEY (id);
3906
3907
3908--
3909-- Name: admin_tools_menu_bookmark_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
3910--
3911
3912ALTER TABLE ONLY admin_tools_menu_bookmark
3913 ADD CONSTRAINT admin_tools_menu_bookmark_pkey PRIMARY KEY (id);
3914
3915
3916--
3917-- Name: aliases_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
3918--
3919
3920ALTER TABLE ONLY aliases
3921 ADD CONSTRAINT aliases_pkey PRIMARY KEY (id);
3922
3923
3924--
3925-- Name: aliases_ruid_idx; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
3926--
3927
3928ALTER TABLE ONLY aliases
3929 ADD CONSTRAINT aliases_ruid_idx UNIQUE (ruid);
3930
3931
3932--
3933-- Name: auth_group_name_key; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
3934--
3935
3936ALTER TABLE ONLY auth_group
3937 ADD CONSTRAINT auth_group_name_key UNIQUE (name);
3938
3939
3940--
3941-- Name: auth_group_permissions_group_id_permission_id_0cd325b0_uniq; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
3942--
3943
3944ALTER TABLE ONLY auth_group_permissions
3945 ADD CONSTRAINT auth_group_permissions_group_id_permission_id_0cd325b0_uniq UNIQUE (group_id, permission_id);
3946
3947
3948--
3949-- Name: auth_group_permissions_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
3950--
3951
3952ALTER TABLE ONLY auth_group_permissions
3953 ADD CONSTRAINT auth_group_permissions_pkey PRIMARY KEY (id);
3954
3955
3956--
3957-- Name: auth_group_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
3958--
3959
3960ALTER TABLE ONLY auth_group
3961 ADD CONSTRAINT auth_group_pkey PRIMARY KEY (id);
3962
3963
3964--
3965-- Name: auth_permission_content_type_id_codename_01ab375a_uniq; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
3966--
3967
3968ALTER TABLE ONLY auth_permission
3969 ADD CONSTRAINT auth_permission_content_type_id_codename_01ab375a_uniq UNIQUE (content_type_id, codename);
3970
3971
3972--
3973-- Name: auth_permission_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
3974--
3975
3976ALTER TABLE ONLY auth_permission
3977 ADD CONSTRAINT auth_permission_pkey PRIMARY KEY (id);
3978
3979
3980--
3981-- Name: auth_user_groups_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
3982--
3983
3984ALTER TABLE ONLY auth_user_groups
3985 ADD CONSTRAINT auth_user_groups_pkey PRIMARY KEY (id);
3986
3987
3988--
3989-- Name: auth_user_groups_user_id_group_id_94350c0c_uniq; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
3990--
3991
3992ALTER TABLE ONLY auth_user_groups
3993 ADD CONSTRAINT auth_user_groups_user_id_group_id_94350c0c_uniq UNIQUE (user_id, group_id);
3994
3995
3996--
3997-- Name: auth_user_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
3998--
3999
4000ALTER TABLE ONLY auth_user
4001 ADD CONSTRAINT auth_user_pkey PRIMARY KEY (id);
4002
4003
4004--
4005-- Name: auth_user_user_permissions_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4006--
4007
4008ALTER TABLE ONLY auth_user_user_permissions
4009 ADD CONSTRAINT auth_user_user_permissions_pkey PRIMARY KEY (id);
4010
4011
4012--
4013-- Name: auth_user_user_permissions_user_id_permission_id_14a6b632_uniq; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4014--
4015
4016ALTER TABLE ONLY auth_user_user_permissions
4017 ADD CONSTRAINT auth_user_user_permissions_user_id_permission_id_14a6b632_uniq UNIQUE (user_id, permission_id);
4018
4019
4020--
4021-- Name: auth_user_username_key; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4022--
4023
4024ALTER TABLE ONLY auth_user
4025 ADD CONSTRAINT auth_user_username_key UNIQUE (username);
4026
4027
4028--
4029-- Name: axes_accessattempt_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4030--
4031
4032ALTER TABLE ONLY axes_accessattempt
4033 ADD CONSTRAINT axes_accessattempt_pkey PRIMARY KEY (id);
4034
4035
4036--
4037-- Name: axes_accesslog_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4038--
4039
4040ALTER TABLE ONLY axes_accesslog
4041 ADD CONSTRAINT axes_accesslog_pkey PRIMARY KEY (id);
4042
4043
4044--
4045-- Name: call_mapping_rule_dpid_pr_454a0ef7_uniq; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4046--
4047
4048ALTER TABLE ONLY call_mapping_rule
4049 ADD CONSTRAINT call_mapping_rule_dpid_pr_454a0ef7_uniq UNIQUE (dpid, pr);
4050
4051
4052--
4053-- Name: call_mapping_rule_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4054--
4055
4056ALTER TABLE ONLY call_mapping_rule
4057 ADD CONSTRAINT call_mapping_rule_pkey PRIMARY KEY (id);
4058
4059
4060--
4061-- Name: call_mapping_rule_pr_key; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4062--
4063
4064ALTER TABLE ONLY call_mapping_rule
4065 ADD CONSTRAINT call_mapping_rule_pr_key UNIQUE (pr);
4066
4067
4068--
4069-- Name: caller_id_prefix_calleridprefixlist_id_prefix_6f76fbbb_uniq; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4070--
4071
4072ALTER TABLE ONLY caller_id_prefix
4073 ADD CONSTRAINT caller_id_prefix_calleridprefixlist_id_prefix_6f76fbbb_uniq UNIQUE (calleridprefixlist_id, prefix);
4074
4075
4076--
4077-- Name: caller_id_prefix_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4078--
4079
4080ALTER TABLE ONLY caller_id_prefix
4081 ADD CONSTRAINT caller_id_prefix_pkey PRIMARY KEY (id);
4082
4083
4084--
4085-- Name: callerid_prefix_list_name_key; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4086--
4087
4088ALTER TABLE ONLY callerid_prefix_list
4089 ADD CONSTRAINT callerid_prefix_list_name_key UNIQUE (name);
4090
4091
4092--
4093-- Name: callerid_prefix_list_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4094--
4095
4096ALTER TABLE ONLY callerid_prefix_list
4097 ADD CONSTRAINT callerid_prefix_list_pkey PRIMARY KEY (id);
4098
4099
4100--
4101-- Name: carrier_cid_norm_rules_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4102--
4103
4104ALTER TABLE ONLY carrier_cid_norm_rules
4105 ADD CONSTRAINT carrier_cid_norm_rules_pkey PRIMARY KEY (id);
4106
4107
4108--
4109-- Name: carrier_norm_rules_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4110--
4111
4112ALTER TABLE ONLY carrier_norm_rules
4113 ADD CONSTRAINT carrier_norm_rules_pkey PRIMARY KEY (id);
4114
4115
4116--
4117-- Name: cdr_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4118--
4119
4120ALTER TABLE ONLY cdr
4121 ADD CONSTRAINT cdr_pkey PRIMARY KEY (id);
4122
4123
4124--
4125-- Name: chroniker_job_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4126--
4127
4128ALTER TABLE ONLY chroniker_job
4129 ADD CONSTRAINT chroniker_job_pkey PRIMARY KEY (id);
4130
4131
4132--
4133-- Name: chroniker_job_subscribers_job_id_user_id_d297a4fc_uniq; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4134--
4135
4136ALTER TABLE ONLY chroniker_job_subscribers
4137 ADD CONSTRAINT chroniker_job_subscribers_job_id_user_id_d297a4fc_uniq UNIQUE (job_id, user_id);
4138
4139
4140--
4141-- Name: chroniker_job_subscribers_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4142--
4143
4144ALTER TABLE ONLY chroniker_job_subscribers
4145 ADD CONSTRAINT chroniker_job_subscribers_pkey PRIMARY KEY (id);
4146
4147
4148--
4149-- Name: chroniker_jobdependency_dependent_id_dependee_id_a59a3257_uniq; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4150--
4151
4152ALTER TABLE ONLY chroniker_jobdependency
4153 ADD CONSTRAINT chroniker_jobdependency_dependent_id_dependee_id_a59a3257_uniq UNIQUE (dependent_id, dependee_id);
4154
4155
4156--
4157-- Name: chroniker_jobdependency_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4158--
4159
4160ALTER TABLE ONLY chroniker_jobdependency
4161 ADD CONSTRAINT chroniker_jobdependency_pkey PRIMARY KEY (id);
4162
4163
4164--
4165-- Name: chroniker_log_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4166--
4167
4168ALTER TABLE ONLY chroniker_log
4169 ADD CONSTRAINT chroniker_log_pkey PRIMARY KEY (id);
4170
4171
4172--
4173-- Name: company_balance_history_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4174--
4175
4176ALTER TABLE ONLY company_balance_history
4177 ADD CONSTRAINT company_balance_history_pkey PRIMARY KEY (id);
4178
4179
4180--
4181-- Name: company_name_key; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4182--
4183
4184ALTER TABLE ONLY company
4185 ADD CONSTRAINT company_name_key UNIQUE (name);
4186
4187
4188--
4189-- Name: company_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4190--
4191
4192ALTER TABLE ONLY company
4193 ADD CONSTRAINT company_pkey PRIMARY KEY (id);
4194
4195
4196--
4197-- Name: company_slug_key; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4198--
4199
4200ALTER TABLE ONLY company
4201 ADD CONSTRAINT company_slug_key UNIQUE (slug);
4202
4203
4204--
4205-- Name: contacts_email_addresses_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4206--
4207
4208ALTER TABLE ONLY contacts_email_addresses
4209 ADD CONSTRAINT contacts_email_addresses_pkey PRIMARY KEY (id);
4210
4211
4212--
4213-- Name: contacts_groups_companies_group_id_company_id_324256c2_uniq; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4214--
4215
4216ALTER TABLE ONLY contacts_groups_companies
4217 ADD CONSTRAINT contacts_groups_companies_group_id_company_id_324256c2_uniq UNIQUE (group_id, company_id);
4218
4219
4220--
4221-- Name: contacts_groups_companies_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4222--
4223
4224ALTER TABLE ONLY contacts_groups_companies
4225 ADD CONSTRAINT contacts_groups_companies_pkey PRIMARY KEY (id);
4226
4227
4228--
4229-- Name: contacts_groups_name_key; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4230--
4231
4232ALTER TABLE ONLY contacts_groups
4233 ADD CONSTRAINT contacts_groups_name_key UNIQUE (name);
4234
4235
4236--
4237-- Name: contacts_groups_people_group_id_person_id_fa3ff5f7_uniq; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4238--
4239
4240ALTER TABLE ONLY contacts_groups_people
4241 ADD CONSTRAINT contacts_groups_people_group_id_person_id_fa3ff5f7_uniq UNIQUE (group_id, person_id);
4242
4243
4244--
4245-- Name: contacts_groups_people_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4246--
4247
4248ALTER TABLE ONLY contacts_groups_people
4249 ADD CONSTRAINT contacts_groups_people_pkey PRIMARY KEY (id);
4250
4251
4252--
4253-- Name: contacts_groups_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4254--
4255
4256ALTER TABLE ONLY contacts_groups
4257 ADD CONSTRAINT contacts_groups_pkey PRIMARY KEY (id);
4258
4259
4260--
4261-- Name: contacts_groups_slug_key; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4262--
4263
4264ALTER TABLE ONLY contacts_groups
4265 ADD CONSTRAINT contacts_groups_slug_key UNIQUE (slug);
4266
4267
4268--
4269-- Name: contacts_people_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4270--
4271
4272ALTER TABLE ONLY contacts_people
4273 ADD CONSTRAINT contacts_people_pkey PRIMARY KEY (id);
4274
4275
4276--
4277-- Name: contacts_people_slug_key; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4278--
4279
4280ALTER TABLE ONLY contacts_people
4281 ADD CONSTRAINT contacts_people_slug_key UNIQUE (slug);
4282
4283
4284--
4285-- Name: contacts_people_user_id_key; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4286--
4287
4288ALTER TABLE ONLY contacts_people
4289 ADD CONSTRAINT contacts_people_user_id_key UNIQUE (user_id);
4290
4291
4292--
4293-- Name: contacts_phone_numbers_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4294--
4295
4296ALTER TABLE ONLY contacts_phone_numbers
4297 ADD CONSTRAINT contacts_phone_numbers_pkey PRIMARY KEY (id);
4298
4299
4300--
4301-- Name: contacts_street_addresses_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4302--
4303
4304ALTER TABLE ONLY contacts_street_addresses
4305 ADD CONSTRAINT contacts_street_addresses_pkey PRIMARY KEY (id);
4306
4307
4308--
4309-- Name: contacts_web_sites_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4310--
4311
4312ALTER TABLE ONLY contacts_web_sites
4313 ADD CONSTRAINT contacts_web_sites_pkey PRIMARY KEY (id);
4314
4315
4316--
4317-- Name: currencies_currency_code_165b7e38_uniq; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4318--
4319
4320ALTER TABLE ONLY currencies_currency
4321 ADD CONSTRAINT currencies_currency_code_165b7e38_uniq UNIQUE (code);
4322
4323
4324--
4325-- Name: currencies_currency_name_24028e95_uniq; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4326--
4327
4328ALTER TABLE ONLY currencies_currency
4329 ADD CONSTRAINT currencies_currency_name_24028e95_uniq UNIQUE (name);
4330
4331
4332--
4333-- Name: currencies_currency_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4334--
4335
4336ALTER TABLE ONLY currencies_currency
4337 ADD CONSTRAINT currencies_currency_pkey PRIMARY KEY (id);
4338
4339
4340--
4341-- Name: customer_cid_norm_rules_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4342--
4343
4344ALTER TABLE ONLY customer_cid_norm_rules
4345 ADD CONSTRAINT customer_cid_norm_rules_pkey PRIMARY KEY (id);
4346
4347
4348--
4349-- Name: customer_directory_name_key; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4350--
4351
4352ALTER TABLE ONLY customer_directory
4353 ADD CONSTRAINT customer_directory_name_key UNIQUE (name);
4354
4355
4356--
4357-- Name: customer_directory_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4358--
4359
4360ALTER TABLE ONLY customer_directory
4361 ADD CONSTRAINT customer_directory_pkey PRIMARY KEY (id);
4362
4363
4364--
4365-- Name: customer_norm_rules_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4366--
4367
4368ALTER TABLE ONLY customer_norm_rules
4369 ADD CONSTRAINT customer_norm_rules_pkey PRIMARY KEY (id);
4370
4371
4372--
4373-- Name: customer_ratecards_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4374--
4375
4376ALTER TABLE ONLY customer_ratecards
4377 ADD CONSTRAINT customer_ratecards_pkey PRIMARY KEY (id);
4378
4379
4380--
4381-- Name: customer_rates_did_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4382--
4383
4384ALTER TABLE ONLY customer_rates_did
4385 ADD CONSTRAINT customer_rates_did_pkey PRIMARY KEY (id);
4386
4387
4388--
4389-- Name: customer_rates_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4390--
4391
4392ALTER TABLE ONLY customer_rates
4393 ADD CONSTRAINT customer_rates_pkey PRIMARY KEY (id);
4394
4395
4396--
4397-- Name: customer_rates_ratecard_id_prefix_55e3b13c_uniq; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4398--
4399
4400ALTER TABLE ONLY customer_rates
4401 ADD CONSTRAINT customer_rates_ratecard_id_prefix_55e3b13c_uniq UNIQUE (ratecard_id, prefix);
4402
4403
4404--
4405-- Name: date_dimension_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4406--
4407
4408ALTER TABLE ONLY date_dimension
4409 ADD CONSTRAINT date_dimension_pkey PRIMARY KEY (id);
4410
4411
4412--
4413-- Name: destination_norm_rules_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4414--
4415
4416ALTER TABLE ONLY destination_norm_rules
4417 ADD CONSTRAINT destination_norm_rules_pkey PRIMARY KEY (id);
4418
4419
4420--
4421-- Name: did_number_key; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4422--
4423
4424ALTER TABLE ONLY did
4425 ADD CONSTRAINT did_number_key UNIQUE (number);
4426
4427
4428--
4429-- Name: did_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4430--
4431
4432ALTER TABLE ONLY did
4433 ADD CONSTRAINT did_pkey PRIMARY KEY (id);
4434
4435
4436--
4437-- Name: did_routes_contract_did_id_order_f6a7aa1e_uniq; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4438--
4439
4440ALTER TABLE ONLY did_routes
4441 ADD CONSTRAINT did_routes_contract_did_id_order_f6a7aa1e_uniq UNIQUE (contract_did_id, "order");
4442
4443
4444--
4445-- Name: did_routes_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4446--
4447
4448ALTER TABLE ONLY did_routes
4449 ADD CONSTRAINT did_routes_pkey PRIMARY KEY (id);
4450
4451
4452--
4453-- Name: dim_customer_destination_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4454--
4455
4456ALTER TABLE ONLY dim_customer_destination
4457 ADD CONSTRAINT dim_customer_destination_pkey PRIMARY KEY (id);
4458
4459
4460--
4461-- Name: dim_customer_hangupcause_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4462--
4463
4464ALTER TABLE ONLY dim_customer_hangupcause
4465 ADD CONSTRAINT dim_customer_hangupcause_pkey PRIMARY KEY (id);
4466
4467
4468--
4469-- Name: dim_customer_sip_hangupcause_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4470--
4471
4472ALTER TABLE ONLY dim_customer_sip_hangupcause
4473 ADD CONSTRAINT dim_customer_sip_hangupcause_pkey PRIMARY KEY (id);
4474
4475
4476--
4477-- Name: dim_provider_destination_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4478--
4479
4480ALTER TABLE ONLY dim_provider_destination
4481 ADD CONSTRAINT dim_provider_destination_pkey PRIMARY KEY (id);
4482
4483
4484--
4485-- Name: dim_provider_hangupcause_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4486--
4487
4488ALTER TABLE ONLY dim_provider_hangupcause
4489 ADD CONSTRAINT dim_provider_hangupcause_pkey PRIMARY KEY (id);
4490
4491
4492--
4493-- Name: dim_provider_sip_hangupcause_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4494--
4495
4496ALTER TABLE ONLY dim_provider_sip_hangupcause
4497 ADD CONSTRAINT dim_provider_sip_hangupcause_pkey PRIMARY KEY (id);
4498
4499
4500--
4501-- Name: django_admin_log_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4502--
4503
4504ALTER TABLE ONLY django_admin_log
4505 ADD CONSTRAINT django_admin_log_pkey PRIMARY KEY (id);
4506
4507
4508--
4509-- Name: django_content_type_app_label_model_76bd3d3b_uniq; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4510--
4511
4512ALTER TABLE ONLY django_content_type
4513 ADD CONSTRAINT django_content_type_app_label_model_76bd3d3b_uniq UNIQUE (app_label, model);
4514
4515
4516--
4517-- Name: django_content_type_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4518--
4519
4520ALTER TABLE ONLY django_content_type
4521 ADD CONSTRAINT django_content_type_pkey PRIMARY KEY (id);
4522
4523
4524--
4525-- Name: django_migrations_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4526--
4527
4528ALTER TABLE ONLY django_migrations
4529 ADD CONSTRAINT django_migrations_pkey PRIMARY KEY (id);
4530
4531
4532--
4533-- Name: django_session_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4534--
4535
4536ALTER TABLE ONLY django_session
4537 ADD CONSTRAINT django_session_pkey PRIMARY KEY (session_key);
4538
4539
4540--
4541-- Name: django_site_domain_a2e37b91_uniq; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4542--
4543
4544ALTER TABLE ONLY django_site
4545 ADD CONSTRAINT django_site_domain_a2e37b91_uniq UNIQUE (domain);
4546
4547
4548--
4549-- Name: django_site_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4550--
4551
4552ALTER TABLE ONLY django_site
4553 ADD CONSTRAINT django_site_pkey PRIMARY KEY (id);
4554
4555
4556--
4557-- Name: domain_attrs_domain_attrs_idx; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4558--
4559
4560ALTER TABLE ONLY domain_attrs
4561 ADD CONSTRAINT domain_attrs_domain_attrs_idx UNIQUE (did, name, value);
4562
4563
4564--
4565-- Name: domain_attrs_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4566--
4567
4568ALTER TABLE ONLY domain_attrs
4569 ADD CONSTRAINT domain_attrs_pkey PRIMARY KEY (id);
4570
4571
4572--
4573-- Name: fraud_alert_company_id_key; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4574--
4575
4576ALTER TABLE ONLY fraud_alert
4577 ADD CONSTRAINT fraud_alert_company_id_key UNIQUE (company_id);
4578
4579
4580--
4581-- Name: fraud_alert_customerdirectory_id_key; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4582--
4583
4584ALTER TABLE ONLY fraud_alert
4585 ADD CONSTRAINT fraud_alert_customerdirectory_id_key UNIQUE (customerdirectory_id);
4586
4587
4588--
4589-- Name: fraud_alert_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4590--
4591
4592ALTER TABLE ONLY fraud_alert
4593 ADD CONSTRAINT fraud_alert_pkey PRIMARY KEY (id);
4594
4595
4596--
4597-- Name: fs_switch_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4598--
4599
4600ALTER TABLE ONLY fs_switch
4601 ADD CONSTRAINT fs_switch_pkey PRIMARY KEY (id);
4602
4603
4604--
4605-- Name: fs_switch_profile_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4606--
4607
4608ALTER TABLE ONLY fs_switch_profile
4609 ADD CONSTRAINT fs_switch_profile_pkey PRIMARY KEY (id);
4610
4611
4612--
4613-- Name: hangup_cause_code_key; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4614--
4615
4616ALTER TABLE ONLY hangup_cause
4617 ADD CONSTRAINT hangup_cause_code_key UNIQUE (code);
4618
4619
4620--
4621-- Name: hangup_cause_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4622--
4623
4624ALTER TABLE ONLY hangup_cause
4625 ADD CONSTRAINT hangup_cause_pkey PRIMARY KEY (id);
4626
4627
4628--
4629-- Name: lcr_group_name_key; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4630--
4631
4632ALTER TABLE ONLY lcr_group
4633 ADD CONSTRAINT lcr_group_name_key UNIQUE (name);
4634
4635
4636--
4637-- Name: lcr_group_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4638--
4639
4640ALTER TABLE ONLY lcr_group
4641 ADD CONSTRAINT lcr_group_pkey PRIMARY KEY (id);
4642
4643
4644--
4645-- Name: lcr_providers_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4646--
4647
4648ALTER TABLE ONLY lcr_providers
4649 ADD CONSTRAINT lcr_providers_pkey PRIMARY KEY (id);
4650
4651
4652--
4653-- Name: location_attrs_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4654--
4655
4656ALTER TABLE ONLY location_attrs
4657 ADD CONSTRAINT location_attrs_pkey PRIMARY KEY (id);
4658
4659
4660--
4661-- Name: location_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4662--
4663
4664ALTER TABLE ONLY location
4665 ADD CONSTRAINT location_pkey PRIMARY KEY (id);
4666
4667
4668--
4669-- Name: location_ruid_idx; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4670--
4671
4672ALTER TABLE ONLY location
4673 ADD CONSTRAINT location_ruid_idx UNIQUE (ruid);
4674
4675
4676--
4677-- Name: normalization_grp_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4678--
4679
4680ALTER TABLE ONLY normalization_grp
4681 ADD CONSTRAINT normalization_grp_pkey PRIMARY KEY (id);
4682
4683
4684--
4685-- Name: normalization_rule_grp_dpid_id_pr_c96b29a4_uniq; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4686--
4687
4688ALTER TABLE ONLY normalization_rule_grp
4689 ADD CONSTRAINT normalization_rule_grp_dpid_id_pr_c96b29a4_uniq UNIQUE (dpid_id, pr);
4690
4691
4692--
4693-- Name: normalization_rule_grp_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4694--
4695
4696ALTER TABLE ONLY normalization_rule_grp
4697 ADD CONSTRAINT normalization_rule_grp_pkey PRIMARY KEY (id);
4698
4699
4700--
4701-- Name: normalization_rule_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4702--
4703
4704ALTER TABLE ONLY normalization_rule
4705 ADD CONSTRAINT normalization_rule_pkey PRIMARY KEY (id);
4706
4707
4708--
4709-- Name: provider_rates_did_name_provider_id_81fb7e2c_uniq; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4710--
4711
4712ALTER TABLE ONLY provider_rates_did
4713 ADD CONSTRAINT provider_rates_did_name_provider_id_81fb7e2c_uniq UNIQUE (name, provider_id);
4714
4715
4716--
4717-- Name: provider_rates_did_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4718--
4719
4720ALTER TABLE ONLY provider_rates_did
4721 ADD CONSTRAINT provider_rates_did_pkey PRIMARY KEY (id);
4722
4723
4724--
4725-- Name: provider_rates_digits_provider_tariff_id_63687874_uniq; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4726--
4727
4728ALTER TABLE ONLY provider_rates
4729 ADD CONSTRAINT provider_rates_digits_provider_tariff_id_63687874_uniq UNIQUE (digits, provider_tariff_id);
4730
4731
4732--
4733-- Name: provider_rates_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4734--
4735
4736ALTER TABLE ONLY provider_rates
4737 ADD CONSTRAINT provider_rates_pkey PRIMARY KEY (id);
4738
4739
4740--
4741-- Name: provider_tariff_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4742--
4743
4744ALTER TABLE ONLY provider_tariff
4745 ADD CONSTRAINT provider_tariff_pkey PRIMARY KEY (id);
4746
4747
4748--
4749-- Name: ratecard_name_key; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4750--
4751
4752ALTER TABLE ONLY ratecard
4753 ADD CONSTRAINT ratecard_name_key UNIQUE (name);
4754
4755
4756--
4757-- Name: ratecard_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4758--
4759
4760ALTER TABLE ONLY ratecard
4761 ADD CONSTRAINT ratecard_pkey PRIMARY KEY (id);
4762
4763
4764--
4765-- Name: sip_profile_name_key; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4766--
4767
4768ALTER TABLE ONLY sip_profile
4769 ADD CONSTRAINT sip_profile_name_key UNIQUE (name);
4770
4771
4772--
4773-- Name: sip_profile_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4774--
4775
4776ALTER TABLE ONLY sip_profile
4777 ADD CONSTRAINT sip_profile_pkey PRIMARY KEY (id);
4778
4779
4780--
4781-- Name: sip_profile_sip_ip_sip_port_ef458fd9_uniq; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4782--
4783
4784ALTER TABLE ONLY sip_profile
4785 ADD CONSTRAINT sip_profile_sip_ip_sip_port_ef458fd9_uniq UNIQUE (sip_ip, sip_port);
4786
4787
4788--
4789-- Name: sofia_gateway_name_key; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4790--
4791
4792ALTER TABLE ONLY sofia_gateway
4793 ADD CONSTRAINT sofia_gateway_name_key UNIQUE (name);
4794
4795
4796--
4797-- Name: sofia_gateway_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4798--
4799
4800ALTER TABLE ONLY sofia_gateway
4801 ADD CONSTRAINT sofia_gateway_pkey PRIMARY KEY (id);
4802
4803
4804--
4805-- Name: trusted_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4806--
4807
4808ALTER TABLE ONLY trusted
4809 ADD CONSTRAINT trusted_pkey PRIMARY KEY (id);
4810
4811
4812--
4813-- Name: uid_domain_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4814--
4815
4816ALTER TABLE ONLY uid_domain
4817 ADD CONSTRAINT uid_domain_pkey PRIMARY KEY (id);
4818
4819
4820--
4821-- Name: version_table_name_idx; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4822--
4823
4824ALTER TABLE ONLY version
4825 ADD CONSTRAINT version_table_name_idx UNIQUE (table_name);
4826
4827
4828--
4829-- Name: voip_switch_pkey; Type: CONSTRAINT; Schema: public; Owner: pyfreebilling; Tablespace:
4830--
4831
4832ALTER TABLE ONLY voip_switch
4833 ADD CONSTRAINT voip_switch_pkey PRIMARY KEY (id);
4834
4835
4836--
4837-- Name: acl_nodes_acllist_id_b385101c; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
4838--
4839
4840CREATE INDEX acl_nodes_acllist_id_b385101c ON acl_nodes USING btree (acllist_id);
4841
4842
4843--
4844-- Name: acl_nodes_company_id_b6417f30; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
4845--
4846
4847CREATE INDEX acl_nodes_company_id_b6417f30 ON acl_nodes USING btree (company_id);
4848
4849
4850--
4851-- Name: admin_tools_menu_bookmark_user_id_0382e410; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
4852--
4853
4854CREATE INDEX admin_tools_menu_bookmark_user_id_0382e410 ON admin_tools_menu_bookmark USING btree (user_id);
4855
4856
4857--
4858-- Name: aliases_account_contact_idx; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
4859--
4860
4861CREATE INDEX aliases_account_contact_idx ON aliases USING btree (username, domain, contact);
4862
4863
4864--
4865-- Name: aliases_expires_idx; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
4866--
4867
4868CREATE INDEX aliases_expires_idx ON aliases USING btree (expires);
4869
4870
4871--
4872-- Name: auth_group_name_a6ea08ec_like; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
4873--
4874
4875CREATE INDEX auth_group_name_a6ea08ec_like ON auth_group USING btree (name varchar_pattern_ops);
4876
4877
4878--
4879-- Name: auth_group_permissions_group_id_b120cbf9; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
4880--
4881
4882CREATE INDEX auth_group_permissions_group_id_b120cbf9 ON auth_group_permissions USING btree (group_id);
4883
4884
4885--
4886-- Name: auth_group_permissions_permission_id_84c5c92e; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
4887--
4888
4889CREATE INDEX auth_group_permissions_permission_id_84c5c92e ON auth_group_permissions USING btree (permission_id);
4890
4891
4892--
4893-- Name: auth_permission_content_type_id_2f476e4b; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
4894--
4895
4896CREATE INDEX auth_permission_content_type_id_2f476e4b ON auth_permission USING btree (content_type_id);
4897
4898
4899--
4900-- Name: auth_user_groups_group_id_97559544; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
4901--
4902
4903CREATE INDEX auth_user_groups_group_id_97559544 ON auth_user_groups USING btree (group_id);
4904
4905
4906--
4907-- Name: auth_user_groups_user_id_6a12ed8b; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
4908--
4909
4910CREATE INDEX auth_user_groups_user_id_6a12ed8b ON auth_user_groups USING btree (user_id);
4911
4912
4913--
4914-- Name: auth_user_user_permissions_permission_id_1fbb5f2c; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
4915--
4916
4917CREATE INDEX auth_user_user_permissions_permission_id_1fbb5f2c ON auth_user_user_permissions USING btree (permission_id);
4918
4919
4920--
4921-- Name: auth_user_user_permissions_user_id_a95ead1b; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
4922--
4923
4924CREATE INDEX auth_user_user_permissions_user_id_a95ead1b ON auth_user_user_permissions USING btree (user_id);
4925
4926
4927--
4928-- Name: auth_user_username_6821ab7c_like; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
4929--
4930
4931CREATE INDEX auth_user_username_6821ab7c_like ON auth_user USING btree (username varchar_pattern_ops);
4932
4933
4934--
4935-- Name: axes_accessattempt_ip_address_10922d9c; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
4936--
4937
4938CREATE INDEX axes_accessattempt_ip_address_10922d9c ON axes_accessattempt USING btree (ip_address);
4939
4940
4941--
4942-- Name: axes_accessattempt_trusted_0eddf52e; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
4943--
4944
4945CREATE INDEX axes_accessattempt_trusted_0eddf52e ON axes_accessattempt USING btree (trusted);
4946
4947
4948--
4949-- Name: axes_accessattempt_user_agent_ad89678b; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
4950--
4951
4952CREATE INDEX axes_accessattempt_user_agent_ad89678b ON axes_accessattempt USING btree (user_agent);
4953
4954
4955--
4956-- Name: axes_accessattempt_user_agent_ad89678b_like; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
4957--
4958
4959CREATE INDEX axes_accessattempt_user_agent_ad89678b_like ON axes_accessattempt USING btree (user_agent varchar_pattern_ops);
4960
4961
4962--
4963-- Name: axes_accessattempt_username_3f2d4ca0; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
4964--
4965
4966CREATE INDEX axes_accessattempt_username_3f2d4ca0 ON axes_accessattempt USING btree (username);
4967
4968
4969--
4970-- Name: axes_accessattempt_username_3f2d4ca0_like; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
4971--
4972
4973CREATE INDEX axes_accessattempt_username_3f2d4ca0_like ON axes_accessattempt USING btree (username varchar_pattern_ops);
4974
4975
4976--
4977-- Name: axes_accesslog_ip_address_86b417e5; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
4978--
4979
4980CREATE INDEX axes_accesslog_ip_address_86b417e5 ON axes_accesslog USING btree (ip_address);
4981
4982
4983--
4984-- Name: axes_accesslog_trusted_496c5681; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
4985--
4986
4987CREATE INDEX axes_accesslog_trusted_496c5681 ON axes_accesslog USING btree (trusted);
4988
4989
4990--
4991-- Name: axes_accesslog_user_agent_0e659004; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
4992--
4993
4994CREATE INDEX axes_accesslog_user_agent_0e659004 ON axes_accesslog USING btree (user_agent);
4995
4996
4997--
4998-- Name: axes_accesslog_user_agent_0e659004_like; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
4999--
5000
5001CREATE INDEX axes_accesslog_user_agent_0e659004_like ON axes_accesslog USING btree (user_agent varchar_pattern_ops);
5002
5003
5004--
5005-- Name: axes_accesslog_username_df93064b; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5006--
5007
5008CREATE INDEX axes_accesslog_username_df93064b ON axes_accesslog USING btree (username);
5009
5010
5011--
5012-- Name: axes_accesslog_username_df93064b_like; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5013--
5014
5015CREATE INDEX axes_accesslog_username_df93064b_like ON axes_accesslog USING btree (username varchar_pattern_ops);
5016
5017
5018--
5019-- Name: caller_id_prefix_calleridprefixlist_id_992c2370; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5020--
5021
5022CREATE INDEX caller_id_prefix_calleridprefixlist_id_992c2370 ON caller_id_prefix USING btree (calleridprefixlist_id);
5023
5024
5025--
5026-- Name: caller_id_prefix_prefix_21ea8602; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5027--
5028
5029CREATE INDEX caller_id_prefix_prefix_21ea8602 ON caller_id_prefix USING btree (prefix);
5030
5031
5032--
5033-- Name: caller_id_prefix_prefix_21ea8602_like; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5034--
5035
5036CREATE INDEX caller_id_prefix_prefix_21ea8602_like ON caller_id_prefix USING btree (prefix varchar_pattern_ops);
5037
5038
5039--
5040-- Name: callerid_prefix_list_name_4068310d_like; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5041--
5042
5043CREATE INDEX callerid_prefix_list_name_4068310d_like ON callerid_prefix_list USING btree (name varchar_pattern_ops);
5044
5045
5046--
5047-- Name: carrier_cid_norm_rules_company_id_97330220; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5048--
5049
5050CREATE INDEX carrier_cid_norm_rules_company_id_97330220 ON carrier_cid_norm_rules USING btree (company_id);
5051
5052
5053--
5054-- Name: carrier_norm_rules_company_id_af9cf419; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5055--
5056
5057CREATE INDEX carrier_norm_rules_company_id_af9cf419 ON carrier_norm_rules USING btree (company_id);
5058
5059
5060--
5061-- Name: cdr_cost_destination_e7eaa97b; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5062--
5063
5064CREATE INDEX cdr_cost_destination_e7eaa97b ON cdr USING btree (cost_destination);
5065
5066
5067--
5068-- Name: cdr_cost_destination_e7eaa97b_like; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5069--
5070
5071CREATE INDEX cdr_cost_destination_e7eaa97b_like ON cdr USING btree (cost_destination varchar_pattern_ops);
5072
5073
5074--
5075-- Name: cdr_customer_id_e0ca2207; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5076--
5077
5078CREATE INDEX cdr_customer_id_e0ca2207 ON cdr USING btree (customer_id);
5079
5080
5081--
5082-- Name: cdr_customerdirectory_id_id_fdcb84fb; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5083--
5084
5085CREATE INDEX cdr_customerdirectory_id_id_fdcb84fb ON cdr USING btree (customerdirectory_id_id);
5086
5087
5088--
5089-- Name: cdr_gateway_id_f388be02; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5090--
5091
5092CREATE INDEX cdr_gateway_id_f388be02 ON cdr USING btree (gateway_id);
5093
5094
5095--
5096-- Name: cdr_hangup_cause_632e2be4; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5097--
5098
5099CREATE INDEX cdr_hangup_cause_632e2be4 ON cdr USING btree (hangup_cause);
5100
5101
5102--
5103-- Name: cdr_hangup_cause_632e2be4_like; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5104--
5105
5106CREATE INDEX cdr_hangup_cause_632e2be4_like ON cdr USING btree (hangup_cause varchar_pattern_ops);
5107
5108
5109--
5110-- Name: cdr_lcr_carrier_id_id_34a6063e; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5111--
5112
5113CREATE INDEX cdr_lcr_carrier_id_id_34a6063e ON cdr USING btree (lcr_carrier_id_id);
5114
5115
5116--
5117-- Name: cdr_lcr_group_id_id_693ca194; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5118--
5119
5120CREATE INDEX cdr_lcr_group_id_id_693ca194 ON cdr USING btree (lcr_group_id_id);
5121
5122
5123--
5124-- Name: cdr_ratecard_id_id_4cbe985f; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5125--
5126
5127CREATE INDEX cdr_ratecard_id_id_4cbe985f ON cdr USING btree (ratecard_id_id);
5128
5129
5130--
5131-- Name: cdr_sell_destination_ad163a41; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5132--
5133
5134CREATE INDEX cdr_sell_destination_ad163a41 ON cdr USING btree (sell_destination);
5135
5136
5137--
5138-- Name: cdr_sell_destination_ad163a41_like; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5139--
5140
5141CREATE INDEX cdr_sell_destination_ad163a41_like ON cdr USING btree (sell_destination varchar_pattern_ops);
5142
5143
5144--
5145-- Name: cdr_start_stamp_24d9ddf7; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5146--
5147
5148CREATE INDEX cdr_start_stamp_24d9ddf7 ON cdr USING btree (start_stamp);
5149
5150
5151--
5152-- Name: chroniker_job_current_pid_9996fbd0; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5153--
5154
5155CREATE INDEX chroniker_job_current_pid_9996fbd0 ON chroniker_job USING btree (current_pid);
5156
5157
5158--
5159-- Name: chroniker_job_current_pid_9996fbd0_like; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5160--
5161
5162CREATE INDEX chroniker_job_current_pid_9996fbd0_like ON chroniker_job USING btree (current_pid varchar_pattern_ops);
5163
5164
5165--
5166-- Name: chroniker_job_subscribers_job_id_cfb16efe; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5167--
5168
5169CREATE INDEX chroniker_job_subscribers_job_id_cfb16efe ON chroniker_job_subscribers USING btree (job_id);
5170
5171
5172--
5173-- Name: chroniker_job_subscribers_user_id_51225b88; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5174--
5175
5176CREATE INDEX chroniker_job_subscribers_user_id_51225b88 ON chroniker_job_subscribers USING btree (user_id);
5177
5178
5179--
5180-- Name: chroniker_jobdependency_dependee_id_5107f29f; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5181--
5182
5183CREATE INDEX chroniker_jobdependency_dependee_id_5107f29f ON chroniker_jobdependency USING btree (dependee_id);
5184
5185
5186--
5187-- Name: chroniker_jobdependency_dependent_id_48fb0cbb; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5188--
5189
5190CREATE INDEX chroniker_jobdependency_dependent_id_48fb0cbb ON chroniker_jobdependency USING btree (dependent_id);
5191
5192
5193--
5194-- Name: chroniker_log_duration_seconds_34305844; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5195--
5196
5197CREATE INDEX chroniker_log_duration_seconds_34305844 ON chroniker_log USING btree (duration_seconds);
5198
5199
5200--
5201-- Name: chroniker_log_job_id_b73a0dc9; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5202--
5203
5204CREATE INDEX chroniker_log_job_id_b73a0dc9 ON chroniker_log USING btree (job_id);
5205
5206
5207--
5208-- Name: chroniker_log_on_time_75c95897; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5209--
5210
5211CREATE INDEX chroniker_log_on_time_75c95897 ON chroniker_log USING btree (on_time);
5212
5213
5214--
5215-- Name: chroniker_log_run_end_datetime_ee9ac252; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5216--
5217
5218CREATE INDEX chroniker_log_run_end_datetime_ee9ac252 ON chroniker_log USING btree (run_end_datetime);
5219
5220
5221--
5222-- Name: chroniker_log_run_start_datetime_ed601856; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5223--
5224
5225CREATE INDEX chroniker_log_run_start_datetime_ed601856 ON chroniker_log USING btree (run_start_datetime);
5226
5227
5228--
5229-- Name: chroniker_log_success_9d4f1251; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5230--
5231
5232CREATE INDEX chroniker_log_success_9d4f1251 ON chroniker_log USING btree (success);
5233
5234
5235--
5236-- Name: company_balance_history_company_id_b46dbb20; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5237--
5238
5239CREATE INDEX company_balance_history_company_id_b46dbb20 ON company_balance_history USING btree (company_id);
5240
5241
5242--
5243-- Name: company_cb_currency_id_019819a4; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5244--
5245
5246CREATE INDEX company_cb_currency_id_019819a4 ON company USING btree (cb_currency_id);
5247
5248
5249--
5250-- Name: company_name_5abe57d9_like; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5251--
5252
5253CREATE INDEX company_name_5abe57d9_like ON company USING btree (name varchar_pattern_ops);
5254
5255
5256--
5257-- Name: company_slug_b6928c11_like; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5258--
5259
5260CREATE INDEX company_slug_b6928c11_like ON company USING btree (slug varchar_pattern_ops);
5261
5262
5263--
5264-- Name: contacts_email_addresses_content_type_id_2918e212; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5265--
5266
5267CREATE INDEX contacts_email_addresses_content_type_id_2918e212 ON contacts_email_addresses USING btree (content_type_id);
5268
5269
5270--
5271-- Name: contacts_email_addresses_object_id_9599d892; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5272--
5273
5274CREATE INDEX contacts_email_addresses_object_id_9599d892 ON contacts_email_addresses USING btree (object_id);
5275
5276
5277--
5278-- Name: contacts_groups_companies_company_id_2af59f80; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5279--
5280
5281CREATE INDEX contacts_groups_companies_company_id_2af59f80 ON contacts_groups_companies USING btree (company_id);
5282
5283
5284--
5285-- Name: contacts_groups_companies_group_id_67fd6bd6; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5286--
5287
5288CREATE INDEX contacts_groups_companies_group_id_67fd6bd6 ON contacts_groups_companies USING btree (group_id);
5289
5290
5291--
5292-- Name: contacts_groups_name_7bb624d1_like; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5293--
5294
5295CREATE INDEX contacts_groups_name_7bb624d1_like ON contacts_groups USING btree (name varchar_pattern_ops);
5296
5297
5298--
5299-- Name: contacts_groups_people_group_id_6bb7ec5f; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5300--
5301
5302CREATE INDEX contacts_groups_people_group_id_6bb7ec5f ON contacts_groups_people USING btree (group_id);
5303
5304
5305--
5306-- Name: contacts_groups_people_person_id_bc35f14c; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5307--
5308
5309CREATE INDEX contacts_groups_people_person_id_bc35f14c ON contacts_groups_people USING btree (person_id);
5310
5311
5312--
5313-- Name: contacts_groups_slug_d188c4b0_like; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5314--
5315
5316CREATE INDEX contacts_groups_slug_d188c4b0_like ON contacts_groups USING btree (slug varchar_pattern_ops);
5317
5318
5319--
5320-- Name: contacts_people_company_id_b327db06; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5321--
5322
5323CREATE INDEX contacts_people_company_id_b327db06 ON contacts_people USING btree (company_id);
5324
5325
5326--
5327-- Name: contacts_people_slug_05c3e86e_like; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5328--
5329
5330CREATE INDEX contacts_people_slug_05c3e86e_like ON contacts_people USING btree (slug varchar_pattern_ops);
5331
5332
5333--
5334-- Name: contacts_phone_numbers_content_type_id_f4da602a; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5335--
5336
5337CREATE INDEX contacts_phone_numbers_content_type_id_f4da602a ON contacts_phone_numbers USING btree (content_type_id);
5338
5339
5340--
5341-- Name: contacts_phone_numbers_object_id_91fc2929; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5342--
5343
5344CREATE INDEX contacts_phone_numbers_object_id_91fc2929 ON contacts_phone_numbers USING btree (object_id);
5345
5346
5347--
5348-- Name: contacts_street_addresses_content_type_id_167af1ea; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5349--
5350
5351CREATE INDEX contacts_street_addresses_content_type_id_167af1ea ON contacts_street_addresses USING btree (content_type_id);
5352
5353
5354--
5355-- Name: contacts_street_addresses_object_id_5f36174d; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5356--
5357
5358CREATE INDEX contacts_street_addresses_object_id_5f36174d ON contacts_street_addresses USING btree (object_id);
5359
5360
5361--
5362-- Name: contacts_web_sites_content_type_id_abb4ab9d; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5363--
5364
5365CREATE INDEX contacts_web_sites_content_type_id_abb4ab9d ON contacts_web_sites USING btree (content_type_id);
5366
5367
5368--
5369-- Name: contacts_web_sites_object_id_e39db9cc; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5370--
5371
5372CREATE INDEX contacts_web_sites_object_id_e39db9cc ON contacts_web_sites USING btree (object_id);
5373
5374
5375--
5376-- Name: currencies_currency_code_165b7e38_like; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5377--
5378
5379CREATE INDEX currencies_currency_code_165b7e38_like ON currencies_currency USING btree (code varchar_pattern_ops);
5380
5381
5382--
5383-- Name: currencies_currency_name_24028e95_like; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5384--
5385
5386CREATE INDEX currencies_currency_name_24028e95_like ON currencies_currency USING btree (name varchar_pattern_ops);
5387
5388
5389--
5390-- Name: currencies_currency_symbol_c0a887e3; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5391--
5392
5393CREATE INDEX currencies_currency_symbol_c0a887e3 ON currencies_currency USING btree (symbol);
5394
5395
5396--
5397-- Name: currencies_currency_symbol_c0a887e3_like; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5398--
5399
5400CREATE INDEX currencies_currency_symbol_c0a887e3_like ON currencies_currency USING btree (symbol varchar_pattern_ops);
5401
5402
5403--
5404-- Name: customer_cid_norm_rules_company_id_91e2b8ae; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5405--
5406
5407CREATE INDEX customer_cid_norm_rules_company_id_91e2b8ae ON customer_cid_norm_rules USING btree (company_id);
5408
5409
5410--
5411-- Name: customer_directory_callee_norm_id_c74f59ef; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5412--
5413
5414CREATE INDEX customer_directory_callee_norm_id_c74f59ef ON customer_directory USING btree (callee_norm_id);
5415
5416
5417--
5418-- Name: customer_directory_callee_norm_in_id_22f5b25e; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5419--
5420
5421CREATE INDEX customer_directory_callee_norm_in_id_22f5b25e ON customer_directory USING btree (callee_norm_in_id);
5422
5423
5424--
5425-- Name: customer_directory_callerid_norm_id_dbac6168; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5426--
5427
5428CREATE INDEX customer_directory_callerid_norm_id_dbac6168 ON customer_directory USING btree (callerid_norm_id);
5429
5430
5431--
5432-- Name: customer_directory_callerid_norm_in_id_f3f53eb9; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5433--
5434
5435CREATE INDEX customer_directory_callerid_norm_in_id_f3f53eb9 ON customer_directory USING btree (callerid_norm_in_id);
5436
5437
5438--
5439-- Name: customer_directory_company_id_5ecaae8b; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5440--
5441
5442CREATE INDEX customer_directory_company_id_5ecaae8b ON customer_directory USING btree (company_id);
5443
5444
5445--
5446-- Name: customer_directory_domain_id_15f23481; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5447--
5448
5449CREATE INDEX customer_directory_domain_id_15f23481 ON customer_directory USING btree (domain_id);
5450
5451
5452--
5453-- Name: customer_directory_name_88ea7d84_like; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5454--
5455
5456CREATE INDEX customer_directory_name_88ea7d84_like ON customer_directory USING btree (name varchar_pattern_ops);
5457
5458
5459--
5460-- Name: customer_norm_rules_company_id_32507c6f; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5461--
5462
5463CREATE INDEX customer_norm_rules_company_id_32507c6f ON customer_norm_rules USING btree (company_id);
5464
5465
5466--
5467-- Name: customer_ratecards_company_id_5fd2bfb7; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5468--
5469
5470CREATE INDEX customer_ratecards_company_id_5fd2bfb7 ON customer_ratecards USING btree (company_id);
5471
5472
5473--
5474-- Name: customer_ratecards_ratecard_id_2ce103c5; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5475--
5476
5477CREATE INDEX customer_ratecards_ratecard_id_2ce103c5 ON customer_ratecards USING btree (ratecard_id);
5478
5479
5480--
5481-- Name: customer_rates_destination_6fd073f4; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5482--
5483
5484CREATE INDEX customer_rates_destination_6fd073f4 ON customer_rates USING btree (destination);
5485
5486
5487--
5488-- Name: customer_rates_destination_6fd073f4_like; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5489--
5490
5491CREATE INDEX customer_rates_destination_6fd073f4_like ON customer_rates USING btree (destination varchar_pattern_ops);
5492
5493
5494--
5495-- Name: customer_rates_prefix_3eccb70b; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5496--
5497
5498CREATE INDEX customer_rates_prefix_3eccb70b ON customer_rates USING btree (prefix);
5499
5500
5501--
5502-- Name: customer_rates_prefix_3eccb70b_like; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5503--
5504
5505CREATE INDEX customer_rates_prefix_3eccb70b_like ON customer_rates USING btree (prefix varchar_pattern_ops);
5506
5507
5508--
5509-- Name: customer_rates_ratecard_id_73e37172; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5510--
5511
5512CREATE INDEX customer_rates_ratecard_id_73e37172 ON customer_rates USING btree (ratecard_id);
5513
5514
5515--
5516-- Name: did_cust_ratecard_id_21d9c7c3; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5517--
5518
5519CREATE INDEX did_cust_ratecard_id_21d9c7c3 ON did USING btree (cust_ratecard_id);
5520
5521
5522--
5523-- Name: did_customer_id_afdc3b5c; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5524--
5525
5526CREATE INDEX did_customer_id_afdc3b5c ON did USING btree (customer_id);
5527
5528
5529--
5530-- Name: did_number_0ef32204_like; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5531--
5532
5533CREATE INDEX did_number_0ef32204_like ON did USING btree (number varchar_pattern_ops);
5534
5535
5536--
5537-- Name: did_prov_ratecard_id_dea836e2; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5538--
5539
5540CREATE INDEX did_prov_ratecard_id_dea836e2 ON did USING btree (prov_ratecard_id);
5541
5542
5543--
5544-- Name: did_provider_id_68d0a22b; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5545--
5546
5547CREATE INDEX did_provider_id_68d0a22b ON did USING btree (provider_id);
5548
5549
5550--
5551-- Name: did_routes_contract_did_id_d545afc5; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5552--
5553
5554CREATE INDEX did_routes_contract_did_id_d545afc5 ON did_routes USING btree (contract_did_id);
5555
5556
5557--
5558-- Name: did_routes_trunk_id_b3f8cec8; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5559--
5560
5561CREATE INDEX did_routes_trunk_id_b3f8cec8 ON did_routes USING btree (trunk_id);
5562
5563
5564--
5565-- Name: dim_customer_destination_customer_id_1979521d; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5566--
5567
5568CREATE INDEX dim_customer_destination_customer_id_1979521d ON dim_customer_destination USING btree (customer_id);
5569
5570
5571--
5572-- Name: dim_customer_destination_date_id_e86167d5; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5573--
5574
5575CREATE INDEX dim_customer_destination_date_id_e86167d5 ON dim_customer_destination USING btree (date_id);
5576
5577
5578--
5579-- Name: dim_customer_hangupcause_customer_id_bde68f07; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5580--
5581
5582CREATE INDEX dim_customer_hangupcause_customer_id_bde68f07 ON dim_customer_hangupcause USING btree (customer_id);
5583
5584
5585--
5586-- Name: dim_customer_hangupcause_date_id_a70b152b; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5587--
5588
5589CREATE INDEX dim_customer_hangupcause_date_id_a70b152b ON dim_customer_hangupcause USING btree (date_id);
5590
5591
5592--
5593-- Name: dim_customer_sip_hangupcause_customer_id_6cfe087d; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5594--
5595
5596CREATE INDEX dim_customer_sip_hangupcause_customer_id_6cfe087d ON dim_customer_sip_hangupcause USING btree (customer_id);
5597
5598
5599--
5600-- Name: dim_customer_sip_hangupcause_date_id_f4e16475; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5601--
5602
5603CREATE INDEX dim_customer_sip_hangupcause_date_id_f4e16475 ON dim_customer_sip_hangupcause USING btree (date_id);
5604
5605
5606--
5607-- Name: dim_provider_destination_date_id_935bbc34; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5608--
5609
5610CREATE INDEX dim_provider_destination_date_id_935bbc34 ON dim_provider_destination USING btree (date_id);
5611
5612
5613--
5614-- Name: dim_provider_destination_provider_id_d83805e4; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5615--
5616
5617CREATE INDEX dim_provider_destination_provider_id_d83805e4 ON dim_provider_destination USING btree (provider_id);
5618
5619
5620--
5621-- Name: dim_provider_hangupcause_date_id_503da2b4; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5622--
5623
5624CREATE INDEX dim_provider_hangupcause_date_id_503da2b4 ON dim_provider_hangupcause USING btree (date_id);
5625
5626
5627--
5628-- Name: dim_provider_hangupcause_provider_id_6c112bda; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5629--
5630
5631CREATE INDEX dim_provider_hangupcause_provider_id_6c112bda ON dim_provider_hangupcause USING btree (provider_id);
5632
5633
5634--
5635-- Name: dim_provider_sip_hangupcause_date_id_8704810b; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5636--
5637
5638CREATE INDEX dim_provider_sip_hangupcause_date_id_8704810b ON dim_provider_sip_hangupcause USING btree (date_id);
5639
5640
5641--
5642-- Name: dim_provider_sip_hangupcause_provider_id_5b0e5193; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5643--
5644
5645CREATE INDEX dim_provider_sip_hangupcause_provider_id_5b0e5193 ON dim_provider_sip_hangupcause USING btree (provider_id);
5646
5647
5648--
5649-- Name: django_admin_log_content_type_id_c4bce8eb; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5650--
5651
5652CREATE INDEX django_admin_log_content_type_id_c4bce8eb ON django_admin_log USING btree (content_type_id);
5653
5654
5655--
5656-- Name: django_admin_log_user_id_c564eba6; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5657--
5658
5659CREATE INDEX django_admin_log_user_id_c564eba6 ON django_admin_log USING btree (user_id);
5660
5661
5662--
5663-- Name: django_session_expire_date_a5c62663; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5664--
5665
5666CREATE INDEX django_session_expire_date_a5c62663 ON django_session USING btree (expire_date);
5667
5668
5669--
5670-- Name: django_session_session_key_c0390e0f_like; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5671--
5672
5673CREATE INDEX django_session_session_key_c0390e0f_like ON django_session USING btree (session_key varchar_pattern_ops);
5674
5675
5676--
5677-- Name: django_site_domain_a2e37b91_like; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5678--
5679
5680CREATE INDEX django_site_domain_a2e37b91_like ON django_site USING btree (domain varchar_pattern_ops);
5681
5682
5683--
5684-- Name: fs_switch_profile_fsswitch_id_cd26032d; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5685--
5686
5687CREATE INDEX fs_switch_profile_fsswitch_id_cd26032d ON fs_switch_profile USING btree (fsswitch_id);
5688
5689
5690--
5691-- Name: fs_switch_profile_outbound_proxy_id_c9d253e6; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5692--
5693
5694CREATE INDEX fs_switch_profile_outbound_proxy_id_c9d253e6 ON fs_switch_profile USING btree (outbound_proxy_id);
5695
5696
5697--
5698-- Name: fs_switch_profile_sipprofile_id_057af46e; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5699--
5700
5701CREATE INDEX fs_switch_profile_sipprofile_id_057af46e ON fs_switch_profile USING btree (sipprofile_id);
5702
5703
5704--
5705-- Name: lcr_group_name_54dca86d_like; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5706--
5707
5708CREATE INDEX lcr_group_name_54dca86d_like ON lcr_group USING btree (name varchar_pattern_ops);
5709
5710
5711--
5712-- Name: lcr_providers_lcr_id_ada024a3; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5713--
5714
5715CREATE INDEX lcr_providers_lcr_id_ada024a3 ON lcr_providers USING btree (lcr_id);
5716
5717
5718--
5719-- Name: lcr_providers_provider_tariff_id_f5673ae4; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5720--
5721
5722CREATE INDEX lcr_providers_provider_tariff_id_f5673ae4 ON lcr_providers USING btree (provider_tariff_id);
5723
5724
5725--
5726-- Name: location_account_contact_idx; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5727--
5728
5729CREATE INDEX location_account_contact_idx ON location USING btree (username, domain, contact);
5730
5731
5732--
5733-- Name: location_attrs_account_record_idx; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5734--
5735
5736CREATE INDEX location_attrs_account_record_idx ON location_attrs USING btree (username, domain, ruid);
5737
5738
5739--
5740-- Name: location_attrs_last_modified_idx; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5741--
5742
5743CREATE INDEX location_attrs_last_modified_idx ON location_attrs USING btree (last_modified);
5744
5745
5746--
5747-- Name: location_connection_idx; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5748--
5749
5750CREATE INDEX location_connection_idx ON location USING btree (server_id, connection_id);
5751
5752
5753--
5754-- Name: location_expires_idx; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5755--
5756
5757CREATE INDEX location_expires_idx ON location USING btree (expires);
5758
5759
5760--
5761-- Name: normalization_rule_grp_dpid_id_5310bb5f; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5762--
5763
5764CREATE INDEX normalization_rule_grp_dpid_id_5310bb5f ON normalization_rule_grp USING btree (dpid_id);
5765
5766
5767--
5768-- Name: normalization_rule_grp_rule_id_9bd3a13a; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5769--
5770
5771CREATE INDEX normalization_rule_grp_rule_id_9bd3a13a ON normalization_rule_grp USING btree (rule_id);
5772
5773
5774--
5775-- Name: provider_rates_destination_2cb8ad5a; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5776--
5777
5778CREATE INDEX provider_rates_destination_2cb8ad5a ON provider_rates USING btree (destination);
5779
5780
5781--
5782-- Name: provider_rates_destination_2cb8ad5a_like; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5783--
5784
5785CREATE INDEX provider_rates_destination_2cb8ad5a_like ON provider_rates USING btree (destination varchar_pattern_ops);
5786
5787
5788--
5789-- Name: provider_rates_did_provider_id_dd6de102; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5790--
5791
5792CREATE INDEX provider_rates_did_provider_id_dd6de102 ON provider_rates_did USING btree (provider_id);
5793
5794
5795--
5796-- Name: provider_rates_digits_93754860; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5797--
5798
5799CREATE INDEX provider_rates_digits_93754860 ON provider_rates USING btree (digits);
5800
5801
5802--
5803-- Name: provider_rates_digits_93754860_like; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5804--
5805
5806CREATE INDEX provider_rates_digits_93754860_like ON provider_rates USING btree (digits varchar_pattern_ops);
5807
5808
5809--
5810-- Name: provider_rates_provider_tariff_id_70029bd3; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5811--
5812
5813CREATE INDEX provider_rates_provider_tariff_id_70029bd3 ON provider_rates USING btree (provider_tariff_id);
5814
5815
5816--
5817-- Name: provider_rates_provider_tariff_id_digits_enabled_9253071f_idx; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5818--
5819
5820CREATE INDEX provider_rates_provider_tariff_id_digits_enabled_9253071f_idx ON provider_rates USING btree (provider_tariff_id, digits, enabled);
5821
5822
5823--
5824-- Name: provider_tariff_callerid_list_id_10e2e2c1; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5825--
5826
5827CREATE INDEX provider_tariff_callerid_list_id_10e2e2c1 ON provider_tariff USING btree (callerid_list_id);
5828
5829
5830--
5831-- Name: provider_tariff_carrier_id_b0dfe425; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5832--
5833
5834CREATE INDEX provider_tariff_carrier_id_b0dfe425 ON provider_tariff USING btree (carrier_id);
5835
5836
5837--
5838-- Name: provider_tariff_currency_id_ef405a72; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5839--
5840
5841CREATE INDEX provider_tariff_currency_id_ef405a72 ON provider_tariff USING btree (currency_id);
5842
5843
5844--
5845-- Name: ratecard_callerid_list_id_f8fe4670; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5846--
5847
5848CREATE INDEX ratecard_callerid_list_id_f8fe4670 ON ratecard USING btree (callerid_list_id);
5849
5850
5851--
5852-- Name: ratecard_currency_id_13c5b537; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5853--
5854
5855CREATE INDEX ratecard_currency_id_13c5b537 ON ratecard USING btree (currency_id);
5856
5857
5858--
5859-- Name: ratecard_lcrgroup_id_f5b2d19d; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5860--
5861
5862CREATE INDEX ratecard_lcrgroup_id_f5b2d19d ON ratecard USING btree (lcrgroup_id);
5863
5864
5865--
5866-- Name: ratecard_name_47e8dd8b_like; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5867--
5868
5869CREATE INDEX ratecard_name_47e8dd8b_like ON ratecard USING btree (name varchar_pattern_ops);
5870
5871
5872--
5873-- Name: sip_profile_name_9b0943d2_like; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5874--
5875
5876CREATE INDEX sip_profile_name_9b0943d2_like ON sip_profile USING btree (name varchar_pattern_ops);
5877
5878
5879--
5880-- Name: sofia_gateway_company_id_b6f88bb3; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5881--
5882
5883CREATE INDEX sofia_gateway_company_id_b6f88bb3 ON sofia_gateway USING btree (company_id);
5884
5885
5886--
5887-- Name: sofia_gateway_domain_id_19383d59; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5888--
5889
5890CREATE INDEX sofia_gateway_domain_id_19383d59 ON sofia_gateway USING btree (domain_id);
5891
5892
5893--
5894-- Name: sofia_gateway_name_0ab1e693_like; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5895--
5896
5897CREATE INDEX sofia_gateway_name_0ab1e693_like ON sofia_gateway USING btree (name varchar_pattern_ops);
5898
5899
5900--
5901-- Name: sofia_gateway_sip_profile_id_9b8a1f4f; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5902--
5903
5904CREATE INDEX sofia_gateway_sip_profile_id_9b8a1f4f ON sofia_gateway USING btree (sip_profile_id);
5905
5906
5907--
5908-- Name: trusted_peer_idx; Type: INDEX; Schema: public; Owner: pyfreebilling; Tablespace:
5909--
5910
5911CREATE INDEX trusted_peer_idx ON trusted USING btree (src_ip);
5912
5913
5914--
5915-- Name: acl_nodes_acllist_id_b385101c_fk_acl_lists_id; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
5916--
5917
5918ALTER TABLE ONLY acl_nodes
5919 ADD CONSTRAINT acl_nodes_acllist_id_b385101c_fk_acl_lists_id FOREIGN KEY (acllist_id) REFERENCES acl_lists(id) DEFERRABLE INITIALLY DEFERRED;
5920
5921
5922--
5923-- Name: acl_nodes_company_id_b6417f30_fk_company_id; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
5924--
5925
5926ALTER TABLE ONLY acl_nodes
5927 ADD CONSTRAINT acl_nodes_company_id_b6417f30_fk_company_id FOREIGN KEY (company_id) REFERENCES company(id) DEFERRABLE INITIALLY DEFERRED;
5928
5929
5930--
5931-- Name: admin_tools_menu_bookmark_user_id_0382e410_fk_auth_user_id; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
5932--
5933
5934ALTER TABLE ONLY admin_tools_menu_bookmark
5935 ADD CONSTRAINT admin_tools_menu_bookmark_user_id_0382e410_fk_auth_user_id FOREIGN KEY (user_id) REFERENCES auth_user(id) DEFERRABLE INITIALLY DEFERRED;
5936
5937
5938--
5939-- Name: auth_group_permissio_permission_id_84c5c92e_fk_auth_perm; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
5940--
5941
5942ALTER TABLE ONLY auth_group_permissions
5943 ADD CONSTRAINT auth_group_permissio_permission_id_84c5c92e_fk_auth_perm FOREIGN KEY (permission_id) REFERENCES auth_permission(id) DEFERRABLE INITIALLY DEFERRED;
5944
5945
5946--
5947-- Name: auth_group_permissions_group_id_b120cbf9_fk_auth_group_id; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
5948--
5949
5950ALTER TABLE ONLY auth_group_permissions
5951 ADD CONSTRAINT auth_group_permissions_group_id_b120cbf9_fk_auth_group_id FOREIGN KEY (group_id) REFERENCES auth_group(id) DEFERRABLE INITIALLY DEFERRED;
5952
5953
5954--
5955-- Name: auth_permission_content_type_id_2f476e4b_fk_django_co; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
5956--
5957
5958ALTER TABLE ONLY auth_permission
5959 ADD CONSTRAINT auth_permission_content_type_id_2f476e4b_fk_django_co FOREIGN KEY (content_type_id) REFERENCES django_content_type(id) DEFERRABLE INITIALLY DEFERRED;
5960
5961
5962--
5963-- Name: auth_user_groups_group_id_97559544_fk_auth_group_id; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
5964--
5965
5966ALTER TABLE ONLY auth_user_groups
5967 ADD CONSTRAINT auth_user_groups_group_id_97559544_fk_auth_group_id FOREIGN KEY (group_id) REFERENCES auth_group(id) DEFERRABLE INITIALLY DEFERRED;
5968
5969
5970--
5971-- Name: auth_user_groups_user_id_6a12ed8b_fk_auth_user_id; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
5972--
5973
5974ALTER TABLE ONLY auth_user_groups
5975 ADD CONSTRAINT auth_user_groups_user_id_6a12ed8b_fk_auth_user_id FOREIGN KEY (user_id) REFERENCES auth_user(id) DEFERRABLE INITIALLY DEFERRED;
5976
5977
5978--
5979-- Name: auth_user_user_permi_permission_id_1fbb5f2c_fk_auth_perm; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
5980--
5981
5982ALTER TABLE ONLY auth_user_user_permissions
5983 ADD CONSTRAINT auth_user_user_permi_permission_id_1fbb5f2c_fk_auth_perm FOREIGN KEY (permission_id) REFERENCES auth_permission(id) DEFERRABLE INITIALLY DEFERRED;
5984
5985
5986--
5987-- Name: auth_user_user_permissions_user_id_a95ead1b_fk_auth_user_id; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
5988--
5989
5990ALTER TABLE ONLY auth_user_user_permissions
5991 ADD CONSTRAINT auth_user_user_permissions_user_id_a95ead1b_fk_auth_user_id FOREIGN KEY (user_id) REFERENCES auth_user(id) DEFERRABLE INITIALLY DEFERRED;
5992
5993
5994--
5995-- Name: caller_id_prefix_calleridprefixlist_i_992c2370_fk_callerid_; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
5996--
5997
5998ALTER TABLE ONLY caller_id_prefix
5999 ADD CONSTRAINT caller_id_prefix_calleridprefixlist_i_992c2370_fk_callerid_ FOREIGN KEY (calleridprefixlist_id) REFERENCES callerid_prefix_list(id) DEFERRABLE INITIALLY DEFERRED;
6000
6001
6002--
6003-- Name: carrier_cid_norm_rules_company_id_97330220_fk_company_id; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6004--
6005
6006ALTER TABLE ONLY carrier_cid_norm_rules
6007 ADD CONSTRAINT carrier_cid_norm_rules_company_id_97330220_fk_company_id FOREIGN KEY (company_id) REFERENCES company(id) DEFERRABLE INITIALLY DEFERRED;
6008
6009
6010--
6011-- Name: carrier_norm_rules_company_id_af9cf419_fk_company_id; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6012--
6013
6014ALTER TABLE ONLY carrier_norm_rules
6015 ADD CONSTRAINT carrier_norm_rules_company_id_af9cf419_fk_company_id FOREIGN KEY (company_id) REFERENCES company(id) DEFERRABLE INITIALLY DEFERRED;
6016
6017
6018--
6019-- Name: cdr_customer_id_e0ca2207_fk_company_id; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6020--
6021
6022ALTER TABLE ONLY cdr
6023 ADD CONSTRAINT cdr_customer_id_e0ca2207_fk_company_id FOREIGN KEY (customer_id) REFERENCES company(id) DEFERRABLE INITIALLY DEFERRED;
6024
6025
6026--
6027-- Name: cdr_customerdirectory_id_id_fdcb84fb_fk_customer_directory_id; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6028--
6029
6030ALTER TABLE ONLY cdr
6031 ADD CONSTRAINT cdr_customerdirectory_id_id_fdcb84fb_fk_customer_directory_id FOREIGN KEY (customerdirectory_id_id) REFERENCES customer_directory(id) DEFERRABLE INITIALLY DEFERRED;
6032
6033
6034--
6035-- Name: cdr_gateway_id_f388be02_fk_sofia_gateway_id; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6036--
6037
6038ALTER TABLE ONLY cdr
6039 ADD CONSTRAINT cdr_gateway_id_f388be02_fk_sofia_gateway_id FOREIGN KEY (gateway_id) REFERENCES sofia_gateway(id) DEFERRABLE INITIALLY DEFERRED;
6040
6041
6042--
6043-- Name: cdr_lcr_carrier_id_id_34a6063e_fk_company_id; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6044--
6045
6046ALTER TABLE ONLY cdr
6047 ADD CONSTRAINT cdr_lcr_carrier_id_id_34a6063e_fk_company_id FOREIGN KEY (lcr_carrier_id_id) REFERENCES company(id) DEFERRABLE INITIALLY DEFERRED;
6048
6049
6050--
6051-- Name: cdr_lcr_group_id_id_693ca194_fk_lcr_group_id; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6052--
6053
6054ALTER TABLE ONLY cdr
6055 ADD CONSTRAINT cdr_lcr_group_id_id_693ca194_fk_lcr_group_id FOREIGN KEY (lcr_group_id_id) REFERENCES lcr_group(id) DEFERRABLE INITIALLY DEFERRED;
6056
6057
6058--
6059-- Name: cdr_ratecard_id_id_4cbe985f_fk_ratecard_id; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6060--
6061
6062ALTER TABLE ONLY cdr
6063 ADD CONSTRAINT cdr_ratecard_id_id_4cbe985f_fk_ratecard_id FOREIGN KEY (ratecard_id_id) REFERENCES ratecard(id) DEFERRABLE INITIALLY DEFERRED;
6064
6065
6066--
6067-- Name: chroniker_job_subscribers_job_id_cfb16efe_fk_chroniker_job_id; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6068--
6069
6070ALTER TABLE ONLY chroniker_job_subscribers
6071 ADD CONSTRAINT chroniker_job_subscribers_job_id_cfb16efe_fk_chroniker_job_id FOREIGN KEY (job_id) REFERENCES chroniker_job(id) DEFERRABLE INITIALLY DEFERRED;
6072
6073
6074--
6075-- Name: chroniker_job_subscribers_user_id_51225b88_fk_auth_user_id; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6076--
6077
6078ALTER TABLE ONLY chroniker_job_subscribers
6079 ADD CONSTRAINT chroniker_job_subscribers_user_id_51225b88_fk_auth_user_id FOREIGN KEY (user_id) REFERENCES auth_user(id) DEFERRABLE INITIALLY DEFERRED;
6080
6081
6082--
6083-- Name: chroniker_jobdepende_dependee_id_5107f29f_fk_chroniker; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6084--
6085
6086ALTER TABLE ONLY chroniker_jobdependency
6087 ADD CONSTRAINT chroniker_jobdepende_dependee_id_5107f29f_fk_chroniker FOREIGN KEY (dependee_id) REFERENCES chroniker_job(id) DEFERRABLE INITIALLY DEFERRED;
6088
6089
6090--
6091-- Name: chroniker_jobdepende_dependent_id_48fb0cbb_fk_chroniker; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6092--
6093
6094ALTER TABLE ONLY chroniker_jobdependency
6095 ADD CONSTRAINT chroniker_jobdepende_dependent_id_48fb0cbb_fk_chroniker FOREIGN KEY (dependent_id) REFERENCES chroniker_job(id) DEFERRABLE INITIALLY DEFERRED;
6096
6097
6098--
6099-- Name: chroniker_log_job_id_b73a0dc9_fk_chroniker_job_id; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6100--
6101
6102ALTER TABLE ONLY chroniker_log
6103 ADD CONSTRAINT chroniker_log_job_id_b73a0dc9_fk_chroniker_job_id FOREIGN KEY (job_id) REFERENCES chroniker_job(id) DEFERRABLE INITIALLY DEFERRED;
6104
6105
6106--
6107-- Name: company_balance_history_company_id_b46dbb20_fk_company_id; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6108--
6109
6110ALTER TABLE ONLY company_balance_history
6111 ADD CONSTRAINT company_balance_history_company_id_b46dbb20_fk_company_id FOREIGN KEY (company_id) REFERENCES company(id) DEFERRABLE INITIALLY DEFERRED;
6112
6113
6114--
6115-- Name: company_cb_currency_id_019819a4_fk_currencies_currency_id; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6116--
6117
6118ALTER TABLE ONLY company
6119 ADD CONSTRAINT company_cb_currency_id_019819a4_fk_currencies_currency_id FOREIGN KEY (cb_currency_id) REFERENCES currencies_currency(id) DEFERRABLE INITIALLY DEFERRED;
6120
6121
6122--
6123-- Name: contacts_email_addre_content_type_id_2918e212_fk_django_co; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6124--
6125
6126ALTER TABLE ONLY contacts_email_addresses
6127 ADD CONSTRAINT contacts_email_addre_content_type_id_2918e212_fk_django_co FOREIGN KEY (content_type_id) REFERENCES django_content_type(id) DEFERRABLE INITIALLY DEFERRED;
6128
6129
6130--
6131-- Name: contacts_groups_comp_group_id_67fd6bd6_fk_contacts_; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6132--
6133
6134ALTER TABLE ONLY contacts_groups_companies
6135 ADD CONSTRAINT contacts_groups_comp_group_id_67fd6bd6_fk_contacts_ FOREIGN KEY (group_id) REFERENCES contacts_groups(id) DEFERRABLE INITIALLY DEFERRED;
6136
6137
6138--
6139-- Name: contacts_groups_companies_company_id_2af59f80_fk_company_id; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6140--
6141
6142ALTER TABLE ONLY contacts_groups_companies
6143 ADD CONSTRAINT contacts_groups_companies_company_id_2af59f80_fk_company_id FOREIGN KEY (company_id) REFERENCES company(id) DEFERRABLE INITIALLY DEFERRED;
6144
6145
6146--
6147-- Name: contacts_groups_people_group_id_6bb7ec5f_fk_contacts_groups_id; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6148--
6149
6150ALTER TABLE ONLY contacts_groups_people
6151 ADD CONSTRAINT contacts_groups_people_group_id_6bb7ec5f_fk_contacts_groups_id FOREIGN KEY (group_id) REFERENCES contacts_groups(id) DEFERRABLE INITIALLY DEFERRED;
6152
6153
6154--
6155-- Name: contacts_groups_people_person_id_bc35f14c_fk_contacts_people_id; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6156--
6157
6158ALTER TABLE ONLY contacts_groups_people
6159 ADD CONSTRAINT contacts_groups_people_person_id_bc35f14c_fk_contacts_people_id FOREIGN KEY (person_id) REFERENCES contacts_people(id) DEFERRABLE INITIALLY DEFERRED;
6160
6161
6162--
6163-- Name: contacts_people_company_id_b327db06_fk_company_id; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6164--
6165
6166ALTER TABLE ONLY contacts_people
6167 ADD CONSTRAINT contacts_people_company_id_b327db06_fk_company_id FOREIGN KEY (company_id) REFERENCES company(id) DEFERRABLE INITIALLY DEFERRED;
6168
6169
6170--
6171-- Name: contacts_people_user_id_7cb8e4e6_fk_auth_user_id; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6172--
6173
6174ALTER TABLE ONLY contacts_people
6175 ADD CONSTRAINT contacts_people_user_id_7cb8e4e6_fk_auth_user_id FOREIGN KEY (user_id) REFERENCES auth_user(id) DEFERRABLE INITIALLY DEFERRED;
6176
6177
6178--
6179-- Name: contacts_phone_numbe_content_type_id_f4da602a_fk_django_co; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6180--
6181
6182ALTER TABLE ONLY contacts_phone_numbers
6183 ADD CONSTRAINT contacts_phone_numbe_content_type_id_f4da602a_fk_django_co FOREIGN KEY (content_type_id) REFERENCES django_content_type(id) DEFERRABLE INITIALLY DEFERRED;
6184
6185
6186--
6187-- Name: contacts_street_addr_content_type_id_167af1ea_fk_django_co; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6188--
6189
6190ALTER TABLE ONLY contacts_street_addresses
6191 ADD CONSTRAINT contacts_street_addr_content_type_id_167af1ea_fk_django_co FOREIGN KEY (content_type_id) REFERENCES django_content_type(id) DEFERRABLE INITIALLY DEFERRED;
6192
6193
6194--
6195-- Name: contacts_web_sites_content_type_id_abb4ab9d_fk_django_co; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6196--
6197
6198ALTER TABLE ONLY contacts_web_sites
6199 ADD CONSTRAINT contacts_web_sites_content_type_id_abb4ab9d_fk_django_co FOREIGN KEY (content_type_id) REFERENCES django_content_type(id) DEFERRABLE INITIALLY DEFERRED;
6200
6201
6202--
6203-- Name: customer_cid_norm_rules_company_id_91e2b8ae_fk_company_id; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6204--
6205
6206ALTER TABLE ONLY customer_cid_norm_rules
6207 ADD CONSTRAINT customer_cid_norm_rules_company_id_91e2b8ae_fk_company_id FOREIGN KEY (company_id) REFERENCES company(id) DEFERRABLE INITIALLY DEFERRED;
6208
6209
6210--
6211-- Name: customer_directory_callee_norm_id_c74f59ef_fk_normaliza; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6212--
6213
6214ALTER TABLE ONLY customer_directory
6215 ADD CONSTRAINT customer_directory_callee_norm_id_c74f59ef_fk_normaliza FOREIGN KEY (callee_norm_id) REFERENCES normalization_grp(id) DEFERRABLE INITIALLY DEFERRED;
6216
6217
6218--
6219-- Name: customer_directory_callee_norm_in_id_22f5b25e_fk_normaliza; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6220--
6221
6222ALTER TABLE ONLY customer_directory
6223 ADD CONSTRAINT customer_directory_callee_norm_in_id_22f5b25e_fk_normaliza FOREIGN KEY (callee_norm_in_id) REFERENCES normalization_grp(id) DEFERRABLE INITIALLY DEFERRED;
6224
6225
6226--
6227-- Name: customer_directory_callerid_norm_id_dbac6168_fk_normaliza; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6228--
6229
6230ALTER TABLE ONLY customer_directory
6231 ADD CONSTRAINT customer_directory_callerid_norm_id_dbac6168_fk_normaliza FOREIGN KEY (callerid_norm_id) REFERENCES normalization_grp(id) DEFERRABLE INITIALLY DEFERRED;
6232
6233
6234--
6235-- Name: customer_directory_callerid_norm_in_id_f3f53eb9_fk_normaliza; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6236--
6237
6238ALTER TABLE ONLY customer_directory
6239 ADD CONSTRAINT customer_directory_callerid_norm_in_id_f3f53eb9_fk_normaliza FOREIGN KEY (callerid_norm_in_id) REFERENCES normalization_grp(id) DEFERRABLE INITIALLY DEFERRED;
6240
6241
6242--
6243-- Name: customer_directory_company_id_5ecaae8b_fk_company_id; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6244--
6245
6246ALTER TABLE ONLY customer_directory
6247 ADD CONSTRAINT customer_directory_company_id_5ecaae8b_fk_company_id FOREIGN KEY (company_id) REFERENCES company(id) DEFERRABLE INITIALLY DEFERRED;
6248
6249
6250--
6251-- Name: customer_directory_domain_id_15f23481_fk_uid_domain_id; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6252--
6253
6254ALTER TABLE ONLY customer_directory
6255 ADD CONSTRAINT customer_directory_domain_id_15f23481_fk_uid_domain_id FOREIGN KEY (domain_id) REFERENCES uid_domain(id) DEFERRABLE INITIALLY DEFERRED;
6256
6257
6258--
6259-- Name: customer_norm_rules_company_id_32507c6f_fk_company_id; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6260--
6261
6262ALTER TABLE ONLY customer_norm_rules
6263 ADD CONSTRAINT customer_norm_rules_company_id_32507c6f_fk_company_id FOREIGN KEY (company_id) REFERENCES company(id) DEFERRABLE INITIALLY DEFERRED;
6264
6265
6266--
6267-- Name: customer_ratecards_company_id_5fd2bfb7_fk_company_id; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6268--
6269
6270ALTER TABLE ONLY customer_ratecards
6271 ADD CONSTRAINT customer_ratecards_company_id_5fd2bfb7_fk_company_id FOREIGN KEY (company_id) REFERENCES company(id) DEFERRABLE INITIALLY DEFERRED;
6272
6273
6274--
6275-- Name: customer_ratecards_ratecard_id_2ce103c5_fk_ratecard_id; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6276--
6277
6278ALTER TABLE ONLY customer_ratecards
6279 ADD CONSTRAINT customer_ratecards_ratecard_id_2ce103c5_fk_ratecard_id FOREIGN KEY (ratecard_id) REFERENCES ratecard(id) DEFERRABLE INITIALLY DEFERRED;
6280
6281
6282--
6283-- Name: customer_rates_ratecard_id_73e37172_fk_ratecard_id; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6284--
6285
6286ALTER TABLE ONLY customer_rates
6287 ADD CONSTRAINT customer_rates_ratecard_id_73e37172_fk_ratecard_id FOREIGN KEY (ratecard_id) REFERENCES ratecard(id) DEFERRABLE INITIALLY DEFERRED;
6288
6289
6290--
6291-- Name: did_cust_ratecard_id_21d9c7c3_fk_ratecard_id; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6292--
6293
6294ALTER TABLE ONLY did
6295 ADD CONSTRAINT did_cust_ratecard_id_21d9c7c3_fk_ratecard_id FOREIGN KEY (cust_ratecard_id) REFERENCES ratecard(id) DEFERRABLE INITIALLY DEFERRED;
6296
6297
6298--
6299-- Name: did_customer_id_afdc3b5c_fk_company_id; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6300--
6301
6302ALTER TABLE ONLY did
6303 ADD CONSTRAINT did_customer_id_afdc3b5c_fk_company_id FOREIGN KEY (customer_id) REFERENCES company(id) DEFERRABLE INITIALLY DEFERRED;
6304
6305
6306--
6307-- Name: did_prov_ratecard_id_dea836e2_fk_provider_tariff_id; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6308--
6309
6310ALTER TABLE ONLY did
6311 ADD CONSTRAINT did_prov_ratecard_id_dea836e2_fk_provider_tariff_id FOREIGN KEY (prov_ratecard_id) REFERENCES provider_tariff(id) DEFERRABLE INITIALLY DEFERRED;
6312
6313
6314--
6315-- Name: did_provider_id_68d0a22b_fk_company_id; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6316--
6317
6318ALTER TABLE ONLY did
6319 ADD CONSTRAINT did_provider_id_68d0a22b_fk_company_id FOREIGN KEY (provider_id) REFERENCES company(id) DEFERRABLE INITIALLY DEFERRED;
6320
6321
6322--
6323-- Name: did_routes_contract_did_id_d545afc5_fk_did_id; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6324--
6325
6326ALTER TABLE ONLY did_routes
6327 ADD CONSTRAINT did_routes_contract_did_id_d545afc5_fk_did_id FOREIGN KEY (contract_did_id) REFERENCES did(id) DEFERRABLE INITIALLY DEFERRED;
6328
6329
6330--
6331-- Name: did_routes_trunk_id_b3f8cec8_fk_customer_directory_id; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6332--
6333
6334ALTER TABLE ONLY did_routes
6335 ADD CONSTRAINT did_routes_trunk_id_b3f8cec8_fk_customer_directory_id FOREIGN KEY (trunk_id) REFERENCES customer_directory(id) DEFERRABLE INITIALLY DEFERRED;
6336
6337
6338--
6339-- Name: dim_customer_destination_customer_id_1979521d_fk_company_id; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6340--
6341
6342ALTER TABLE ONLY dim_customer_destination
6343 ADD CONSTRAINT dim_customer_destination_customer_id_1979521d_fk_company_id FOREIGN KEY (customer_id) REFERENCES company(id) DEFERRABLE INITIALLY DEFERRED;
6344
6345
6346--
6347-- Name: dim_customer_destination_date_id_e86167d5_fk_date_dimension_id; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6348--
6349
6350ALTER TABLE ONLY dim_customer_destination
6351 ADD CONSTRAINT dim_customer_destination_date_id_e86167d5_fk_date_dimension_id FOREIGN KEY (date_id) REFERENCES date_dimension(id) DEFERRABLE INITIALLY DEFERRED;
6352
6353
6354--
6355-- Name: dim_customer_hangupcause_customer_id_bde68f07_fk_company_id; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6356--
6357
6358ALTER TABLE ONLY dim_customer_hangupcause
6359 ADD CONSTRAINT dim_customer_hangupcause_customer_id_bde68f07_fk_company_id FOREIGN KEY (customer_id) REFERENCES company(id) DEFERRABLE INITIALLY DEFERRED;
6360
6361
6362--
6363-- Name: dim_customer_hangupcause_date_id_a70b152b_fk_date_dimension_id; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6364--
6365
6366ALTER TABLE ONLY dim_customer_hangupcause
6367 ADD CONSTRAINT dim_customer_hangupcause_date_id_a70b152b_fk_date_dimension_id FOREIGN KEY (date_id) REFERENCES date_dimension(id) DEFERRABLE INITIALLY DEFERRED;
6368
6369
6370--
6371-- Name: dim_customer_sip_han_date_id_f4e16475_fk_date_dime; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6372--
6373
6374ALTER TABLE ONLY dim_customer_sip_hangupcause
6375 ADD CONSTRAINT dim_customer_sip_han_date_id_f4e16475_fk_date_dime FOREIGN KEY (date_id) REFERENCES date_dimension(id) DEFERRABLE INITIALLY DEFERRED;
6376
6377
6378--
6379-- Name: dim_customer_sip_hangupcause_customer_id_6cfe087d_fk_company_id; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6380--
6381
6382ALTER TABLE ONLY dim_customer_sip_hangupcause
6383 ADD CONSTRAINT dim_customer_sip_hangupcause_customer_id_6cfe087d_fk_company_id FOREIGN KEY (customer_id) REFERENCES company(id) DEFERRABLE INITIALLY DEFERRED;
6384
6385
6386--
6387-- Name: dim_provider_destination_date_id_935bbc34_fk_date_dimension_id; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6388--
6389
6390ALTER TABLE ONLY dim_provider_destination
6391 ADD CONSTRAINT dim_provider_destination_date_id_935bbc34_fk_date_dimension_id FOREIGN KEY (date_id) REFERENCES date_dimension(id) DEFERRABLE INITIALLY DEFERRED;
6392
6393
6394--
6395-- Name: dim_provider_destination_provider_id_d83805e4_fk_company_id; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6396--
6397
6398ALTER TABLE ONLY dim_provider_destination
6399 ADD CONSTRAINT dim_provider_destination_provider_id_d83805e4_fk_company_id FOREIGN KEY (provider_id) REFERENCES company(id) DEFERRABLE INITIALLY DEFERRED;
6400
6401
6402--
6403-- Name: dim_provider_hangupcause_date_id_503da2b4_fk_date_dimension_id; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6404--
6405
6406ALTER TABLE ONLY dim_provider_hangupcause
6407 ADD CONSTRAINT dim_provider_hangupcause_date_id_503da2b4_fk_date_dimension_id FOREIGN KEY (date_id) REFERENCES date_dimension(id) DEFERRABLE INITIALLY DEFERRED;
6408
6409
6410--
6411-- Name: dim_provider_hangupcause_provider_id_6c112bda_fk_company_id; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6412--
6413
6414ALTER TABLE ONLY dim_provider_hangupcause
6415 ADD CONSTRAINT dim_provider_hangupcause_provider_id_6c112bda_fk_company_id FOREIGN KEY (provider_id) REFERENCES company(id) DEFERRABLE INITIALLY DEFERRED;
6416
6417
6418--
6419-- Name: dim_provider_sip_han_date_id_8704810b_fk_date_dime; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6420--
6421
6422ALTER TABLE ONLY dim_provider_sip_hangupcause
6423 ADD CONSTRAINT dim_provider_sip_han_date_id_8704810b_fk_date_dime FOREIGN KEY (date_id) REFERENCES date_dimension(id) DEFERRABLE INITIALLY DEFERRED;
6424
6425
6426--
6427-- Name: dim_provider_sip_hangupcause_provider_id_5b0e5193_fk_company_id; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6428--
6429
6430ALTER TABLE ONLY dim_provider_sip_hangupcause
6431 ADD CONSTRAINT dim_provider_sip_hangupcause_provider_id_5b0e5193_fk_company_id FOREIGN KEY (provider_id) REFERENCES company(id) DEFERRABLE INITIALLY DEFERRED;
6432
6433
6434--
6435-- Name: django_admin_log_content_type_id_c4bce8eb_fk_django_co; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6436--
6437
6438ALTER TABLE ONLY django_admin_log
6439 ADD CONSTRAINT django_admin_log_content_type_id_c4bce8eb_fk_django_co FOREIGN KEY (content_type_id) REFERENCES django_content_type(id) DEFERRABLE INITIALLY DEFERRED;
6440
6441
6442--
6443-- Name: django_admin_log_user_id_c564eba6_fk_auth_user_id; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6444--
6445
6446ALTER TABLE ONLY django_admin_log
6447 ADD CONSTRAINT django_admin_log_user_id_c564eba6_fk_auth_user_id FOREIGN KEY (user_id) REFERENCES auth_user(id) DEFERRABLE INITIALLY DEFERRED;
6448
6449
6450--
6451-- Name: fraud_alert_company_id_04d2b09f_fk_company_id; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6452--
6453
6454ALTER TABLE ONLY fraud_alert
6455 ADD CONSTRAINT fraud_alert_company_id_04d2b09f_fk_company_id FOREIGN KEY (company_id) REFERENCES company(id) DEFERRABLE INITIALLY DEFERRED;
6456
6457
6458--
6459-- Name: fraud_alert_customerdirectory_id_2c34666e_fk_customer_; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6460--
6461
6462ALTER TABLE ONLY fraud_alert
6463 ADD CONSTRAINT fraud_alert_customerdirectory_id_2c34666e_fk_customer_ FOREIGN KEY (customerdirectory_id) REFERENCES customer_directory(id) DEFERRABLE INITIALLY DEFERRED;
6464
6465
6466--
6467-- Name: fs_switch_profile_fsswitch_id_cd26032d_fk_fs_switch_id; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6468--
6469
6470ALTER TABLE ONLY fs_switch_profile
6471 ADD CONSTRAINT fs_switch_profile_fsswitch_id_cd26032d_fk_fs_switch_id FOREIGN KEY (fsswitch_id) REFERENCES fs_switch(id) DEFERRABLE INITIALLY DEFERRED;
6472
6473
6474--
6475-- Name: fs_switch_profile_outbound_proxy_id_c9d253e6_fk_fs_switch_id; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6476--
6477
6478ALTER TABLE ONLY fs_switch_profile
6479 ADD CONSTRAINT fs_switch_profile_outbound_proxy_id_c9d253e6_fk_fs_switch_id FOREIGN KEY (outbound_proxy_id) REFERENCES fs_switch(id) DEFERRABLE INITIALLY DEFERRED;
6480
6481
6482--
6483-- Name: fs_switch_profile_sipprofile_id_057af46e_fk_sip_profile_id; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6484--
6485
6486ALTER TABLE ONLY fs_switch_profile
6487 ADD CONSTRAINT fs_switch_profile_sipprofile_id_057af46e_fk_sip_profile_id FOREIGN KEY (sipprofile_id) REFERENCES sip_profile(id) DEFERRABLE INITIALLY DEFERRED;
6488
6489
6490--
6491-- Name: lcr_providers_lcr_id_ada024a3_fk_lcr_group_id; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6492--
6493
6494ALTER TABLE ONLY lcr_providers
6495 ADD CONSTRAINT lcr_providers_lcr_id_ada024a3_fk_lcr_group_id FOREIGN KEY (lcr_id) REFERENCES lcr_group(id) DEFERRABLE INITIALLY DEFERRED;
6496
6497
6498--
6499-- Name: lcr_providers_provider_tariff_id_f5673ae4_fk_provider_tariff_id; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6500--
6501
6502ALTER TABLE ONLY lcr_providers
6503 ADD CONSTRAINT lcr_providers_provider_tariff_id_f5673ae4_fk_provider_tariff_id FOREIGN KEY (provider_tariff_id) REFERENCES provider_tariff(id) DEFERRABLE INITIALLY DEFERRED;
6504
6505
6506--
6507-- Name: normalization_rule_g_rule_id_9bd3a13a_fk_normaliza; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6508--
6509
6510ALTER TABLE ONLY normalization_rule_grp
6511 ADD CONSTRAINT normalization_rule_g_rule_id_9bd3a13a_fk_normaliza FOREIGN KEY (rule_id) REFERENCES normalization_rule(id) DEFERRABLE INITIALLY DEFERRED;
6512
6513
6514--
6515-- Name: normalization_rule_grp_dpid_id_5310bb5f_fk_normalization_grp_id; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6516--
6517
6518ALTER TABLE ONLY normalization_rule_grp
6519 ADD CONSTRAINT normalization_rule_grp_dpid_id_5310bb5f_fk_normalization_grp_id FOREIGN KEY (dpid_id) REFERENCES normalization_grp(id) DEFERRABLE INITIALLY DEFERRED;
6520
6521
6522--
6523-- Name: provider_rates_did_provider_id_dd6de102_fk_company_id; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6524--
6525
6526ALTER TABLE ONLY provider_rates_did
6527 ADD CONSTRAINT provider_rates_did_provider_id_dd6de102_fk_company_id FOREIGN KEY (provider_id) REFERENCES company(id) DEFERRABLE INITIALLY DEFERRED;
6528
6529
6530--
6531-- Name: provider_rates_provider_tariff_id_70029bd3_fk_provider_; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6532--
6533
6534ALTER TABLE ONLY provider_rates
6535 ADD CONSTRAINT provider_rates_provider_tariff_id_70029bd3_fk_provider_ FOREIGN KEY (provider_tariff_id) REFERENCES provider_tariff(id) DEFERRABLE INITIALLY DEFERRED;
6536
6537
6538--
6539-- Name: provider_tariff_callerid_list_id_10e2e2c1_fk_callerid_; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6540--
6541
6542ALTER TABLE ONLY provider_tariff
6543 ADD CONSTRAINT provider_tariff_callerid_list_id_10e2e2c1_fk_callerid_ FOREIGN KEY (callerid_list_id) REFERENCES callerid_prefix_list(id) DEFERRABLE INITIALLY DEFERRED;
6544
6545
6546--
6547-- Name: provider_tariff_carrier_id_b0dfe425_fk_company_id; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6548--
6549
6550ALTER TABLE ONLY provider_tariff
6551 ADD CONSTRAINT provider_tariff_carrier_id_b0dfe425_fk_company_id FOREIGN KEY (carrier_id) REFERENCES company(id) DEFERRABLE INITIALLY DEFERRED;
6552
6553
6554--
6555-- Name: provider_tariff_currency_id_ef405a72_fk_currencies_currency_id; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6556--
6557
6558ALTER TABLE ONLY provider_tariff
6559 ADD CONSTRAINT provider_tariff_currency_id_ef405a72_fk_currencies_currency_id FOREIGN KEY (currency_id) REFERENCES currencies_currency(id) DEFERRABLE INITIALLY DEFERRED;
6560
6561
6562--
6563-- Name: ratecard_callerid_list_id_f8fe4670_fk_callerid_prefix_list_id; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6564--
6565
6566ALTER TABLE ONLY ratecard
6567 ADD CONSTRAINT ratecard_callerid_list_id_f8fe4670_fk_callerid_prefix_list_id FOREIGN KEY (callerid_list_id) REFERENCES callerid_prefix_list(id) DEFERRABLE INITIALLY DEFERRED;
6568
6569
6570--
6571-- Name: ratecard_currency_id_13c5b537_fk_currencies_currency_id; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6572--
6573
6574ALTER TABLE ONLY ratecard
6575 ADD CONSTRAINT ratecard_currency_id_13c5b537_fk_currencies_currency_id FOREIGN KEY (currency_id) REFERENCES currencies_currency(id) DEFERRABLE INITIALLY DEFERRED;
6576
6577
6578--
6579-- Name: ratecard_lcrgroup_id_f5b2d19d_fk_lcr_group_id; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6580--
6581
6582ALTER TABLE ONLY ratecard
6583 ADD CONSTRAINT ratecard_lcrgroup_id_f5b2d19d_fk_lcr_group_id FOREIGN KEY (lcrgroup_id) REFERENCES lcr_group(id) DEFERRABLE INITIALLY DEFERRED;
6584
6585
6586--
6587-- Name: sofia_gateway_company_id_b6f88bb3_fk_company_id; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6588--
6589
6590ALTER TABLE ONLY sofia_gateway
6591 ADD CONSTRAINT sofia_gateway_company_id_b6f88bb3_fk_company_id FOREIGN KEY (company_id) REFERENCES company(id) DEFERRABLE INITIALLY DEFERRED;
6592
6593
6594--
6595-- Name: sofia_gateway_domain_id_19383d59_fk_uid_domain_id; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6596--
6597
6598ALTER TABLE ONLY sofia_gateway
6599 ADD CONSTRAINT sofia_gateway_domain_id_19383d59_fk_uid_domain_id FOREIGN KEY (domain_id) REFERENCES uid_domain(id) DEFERRABLE INITIALLY DEFERRED;
6600
6601
6602--
6603-- Name: sofia_gateway_sip_profile_id_9b8a1f4f_fk_sip_profile_id; Type: FK CONSTRAINT; Schema: public; Owner: pyfreebilling
6604--
6605
6606ALTER TABLE ONLY sofia_gateway
6607 ADD CONSTRAINT sofia_gateway_sip_profile_id_9b8a1f4f_fk_sip_profile_id FOREIGN KEY (sip_profile_id) REFERENCES sip_profile(id) DEFERRABLE INITIALLY DEFERRED;
6608
6609
6610--
6611-- Name: public; Type: ACL; Schema: -; Owner: postgres
6612--
6613
6614REVOKE ALL ON SCHEMA public FROM PUBLIC;
6615REVOKE ALL ON SCHEMA public FROM postgres;
6616GRANT ALL ON SCHEMA public TO postgres;
6617GRANT ALL ON SCHEMA public TO PUBLIC;
6618
6619
6620--
6621-- PostgreSQL database dump complete
6622--