Setting up a redshift user and database with the required permissions for the site to function correctly.
First we need to ensure that One Model can access your redshift cluster. This would either mean that your redshift cluster has open access, or that you have whitelisted the One Model servers to use it. To get the IP to whitelist for your region, please contact support.
Next we need to setup the user that One Model will connect to your redshift cluster with. To do that we can use the following SQL statement. In all of the following scripts you will need to replace %YourUsernme% with the name of the user that you are creating, %YourPassword% with the password that you are generating and %YourDatabaseName% with the name of the database you are creating.
CREATE USER %YourUsernme% with PASSWORD '%YourPassword%' CREATEUSER;
Next we need to setup the permissions to allow the user to read the system tables. This is required for some of the sites functions to work properly.
GRANT USAGE ON SCHEMA information_schema TO %YourUsernme%;
GRANT USAGE ON SCHEMA pg_catalog TO %YourUsernme%;
GRANT SELECT ON ALL TABLES IN SCHEMA information_schema TO %YourUsernme%;
GRANT SELECT ON ALL TABLES IN SCHEMA pg_catalog TO %YourUsernme%;
The last step is to create a new database on redshift to destinate all of the data to. We recommend making the user that you have created the owner of the database so that we can perform all of the required functions to objects within it.
CREATE DATABASE %YourDatabaseName% WITH OWNER = %YourUsernme%;