How to set up user-registration sample with PostgreSQL

There is a well known sample project: https://github.com/cuba-platform/sample-user-registration

In this short topic you will know how to set up PostgreSQL with this sample.

  1. Change Database type to PostgreSQL
  2. Go to Data Model section and call Generate database scripts action.
  3. Switch to init data tab and insert SQL from 30.create-db.sql of HSQL from project.
  4. Change IS_DEFAULT_ROLE for SEC_ROLE to false:
-- default role
insert into SEC_ROLE (ID, VERSION, CREATE_TS, CREATED_BY, NAME, LOC_NAME, DESCRIPTION, ROLE_TYPE, IS_DEFAULT_ROLE)
values ('3ec31528-dc0e-c341-7727-7b46771ae9ff', 2, '2016-11-20 23:11:35', 'u1', 'Users', null, null, 0, false);
  1. Click on Save and Close.
  2. Create database and Run application

There’s nothing in Init data tab
image
Also the file “sample-user-registration\modules\core\db\init\postgres\30.create-db.sql” is empty…

Copy the content of 30.create-db.sql file from core/db/init/hsql and insert here.

Oh about “change it to false” Now I seem to understand I’ve opened a question about it Why in sample user registration you set role manually?