9
0
mirror of https://github.com/WiIIiam278/HuskSync.git synced 2025-12-23 08:39:19 +00:00
Files
HuskSync/common/src/main/resources/database/postgresql_schema.sql
Preva1l 2b1e72a42e fix: wrong type in PostgreSQL schema (#299)
* Started impl for mongo

* fix silly mistake with postgresql

* fix silly mistake with postgresql
2024-05-10 19:06:34 +01:00

22 lines
682 B
SQL

-- Create the users table if it does not exist
CREATE TABLE IF NOT EXISTS "%users_table%"
(
uuid uuid NOT NULL UNIQUE,
username varchar(16) NOT NULL,
PRIMARY KEY (uuid)
);
-- Create the user data table if it does not exist
CREATE TABLE IF NOT EXISTS "%user_data_table%"
(
version_uuid uuid NOT NULL UNIQUE,
player_uuid uuid NOT NULL,
timestamp timestamp NOT NULL,
save_cause varchar(32) NOT NULL,
pinned boolean NOT NULL DEFAULT FALSE,
data bytea NOT NULL,
PRIMARY KEY (version_uuid, player_uuid),
FOREIGN KEY (player_uuid) REFERENCES "%users_table%" (uuid) ON DELETE CASCADE
);