Update database.sql

Upload new database schema
This commit is contained in:
Ocarinaoftime 2025-04-25 11:38:58 -04:00 committed by GitHub
parent 912816b90c
commit 169573c69f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2,12 +2,13 @@
-- PostgreSQL database dump -- PostgreSQL database dump
-- --
-- Dumped from database version 14.5 (Homebrew) -- Dumped from database version 17.4 (Ubuntu 17.4-1.pgdg22.04+2)
-- Dumped by pg_dump version 14.5 (Homebrew) -- Dumped by pg_dump version 17.4 (Ubuntu 17.4-1.pgdg22.04+2)
SET statement_timeout = 0; SET statement_timeout = 0;
SET lock_timeout = 0; SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0; SET idle_in_transaction_session_timeout = 0;
SET transaction_timeout = 0;
SET client_encoding = 'UTF8'; SET client_encoding = 'UTF8';
SET standard_conforming_strings = on; SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false); SELECT pg_catalog.set_config('search_path', '', false);
@ -20,16 +21,29 @@ SET default_tablespace = '';
SET default_table_access_method = heap; SET default_table_access_method = heap;
--
-- Name: gifted_titles; Type: TABLE; Schema: public; Owner: wiisoap
--
CREATE TABLE public.gifted_titles (
title_id character(16) NOT NULL,
trans_id character(10) NOT NULL,
friend_code character(16)
);
ALTER TABLE public.gifted_titles OWNER TO wiisoap;
-- --
-- Name: owned_titles; Type: TABLE; Schema: public; Owner: wiisoap -- Name: owned_titles; Type: TABLE; Schema: public; Owner: wiisoap
-- --
CREATE TABLE public.owned_titles ( CREATE TABLE public.owned_titles (
account_id integer NOT NULL, account_id integer NOT NULL,
title_id character varying(16) NOT NULL, title_id character varying(16) NOT NULL,
version integer, version integer,
item_id integer, item_id integer,
date_purchased timestamp without time zone DEFAULT now() NOT NULL date_purchased timestamp without time zone DEFAULT now() NOT NULL
); );
@ -40,11 +54,11 @@ ALTER TABLE public.owned_titles OWNER TO wiisoap;
-- --
CREATE TABLE public.service_titles ( CREATE TABLE public.service_titles (
item_id integer NOT NULL, item_id integer NOT NULL,
price_code integer NOT NULL, price_code integer NOT NULL,
price integer NOT NULL, price integer NOT NULL,
title_id character varying(16) NOT NULL, title_id character varying(16) NOT NULL,
reference_id character varying(32) reference_id character varying(32)
); );
@ -55,40 +69,20 @@ ALTER TABLE public.service_titles OWNER TO wiisoap;
-- --
CREATE TABLE public.userbase ( CREATE TABLE public.userbase (
device_id bigint NOT NULL, device_id bigint NOT NULL,
device_token character varying(21) NOT NULL, device_token character varying(21) NOT NULL,
device_token_hashed character varying(32) NOT NULL, device_token_hashed character varying(32) NOT NULL,
account_id integer NOT NULL, account_id integer NOT NULL,
region character varying(3), region character varying(3),
serial_number character varying(12) serial_number character varying(12),
points character varying(6),
altregion text DEFAULT 'N/A'::text,
og_title character varying(255) DEFAULT 0
); );
ALTER TABLE public.userbase OWNER TO wiisoap; 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 -- Name: service_titles item_id; Type: CONSTRAINT; Schema: public; Owner: wiisoap
-- --
@ -96,6 +90,7 @@ COPY public.userbase (device_id, device_token, device_token_hashed, account_id,
ALTER TABLE ONLY public.service_titles ALTER TABLE ONLY public.service_titles
ADD CONSTRAINT item_id PRIMARY KEY (item_id); ADD CONSTRAINT item_id PRIMARY KEY (item_id);
-- --
-- Name: service_titles service_titles_reference_id_key; Type: CONSTRAINT; Schema: public; Owner: wiisoap -- Name: service_titles service_titles_reference_id_key; Type: CONSTRAINT; Schema: public; Owner: wiisoap
-- --
@ -103,6 +98,7 @@ ALTER TABLE ONLY public.service_titles
ALTER TABLE ONLY public.service_titles ALTER TABLE ONLY public.service_titles
ADD CONSTRAINT service_titles_reference_id_key UNIQUE (reference_id); ADD CONSTRAINT service_titles_reference_id_key UNIQUE (reference_id);
-- --
-- Name: userbase userbase_pk; Type: CONSTRAINT; Schema: public; Owner: wiisoap -- Name: userbase userbase_pk; Type: CONSTRAINT; Schema: public; Owner: wiisoap
-- --
@ -138,6 +134,7 @@ CREATE UNIQUE INDEX userbase_device_id_uindex ON public.userbase USING btree (de
CREATE UNIQUE INDEX userbase_device_token_uindex ON public.userbase USING btree (device_token); 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 -- Name: owned_titles order_account_ids; Type: FK CONSTRAINT; Schema: public; Owner: wiisoap
-- --
@ -148,4 +145,5 @@ ALTER TABLE ONLY public.owned_titles
-- --
-- PostgreSQL database dump complete -- PostgreSQL database dump complete
-- --