Browse Source

correct work with notes published for presentities (with persistence)

Vaclav Kubart 20 years ago
parent
commit
5d20a960e9

+ 1 - 1
db/schema/presentity_contact.xml

@@ -52,7 +52,7 @@
     <column>
     <column>
 	<name>expires</name>
 	<name>expires</name>
 	<type>datetime</type>
 	<type>datetime</type>
-	<default>2020-05-28 21:32:15</default>
+	<default>2004-05-28 21:32:15</default>
     </column>
     </column>
 
 
     <column id="prescontact.placeid">
     <column id="prescontact.placeid">

+ 61 - 0
db/schema/presentity_notes.xml

@@ -0,0 +1,61 @@
+<?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"
+    xmlns:db="http://docbook.org/ns/docbook"
+    xmlns:my="http://iptel.org/dbschema/mysql"
+    xmlns:pg="http://iptel.org/dbschema/postgres"
+    xmlns:dt="http://iptel.org/dbschema/dbtext">
+    <name>presentity_notes</name>
+    <version>1</version>
+    
+    <column id="presnotes.dbid">
+		<name>dbid</name>
+		<type>string</type>
+		<size>64</size>
+    </column>
+	
+	<!-- foreign key (presentity) -->
+    <column>
+		<name>presid</name>
+		<type>unsigned int</type>
+		<size>10</size>
+    </column>
+    
+	<column>
+		<name>etag</name>
+		<type>string</type>
+		<size>64</size>
+    </column>
+    
+	<column>
+		<name>note</name>
+		<type>string</type>
+		<size>128</size>
+    </column>
+	
+	<column>
+		<name>lang</name>
+		<type>string</type>
+		<size>64</size>
+    </column>
+
+    <column>
+		<name>expires</name>
+		<type>datetime</type>
+		<default>2005-12-07 08:13:15</default>
+    </column>
+
+    <index>
+		<name>pnotes_idx1</name>
+		<colref linkend="presnotes.dbid"/>
+		<unique/>
+    </index>
+    
+</table>

+ 1 - 0
db/schema/ser.xml

@@ -66,6 +66,7 @@
 
 
     <!-- Presence related tables -->
     <!-- Presence related tables -->
     <xi:include href="presentity.xml"/>
     <xi:include href="presentity.xml"/>
+    <xi:include href="presentity_notes.xml"/>
     <xi:include href="presentity_contact.xml"/>
     <xi:include href="presentity_contact.xml"/>
     <xi:include href="watcherinfo.xml"/>
     <xi:include href="watcherinfo.xml"/>
     
     

+ 11 - 1
scripts/mysql/my_create.sql

@@ -296,13 +296,23 @@ CREATE TABLE presentity (
     KEY presentity_key2 (uri)
     KEY presentity_key2 (uri)
 );
 );
 
 
+CREATE TABLE presentity_notes (
+    dbid VARCHAR(64) NOT NULL,
+    presid INT(10) UNSIGNED NOT NULL,
+    etag VARCHAR(64) NOT NULL,
+    note VARCHAR(128) NOT NULL,
+    lang VARCHAR(64) NOT NULL,
+    expires DATETIME NOT NULL DEFAULT '2005-12-07 08:13:15',
+    UNIQUE KEY pnotes_idx1 (dbid)
+);
+
 CREATE TABLE presentity_contact (
 CREATE TABLE presentity_contact (
     contactid INT(10) UNSIGNED AUTO_INCREMENT NOT NULL,
     contactid INT(10) UNSIGNED AUTO_INCREMENT NOT NULL,
     presid INT(10) UNSIGNED NOT NULL,
     presid INT(10) UNSIGNED NOT NULL,
     basic VARCHAR(32) NOT NULL DEFAULT 'offline',
     basic VARCHAR(32) NOT NULL DEFAULT 'offline',
     status VARCHAR(32) NOT NULL,
     status VARCHAR(32) NOT NULL,
     location VARCHAR(128) NOT NULL,
     location VARCHAR(128) NOT NULL,
-    expires DATETIME NOT NULL DEFAULT '2020-05-28 21:32:15',
+    expires DATETIME NOT NULL DEFAULT '2004-05-28 21:32:15',
     placeid INT(10),
     placeid INT(10),
     priority FLOAT NOT NULL DEFAULT '0.5',
     priority FLOAT NOT NULL DEFAULT '0.5',
     contact VARCHAR(255),
     contact VARCHAR(255),

+ 11 - 1
scripts/oracle/or_create.sql

@@ -284,13 +284,23 @@ CREATE TABLE presentity (
 
 
 );
 );
 
 
+CREATE TABLE presentity_notes (
+    dbid string(64) NOT NULL,
+    presid int(10) NOT NULL,
+    etag string(64) NOT NULL,
+    note string(128) NOT NULL,
+    lang string(64) NOT NULL,
+    expires datetime NOT NULL DEFAULT '2005-12-07 08:13:15',
+    pnotes_idx1 UNIQUE (dbid, )
+);
+
 CREATE TABLE presentity_contact (
 CREATE TABLE presentity_contact (
     contactid int(10) NOT NULL,
     contactid int(10) NOT NULL,
     presid int(10) NOT NULL,
     presid int(10) NOT NULL,
     basic string(32) NOT NULL DEFAULT 'offline',
     basic string(32) NOT NULL DEFAULT 'offline',
     status string(32) NOT NULL,
     status string(32) NOT NULL,
     location string(128) NOT NULL,
     location string(128) NOT NULL,
-    expires datetime NOT NULL DEFAULT '2020-05-28 21:32:15',
+    expires datetime NOT NULL DEFAULT '2004-05-28 21:32:15',
     placeid int(10),
     placeid int(10),
     priority float NOT NULL DEFAULT '0.5',
     priority float NOT NULL DEFAULT '0.5',
     contact string(255),
     contact string(255),

+ 11 - 1
scripts/postgres/pg_create.sql

@@ -307,13 +307,23 @@ CREATE TABLE presentity (
 
 
 CREATE INDEX presentity_key2 ON presentity (uri);
 CREATE INDEX presentity_key2 ON presentity (uri);
 
 
+CREATE TABLE presentity_notes (
+    dbid VARCHAR(64) NOT NULL,
+    presid INTEGER NOT NULL,
+    etag VARCHAR(64) NOT NULL,
+    note VARCHAR(128) NOT NULL,
+    lang VARCHAR(64) NOT NULL,
+    expires TIMESTAMP NOT NULL DEFAULT '2005-12-07 08:13:15',
+    CONSTRAINT pnotes_idx1 UNIQUE (dbid)
+);
+
 CREATE TABLE presentity_contact (
 CREATE TABLE presentity_contact (
     contactid SERIAL NOT NULL,
     contactid SERIAL NOT NULL,
     presid INTEGER NOT NULL,
     presid INTEGER NOT NULL,
     basic VARCHAR(32) NOT NULL DEFAULT 'offline',
     basic VARCHAR(32) NOT NULL DEFAULT 'offline',
     status VARCHAR(32) NOT NULL,
     status VARCHAR(32) NOT NULL,
     location VARCHAR(128) NOT NULL,
     location VARCHAR(128) NOT NULL,
-    expires TIMESTAMP NOT NULL DEFAULT '2020-05-28 21:32:15',
+    expires TIMESTAMP NOT NULL DEFAULT '2004-05-28 21:32:15',
     placeid INTEGER,
     placeid INTEGER,
     priority REAL NOT NULL DEFAULT '0.5',
     priority REAL NOT NULL DEFAULT '0.5',
     contact VARCHAR(255),
     contact VARCHAR(255),