Index: openacs-4/packages/acs-core-docs/www/tutorial-database.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/tutorial-database.adp,v diff -u -N -r1.1.2.11 -r1.1.2.12 --- openacs-4/packages/acs-core-docs/www/tutorial-database.adp 21 Jun 2016 07:44:36 -0000 1.1.2.11 +++ openacs-4/packages/acs-core-docs/www/tutorial-database.adp 23 Jun 2016 08:32:46 -0000 1.1.2.12 @@ -42,11 +42,12 @@ simplify our database creation. (More information about ACS Objects. More information about the Content Repository.)

-

Figure 9.2. Tutorial -Data Model

Tutorial Data Model
+

Figure 9.2. Tutorial Data +Model

Tutorial Data Model

The top of each sql file has some standard comments, including doc tags such as \@author which -will be picked up by the API browser. The string $‌Id:$ will automatically be expanded when +will be picked up by the API browser. The string $‌Id: tutorial-database.html,v 1.44.2.10 2016/06/21 +07:44:36 gustafn Exp $ will automatically be expanded when the file is checked in to cvs.

 [$OPENACS_SERVICE_NAME ~]$ cd /var/lib/aolserver/$OPENACS_SERVICE_NAME/packages/myfirstpackage/sql/postgresql
 [$OPENACS_SERVICE_NAME postgresql]$ emacs myfirstpackage-create.sql
@@ -75,14 +76,14 @@
 

The creation script calls a function in PL/pgSQL (PL/pgSQL is a procedural language extention to sql), content_type__create_type, which in turn creates the necessary database changes to support our data object. -Notice the use of "mfp." This is derived from "My First Package" -and ensures that our object is unlikely to conflict with objects -from other packages.

Create a database file to drop everything if the package is +Notice the use of "mfp." This is derived from "My +First Package" and ensures that our object is unlikely to +conflict with objects from other packages.

Create a database file to drop everything if the package is uninstalled.

 [$OPENACS_SERVICE_NAME postgresql]$ emacs myfirstpackage-drop.sql
 
-

Figure 9.4. Database -Deletion Script

+

Figure 9.4. Database Deletion +Script

 -- drop script
 --
 -- \@author joel\@aufrecht.org
@@ -113,7 +114,7 @@
 again. If there are errors in the database table creation, you may
 need to run the drop script to drop the table so that you can
 recreate it. The drop script will probably have errors since some
-of the things it's trying to drop may be missing. They can be
+of the things it's trying to drop may be missing. They can be
 ignored.

Once you get the same output as shown above, test the drop script:

 [$OPENACS_SERVICE_NAME postgresql]$ psql service0 -f myfirstpackage-drop.sql