Creating the database schema script
You can create the database schema script by using the gen-create-schema Ant task.
Procedure
To create the SQL script that is necessary to create or
update the database schema, run the gen-create-schema Ant
task with these parameters:
- -Dserver.url=<server url>
- -DdatasourceName=<data source name>
- -DextensionModel=<model file>
- The model description (.brmx extension).
- -DextensionData=<data file>
- The model data description (.brdx extension).
- [-DdbSchemaName=<database schema name>]
- You can use this optional parameter to specify the database schema name in which the Decision Center tables are stored. If you do not specify the parameter, Decision Center uses the database user name as the schema name. However, some databases allow some users to access several schemas, and the default schema is not always named the same as the user.
- [-DoutputFile=<SQL file>]
- The name of the file that stores the generated SQL script. If this parameter is not specified, the task creates a file named output.sql in the directory that is defined as basedir in the build.xml file.
ant gen-create-schema -DextensionModel=my_model_file.brmx -DextensionData=my_data_file.brdx -DoutputFile=my_sql_file.sql
Results
- The task connects to the specified data source from the application server.
- The task checks whether this data source points to an existing
Decision
Center
database.
- If a database does not exist, the task builds the SQL script to create a fresh database schema to store the model.
- If a database does exist, the task builds the SQL script that is necessary to update the existing database schema.