[sr-dev] git:master: srdb1/dbschema/sqlite: adjust binary column type to BLOB

Timo Teras timo.teras at iki.fi
Tue May 22 13:04:00 CEST 2012


Module: sip-router
Branch: master
Commit: 33e1ad7499642f660d77b6581e48c44d46923f0e
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=33e1ad7499642f660d77b6581e48c44d46923f0e

Author: Timo Teräs <timo.teras at iki.fi>
Committer: Timo Teräs <timo.teras at iki.fi>
Date:   Tue May 22 13:58:16 2012 +0300

srdb1/dbschema/sqlite: adjust binary column type to BLOB

The BYTEA was a mistake in first place (copied from postgres xsl).

SQlite needs the type to be BLOB for proper affinity. This is also
what the db_sqlite driver expects.

---

 doc/stylesheets/dbschema_k/xsl/db_sqlite.xsl |    2 +-
 utils/kamctl/db_sqlite/msilo-create.sql      |    2 +-
 utils/kamctl/db_sqlite/presence-create.sql   |    4 ++--
 utils/kamctl/db_sqlite/rls-create.sql        |    2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/doc/stylesheets/dbschema_k/xsl/db_sqlite.xsl b/doc/stylesheets/dbschema_k/xsl/db_sqlite.xsl
index 9fd202f..9e2e489 100644
--- a/doc/stylesheets/dbschema_k/xsl/db_sqlite.xsl
+++ b/doc/stylesheets/dbschema_k/xsl/db_sqlite.xsl
@@ -87,7 +87,7 @@
 	    </xsl:when>
 	    <xsl:when test="$type='binary' or
 						$type='largebinary'">
-		<xsl:text>BYTEA</xsl:text>
+		<xsl:text>BLOB</xsl:text>
 		<xsl:call-template name="column.size"/>
 		<xsl:call-template name="column.trailing"/>
 	    </xsl:when>
diff --git a/utils/kamctl/db_sqlite/msilo-create.sql b/utils/kamctl/db_sqlite/msilo-create.sql
index bd7f2a1..af2fdaa 100644
--- a/utils/kamctl/db_sqlite/msilo-create.sql
+++ b/utils/kamctl/db_sqlite/msilo-create.sql
@@ -9,7 +9,7 @@ CREATE TABLE silo (
     exp_time INTEGER DEFAULT 0 NOT NULL,
     snd_time INTEGER DEFAULT 0 NOT NULL,
     ctype VARCHAR(32) DEFAULT 'text/plain' NOT NULL,
-    body BYTEA DEFAULT '' NOT NULL,
+    body BLOB DEFAULT '' NOT NULL,
     extra_hdrs TEXT DEFAULT '' NOT NULL,
     callid VARCHAR(128) DEFAULT '' NOT NULL,
     status INTEGER DEFAULT 0 NOT NULL
diff --git a/utils/kamctl/db_sqlite/presence-create.sql b/utils/kamctl/db_sqlite/presence-create.sql
index 6a8649a..a9a9157 100644
--- a/utils/kamctl/db_sqlite/presence-create.sql
+++ b/utils/kamctl/db_sqlite/presence-create.sql
@@ -7,7 +7,7 @@ CREATE TABLE presentity (
     etag VARCHAR(64) NOT NULL,
     expires INTEGER NOT NULL,
     received_time INTEGER NOT NULL,
-    body BYTEA NOT NULL,
+    body BLOB NOT NULL,
     sender VARCHAR(128) NOT NULL,
     CONSTRAINT presentity_presentity_idx UNIQUE (username, domain, event, etag)
 );
@@ -68,7 +68,7 @@ CREATE TABLE xcap (
     id INTEGER PRIMARY KEY NOT NULL,
     username VARCHAR(64) NOT NULL,
     domain VARCHAR(64) NOT NULL,
-    doc BYTEA NOT NULL,
+    doc BLOB NOT NULL,
     doc_type INTEGER NOT NULL,
     etag VARCHAR(64) NOT NULL,
     source INTEGER NOT NULL,
diff --git a/utils/kamctl/db_sqlite/rls-create.sql b/utils/kamctl/db_sqlite/rls-create.sql
index e832978..20b5e62 100644
--- a/utils/kamctl/db_sqlite/rls-create.sql
+++ b/utils/kamctl/db_sqlite/rls-create.sql
@@ -4,7 +4,7 @@ CREATE TABLE rls_presentity (
     rlsubs_did VARCHAR(255) NOT NULL,
     resource_uri VARCHAR(128) NOT NULL,
     content_type VARCHAR(255) NOT NULL,
-    presence_state BYTEA NOT NULL,
+    presence_state BLOB NOT NULL,
     expires INTEGER NOT NULL,
     updated INTEGER NOT NULL,
     auth_state INTEGER NOT NULL,




More information about the sr-dev mailing list