-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathredash-data.sql
1792 lines (1179 loc) · 43.6 KB
/
redash-data.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
--
-- PostgreSQL database dump
--
-- Dumped from database version 9.5.6
-- Dumped by pg_dump version 9.5.17
SET statement_timeout = 0;
SET lock_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;
--
-- Name: DATABASE postgres; Type: COMMENT; Schema: -; Owner: postgres
--
COMMENT ON DATABASE postgres IS 'default administrative connection database';
--
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner:
--
CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
--
-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner:
--
COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
--
-- Name: queries_search_vector_update(); Type: FUNCTION; Schema: public; Owner: postgres
--
CREATE FUNCTION public.queries_search_vector_update() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
NEW.search_vector = ((setweight(to_tsvector('pg_catalog.simple', regexp_replace(coalesce(CAST(NEW.id AS TEXT), ''), '[-@.]', ' ', 'g')), 'B') || setweight(to_tsvector('pg_catalog.simple', regexp_replace(coalesce(NEW.name, ''), '[-@.]', ' ', 'g')), 'A')) || setweight(to_tsvector('pg_catalog.simple', regexp_replace(coalesce(NEW.description, ''), '[-@.]', ' ', 'g')), 'C')) || setweight(to_tsvector('pg_catalog.simple', regexp_replace(coalesce(NEW.query, ''), '[-@.]', ' ', 'g')), 'D');
RETURN NEW;
END
$$;
ALTER FUNCTION public.queries_search_vector_update() OWNER TO postgres;
SET default_tablespace = '';
SET default_with_oids = false;
--
-- Name: access_permissions; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.access_permissions (
object_type character varying(255) NOT NULL,
object_id integer NOT NULL,
id integer NOT NULL,
access_type character varying(255) NOT NULL,
grantor_id integer NOT NULL,
grantee_id integer NOT NULL
);
ALTER TABLE public.access_permissions OWNER TO postgres;
--
-- Name: access_permissions_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.access_permissions_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.access_permissions_id_seq OWNER TO postgres;
--
-- Name: access_permissions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.access_permissions_id_seq OWNED BY public.access_permissions.id;
--
-- Name: alembic_version; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.alembic_version (
version_num character varying(32) NOT NULL
);
ALTER TABLE public.alembic_version OWNER TO postgres;
--
-- Name: alert_subscriptions; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.alert_subscriptions (
updated_at timestamp with time zone NOT NULL,
created_at timestamp with time zone NOT NULL,
id integer NOT NULL,
user_id integer NOT NULL,
destination_id integer,
alert_id integer NOT NULL
);
ALTER TABLE public.alert_subscriptions OWNER TO postgres;
--
-- Name: alert_subscriptions_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.alert_subscriptions_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.alert_subscriptions_id_seq OWNER TO postgres;
--
-- Name: alert_subscriptions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.alert_subscriptions_id_seq OWNED BY public.alert_subscriptions.id;
--
-- Name: alerts; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.alerts (
updated_at timestamp with time zone NOT NULL,
created_at timestamp with time zone NOT NULL,
id integer NOT NULL,
name character varying(255) NOT NULL,
query_id integer NOT NULL,
user_id integer NOT NULL,
options text NOT NULL,
state character varying(255) NOT NULL,
last_triggered_at timestamp with time zone,
rearm integer
);
ALTER TABLE public.alerts OWNER TO postgres;
--
-- Name: alerts_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.alerts_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.alerts_id_seq OWNER TO postgres;
--
-- Name: alerts_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.alerts_id_seq OWNED BY public.alerts.id;
--
-- Name: api_keys; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.api_keys (
object_type character varying(255) NOT NULL,
object_id integer NOT NULL,
updated_at timestamp with time zone NOT NULL,
created_at timestamp with time zone NOT NULL,
id integer NOT NULL,
org_id integer NOT NULL,
api_key character varying(255) NOT NULL,
active boolean NOT NULL,
created_by_id integer
);
ALTER TABLE public.api_keys OWNER TO postgres;
--
-- Name: api_keys_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.api_keys_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.api_keys_id_seq OWNER TO postgres;
--
-- Name: api_keys_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.api_keys_id_seq OWNED BY public.api_keys.id;
--
-- Name: changes; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.changes (
object_type character varying(255) NOT NULL,
object_id integer NOT NULL,
id integer NOT NULL,
object_version integer NOT NULL,
user_id integer NOT NULL,
change text NOT NULL,
created_at timestamp with time zone NOT NULL
);
ALTER TABLE public.changes OWNER TO postgres;
--
-- Name: changes_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.changes_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.changes_id_seq OWNER TO postgres;
--
-- Name: changes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.changes_id_seq OWNED BY public.changes.id;
--
-- Name: dashboards; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.dashboards (
updated_at timestamp with time zone NOT NULL,
created_at timestamp with time zone NOT NULL,
id integer NOT NULL,
version integer NOT NULL,
org_id integer NOT NULL,
slug character varying(140) NOT NULL,
name character varying(100) NOT NULL,
user_id integer NOT NULL,
layout text NOT NULL,
dashboard_filters_enabled boolean NOT NULL,
is_archived boolean NOT NULL,
is_draft boolean NOT NULL,
tags character varying[]
);
ALTER TABLE public.dashboards OWNER TO postgres;
--
-- Name: dashboards_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.dashboards_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.dashboards_id_seq OWNER TO postgres;
--
-- Name: dashboards_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.dashboards_id_seq OWNED BY public.dashboards.id;
--
-- Name: data_source_groups; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.data_source_groups (
id integer NOT NULL,
data_source_id integer NOT NULL,
group_id integer NOT NULL,
view_only boolean NOT NULL
);
ALTER TABLE public.data_source_groups OWNER TO postgres;
--
-- Name: data_source_groups_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.data_source_groups_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.data_source_groups_id_seq OWNER TO postgres;
--
-- Name: data_source_groups_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.data_source_groups_id_seq OWNED BY public.data_source_groups.id;
--
-- Name: data_sources; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.data_sources (
id integer NOT NULL,
org_id integer NOT NULL,
name character varying(255) NOT NULL,
type character varying(255) NOT NULL,
options text NOT NULL,
queue_name character varying(255) NOT NULL,
scheduled_queue_name character varying(255) NOT NULL,
created_at timestamp with time zone NOT NULL
);
ALTER TABLE public.data_sources OWNER TO postgres;
--
-- Name: data_sources_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.data_sources_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.data_sources_id_seq OWNER TO postgres;
--
-- Name: data_sources_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.data_sources_id_seq OWNED BY public.data_sources.id;
--
-- Name: events; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.events (
id integer NOT NULL,
org_id integer NOT NULL,
user_id integer,
action character varying(255) NOT NULL,
object_type character varying(255) NOT NULL,
object_id character varying(255),
additional_properties text,
created_at timestamp with time zone NOT NULL
);
ALTER TABLE public.events OWNER TO postgres;
--
-- Name: events_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.events_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.events_id_seq OWNER TO postgres;
--
-- Name: events_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.events_id_seq OWNED BY public.events.id;
--
-- Name: favorites; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.favorites (
updated_at timestamp with time zone NOT NULL,
created_at timestamp with time zone NOT NULL,
id integer NOT NULL,
org_id integer NOT NULL,
object_type character varying(255) NOT NULL,
object_id integer NOT NULL,
user_id integer NOT NULL
);
ALTER TABLE public.favorites OWNER TO postgres;
--
-- Name: favorites_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.favorites_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.favorites_id_seq OWNER TO postgres;
--
-- Name: favorites_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.favorites_id_seq OWNED BY public.favorites.id;
--
-- Name: groups; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.groups (
id integer NOT NULL,
org_id integer NOT NULL,
type character varying(255) NOT NULL,
name character varying(100) NOT NULL,
permissions character varying(255)[] NOT NULL,
created_at timestamp with time zone NOT NULL
);
ALTER TABLE public.groups OWNER TO postgres;
--
-- Name: groups_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.groups_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.groups_id_seq OWNER TO postgres;
--
-- Name: groups_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.groups_id_seq OWNED BY public.groups.id;
--
-- Name: notification_destinations; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.notification_destinations (
id integer NOT NULL,
org_id integer NOT NULL,
user_id integer NOT NULL,
name character varying(255) NOT NULL,
type character varying(255) NOT NULL,
options text NOT NULL,
created_at timestamp with time zone NOT NULL
);
ALTER TABLE public.notification_destinations OWNER TO postgres;
--
-- Name: notification_destinations_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.notification_destinations_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.notification_destinations_id_seq OWNER TO postgres;
--
-- Name: notification_destinations_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.notification_destinations_id_seq OWNED BY public.notification_destinations.id;
--
-- Name: organizations; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.organizations (
updated_at timestamp with time zone NOT NULL,
created_at timestamp with time zone NOT NULL,
id integer NOT NULL,
name character varying(255) NOT NULL,
slug character varying(255) NOT NULL,
settings text NOT NULL
);
ALTER TABLE public.organizations OWNER TO postgres;
--
-- Name: organizations_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.organizations_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.organizations_id_seq OWNER TO postgres;
--
-- Name: organizations_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.organizations_id_seq OWNED BY public.organizations.id;
--
-- Name: queries; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.queries (
updated_at timestamp with time zone NOT NULL,
created_at timestamp with time zone NOT NULL,
id integer NOT NULL,
version integer NOT NULL,
org_id integer NOT NULL,
data_source_id integer,
latest_query_data_id integer,
name character varying(255) NOT NULL,
description character varying(4096),
query text NOT NULL,
query_hash character varying(32) NOT NULL,
api_key character varying(40) NOT NULL,
user_id integer NOT NULL,
last_modified_by_id integer,
is_archived boolean NOT NULL,
is_draft boolean NOT NULL,
schedule character varying(10),
schedule_failures integer NOT NULL,
options text NOT NULL,
search_vector tsvector,
tags character varying[]
);
ALTER TABLE public.queries OWNER TO postgres;
--
-- Name: queries_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.queries_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.queries_id_seq OWNER TO postgres;
--
-- Name: queries_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.queries_id_seq OWNED BY public.queries.id;
--
-- Name: query_results; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.query_results (
id integer NOT NULL,
org_id integer NOT NULL,
data_source_id integer NOT NULL,
query_hash character varying(32) NOT NULL,
query text NOT NULL,
data text NOT NULL,
runtime double precision NOT NULL,
retrieved_at timestamp with time zone NOT NULL
);
ALTER TABLE public.query_results OWNER TO postgres;
--
-- Name: query_results_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.query_results_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.query_results_id_seq OWNER TO postgres;
--
-- Name: query_results_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.query_results_id_seq OWNED BY public.query_results.id;
--
-- Name: query_snippets; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.query_snippets (
updated_at timestamp with time zone NOT NULL,
created_at timestamp with time zone NOT NULL,
id integer NOT NULL,
org_id integer NOT NULL,
trigger character varying(255) NOT NULL,
description text NOT NULL,
user_id integer NOT NULL,
snippet text NOT NULL
);
ALTER TABLE public.query_snippets OWNER TO postgres;
--
-- Name: query_snippets_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.query_snippets_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.query_snippets_id_seq OWNER TO postgres;
--
-- Name: query_snippets_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.query_snippets_id_seq OWNED BY public.query_snippets.id;
--
-- Name: users; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.users (
updated_at timestamp with time zone NOT NULL,
created_at timestamp with time zone NOT NULL,
id integer NOT NULL,
org_id integer NOT NULL,
name character varying(320) NOT NULL,
email character varying(255) NOT NULL,
profile_image_url character varying(320),
password_hash character varying(128),
groups integer[],
api_key character varying(40) NOT NULL,
disabled_at timestamp with time zone
);
ALTER TABLE public.users OWNER TO postgres;
--
-- Name: users_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.users_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.users_id_seq OWNER TO postgres;
--
-- Name: users_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.users_id_seq OWNED BY public.users.id;
--
-- Name: visualizations; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.visualizations (
updated_at timestamp with time zone NOT NULL,
created_at timestamp with time zone NOT NULL,
id integer NOT NULL,
type character varying(100) NOT NULL,
query_id integer NOT NULL,
name character varying(255) NOT NULL,
description character varying(4096),
options text NOT NULL
);
ALTER TABLE public.visualizations OWNER TO postgres;
--
-- Name: visualizations_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.visualizations_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.visualizations_id_seq OWNER TO postgres;
--
-- Name: visualizations_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.visualizations_id_seq OWNED BY public.visualizations.id;
--
-- Name: widgets; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.widgets (
updated_at timestamp with time zone NOT NULL,
created_at timestamp with time zone NOT NULL,
id integer NOT NULL,
visualization_id integer,
text text,
width integer NOT NULL,
options text NOT NULL,
dashboard_id integer NOT NULL
);
ALTER TABLE public.widgets OWNER TO postgres;
--
-- Name: widgets_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.widgets_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.widgets_id_seq OWNER TO postgres;
--
-- Name: widgets_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.widgets_id_seq OWNED BY public.widgets.id;
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.access_permissions ALTER COLUMN id SET DEFAULT nextval('public.access_permissions_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.alert_subscriptions ALTER COLUMN id SET DEFAULT nextval('public.alert_subscriptions_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.alerts ALTER COLUMN id SET DEFAULT nextval('public.alerts_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.api_keys ALTER COLUMN id SET DEFAULT nextval('public.api_keys_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.changes ALTER COLUMN id SET DEFAULT nextval('public.changes_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.dashboards ALTER COLUMN id SET DEFAULT nextval('public.dashboards_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.data_source_groups ALTER COLUMN id SET DEFAULT nextval('public.data_source_groups_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.data_sources ALTER COLUMN id SET DEFAULT nextval('public.data_sources_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.events ALTER COLUMN id SET DEFAULT nextval('public.events_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.favorites ALTER COLUMN id SET DEFAULT nextval('public.favorites_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.groups ALTER COLUMN id SET DEFAULT nextval('public.groups_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.notification_destinations ALTER COLUMN id SET DEFAULT nextval('public.notification_destinations_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.organizations ALTER COLUMN id SET DEFAULT nextval('public.organizations_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.queries ALTER COLUMN id SET DEFAULT nextval('public.queries_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.query_results ALTER COLUMN id SET DEFAULT nextval('public.query_results_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.query_snippets ALTER COLUMN id SET DEFAULT nextval('public.query_snippets_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.users ALTER COLUMN id SET DEFAULT nextval('public.users_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.visualizations ALTER COLUMN id SET DEFAULT nextval('public.visualizations_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.widgets ALTER COLUMN id SET DEFAULT nextval('public.widgets_id_seq'::regclass);
--
-- Data for Name: access_permissions; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.access_permissions (object_type, object_id, id, access_type, grantor_id, grantee_id) FROM stdin;
\.
--
-- Name: access_permissions_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public.access_permissions_id_seq', 1, false);
--
-- Data for Name: alembic_version; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.alembic_version (version_num) FROM stdin;
71477dadd6ef
\.
--
-- Data for Name: alert_subscriptions; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.alert_subscriptions (updated_at, created_at, id, user_id, destination_id, alert_id) FROM stdin;
\.
--
-- Name: alert_subscriptions_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public.alert_subscriptions_id_seq', 1, false);
--
-- Data for Name: alerts; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.alerts (updated_at, created_at, id, name, query_id, user_id, options, state, last_triggered_at, rearm) FROM stdin;
\.
--