annotate db/structure.sql @ 495:92929378413e

Update to latest rails
author nanaya <me@nanaya.net>
date Sun, 15 Dec 2024 22:18:06 +0900
parents 4608d12ebe03
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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;
495
92929378413e Update to latest rails
nanaya <me@nanaya.net>
parents: 463
diff changeset
8 SET xmloption = content;
460
b1ef80121c79 Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff changeset
9 SET client_min_messages = warning;
b1ef80121c79 Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff changeset
10 SET row_security = off;
b1ef80121c79 Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff changeset
11
b1ef80121c79 Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff changeset
12 SET default_tablespace = '';
b1ef80121c79 Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff changeset
13
495
92929378413e Update to latest rails
nanaya <me@nanaya.net>
parents: 463
diff changeset
14 SET default_table_access_method = heap;
460
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 --
b1ef80121c79 Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff changeset
17 -- Name: ar_internal_metadata; Type: TABLE; Schema: public; Owner: -
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
b1ef80121c79 Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff changeset
20 CREATE TABLE public.ar_internal_metadata (
b1ef80121c79 Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff changeset
21 key character varying NOT NULL,
b1ef80121c79 Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff changeset
22 value character varying,
b1ef80121c79 Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff changeset
23 created_at timestamp with time zone NOT NULL,
b1ef80121c79 Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff changeset
24 updated_at timestamp with time zone NOT NULL
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 --
b1ef80121c79 Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff changeset
29 -- Name: pastes; Type: TABLE; Schema: public; Owner: -
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
b1ef80121c79 Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff changeset
32 CREATE TABLE public.pastes (
b1ef80121c79 Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff changeset
33 id integer NOT NULL,
b1ef80121c79 Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff changeset
34 ip character varying(50) NOT NULL,
b1ef80121c79 Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff changeset
35 paste text NOT NULL,
b1ef80121c79 Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff changeset
36 paste_hash character varying(150) NOT NULL,
463
4608d12ebe03 Sync database
nanaya <me@nanaya.pro>
parents: 460
diff changeset
37 created_at timestamp with time zone,
4608d12ebe03 Sync database
nanaya <me@nanaya.pro>
parents: 460
diff changeset
38 updated_at timestamp with time zone,
460
b1ef80121c79 Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff changeset
39 key character varying(100),
b1ef80121c79 Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff changeset
40 secret character varying(100),
b1ef80121c79 Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff changeset
41 language character varying(100)
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 --
b1ef80121c79 Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff changeset
46 -- Name: pastes_id_seq; Type: SEQUENCE; Schema: public; Owner: -
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
b1ef80121c79 Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff changeset
49 CREATE SEQUENCE public.pastes_id_seq
b1ef80121c79 Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff changeset
50 AS integer
b1ef80121c79 Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff changeset
51 START WITH 1
b1ef80121c79 Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff changeset
52 INCREMENT BY 1
b1ef80121c79 Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff changeset
53 NO MINVALUE
b1ef80121c79 Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff changeset
54 NO MAXVALUE
b1ef80121c79 Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff changeset
55 CACHE 1;
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 --
b1ef80121c79 Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff changeset
59 -- 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
60 --
b1ef80121c79 Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff changeset
61
b1ef80121c79 Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff changeset
62 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
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 --
b1ef80121c79 Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff changeset
66 -- Name: schema_migrations; Type: TABLE; Schema: public; Owner: -
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
b1ef80121c79 Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff changeset
69 CREATE TABLE public.schema_migrations (
b1ef80121c79 Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff changeset
70 version character varying NOT NULL
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 --
b1ef80121c79 Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff changeset
75 -- Name: pastes id; Type: DEFAULT; Schema: public; Owner: -
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
b1ef80121c79 Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff changeset
78 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
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 --
b1ef80121c79 Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff changeset
82 -- 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
83 --
b1ef80121c79 Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff changeset
84
b1ef80121c79 Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff changeset
85 ALTER TABLE ONLY public.ar_internal_metadata
b1ef80121c79 Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff changeset
86 ADD CONSTRAINT ar_internal_metadata_pkey PRIMARY KEY (key);
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 --
b1ef80121c79 Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff changeset
90 -- Name: pastes pastes_pkey; Type: CONSTRAINT; Schema: public; Owner: -
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
b1ef80121c79 Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff changeset
93 ALTER TABLE ONLY public.pastes
b1ef80121c79 Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff changeset
94 ADD CONSTRAINT pastes_pkey PRIMARY KEY (id);
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 --
b1ef80121c79 Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff changeset
98 -- 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
99 --
b1ef80121c79 Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff changeset
100
b1ef80121c79 Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff changeset
101 ALTER TABLE ONLY public.schema_migrations
b1ef80121c79 Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff changeset
102 ADD CONSTRAINT schema_migrations_pkey PRIMARY KEY (version);
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
b1ef80121c79 Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff changeset
105 --
463
4608d12ebe03 Sync database
nanaya <me@nanaya.pro>
parents: 460
diff changeset
106 -- 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
107 --
b1ef80121c79 Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff changeset
108
463
4608d12ebe03 Sync database
nanaya <me@nanaya.pro>
parents: 460
diff changeset
109 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
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 --
b1ef80121c79 Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff changeset
113 -- Name: index_pastes_on_secret; Type: INDEX; Schema: public; Owner: -
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
b1ef80121c79 Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff changeset
116 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
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 --
b1ef80121c79 Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff changeset
120 -- PostgreSQL database dump complete
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
b1ef80121c79 Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff changeset
123 SET search_path TO "$user", public;
b1ef80121c79 Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff changeset
124
b1ef80121c79 Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff changeset
125 INSERT INTO "schema_migrations" (version) VALUES
495
92929378413e Update to latest rails
nanaya <me@nanaya.net>
parents: 463
diff changeset
126 ('20180625074738'),
92929378413e Update to latest rails
nanaya <me@nanaya.net>
parents: 463
diff changeset
127 ('20150916161622'),
92929378413e Update to latest rails
nanaya <me@nanaya.net>
parents: 463
diff changeset
128 ('20150914054154'),
92929378413e Update to latest rails
nanaya <me@nanaya.net>
parents: 463
diff changeset
129 ('20130512032335'),
460
b1ef80121c79 Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff changeset
130 ('20130511133450'),
495
92929378413e Update to latest rails
nanaya <me@nanaya.net>
parents: 463
diff changeset
131 ('20130201150322'),
92929378413e Update to latest rails
nanaya <me@nanaya.net>
parents: 463
diff changeset
132 ('20120905074204'),
92929378413e Update to latest rails
nanaya <me@nanaya.net>
parents: 463
diff changeset
133 ('20120905072325'),
92929378413e Update to latest rails
nanaya <me@nanaya.net>
parents: 463
diff changeset
134 ('20120826182012'),
92929378413e Update to latest rails
nanaya <me@nanaya.net>
parents: 463
diff changeset
135 ('20120826180414');
460
b1ef80121c79 Update to use correct timestamp datatype
nanaya <me@nanaya.pro>
parents:
diff changeset
136