-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdatabase.sql
151 lines (105 loc) · 4.19 KB
/
database.sql
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
--
-- PostgreSQL database dump
--
-- Dumped from database version 14.5 (Homebrew)
-- Dumped by pg_dump version 14.5 (Homebrew)
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;
SET default_tablespace = '';
SET default_table_access_method = heap;
--
-- Name: owned_titles; Type: TABLE; Schema: public; Owner: wiisoap
--
CREATE TABLE public.owned_titles (
account_id integer NOT NULL,
title_id character varying(16) NOT NULL,
version integer,
item_id integer,
date_purchased timestamp without time zone DEFAULT now() NOT NULL
);
ALTER TABLE public.owned_titles OWNER TO wiisoap;
--
-- Name: service_titles; Type: TABLE; Schema: public; Owner: wiisoap
--
CREATE TABLE public.service_titles (
item_id integer NOT NULL,
price_code integer NOT NULL,
price integer NOT NULL,
title_id character varying(16) NOT NULL,
reference_id character varying(32)
);
ALTER TABLE public.service_titles OWNER TO wiisoap;
--
-- Name: userbase; Type: TABLE; Schema: public; Owner: wiisoap
--
CREATE TABLE public.userbase (
device_id bigint NOT NULL,
device_token character varying(21) NOT NULL,
device_token_hashed character varying(32) NOT NULL,
account_id integer NOT NULL,
region character varying(3),
serial_number character varying(12)
);
ALTER TABLE public.userbase OWNER TO wiisoap;
--
-- Data for Name: owned_titles; Type: TABLE DATA; Schema: public; Owner: wiisoap
--
COPY public.owned_titles (account_id, title_id, version, item_id, date_purchased) FROM stdin;
\.
--
-- Data for Name: service_titles; Type: TABLE DATA; Schema: public; Owner: wiisoap
--
COPY public.service_titles (item_id, price_code, price, title_id, reference_id) FROM stdin;
\.
--
-- Data for Name: userbase; Type: TABLE DATA; Schema: public; Owner: wiisoap
--
COPY public.userbase (device_id, device_token, device_token_hashed, account_id, region, serial_number) FROM stdin;
\.
--
-- Name: service_titles item_id; Type: CONSTRAINT; Schema: public; Owner: wiisoap
--
ALTER TABLE ONLY public.service_titles
ADD CONSTRAINT item_id PRIMARY KEY (item_id);
--
-- Name: service_titles service_titles_reference_id_key; Type: CONSTRAINT; Schema: public; Owner: wiisoap
--
ALTER TABLE ONLY public.service_titles
ADD CONSTRAINT service_titles_reference_id_key UNIQUE (reference_id);
--
-- Name: userbase userbase_pk; Type: CONSTRAINT; Schema: public; Owner: wiisoap
--
ALTER TABLE ONLY public.userbase
ADD CONSTRAINT userbase_pk PRIMARY KEY (account_id);
--
-- Name: owned_titles_account_id_uindex; Type: INDEX; Schema: public; Owner: wiisoap
--
CREATE INDEX owned_titles_account_id_uindex ON public.owned_titles USING btree (account_id);
--
-- Name: userbase_account_id_uindex; Type: INDEX; Schema: public; Owner: wiisoap
--
CREATE UNIQUE INDEX userbase_account_id_uindex ON public.userbase USING btree (account_id);
--
-- Name: userbase_device_id_uindex; Type: INDEX; Schema: public; Owner: wiisoap
--
CREATE UNIQUE INDEX userbase_device_id_uindex ON public.userbase USING btree (device_id);
--
-- Name: userbase_device_token_uindex; Type: INDEX; Schema: public; Owner: wiisoap
--
CREATE UNIQUE INDEX userbase_device_token_uindex ON public.userbase USING btree (device_token);
--
-- Name: owned_titles order_account_ids; Type: FK CONSTRAINT; Schema: public; Owner: wiisoap
--
ALTER TABLE ONLY public.owned_titles
ADD CONSTRAINT order_account_ids FOREIGN KEY (account_id) REFERENCES public.userbase(account_id);
--
-- PostgreSQL database dump complete
--