mirror of
https://github.com/WiIIiam278/HuskSync.git
synced 2025-12-26 10:09:10 +00:00
feat: PostgreSQL, Mongo Atlas & Replica Support (#255)
* Started impl for mongo * added docs * refactor of the mongo code, made mongodb artifacts download at run time, tested and working * complete all change requests * remove mongo and bson from relocations as they arnt needed * changed the config * updated docs * not null not null not null not null not null not null not null not null not null not null not null not null not null not null not null not null not null not null not null not null not null not null not null not null * added postgres support (closes https://github.com/WiIIiam278/HuskSync/issues/212) * add support for mongodb atlas, added atlas and postrgres to docs, update the config example in docs, also updates mongodb driver bc apparently i was special and very very out of data * Rework how mongo connections are handled, **breaks config for mongo only**, allows for MongoDB Atlas, normal MongoDb AND MongoDB replica sets via the parameters in advanced mongo settings, added try and catch on all mongo operations so that it actually throws instead of a cutsie little warning * small doc change * whoops forgot to instantiate MongoCollectionHelper, and added missing step from docs for atlas users * why thats a tad embarrassing (grammar mistake) * add cluster id to `/husksync status`, shows "MongoDB Atlas" in status if using mongodb atlas --------- Co-authored-by: William <will27528@gmail.com>
This commit is contained in:
22
common/src/main/resources/database/postgresql_schema.sql
Normal file
22
common/src/main/resources/database/postgresql_schema.sql
Normal file
@@ -0,0 +1,22 @@
|
||||
-- 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 longblob NOT NULL,
|
||||
|
||||
PRIMARY KEY (version_uuid, player_uuid),
|
||||
FOREIGN KEY (player_uuid) REFERENCES "%users_table%" (uuid) ON DELETE CASCADE
|
||||
);
|
||||
Reference in New Issue
Block a user