Project

General

Profile

Actions

Bug #2453

closed

Empty DB created, add necessary population + verify

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

Status:
Resolved
Priority:
Immediate
Assignee:
Category:
db_implement
Target version:
Start date:
06/02/2006
Due date:
% Done:

0%

Estimated time:
Bugzilla-Id:
2453

Description

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 vegbank.org. 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','');
INSERT 0 1
vegbank=# insert into usr (usr_id, party_id, password, permission_type, email_address) values (1,1,'mypasswd',15,'');
INSERT 0 1

see the INSTALL file for additional notes.

Actions #1

Updated by Chad Berkley over 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 over 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 18 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 18 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 18 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 18 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 18 years ago

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

Actions #8

Updated by Redmine Admin over 11 years ago

Original Bugzilla ID was 2453

Actions

Also available in: Atom PDF