Mercurial > zeropaste
annotate db/structure.sql @ 481:88fd5722fcb3
Update defaults
author | nanaya <me@nanaya.pro> |
---|---|
date | Sun, 28 Nov 2021 19:45:05 +0900 |
parents | 4608d12ebe03 |
children |
rev | line source |
---|---|
460
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
1 SET statement_timeout = 0; |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
2 SET lock_timeout = 0; |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
3 SET idle_in_transaction_session_timeout = 0; |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
4 SET client_encoding = 'UTF8'; |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
5 SET standard_conforming_strings = on; |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
6 SELECT pg_catalog.set_config('search_path', '', false); |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
7 SET check_function_bodies = false; |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
8 SET client_min_messages = warning; |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
9 SET row_security = off; |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
10 |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
11 SET default_tablespace = ''; |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
12 |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
13 SET default_with_oids = false; |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
14 |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
15 -- |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
16 -- Name: ar_internal_metadata; Type: TABLE; Schema: public; Owner: - |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
17 -- |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
18 |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
19 CREATE TABLE public.ar_internal_metadata ( |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
20 key character varying NOT NULL, |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
21 value character varying, |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
22 created_at timestamp with time zone NOT NULL, |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
23 updated_at timestamp with time zone NOT NULL |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
24 ); |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
25 |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
26 |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
27 -- |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
28 -- Name: pastes; Type: TABLE; Schema: public; Owner: - |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
29 -- |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
30 |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
31 CREATE TABLE public.pastes ( |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
32 id integer NOT NULL, |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
33 ip character varying(50) NOT NULL, |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
34 paste text NOT NULL, |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
35 paste_hash character varying(150) NOT NULL, |
463 | 36 created_at timestamp with time zone, |
37 updated_at timestamp with time zone, | |
460
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
38 key character varying(100), |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
39 secret character varying(100), |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
40 language character varying(100) |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
41 ); |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
42 |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
43 |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
44 -- |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
45 -- Name: pastes_id_seq; Type: SEQUENCE; Schema: public; Owner: - |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
46 -- |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
47 |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
48 CREATE SEQUENCE public.pastes_id_seq |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
49 AS integer |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
50 START WITH 1 |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
51 INCREMENT BY 1 |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
52 NO MINVALUE |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
53 NO MAXVALUE |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
54 CACHE 1; |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
55 |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
56 |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
57 -- |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
58 -- Name: pastes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
59 -- |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
60 |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
61 ALTER SEQUENCE public.pastes_id_seq OWNED BY public.pastes.id; |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
62 |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
63 |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
64 -- |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
65 -- Name: schema_migrations; Type: TABLE; Schema: public; Owner: - |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
66 -- |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
67 |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
68 CREATE TABLE public.schema_migrations ( |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
69 version character varying NOT NULL |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
70 ); |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
71 |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
72 |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
73 -- |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
74 -- Name: pastes id; Type: DEFAULT; Schema: public; Owner: - |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
75 -- |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
76 |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
77 ALTER TABLE ONLY public.pastes ALTER COLUMN id SET DEFAULT nextval('public.pastes_id_seq'::regclass); |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
78 |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
79 |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
80 -- |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
81 -- Name: ar_internal_metadata ar_internal_metadata_pkey; Type: CONSTRAINT; Schema: public; Owner: - |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
82 -- |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
83 |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
84 ALTER TABLE ONLY public.ar_internal_metadata |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
85 ADD CONSTRAINT ar_internal_metadata_pkey PRIMARY KEY (key); |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
86 |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
87 |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
88 -- |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
89 -- Name: pastes pastes_pkey; Type: CONSTRAINT; Schema: public; Owner: - |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
90 -- |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
91 |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
92 ALTER TABLE ONLY public.pastes |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
93 ADD CONSTRAINT pastes_pkey PRIMARY KEY (id); |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
94 |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
95 |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
96 -- |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
97 -- Name: schema_migrations schema_migrations_pkey; Type: CONSTRAINT; Schema: public; Owner: - |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
98 -- |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
99 |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
100 ALTER TABLE ONLY public.schema_migrations |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
101 ADD CONSTRAINT schema_migrations_pkey PRIMARY KEY (version); |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
102 |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
103 |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
104 -- |
463 | 105 -- Name: index_pastes_on_ip_and_paste_hash; Type: INDEX; Schema: public; Owner: - |
460
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
106 -- |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
107 |
463 | 108 CREATE UNIQUE INDEX index_pastes_on_ip_and_paste_hash ON public.pastes USING btree (ip, paste_hash); |
460
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
109 |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
110 |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
111 -- |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
112 -- Name: index_pastes_on_secret; Type: INDEX; Schema: public; Owner: - |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
113 -- |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
114 |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
115 CREATE INDEX index_pastes_on_secret ON public.pastes USING btree (secret); |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
116 |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
117 |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
118 -- |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
119 -- PostgreSQL database dump complete |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
120 -- |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
121 |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
122 SET search_path TO "$user", public; |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
123 |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
124 INSERT INTO "schema_migrations" (version) VALUES |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
125 ('20120826180414'), |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
126 ('20120826182012'), |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
127 ('20120905072325'), |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
128 ('20120905074204'), |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
129 ('20130201150322'), |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
130 ('20130511133450'), |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
131 ('20130512032335'), |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
132 ('20150914054154'), |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
133 ('20150916161622'), |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
134 ('20180625074738'); |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
135 |
b1ef80121c79
Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff
changeset
|
136 |