-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpublic_schema_dump.sql
More file actions
1874 lines (1268 loc) · 48.4 KB
/
public_schema_dump.sql
File metadata and controls
1874 lines (1268 loc) · 48.4 KB
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 15.6
-- Dumped by pg_dump version 15.6
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_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: auth; Type: SCHEMA; Schema: -; Owner: postgres
--
CREATE SCHEMA auth;
ALTER SCHEMA auth OWNER TO postgres;
--
-- Name: extensions; Type: SCHEMA; Schema: -; Owner: postgres
--
CREATE SCHEMA extensions;
ALTER SCHEMA extensions OWNER TO postgres;
--
-- Name: pgbouncer; Type: SCHEMA; Schema: -; Owner: pgbouncer
--
CREATE SCHEMA pgbouncer;
ALTER SCHEMA pgbouncer OWNER TO pgbouncer;
--
-- Name: pgcrypto; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS pgcrypto WITH SCHEMA extensions;
--
-- Name: EXTENSION pgcrypto; Type: COMMENT; Schema: -; Owner:
--
COMMENT ON EXTENSION pgcrypto IS 'cryptographic functions';
--
-- Name: pgjwt; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS pgjwt WITH SCHEMA extensions;
--
-- Name: EXTENSION pgjwt; Type: COMMENT; Schema: -; Owner:
--
COMMENT ON EXTENSION pgjwt IS 'JSON Web Token API for Postgresql';
--
-- Name: uuid-ossp; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS "uuid-ossp" WITH SCHEMA extensions;
--
-- Name: EXTENSION "uuid-ossp"; Type: COMMENT; Schema: -; Owner:
--
COMMENT ON EXTENSION "uuid-ossp" IS 'generate universally unique identifiers (UUIDs)';
--
-- Name: factor_type; Type: TYPE; Schema: auth; Owner: postgres
--
CREATE TYPE auth.factor_type AS ENUM (
'totp',
'phone'
);
ALTER TYPE auth.factor_type OWNER TO postgres;
--
-- Name: aal_level; Type: TYPE; Schema: public; Owner: postgres
--
CREATE TYPE public.aal_level AS ENUM (
'aal1',
'aal2',
'aal3'
);
ALTER TYPE public.aal_level OWNER TO postgres;
--
-- Name: code_challenge_method; Type: TYPE; Schema: public; Owner: postgres
--
CREATE TYPE public.code_challenge_method AS ENUM (
's256',
'plain'
);
ALTER TYPE public.code_challenge_method OWNER TO postgres;
--
-- Name: factor_status; Type: TYPE; Schema: public; Owner: postgres
--
CREATE TYPE public.factor_status AS ENUM (
'unverified',
'verified'
);
ALTER TYPE public.factor_status OWNER TO postgres;
--
-- Name: factor_type; Type: TYPE; Schema: public; Owner: postgres
--
CREATE TYPE public.factor_type AS ENUM (
'totp',
'webauthn'
);
ALTER TYPE public.factor_type OWNER TO postgres;
--
-- Name: one_time_token_type; Type: TYPE; Schema: public; Owner: postgres
--
CREATE TYPE public.one_time_token_type AS ENUM (
'confirmation_token',
'reauthentication_token',
'recovery_token',
'email_change_token_new',
'email_change_token_current',
'phone_change_token'
);
ALTER TYPE public.one_time_token_type OWNER TO postgres;
--
-- Name: email(); Type: FUNCTION; Schema: auth; Owner: postgres
--
CREATE FUNCTION auth.email() RETURNS text
LANGUAGE sql STABLE
AS $$
select
coalesce(
nullif(current_setting('request.jwt.claim.email', true), ''),
(nullif(current_setting('request.jwt.claims', true), '')::jsonb ->> 'email')
)::text
$$;
ALTER FUNCTION auth.email() OWNER TO postgres;
--
-- Name: FUNCTION email(); Type: COMMENT; Schema: auth; Owner: postgres
--
COMMENT ON FUNCTION auth.email() IS 'Deprecated. Use auth.jwt() -> ''email'' instead.';
--
-- Name: jwt(); Type: FUNCTION; Schema: auth; Owner: postgres
--
CREATE FUNCTION auth.jwt() RETURNS jsonb
LANGUAGE sql STABLE
AS $$
select
coalesce(
nullif(current_setting('request.jwt.claim', true), ''),
nullif(current_setting('request.jwt.claims', true), '')
)::jsonb
$$;
ALTER FUNCTION auth.jwt() OWNER TO postgres;
--
-- Name: role(); Type: FUNCTION; Schema: auth; Owner: postgres
--
CREATE FUNCTION auth.role() RETURNS text
LANGUAGE sql STABLE
AS $$
select
coalesce(
nullif(current_setting('request.jwt.claim.role', true), ''),
(nullif(current_setting('request.jwt.claims', true), '')::jsonb ->> 'role')
)::text
$$;
ALTER FUNCTION auth.role() OWNER TO postgres;
--
-- Name: FUNCTION role(); Type: COMMENT; Schema: auth; Owner: postgres
--
COMMENT ON FUNCTION auth.role() IS 'Deprecated. Use auth.jwt() -> ''role'' instead.';
--
-- Name: uid(); Type: FUNCTION; Schema: auth; Owner: postgres
--
CREATE FUNCTION auth.uid() RETURNS uuid
LANGUAGE sql STABLE
AS $$
select
coalesce(
nullif(current_setting('request.jwt.claim.sub', true), ''),
(nullif(current_setting('request.jwt.claims', true), '')::jsonb ->> 'sub')
)::uuid
$$;
ALTER FUNCTION auth.uid() OWNER TO postgres;
--
-- Name: FUNCTION uid(); Type: COMMENT; Schema: auth; Owner: postgres
--
COMMENT ON FUNCTION auth.uid() IS 'Deprecated. Use auth.jwt() -> ''sub'' instead.';
--
-- Name: get_auth(text); Type: FUNCTION; Schema: pgbouncer; Owner: postgres
--
CREATE FUNCTION pgbouncer.get_auth(p_usename text) RETURNS TABLE(username text, password text)
LANGUAGE plpgsql SECURITY DEFINER
AS $$
BEGIN
RAISE WARNING 'PgBouncer auth request: %', p_usename;
RETURN QUERY
SELECT usename::TEXT, passwd::TEXT FROM pg_catalog.pg_shadow
WHERE usename = p_usename;
END;
$$;
ALTER FUNCTION pgbouncer.get_auth(p_usename text) OWNER TO postgres;
SET default_tablespace = '';
SET default_table_access_method = heap;
--
-- Name: audit_log_entries; Type: TABLE; Schema: auth; Owner: postgres
--
CREATE TABLE auth.audit_log_entries (
instance_id uuid,
id uuid NOT NULL,
payload json,
created_at timestamp with time zone,
ip_address character varying(64) DEFAULT ''::character varying NOT NULL
);
ALTER TABLE auth.audit_log_entries OWNER TO postgres;
--
-- Name: TABLE audit_log_entries; Type: COMMENT; Schema: auth; Owner: postgres
--
COMMENT ON TABLE auth.audit_log_entries IS 'Auth: Audit trail for user actions.';
--
-- Name: flow_state; Type: TABLE; Schema: auth; Owner: postgres
--
CREATE TABLE auth.flow_state (
id uuid DEFAULT gen_random_uuid() NOT NULL,
user_id uuid,
auth_code text,
code_challenge_method text,
code_challenge text,
provider text,
created_at timestamp with time zone,
updated_at timestamp with time zone,
authentication_method text NOT NULL,
auth_code_issued_at timestamp with time zone
);
ALTER TABLE auth.flow_state OWNER TO postgres;
--
-- Name: TABLE flow_state; Type: COMMENT; Schema: auth; Owner: postgres
--
COMMENT ON TABLE auth.flow_state IS 'stores metadata for pkce logins';
--
-- Name: identities; Type: TABLE; Schema: auth; Owner: postgres
--
CREATE TABLE auth.identities (
id text NOT NULL,
user_id uuid NOT NULL,
identity_data jsonb NOT NULL,
provider text NOT NULL,
last_sign_in_at timestamp with time zone,
created_at timestamp with time zone,
updated_at timestamp with time zone
);
ALTER TABLE auth.identities OWNER TO postgres;
--
-- Name: instances; Type: TABLE; Schema: auth; Owner: postgres
--
CREATE TABLE auth.instances (
id uuid NOT NULL,
uuid uuid,
raw_base_config text,
created_at timestamp with time zone,
updated_at timestamp with time zone
);
ALTER TABLE auth.instances OWNER TO postgres;
--
-- Name: TABLE instances; Type: COMMENT; Schema: auth; Owner: postgres
--
COMMENT ON TABLE auth.instances IS 'Auth: Manages users across multiple sites.';
--
-- Name: mfa_amr_claims; Type: TABLE; Schema: auth; Owner: postgres
--
CREATE TABLE auth.mfa_amr_claims (
session_id uuid NOT NULL,
created_at timestamp with time zone NOT NULL,
updated_at timestamp with time zone NOT NULL,
authentication_method text NOT NULL,
id uuid NOT NULL
);
ALTER TABLE auth.mfa_amr_claims OWNER TO postgres;
--
-- Name: TABLE mfa_amr_claims; Type: COMMENT; Schema: auth; Owner: postgres
--
COMMENT ON TABLE auth.mfa_amr_claims IS 'auth: stores authenticator method reference claims for multi factor authentication';
--
-- Name: mfa_challenges; Type: TABLE; Schema: auth; Owner: postgres
--
CREATE TABLE auth.mfa_challenges (
id uuid NOT NULL,
factor_id uuid NOT NULL,
created_at timestamp with time zone NOT NULL,
verified_at timestamp with time zone,
ip_address inet NOT NULL,
otp_code text,
web_authn_session_data jsonb
);
ALTER TABLE auth.mfa_challenges OWNER TO postgres;
--
-- Name: TABLE mfa_challenges; Type: COMMENT; Schema: auth; Owner: postgres
--
COMMENT ON TABLE auth.mfa_challenges IS 'auth: stores metadata about challenge requests made';
--
-- Name: mfa_factors; Type: TABLE; Schema: auth; Owner: postgres
--
CREATE TABLE auth.mfa_factors (
id uuid NOT NULL,
user_id uuid NOT NULL,
friendly_name text,
factor_type public.factor_type NOT NULL,
status public.factor_status NOT NULL,
created_at timestamp with time zone NOT NULL,
updated_at timestamp with time zone NOT NULL,
secret text,
phone text,
last_challenged_at timestamp with time zone,
web_authn_credential jsonb,
web_authn_aaguid uuid
);
ALTER TABLE auth.mfa_factors OWNER TO postgres;
--
-- Name: TABLE mfa_factors; Type: COMMENT; Schema: auth; Owner: postgres
--
COMMENT ON TABLE auth.mfa_factors IS 'auth: stores metadata about factors';
--
-- Name: one_time_tokens; Type: TABLE; Schema: auth; Owner: postgres
--
CREATE TABLE auth.one_time_tokens (
id uuid NOT NULL,
user_id uuid NOT NULL,
token_type public.one_time_token_type NOT NULL,
token_hash text NOT NULL,
relates_to text NOT NULL,
created_at timestamp without time zone DEFAULT now() NOT NULL,
updated_at timestamp without time zone DEFAULT now() NOT NULL,
CONSTRAINT one_time_tokens_token_hash_check CHECK ((char_length(token_hash) > 0))
);
ALTER TABLE auth.one_time_tokens OWNER TO postgres;
--
-- Name: refresh_tokens; Type: TABLE; Schema: auth; Owner: postgres
--
CREATE TABLE auth.refresh_tokens (
instance_id uuid,
id bigint NOT NULL,
token character varying(255),
user_id character varying(255),
revoked boolean,
created_at timestamp with time zone,
updated_at timestamp with time zone,
parent character varying(255),
session_id uuid
);
ALTER TABLE auth.refresh_tokens OWNER TO postgres;
--
-- Name: TABLE refresh_tokens; Type: COMMENT; Schema: auth; Owner: postgres
--
COMMENT ON TABLE auth.refresh_tokens IS 'Auth: Store of tokens used to refresh JWT tokens once they expire.';
--
-- Name: refresh_tokens_id_seq; Type: SEQUENCE; Schema: auth; Owner: postgres
--
CREATE SEQUENCE auth.refresh_tokens_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE auth.refresh_tokens_id_seq OWNER TO postgres;
--
-- Name: refresh_tokens_id_seq; Type: SEQUENCE OWNED BY; Schema: auth; Owner: postgres
--
ALTER SEQUENCE auth.refresh_tokens_id_seq OWNED BY auth.refresh_tokens.id;
--
-- Name: saml_providers; Type: TABLE; Schema: auth; Owner: postgres
--
CREATE TABLE auth.saml_providers (
id uuid DEFAULT gen_random_uuid() NOT NULL,
sso_provider_id uuid NOT NULL,
entity_id text NOT NULL,
metadata_xml text NOT NULL,
metadata_url text,
attribute_mapping text,
created_at timestamp with time zone,
updated_at timestamp with time zone,
name_id_format text
);
ALTER TABLE auth.saml_providers OWNER TO postgres;
--
-- Name: TABLE saml_providers; Type: COMMENT; Schema: auth; Owner: postgres
--
COMMENT ON TABLE auth.saml_providers IS 'Auth: Manages SAML Identity Provider connections.';
--
-- Name: saml_relay_states; Type: TABLE; Schema: auth; Owner: postgres
--
CREATE TABLE auth.saml_relay_states (
id uuid DEFAULT gen_random_uuid() NOT NULL,
sso_provider_id uuid NOT NULL,
request_id text NOT NULL,
for_email text,
redirect_to text,
created_at timestamp with time zone,
updated_at timestamp with time zone,
flow_state_id uuid
);
ALTER TABLE auth.saml_relay_states OWNER TO postgres;
--
-- Name: TABLE saml_relay_states; Type: COMMENT; Schema: auth; Owner: postgres
--
COMMENT ON TABLE auth.saml_relay_states IS 'Auth: Contains SAML Relay State information for each Service Provider initiated login.';
--
-- Name: schema_migrations; Type: TABLE; Schema: auth; Owner: postgres
--
CREATE TABLE auth.schema_migrations (
version character varying(255) NOT NULL
);
ALTER TABLE auth.schema_migrations OWNER TO postgres;
--
-- Name: TABLE schema_migrations; Type: COMMENT; Schema: auth; Owner: postgres
--
COMMENT ON TABLE auth.schema_migrations IS 'Auth: Manages updates to the auth system.';
--
-- Name: sessions; Type: TABLE; Schema: auth; Owner: postgres
--
CREATE TABLE auth.sessions (
id uuid DEFAULT gen_random_uuid() NOT NULL,
user_id uuid NOT NULL,
issued_at timestamp with time zone,
expires_at timestamp with time zone,
created_at timestamp with time zone,
updated_at timestamp with time zone,
factor_id uuid,
aal public.aal_level,
not_after timestamp with time zone,
refreshed_at timestamp without time zone,
user_agent text,
ip inet,
tag text
);
ALTER TABLE auth.sessions OWNER TO postgres;
--
-- Name: TABLE sessions; Type: COMMENT; Schema: auth; Owner: postgres
--
COMMENT ON TABLE auth.sessions IS 'Auth: Stores session data associated to a user.';
--
-- Name: COLUMN sessions.not_after; Type: COMMENT; Schema: auth; Owner: postgres
--
COMMENT ON COLUMN auth.sessions.not_after IS 'Auth: Not after is a nullable column that contains a timestamp after which the session should be regarded as expired.';
--
-- Name: sso_domains; Type: TABLE; Schema: auth; Owner: postgres
--
CREATE TABLE auth.sso_domains (
id uuid DEFAULT gen_random_uuid() NOT NULL,
sso_provider_id uuid NOT NULL,
domain text NOT NULL,
created_at timestamp with time zone,
updated_at timestamp with time zone
);
ALTER TABLE auth.sso_domains OWNER TO postgres;
--
-- Name: TABLE sso_domains; Type: COMMENT; Schema: auth; Owner: postgres
--
COMMENT ON TABLE auth.sso_domains IS 'Auth: Manages SSO email address domain mapping to an SSO Identity Provider.';
--
-- Name: sso_providers; Type: TABLE; Schema: auth; Owner: postgres
--
CREATE TABLE auth.sso_providers (
id uuid DEFAULT gen_random_uuid() NOT NULL,
resource_id text,
created_at timestamp with time zone,
updated_at timestamp with time zone
);
ALTER TABLE auth.sso_providers OWNER TO postgres;
--
-- Name: TABLE sso_providers; Type: COMMENT; Schema: auth; Owner: postgres
--
COMMENT ON TABLE auth.sso_providers IS 'Auth: Manages SSO identity provider information; see saml_providers for SAML.';
--
-- Name: COLUMN sso_providers.resource_id; Type: COMMENT; Schema: auth; Owner: postgres
--
COMMENT ON COLUMN auth.sso_providers.resource_id IS 'Auth: Uniquely identifies a SSO provider according to a user-chosen resource ID (case insensitive), useful in infrastructure as code.';
--
-- Name: users; Type: TABLE; Schema: auth; Owner: postgres
--
CREATE TABLE auth.users (
instance_id uuid,
id uuid NOT NULL,
aud character varying(255),
role character varying(255),
email character varying(255),
encrypted_password character varying(255),
email_confirmed_at timestamp with time zone,
invited_at timestamp with time zone,
confirmation_token character varying(255),
confirmation_sent_at timestamp with time zone,
recovery_token character varying(255),
recovery_sent_at timestamp with time zone,
email_change_token_new character varying(255),
email_change character varying(255),
email_change_sent_at timestamp with time zone,
last_sign_in_at timestamp with time zone,
raw_app_meta_data jsonb,
raw_user_meta_data jsonb,
is_super_admin boolean,
created_at timestamp with time zone,
updated_at timestamp with time zone,
phone text DEFAULT NULL::character varying,
phone_confirmed_at timestamp with time zone,
phone_change text DEFAULT ''::character varying,
phone_change_token character varying(255) DEFAULT ''::character varying,
phone_change_sent_at timestamp with time zone,
confirmed_at timestamp with time zone GENERATED ALWAYS AS (LEAST(email_confirmed_at, phone_confirmed_at)) STORED,
email_change_token_current character varying(255) DEFAULT ''::character varying,
email_change_confirm_status smallint DEFAULT 0,
banned_until timestamp with time zone,
reauthentication_token character varying(255) DEFAULT ''::character varying,
reauthentication_sent_at timestamp with time zone,
is_sso_user boolean DEFAULT false NOT NULL,
deleted_at timestamp with time zone,
is_anonymous boolean DEFAULT false NOT NULL,
CONSTRAINT users_email_change_confirm_status_check CHECK (((email_change_confirm_status >= 0) AND (email_change_confirm_status <= 2)))
);
ALTER TABLE auth.users OWNER TO postgres;
--
-- Name: TABLE users; Type: COMMENT; Schema: auth; Owner: postgres
--
COMMENT ON TABLE auth.users IS 'Auth: Stores user login data within a secure schema.';
--
-- Name: COLUMN users.is_sso_user; Type: COMMENT; Schema: auth; Owner: postgres
--
COMMENT ON COLUMN auth.users.is_sso_user IS 'Auth: Set this column to true when the account comes from SSO. These accounts can have duplicate emails.';
--
-- Name: audit_log_entries; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.audit_log_entries (
id uuid DEFAULT gen_random_uuid() NOT NULL,
instance_id uuid,
payload jsonb,
created_at timestamp with time zone DEFAULT now(),
ip_address text
);
ALTER TABLE public.audit_log_entries OWNER TO postgres;
--
-- Name: identities; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.identities (
id text NOT NULL,
user_id uuid NOT NULL,
identity_data jsonb NOT NULL,
provider text NOT NULL,
last_sign_in_at timestamp with time zone,
created_at timestamp with time zone,
updated_at timestamp with time zone,
email text,
provider_id text
);
ALTER TABLE public.identities OWNER TO postgres;
--
-- Name: mfa_amr_claims; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.mfa_amr_claims (
session_id uuid NOT NULL,
user_id uuid,
created_at timestamp with time zone DEFAULT now(),
updated_at timestamp with time zone DEFAULT now(),
authentication_method text NOT NULL
);
ALTER TABLE public.mfa_amr_claims OWNER TO postgres;
--
-- Name: migrations; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.migrations (
id integer NOT NULL,
name character varying(100) NOT NULL,
hash character varying(40) NOT NULL,
executed_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP
);
ALTER TABLE public.migrations OWNER TO postgres;
--
-- Name: one_time_tokens; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.one_time_tokens (
id uuid DEFAULT gen_random_uuid() NOT NULL,
instance_id uuid,
user_id uuid,
token_type text,
token_hash text,
revoked boolean DEFAULT false,
created_at timestamp with time zone DEFAULT now(),
updated_at timestamp with time zone DEFAULT now()
);
ALTER TABLE public.one_time_tokens OWNER TO postgres;
--
-- Name: refresh_tokens; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.refresh_tokens (
id uuid DEFAULT gen_random_uuid() NOT NULL,
instance_id uuid,
user_id uuid,
token text,
revoked boolean DEFAULT false,
created_at timestamp with time zone DEFAULT now(),
updated_at timestamp with time zone DEFAULT now(),
parent uuid,
session_id uuid
);
ALTER TABLE public.refresh_tokens OWNER TO postgres;
--
-- Name: schema_migrations; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.schema_migrations (
version character varying(14) NOT NULL
);
ALTER TABLE public.schema_migrations OWNER TO postgres;
--
-- Name: sessions; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.sessions (
id uuid DEFAULT gen_random_uuid() NOT NULL,
user_id uuid,
created_at timestamp with time zone DEFAULT now(),
updated_at timestamp with time zone DEFAULT now(),
factor_id uuid,
aal text,
not_after timestamp with time zone,
refreshed_at timestamp with time zone,
ip_address text,
user_agent text,
tag text,
authentication_method text,
created_by uuid,
updated_by uuid,
ip text
);
ALTER TABLE public.sessions OWNER TO postgres;
--
-- Name: users; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.users (
instance_id uuid,
id uuid NOT NULL,
aud character varying(255),
role character varying(255),
email character varying(255),
encrypted_password character varying(255),
confirmed_at timestamp with time zone,
invited_at timestamp with time zone,
confirmation_token character varying(255),
confirmation_sent_at timestamp with time zone,
recovery_token character varying(255),
recovery_sent_at timestamp with time zone,
email_change_token character varying(255),
email_change character varying(255),
email_change_sent_at timestamp with time zone,
last_sign_in_at timestamp with time zone,
raw_app_meta_data jsonb,
raw_user_meta_data jsonb,
is_super_admin boolean,
created_at timestamp with time zone,
updated_at timestamp with time zone,
banned_until timestamp with time zone,
deleted_at timestamp with time zone,
email_change_confirm_status smallint,
email_change_token_current character varying(255),
email_change_token_new character varying(255),
email_confirmed_at timestamp with time zone,
is_anonymous boolean,
is_sso_user boolean,
phone character varying(15),
phone_change character varying(15),
phone_change_sent_at timestamp with time zone,
phone_change_token character varying(255) DEFAULT ''::character varying,
phone_confirmed_at timestamp with time zone,
reauthentication_token text,
reauthentication_sent_at timestamp with time zone
);
ALTER TABLE public.users OWNER TO postgres;
--
-- Name: refresh_tokens id; Type: DEFAULT; Schema: auth; Owner: postgres
--
ALTER TABLE ONLY auth.refresh_tokens ALTER COLUMN id SET DEFAULT nextval('auth.refresh_tokens_id_seq'::regclass);
--
-- Name: mfa_amr_claims amr_id_pk; Type: CONSTRAINT; Schema: auth; Owner: postgres
--
ALTER TABLE ONLY auth.mfa_amr_claims
ADD CONSTRAINT amr_id_pk PRIMARY KEY (id);
--
-- Name: audit_log_entries audit_log_entries_pkey; Type: CONSTRAINT; Schema: auth; Owner: postgres
--
ALTER TABLE ONLY auth.audit_log_entries
ADD CONSTRAINT audit_log_entries_pkey PRIMARY KEY (id);
--
-- Name: flow_state flow_state_pkey; Type: CONSTRAINT; Schema: auth; Owner: postgres
--
ALTER TABLE ONLY auth.flow_state
ADD CONSTRAINT flow_state_pkey PRIMARY KEY (id);
--
-- Name: identities identities_pkey; Type: CONSTRAINT; Schema: auth; Owner: postgres
--
ALTER TABLE ONLY auth.identities
ADD CONSTRAINT identities_pkey PRIMARY KEY (id);
--
-- Name: instances instances_pkey; Type: CONSTRAINT; Schema: auth; Owner: postgres
--
ALTER TABLE ONLY auth.instances
ADD CONSTRAINT instances_pkey PRIMARY KEY (id);
--
-- Name: mfa_amr_claims mfa_amr_claims_session_id_authentication_method_pkey; Type: CONSTRAINT; Schema: auth; Owner: postgres
--
ALTER TABLE ONLY auth.mfa_amr_claims
ADD CONSTRAINT mfa_amr_claims_session_id_authentication_method_pkey UNIQUE (session_id, authentication_method);
--
-- Name: mfa_challenges mfa_challenges_pkey; Type: CONSTRAINT; Schema: auth; Owner: postgres
--
ALTER TABLE ONLY auth.mfa_challenges
ADD CONSTRAINT mfa_challenges_pkey PRIMARY KEY (id);
--
-- Name: mfa_factors mfa_factors_last_challenged_at_key; Type: CONSTRAINT; Schema: auth; Owner: postgres
--
ALTER TABLE ONLY auth.mfa_factors
ADD CONSTRAINT mfa_factors_last_challenged_at_key UNIQUE (last_challenged_at);
--
-- Name: mfa_factors mfa_factors_pkey; Type: CONSTRAINT; Schema: auth; Owner: postgres
--
ALTER TABLE ONLY auth.mfa_factors
ADD CONSTRAINT mfa_factors_pkey PRIMARY KEY (id);
--
-- Name: one_time_tokens one_time_tokens_pkey; Type: CONSTRAINT; Schema: auth; Owner: postgres
--
ALTER TABLE ONLY auth.one_time_tokens
ADD CONSTRAINT one_time_tokens_pkey PRIMARY KEY (id);
--
-- Name: refresh_tokens refresh_tokens_pkey; Type: CONSTRAINT; Schema: auth; Owner: postgres
--
ALTER TABLE ONLY auth.refresh_tokens
ADD CONSTRAINT refresh_tokens_pkey PRIMARY KEY (id);
--
-- Name: refresh_tokens refresh_tokens_token_unique; Type: CONSTRAINT; Schema: auth; Owner: postgres
--