| Ah3 Invoicing and Inventory System for Repair Shops | ||
|---|---|---|
| Prev | Chapter 5. Building and Installation | |
The create_db.sh script has been supplied with ah3. It will ensure postres is started, it will accept connection s from the network, it will use trust authentication for those connections from localhost and create the ah3 user. After this, it will create the ah3 database under the ownership of ah3 and install the scheme and a minimal data set required to run the ah3 program.
This script is simple to read. It does have security implications for your computer. If you are only running ah3 on the computer and it's database, it should be fine. Otherwise, you should check it and make sure it is not doing anything to your disliking.
This script is installed via the ah3 rpm file, can be found as /opt/ah3/create_db.sh and should be executed as the root user.
This proceedure has a couple of assumptions. First, that the postgres database is installed and the server daemon is started. Secondly, that the installer has the appropriate permissions to create postgres users and databases. On SuSE distributions, performing these operations as root will satisfy both of these assumptions.
Performing the following steps will create the database for Ah3. Select an appropriate username to use on the command lines where <user> is specified.
Execute createuser --createdb --no-superuser --no-createrole <user>
Execute createdb --owner <user> ah3
Execute psql --username <user> < /opt/ah3/database/ah3.psql
An example database providing a large set of customer information including vehicles and workorders is supplied with both the rpm and tar file distributions of Ah3. This data can be used to try out the program, then the database can be dropped and recreated to use for real. Execute the command psql --username <user> < /opt/ah3/database/exeample_db.sql. Once it completes, you should have a database with several hundred customers.
For those strange people out there who like to glean personal information from databases such as this, forget it. It just looks real. The data has been sanitized in that it has bogus names and addresses, phone numbers and vehicle information.