mirror of
https://github.com/WiIIiam278/HuskSync.git
synced 2025-12-23 08:39:19 +00:00
* Started impl for mongo * fix silly mistake with postgresql * fix silly mistake with postgresql
22 lines
682 B
SQL
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
|
|
); |