comparison db/structure.sql @ 460:b1ef80121c79

Update to use correct timestamp datatype Use sql dump instead of ruby because zone info would be lost otherwise.
author nanaya <me@nanaya.pro>
date Mon, 25 Jun 2018 16:53:47 +0900
parents
children 4608d12ebe03
comparison
equal deleted inserted replaced
459:07d6c6639adf 460:b1ef80121c79
1 SET statement_timeout = 0;
2 SET lock_timeout = 0;
3 SET idle_in_transaction_session_timeout = 0;
4 SET client_encoding = 'UTF8';
5 SET standard_conforming_strings = on;
6 SELECT pg_catalog.set_config('search_path', '', false);
7 SET check_function_bodies = false;
8 SET client_min_messages = warning;
9 SET row_security = off;
10
11 --
12 -- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: -
13 --
14
15 CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
16
17
18 --
19 -- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner: -
20 --
21
22 COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
23
24
25 --
26 -- Name: hstore; Type: EXTENSION; Schema: -; Owner: -
27 --
28
29 CREATE EXTENSION IF NOT EXISTS hstore WITH SCHEMA public;
30
31
32 --
33 -- Name: EXTENSION hstore; Type: COMMENT; Schema: -; Owner: -
34 --
35
36 COMMENT ON EXTENSION hstore IS 'data type for storing sets of (key, value) pairs';
37
38
39 SET default_tablespace = '';
40
41 SET default_with_oids = false;
42
43 --
44 -- Name: ar_internal_metadata; Type: TABLE; Schema: public; Owner: -
45 --
46
47 CREATE TABLE public.ar_internal_metadata (
48 key character varying NOT NULL,
49 value character varying,
50 created_at timestamp with time zone NOT NULL,
51 updated_at timestamp with time zone NOT NULL
52 );
53
54
55 --
56 -- Name: pastes; Type: TABLE; Schema: public; Owner: -
57 --
58
59 CREATE TABLE public.pastes (
60 id integer NOT NULL,
61 ip character varying(50) NOT NULL,
62 paste text NOT NULL,
63 paste_hash character varying(150) NOT NULL,
64 created_at timestamp with time zone NOT NULL,
65 updated_at timestamp with time zone NOT NULL,
66 key character varying(100),
67 secret character varying(100),
68 language character varying(100)
69 );
70
71
72 --
73 -- Name: pastes_id_seq; Type: SEQUENCE; Schema: public; Owner: -
74 --
75
76 CREATE SEQUENCE public.pastes_id_seq
77 AS integer
78 START WITH 1
79 INCREMENT BY 1
80 NO MINVALUE
81 NO MAXVALUE
82 CACHE 1;
83
84
85 --
86 -- Name: pastes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
87 --
88
89 ALTER SEQUENCE public.pastes_id_seq OWNED BY public.pastes.id;
90
91
92 --
93 -- Name: schema_migrations; Type: TABLE; Schema: public; Owner: -
94 --
95
96 CREATE TABLE public.schema_migrations (
97 version character varying NOT NULL
98 );
99
100
101 --
102 -- Name: pastes id; Type: DEFAULT; Schema: public; Owner: -
103 --
104
105 ALTER TABLE ONLY public.pastes ALTER COLUMN id SET DEFAULT nextval('public.pastes_id_seq'::regclass);
106
107
108 --
109 -- Name: ar_internal_metadata ar_internal_metadata_pkey; Type: CONSTRAINT; Schema: public; Owner: -
110 --
111
112 ALTER TABLE ONLY public.ar_internal_metadata
113 ADD CONSTRAINT ar_internal_metadata_pkey PRIMARY KEY (key);
114
115
116 --
117 -- Name: pastes pastes_pkey; Type: CONSTRAINT; Schema: public; Owner: -
118 --
119
120 ALTER TABLE ONLY public.pastes
121 ADD CONSTRAINT pastes_pkey PRIMARY KEY (id);
122
123
124 --
125 -- Name: schema_migrations schema_migrations_pkey; Type: CONSTRAINT; Schema: public; Owner: -
126 --
127
128 ALTER TABLE ONLY public.schema_migrations
129 ADD CONSTRAINT schema_migrations_pkey PRIMARY KEY (version);
130
131
132 --
133 -- Name: index_pastes_on_ip_and_hash; Type: INDEX; Schema: public; Owner: -
134 --
135
136 CREATE UNIQUE INDEX index_pastes_on_ip_and_hash ON public.pastes USING btree (ip, paste_hash);
137
138
139 --
140 -- Name: index_pastes_on_secret; Type: INDEX; Schema: public; Owner: -
141 --
142
143 CREATE INDEX index_pastes_on_secret ON public.pastes USING btree (secret);
144
145
146 --
147 -- PostgreSQL database dump complete
148 --
149
150 SET search_path TO "$user", public;
151
152 INSERT INTO "schema_migrations" (version) VALUES
153 ('20120826180414'),
154 ('20120826182012'),
155 ('20120905072325'),
156 ('20120905074204'),
157 ('20130201150322'),
158 ('20130511133450'),
159 ('20130512032335'),
160 ('20150914054154'),
161 ('20150916161622'),
162 ('20180625074738');
163
164