Wiki

Clone wiki

Creedo / setup / Database initialization

[ Home | Developer Setup ]

Database Initialization

There is a web service that allows you to load database initialization scripts into the currently active database. The database scripts should be located under database/name/ where the name can vary. By setting the property "creedo.plugin.active" in your application properties file, the database file folder is determined. If you use the plugin "default", then all SQL files in database/default are applied in order.

Initialization service

You can call the initalization service after application startup. For this call the URL:

http://localhost:8080/Creedo/root/initDatabase.htm?adminpass=YourAdminPassword&adminmail=Your@Mail.com&setuppw=YourSetupPw

The "adminmail" and "adminpass" are the account and password that you use to log in Creedo. The "setuppw" is the Creedo setup password which is defined by default in field "creedo.setup.pass" of the file "src/main/resources/default.properties".

First thing is that it will drop the current database schema. Then it will load all SQL files contained in the directory, sort by name and execute sequentially.

Incremental update

If you want to apply SQL files on an existing database, you can tell the service to not drop the database before applying the scripts. Call the URL with an additional increment=true parameter so that it looks like this:

http://localhost:8080/Creedo/root/initDatabase.htm?adminpass=YourAdminPassword&adminmail=Your@Mail.com&setuppw=YourSetupPw&increment=true

Use this functionality e.g. to update your users table with your local users.

Updated