Create Account Management Schema
note
Account Management API is now deprecated and we recommend that you use Account Management functionality built into Elastic Path Commerce 8.2 and later.
Pre-requisites
- Ensure that all requirements described in the Requirements are met
- Ensure that you have the URLs for the Account Management user interface, the Account Management API, and Keycloak
- Ensure that the MySQL compatible service is provisioned and the username, password, and other connectivity details are available
- Ensure that you have access to a machine which has connectivity to the MySQL service and can run Liquibase migrations
- Ensure that Keycloak is configured and deployed
- Ensure that the ID, full name, and e-mail of the seller administrator that you created in Keycloak are available.
- For more information, see the Creating new seller administrator section
Initialize Database schema
- Create a
liquibase.properties
file with the appropriate database access credentials and schema name - Copy the contents of the database folder from the
account-management-1.0.0.zip
andliquibase.properties
files to the computer that execute the schema creation - To create the schema, run the following command:
./liquibase --changeLogFile=database/changelog-master.xml update
- Connect to the database and run the following query:
INSERT INTO TUSER (GUID, IDP_IDENTIFIER, FULL_NAME, EMAIL, USER_TYPE) VALUES(UUID(), "<SELLER_ADMIN_ID>", "<Seller Admin Full Name>", "<Seller Admin Email>", "SELLER_USER");
Validate Database schema
- Verify that the Liquibase command completed without error
- Connect to the MySQL Server and verify that the schema is created
- For this verification, use the MySQL credentials that you use to authenticate the Account Management API service
- Verify that the newly added user is listed in the
TUSER
table
Post deployment
Below are some of the tasks that needs to be done after database schema has been deployed.
Configure Store Access for Associate
An associate can shop from all stores that has store codes in the TSTOREREF
table. If you want to restrict associate’s access to a specific store, remove the appropriate row from the TSTOREREF
table. For a new store, add a row to the Account Management database in the TSTOREREF
table.
Use this procedure to add a new row to configure a store that can be accessed from the Account Management service.
To add a new row to the Account Management database in the TSTOREREF
table, connect to the database and run the following query:
INSERT INTO TSTOREREF (STORECODE) VALUES (<store code from commerce>);
Setup Seller Administrator
Use this procedure to add a new seller administrator who can manage all organizations and division accounts in Account Management service.
- In KeyCloak, create a new user in
Commerce
realm and take a note of the User ID.- For more information about creating a new user in Keycloak, see the steps on Setting up a seller administrator in keycloak
- In the Account Management database in the
TUSER
table, add a new row by running the following query:
INSERT INTO TUSER (GUID, IDP_IDENTIFIER, FULL_NAME, EMAIL, USER_TYPE) VALUES(UUID(), "<SELLER_ADMIN_ID>", "<Seller Admin Full Name>", "<Seller Admin Email>", "SELLER_USER");