Skip to content

Commit 765d9b6

Browse files
committed
Fix structure.sql
1 parent 4ab1f74 commit 765d9b6

File tree

1 file changed

+58
-62
lines changed

1 file changed

+58
-62
lines changed

db/main/structure.sql

Lines changed: 58 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ SET client_encoding = 'UTF8';
55
SET standard_conforming_strings = on;
66
SELECT pg_catalog.set_config('search_path', '', false);
77
SET check_function_bodies = false;
8+
SET xmloption = content;
89
SET client_min_messages = warning;
910
SET row_security = off;
1011

@@ -896,6 +897,41 @@ CREATE TABLE public.ar_internal_metadata (
896897
);
897898

898899

900+
--
901+
-- Name: audits; Type: TABLE; Schema: public; Owner: -
902+
--
903+
904+
CREATE TABLE public.audits (
905+
id bigint NOT NULL,
906+
owner_id integer,
907+
owner_type character varying,
908+
created_at timestamp without time zone,
909+
change_source character varying,
910+
source_changes json,
911+
source_id integer,
912+
source_type character varying
913+
);
914+
915+
916+
--
917+
-- Name: audits_id_seq; Type: SEQUENCE; Schema: public; Owner: -
918+
--
919+
920+
CREATE SEQUENCE public.audits_id_seq
921+
START WITH 1
922+
INCREMENT BY 1
923+
NO MINVALUE
924+
NO MAXVALUE
925+
CACHE 1;
926+
927+
928+
--
929+
-- Name: audits_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
930+
--
931+
932+
ALTER SEQUENCE public.audits_id_seq OWNED BY public.audits.id;
933+
934+
899935
--
900936
-- Name: beta_features; Type: TABLE; Schema: public; Owner: -
901937
--
@@ -1041,8 +1077,8 @@ ALTER SEQUENCE public.broadcasts_id_seq OWNED BY public.broadcasts.id;
10411077
--
10421078

10431079
CREATE TABLE public.build_backups (
1044-
id bigint NOT NULL,
1045-
repository_id bigint,
1080+
id integer NOT NULL,
1081+
repository_id integer,
10461082
file_name character varying,
10471083
created_at timestamp without time zone
10481084
);
@@ -1479,8 +1515,8 @@ CREATE TABLE public.deleted_jobs (
14791515
com_id integer,
14801516
config_id integer,
14811517
restarted_at timestamp without time zone,
1482-
restarted_by integer DEFAULT NULL,
1483-
priority integer
1518+
priority integer,
1519+
restarted_by integer
14841520
);
14851521

14861522

@@ -1612,7 +1648,6 @@ CREATE TABLE public.deleted_requests (
16121648
config_id integer,
16131649
yaml_config_id integer,
16141650
github_guid text,
1615-
pull_request_mergeable_state character varying,
16161651
pull_request_mergeable character varying
16171652
);
16181653

@@ -1937,8 +1972,8 @@ CREATE TABLE public.jobs (
19371972
com_id integer,
19381973
config_id integer,
19391974
restarted_at timestamp without time zone,
1940-
restarted_by integer DEFAULT NULL,
1941-
priority integer
1975+
priority integer,
1976+
restarted_by integer
19421977
);
19431978

19441979

@@ -2503,7 +2538,6 @@ CREATE TABLE public.requests (
25032538
config_id integer,
25042539
yaml_config_id integer,
25052540
github_guid text,
2506-
pull_request_mergeable_state character varying,
25072541
pull_request_mergeable character varying
25082542
);
25092543

@@ -3023,45 +3057,17 @@ ALTER SEQUENCE public.users_id_seq OWNED BY public.users.id;
30233057

30243058

30253059
--
3026-
-- Name: audits; Type: TABLE; Schema: public; Owner: -
3027-
--
3028-
3029-
CREATE TABLE public.audits (
3030-
id integer NOT NULL,
3031-
owner_id integer NOT NULL,
3032-
owner_type character varying,
3033-
created_at timestamp without time zone NOT NULL,
3034-
change_source character varying,
3035-
source_changes jsonb NOT NULL,
3036-
source_id integer NOT NULL,
3037-
source_type character varying
3038-
);
3039-
3040-
3041-
--
3042-
-- Name: audits_id_seq; Type: SEQUENCE; Schema: public; Owner: -
3043-
--
3044-
3045-
CREATE SEQUENCE public.audits_id_seq
3046-
START WITH 1
3047-
INCREMENT BY 1
3048-
NO MINVALUE
3049-
NO MAXVALUE
3050-
CACHE 1;
3051-
3052-
3053-
--
3054-
-- Name: audits_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
3060+
-- Name: abuses id; Type: DEFAULT; Schema: public; Owner: -
30553061
--
30563062

3057-
ALTER SEQUENCE public.audits_id_seq OWNED BY public.audits.id;
3063+
ALTER TABLE ONLY public.abuses ALTER COLUMN id SET DEFAULT nextval('public.abuses_id_seq'::regclass);
30583064

30593065

30603066
--
3061-
-- Name: abuses id; Type: DEFAULT; Schema: public; Owner: -
3067+
-- Name: audits id; Type: DEFAULT; Schema: public; Owner: -
30623068
--
30633069

3064-
ALTER TABLE ONLY public.abuses ALTER COLUMN id SET DEFAULT nextval('public.abuses_id_seq'::regclass);
3070+
ALTER TABLE ONLY public.audits ALTER COLUMN id SET DEFAULT nextval('public.audits_id_seq'::regclass);
30653071

30663072

30673073
--
@@ -3372,12 +3378,6 @@ ALTER TABLE ONLY public.user_utm_params ALTER COLUMN id SET DEFAULT nextval('pub
33723378
ALTER TABLE ONLY public.users ALTER COLUMN id SET DEFAULT nextval('public.users_id_seq'::regclass);
33733379

33743380

3375-
--
3376-
-- Name: audits id; Type: DEFAULT; Schema: public; Owner: -
3377-
--
3378-
3379-
ALTER TABLE ONLY public.audits ALTER COLUMN id SET DEFAULT nextval('public.audits_id_seq'::regclass);
3380-
33813381
--
33823382
-- Name: abuses abuses_pkey; Type: CONSTRAINT; Schema: public; Owner: -
33833383
--
@@ -3394,6 +3394,14 @@ ALTER TABLE ONLY public.ar_internal_metadata
33943394
ADD CONSTRAINT ar_internal_metadata_pkey PRIMARY KEY (key);
33953395

33963396

3397+
--
3398+
-- Name: audits audits_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3399+
--
3400+
3401+
ALTER TABLE ONLY public.audits
3402+
ADD CONSTRAINT audits_pkey PRIMARY KEY (id);
3403+
3404+
33973405
--
33983406
-- Name: beta_features beta_features_pkey; Type: CONSTRAINT; Schema: public; Owner: -
33993407
--
@@ -3770,14 +3778,6 @@ ALTER TABLE ONLY public.users
37703778
ADD CONSTRAINT users_pkey PRIMARY KEY (id);
37713779

37723780

3773-
--
3774-
-- Name: audits audits_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3775-
--
3776-
3777-
ALTER TABLE ONLY public.audits
3778-
ADD CONSTRAINT audits_pkey PRIMARY KEY (id);
3779-
3780-
37813781
--
37823782
-- Name: github_id_installations_idx; Type: INDEX; Schema: public; Owner: -
37833783
--
@@ -3869,13 +3869,6 @@ CREATE INDEX index_branches_on_repository_id_and_name_and_id ON public.branches
38693869
CREATE INDEX index_broadcasts_on_recipient_id_and_recipient_type ON public.broadcasts USING btree (recipient_id, recipient_type);
38703870

38713871

3872-
--
3873-
-- Name: index_build_backups_on_repository_id; Type: INDEX; Schema: public; Owner: -
3874-
--
3875-
3876-
CREATE INDEX index_build_backups_on_repository_id ON public.build_backups USING btree (repository_id);
3877-
3878-
38793872
--
38803873
-- Name: index_build_configs_on_com_id; Type: INDEX; Schema: public; Owner: -
38813874
--
@@ -5913,6 +5906,9 @@ INSERT INTO "schema_migrations" (version) VALUES
59135906
('20202427123653'),
59145907
('20210203130200'),
59155908
('20210203143155'),
5916-
('20210203143406');
5909+
('20210203143406'),
5910+
('20210614140633'),
5911+
('20220621151453'),
5912+
('20220722162400');
59175913

59185914

0 commit comments

Comments
 (0)