Index: openacs-4/packages/acs-core-docs/www/xml/developers-guide/tutorial-db.xml
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/xml/developers-guide/tutorial-db.xml,v
diff -u -r1.12 -r1.13
--- openacs-4/packages/acs-core-docs/www/xml/developers-guide/tutorial-db.xml 27 Apr 2004 00:53:41 -0000 1.12
+++ openacs-4/packages/acs-core-docs/www/xml/developers-guide/tutorial-db.xml 14 May 2004 14:10:27 -0000 1.13
@@ -64,8 +64,8 @@
by the API browser. The string
$Id:$ will automatically be
expanded when the file is checked in to cvs.
-[service0 ~]$ cd /var/lib/aolserver/service0/packages/myfirstpackage/sql/postgresql
-[service0 postgresql]$ emacs myfirstpackage-create.sql
+[$OPENACS_SERVICE_NAME ~]$ cd /var/lib/aolserver/$OPENACS_SERVICE_NAME/packages/myfirstpackage/sql/postgresql
+[$OPENACS_SERVICE_NAME postgresql]$ emacs myfirstpackage-create.sqlPaste the text below into the file, save, and close.The Database Creation Script
@@ -79,33 +79,33 @@
with objects from other packages.
Create a database file to drop everything if the package is uninstalled.
-[service0 postgresql]$ emacs myfirstpackage-drop.sql
+[$OPENACS_SERVICE_NAME postgresql]$ emacs myfirstpackage-drop.sqlDatabase Deletion Scriptexample missing
(like the creation script the drop script calls a PL/pgSQL function: content_type__drop_typeRun the create script manually to add your tables and functions.
- [service0 postgresql]$ psql -f myfirstpackage-create.sql
+ [$OPENACS_SERVICE_NAME postgresql]$ psql -f myfirstpackage-create.sql
psql:myfirstpackage-create.sql:15: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'mfp_notes_pkey' for table 'mfp_notes'
psql:myfirstpackage-create.sql:15: NOTICE: CREATE TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
content_type__create_type
---------------------------
0
(1 row)
-[service0 postgresql]$
+[$OPENACS_SERVICE_NAME postgresql]$If there are errors, use them to debug the sql file and try 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 ignored.Once you get the same output as shown above, test the drop script:
- [service0 postgresql]$ psql -f myfirstpackage-drop.sql
+ [$OPENACS_SERVICE_NAME postgresql]$ psql -f myfirstpackage-drop.sql
content_type__drop_type
-------------------------
0
(1 row)
-[service0 postgresql]$
+[$OPENACS_SERVICE_NAME postgresql]$Once both scripts are working without errors, run the create script one last time and proceed.
- [service0 postgresql]$ psql -f myfirstpackage-create.sql
+ [$OPENACS_SERVICE_NAME postgresql]$ psql -f myfirstpackage-create.sql
\ No newline at end of file