Bug #2453


Empty DB created, add necessary population + verify

Added by Chad Berkley almost 18 years ago. Updated over 17 years ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:


Currenty, the sql scripts, both generated and static, do not properly build the database. It is currently impossible to build a working empty database, instead you must use a backup copy from These scripts need to be updated so that the creation of an empty db is possible. Also, all of the bootstrapping functions, such as creating an initial admin user need to be taken care of by the scripts. The known scripts that must be run are:

bash$ psql -U vegbank vegbank < build/sql/vegbank.sql >dbcreate.log
bash$ psql -U vegbank vegbank < build/sql/create_aggregrates.sql
bash$ psql -U vegbank vegbank < build/sql/create_extras.sql
bash$ psql -U vegbank vegbank < build/sql/denorm/add_embargo_all_or_nothingfields.sql.sql

bash$ psql
vegbank=# insert into party (party_id, givenname, surname, email) values (1,'jim','bob','');
vegbank=# insert into usr (usr_id, party_id, password, permission_type, email_address) values (1,1,'mypasswd',15,'');

see the INSTALL file for additional notes.

Actions #1

Updated by Chad Berkley almost 18 years ago

Also need a DROP script so we don't have to use a dropdb to start with a fresh schema.

Actions #2

Updated by Michael Lee almost 18 years ago

Might we be able to get by with an update script from schema 1 to schema 2. Realistically, this will be needed as we will want to continue the data that are already in the database.

We can currently generate the new model from scratch, but not populate it. We can also create a "basis" script that probably needs human intervention, but that will help create scripts to upgrade from one version to another. The former (creation) is accompished by /src/xsl/VegBankModel2SQL.xsl

The latter is accomplished by /docs/xml/changedoc_2ALTER.xsl (the params in this file should be changed to indicate which version).

Actions #3

Updated by Michael Lee over 17 years ago

aux_roles need to be prepopulated, as the loader doens't allow new ones (correct behaviour)

Actions #4

Updated by Michael Lee over 17 years ago

aux_role is now properly populated in the vegbank_populate_configtables.sql

This is also called with the build script, so comment #3 is now resolved.

Actions #5

Updated by Michael Lee over 17 years ago

ant dbverify that Chad did is now working to create all tables and ant dbVerify verifies that they have been created OK. What I don't know yet is if all the views exist, too, or if the sequences are right. Also, would be nice to somehow verify that certain tables have data, which would seem needed for some tables (aux_role, some dba tables).

Actions #6

Updated by Michael Lee over 17 years ago

dbVerify now validates sequences and views. Last bit that would be nice to check is to see that certain tables (dba type tables) actually have data (aux_role, etc.) Need to add a new attribute to db_model_vegbank.xml to tell which tables need to be populated.

Actions #7

Updated by Michael Lee over 17 years ago

ant dbVerify now validates default values and also checks that certain tables are prepopulated.

Actions #8

Updated by Redmine Admin about 11 years ago

Original Bugzilla ID was 2453


Also available in: Atom PDF