

DIRECTORIES
-------------------------------------------------------------------------------

/schema/spacewalk
/schema/spacewalk/common                - Common DDL
/schema/spacewalk/common/tables         - Common DDL: table,index,sequences
/schema/spacewalk/common/data           - Common SQL: INSERTs
/schema/spacewalk/common/views          - Generic view DDL

ORACLE:

/schema/spacewalk/oracle                - Oracle specific DDL
/schema/spacewalk/oracle/class          - Oracle specific class DDL
/schema/spacewalk/oracle/tables         - Oracle specific table DDL
/schema/spacewalk/oracle/tables/common  - Generated from common/tables
/schema/spacewalk/oracle/views          - Oracle specific view DDL
/schema/spacewalk/oracle/views/common   - Copied from common/views
/schema/spacewalk/oracle/data           - Oracle specific INSERTs
/schema/spacewalk/oracle/data/common    - Generated from common/data
/schema/spacewalk/oracle/triggers       - Oracle specific trigger DDL
/schema/spacewalk/oracle/procs          - PL/SQL procedures/functions DDL.
/schema/spacewalk/oracle/packages       - PL/SQL packages DDL.

POSTGRES:

/schema/spacewalk/postgres                - Postgres specific DDL
/schema/spacewalk/postgres/class          - Postgres specific class DDL
/schema/spacewalk/postgres/tables         - Postgres specific table DDL
/schema/spacewalk/postgres/tables/common  - Generated from common/tables
/schema/spacewalk/postgres/views          - Postgres specific view DDL
/schema/spacewalk/postgres/views/common   - Copied from common/views
/schema/spacewalk/postgres/data           - Postgres specific INSERTs
/schema/spacewalk/postgres/data/common    - Generated from common/data
/schema/spacewalk/postgres/triggers       - Postgres specific trigger DDL
/schema/spacewalk/postgres/procs          - PG/SQL procedures/functions DDL.
/schema/spacewalk/postgres/packages       - PG/SQL packages DDL.


TOOLS
-------------------------------------------------------------------------------

chameleon - Used to translate the common DDL to oracle|postgres specific
            DDL and upgrade scripts.

blend     - Used to generate the main.sql based on .deps files.


DEPENDENCY FILES (.deps)
-------------------------------------------------------------------------------

Terms:
  namespace - A root directory.
              May be: (.|class|tables|views|procs|packages)
              where (.) represents the current namesapce.

  qname     - A qualified name.
              May be: [namespace/]basename[.ext].  When the namespace
              is not specified, the name is unqualified and resolved
              using the "path".  Using the extension is only necessary
              when more then (1) file exists in a given namespace with
              the same name but with different extensions.

Format:

  path = {namespace}([\s,]+{namespace})*

  {qname} :: {qname}([\s,]+{qname})*

Examples:

  path = . tables packages"

  * :: sequence_nextval

  rhnSharedChannelView :: rhnChannel procs/lookup_functions \
                          rhn_channel.pks

  Assuming the current namespace (or directory) is /views.
  The table dependency "rhnChannel" is unqualifed and would be searched
  for in the following order:
    1st. views/rhnChannel
    2nd. tables/rhnChannel
    3rd. packages/rhnChannel
  However, lookup_functions dependency is qualified by namespace so the
  path will not be used.
  The package header dependency "rhn_channel.pks" is unqualifed and but has
  an extension and would be searched for in the following order:
    1st. views/rhn_channel.pks
    2nd. tables/rhn_channel.pks
    3rd. packages/rhn_channel.pks

  The star notation prepends its list to all following entries in the file.

Lines may be joined by (\).

MAIN.SQL

The main.sql file is generated and references includes
the individual .sql, .pks, .pkb files within the directory
tree.  This file is generated by blend and ordered
based on .deps files.  This takes the place of the universal .sql
file.

SPECIAL FILES

clean.sql - If found in the current directory, the contents of this file is
            inserted at the beginning of the output.  This file is expected
            to contain commands to clean (clear) the database before schema
            installation.

start.sql - If found in the current directory, the contents of this file is
            inserted at the beginning of the output (after clean.sql).  This
            file is expected to contain commands used to condition the database
            or database session to schema installation.

end.sql -   If found in the current directory, the contents of this file is
            appended to the end of the output.  This file contains commands
            to commit or post process the installed schema such as commit inserted
            data or to exit an application used for the installation.
