<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE table PUBLIC "-//iptel.org//DTD DBSchema V1.0//EN"
  "http://iptel.org/dbschema/dtd/1.0/dbschema.dtd" [

<!ENTITY % entities SYSTEM "entities.xml">
%entities;

]>

<table role="presence">

  <name>presentity_contact</name>
  <description>
	Table holding published tuples (NOT tuples generated by registrations).
  </description>
  
  <!-- related to the version of presence snapshot -->
  <version>5</version>
  
  <!-- presentity ID -->
  <column id="prescontact.pres_id">
	<name>pres_id</name>
	<type>string</type>
	<size>64</size>
	<description>Presentity ID.</description>
  </column>

  <!-- basic status -->
  <column>
	<name>basic</name>
	<type>int</type>
	<size>3</size>
	<description>
	  Basic status as number. It can have values 0 (open) or 1 (closed).
	</description>
  </column>

  <column>
	<name>expires</name>
	<type>datetime</type>
	<default>2004-05-28 21:32:15</default>
	<description>Expiration value.</description>
  </column>

  <column>
	<name>priority</name>
	<type>float</type>
	<default>0.5</default>
	<description>Contact priority value.</description>
  </column>

  <column>
	<name>contact</name>
	<type>string</type>
	<size>&uri_len;</size>
	<null/>
	<description>Published contact information.</description>
  </column>

  <!-- tuple ID -->
  <column id="prescontact.tupleid">
	<name>tupleid</name>
	<type>string</type>
	<size>64</size>
	<description>Generated tuple identification.</description>
  </column>

  <!-- published with this entity tag (only published tuples are stored
	   into database) -->
  <column>
	<name>etag</name>
	<type>string</type>
	<size>64</size>
	<description>Entity tag used for tuple publication.</description>
  </column>

  <!-- tuple must published with ID (see PIDF spec.) -->
  <column>
	<name>published_id</name>
	<type>string</type>
	<size>64</size>
	<description>Tuple identification used in PUBLISH.</description>
  </column>

  <index>
	<name>presid_index</name>
	<colref linkend="prescontact.pres_id"/>
	<colref linkend="prescontact.tupleid"/>
	<unique/>
  </index>

</table>
