RISE to Bloome Software
Log In    
Home
RISE
Expand RISERISE
Marshal
Download
 
 
r2bsoftware.se r2bsoftware.se
 
 
 
Click to hide navigation tree
Database model
A database model, or Relation Database Model, can be generated from your information model by selecting how to generate it and a code generator to use. A database model can be generated either directly to file, by the RISE Editor itself, or by sending the model to a RISE Server for generation, see Using the RISE Server for more details.
 
Generate database script
To generate database code directly to file select menu item "Generate to File" in the Tools menu of the RISE Editor. This will display the below generator dialog. Select a code generator and, if needed, modify its properties and click the "Generate code" button. The generated code will be displayed in a tab page. Press the "Save selected tab to file" (or "Save all tabs to file") button to save the result to disk.
 
 
The option to generate code to file is always present - provided your RISE Editor is licensed for code generation - and doesn't require any server components to be available.
 
The generated model
The database model is created as a script consisting of a sequence of commands leading to the intended final result. A database model is made up of three different parts:
  1. The model evolution. This part is an ordered sequence of operations made on tables, column, indexes, constraints and so forth. The purpose of the ordered sequence is to allow you to apply the script to any database including one that contains an older version of the model.
  2. Creation of views. Views are deleted if they exists and are then recreated according to their current definition in the model.
  3. Insertion of default data. A RISE information model may contain data to be inserted by default into entities (tables).
In the following model
 
 
could correspond to the following pseudo code for the model evolution. The exact order of the commands below would depend on in which order they where actually created. Of course, the sequence below could contain commands for modifying already created items as well.
 
if (model missing) version = 0
if (version==0) Create Folder table, version++
if (version==1) Add Name column to Folder table, version++
if (version==2) Create Document table, version++
if (version==3) Add Name column to Document table, version++
if (version==4) Add foreign key column Parent to Folder table, version++
if (version==5) Add foreign key column Folder to Document table, version++
if (version==6) Add Author column to Document table, version++
 
If our model contains views or data these commands would follow after the model evolution sequence.
 
 
Related articles: