<?xml version="1.0"?>
<!--
    The contents of this file are subject to the Mozilla Public License Version 1.1
    (the "License"); you may not use this file except in compliance with the License.
    You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.

    Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
    WARRANTY OF ANY KIND, either express or implied. See the License for the specific
    language governing rights and limitations under the License.

    The Original Code is the Venice Web Communities System.

    The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
    for Silverwrist Design Studios.  Portions created by Eric J. Bowersox are
    Copyright (C) 2003 Eric J. Bowersox/Silverwrist Design Studios.  All Rights Reserved.

    Contributor(s): 
-->
<database-info>
  <command>
    <install log="Creating conference table"><![CDATA[
      CREATE TABLE conferences (
        confid INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
        createdate DATETIME NOT NULL,
        lastupdate DATETIME NULL,
        aclid INT NOT NULL DEFAULT -1,
        highest_topic SMALLINT NOT NULL DEFAULT 0,
        name VARCHAR(128) NOT NULL,
        INDEX by_name (name)
      );
    ]]></install>
    <uninstall log="Dropping conference table"><![CDATA[
      DROP TABLE conferences;
    ]]></uninstall>
  </command>
  <command>
    <install log="Creating conference properties table"><![CDATA[
      CREATE TABLE conf_props (
        confid INT NOT NULL,
        nsid INT NOT NULL,
        prop_name VARCHAR(255) BINARY NOT NULL,
        prop_value VARCHAR(255),
        PRIMARY KEY (confid, nsid, prop_name)
      );
    ]]></install>
    <uninstall log="Dropping conference properties table"><![CDATA[
      DROP TABLE conf_props;
    ]]></uninstall>
  </command>
  <command>
    <install log="Creating conference linking table"><![CDATA[
      CREATE TABLE conf_links (
        cid INT NOT NULL,
        confid INT NOT NULL,
        sequence INT NOT NULL,
        hide TINYINT NOT NULL DEFAULT 0,
        PRIMARY KEY (cid, confid),
        UNIQUE INDEX reverse (confid, cid),
        INDEX by_display (cid, sequence)
      );
    ]]></install>
    <uninstall log="Dropping conference linking table"><![CDATA[
      DROP TABLE conf_links;
    ]]></uninstall>
  </command>
  <command>
    <install log="Creating conference aliases table"><![CDATA[
      CREATE TABLE conf_alias (
        confid INT NOT NULL,
        alias VARCHAR(64) NOT NULL PRIMARY KEY,
        prime TINYINT NOT NULL DEFAULT 0,
        INDEX by_confid (confid)
      );
    ]]></install>
    <uninstall log="Dropping conference aliases table"><![CDATA[
      DROP TABLE conf_alias;
    ]]></uninstall>
  </command>
</database-info>
