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

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

]>

<table>
  <name>uid_uri_attrs</name>
  <version>2</version>
  <type db="mysql">&MYSQL_TABLE_TYPE;</type>

  <column id="id">
    <name>id</name>
    <type>unsigned int</type>
    <size>&table_id_len;</size>
    <autoincrement/>
    <primary/>
    <type db="dbtext">int,auto</type>
    <description>Unique ID</description>
  </column>

  <column id="uriattrs.username">
	<name>username</name>
	<type>string</type>
	<size>&user_len;</size>
  </column>

  <column id="uriattrs.did">
    <name>did</name>
    <type>string</type>
    <size>&id_len;</size>
  </column>
  
  <column id="uriattrs.name">
	<name>name</name>
	<type>string</type>
	<size>&avp_name_len;</size>
  </column>

  <column id="uriattrs.value">
	<name>value</name>
	<type>string</type>
	<null/>
	<size>&avp_val_len;</size>
  </column>

  <column>
	<name>type</name>
	<type>int</type>
	<default>0</default>
  </column>

  <column id="uriattrs.flags">
	<name>flags</name>
	<type>unsigned int</type>
	<default>0</default>
	<description>
	  Various flags (SER_LOAD and such).
	</description>
  </column>

  <column id="uriattrs.scheme">
    <name>scheme</name>
    <type>string</type>
	<size>8</size>
    <default>sip</default>
    <description>
      URI scheme:
      - SIP  
      - SIPS 
      - TEL  
      - TELS 
    </description>
  </column>

  <index>
	<unique/>
	<name>uriattrs_idx</name>
    <colref linkend="uriattrs.username"/>
	<colref linkend="uriattrs.did"/>
	<colref linkend="uriattrs.name"/>
	<colref linkend="uriattrs.value"/>
	<colref linkend="uriattrs.scheme"/>
  </index>

</table>
