Postgres
PostgreSQL is a powerful, open source object-relational database system with over 30 years of active development that has earned it a strong reputation for reliability, feature robustness, and performance.
Using Postgres as an alternative to MSSQL
- Open
src/.env.
- Replace the
OWSDBConnectionString
withHost=host.docker.internal;Port=5432;Database=openworldserver;Username=postgres;Password=yourStrong(!)Password;
- Replace the value in OWSDBBackend with postgres
Update database version
-
Open PGAdmin3/4 and connect to localhost using the following credentials:
- Username
- postgres
- Password
- yourStrong(!)Password
-
Run the following SQL statement against the Open World Server database.
SELECT * FROM OWSVersion
-
Compare the OWSDBVersion returned with the SQL update scripts in the
Databases\MSSQL\UpdateScriptsFolder
to see which scripts to run on your database. -
The update scripts have From[SomeVersion]To[SomeVersion] in the name. Run them in order starting with the From[SomeVersion] that matches your OWSDBVersion from the previous step. To run the script open the file, copy the contents from it and run it as a SQL statement against the Open World Server database like you did in step 2. If you are not familiar with SQL please refer to the SQL Tutorial to learn more about it.
Create API Key
-
Open PGAdmin3/4 and connect to localhost using the following credentials:
- Username
- postgres
- Password
- yourStrong(!)Password
-
Run the following SQL statment against the Open World Server database.
(Optional): Replace NULL with a single-quoted UUID. For example ‘00000000-0000-0000-0000-000000000000’::uuid
CALL AddNewCustomer ('CustomerName', 'FirstName', 'LastName', 'Email', 'Password', NULL);
Be sure to replace the values:
- CustomerName
- The nickname or profile name of the customer.
- FirstName
- The firstname of the customer.
- LastName
- The lastname of the customer.
- Enter the mail address of the customer.
- Password
- Enter a secure password.
-
Run the following SQL statment against the Open World Server database to get your API key. Save the key for later.
SELECT CustomerGUID FROM Customers LIMIT 1;