Page 1 of 1

MySQL: Creating the Broadleaf DB Schema (initial)

Posted: Fri Jul 17, 2015 2:10 am
by blondeMatrix
Hello All,

Having built the Broadleaf WARs, I would simply like to deploy to my web server and have Broadleaf create ALL tables necessary to run the demo Heat Clinic application. Next, I intend to modify the products, categories and so forth, and thereby transition to a true 'production' shopping site. This seems to be in accord with advice on this site for getting set up with a working Broadleaf shopping site.

Evidentally Broadleaf doesn't automatically fully create the Broadleaf database schema when deployed and run for the first time. Firstly, it seems that three vital SQL files are missing from the Broadleaf installation:

load_admin_menu.sql
load_admin_permissions.sql
load_admin_roles.sql

Moreover, it appears that Broadleaf will only run the necessary SQL DB schema creation files when run in 'development' mode. Is this correct?

How do you suggest I configure Broadleaf's runtime properties to accomplish this very typical scenario? Is it best to add the three abovementioned SQL scripts to the WAR, or manually import/run them prior to starting up Broadleaf for the first time?

Thanks in advance for any help. :-)

Regards,

Chris.

Re: MySQL: Creating the Broadleaf DB Schema (initial)

Posted: Mon Jul 27, 2015 4:48 am
by phillipuniverse
Change blPU.hibernate.hbm2ddl.auto=create in the enviroment properties file that you are deploying Broadleaf to. For instance, if you put in -Druntime.environment=staging then modify staging.properties to put that value.

Be warned, this will recreate all tables every time the server starts up. You should probably do this once, shut down, and then remove it.