You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-user@jakarta.apache.org by stuart macpherson <so...@virgin.net> on 2002/09/29 10:03:46 UTC

RE: Question about slide and mysql

Actually, that's precisely how I have my stores setup, and also this is how
the official (NOT the unofficial) docs tell you to do it.  I have
encountered no problems so far...  

I don't understand why you have use the tag KEY... What is the concept of
KEY if not to be used as some kind of unique key?  I mean, I don't see the
point of using the KEY reference directly in place of a PK.  

I agree with you that a 255-long segment of a BLOB may not be unique if its
total length is more.  However, I don't agree that the way to sort it is to
use KEY instead of PK...  this doesn't make sense.

If you anticipate URIs of longer than 255 then why not use LONGBLOB?  

Stu


-----Original Message-----
From: Wendt, Alexander [mailto:alexander.wendt@volkswagen.de] 
Sent: 29 September 2003 08:14
To: 'Slide Users Mailing List'
Subject: RE: Question about slide and mysql

Hi.

@stuart:

What you said about the primary-key is not the whole thruth.
The primary-key of BLOBs in the slide-mysql-shema is definitively wrong.
A BLOB can be primary, but primary has to be unique and a key in MySQL has
only a length of 255 chars. So if you use an uri with more than this 255
chars, you run into trouble. All primary-keys in slilde have to be simple
keys.

i.e.:

# --------------------------------------------------------
CREATE TABLE branches (
  uri blob NOT NULL,
  xnumber varchar(20) default NULL,
  childnumber varchar(20) default NULL,
  KEY uri (uri(255))
)
# --------------------------------------------------------
CREATE TABLE children (
  uri blob,
  childuri blob NOT NULL,
  KEY uri (uri(245),childuri(255))
)
# --------------------------------------------------------
CREATE TABLE label (
  uri blob NOT NULL,
  xnumber varchar(20) default NULL,
  label blob,
  KEY uri (uri(255))
)
# --------------------------------------------------------
CREATE TABLE latestrevisions (
  uri blob NOT NULL,
  branchname varchar(255) default NULL,
  xnumber varchar(20) default NULL,
  KEY uri (uri(255))
)
# --------------------------------------------------------
CREATE TABLE links (
  link blob NOT NULL,
  linkto blob,
  PRIMARY KEY  (link(255))
)
# --------------------------------------------------------
CREATE TABLE locks (
  id blob,
  object blob NOT NULL,
  subject blob,
  type varchar(255) default NULL,
  expirationdate varchar(15) default NULL,
  inheritable tinyint(1) default NULL,
  xexclusive tinyint(1) default NULL,
  KEY id (id(255)),
  KEY object (object(255),subject(245))
)
# --------------------------------------------------------
CREATE TABLE objects (
  uri blob NOT NULL,
  classname varchar(255) default NULL,
  KEY uri (uri(255),classname(245))
)
# --------------------------------------------------------
CREATE TABLE permissions (
  object blob,
  revisionnumber varchar(20) default NULL,
  subject blob,
  action varchar(255) default NULL,
  inheritable tinyint(1) default NULL,
  negative tinyint(1) default NULL,
  KEY object (object(255),subject(245))
)
# --------------------------------------------------------
CREATE TABLE property (
  uri blob,
  xnumber varchar(20) default NULL,
  name varchar(255) default NULL,
  value blob,
  namespace varchar(255) default NULL,
  type varchar(100) default NULL,
  protected tinyint(1) default NULL,
  KEY uri (uri(255),name(245))
}
# --------------------------------------------------------
CREATE TABLE revision (
  uri blob NOT NULL,
  xnumber varchar(20) default NULL,
  branchname varchar(255) default NULL,
  KEY uri (uri(255))
)
# --------------------------------------------------------
CREATE TABLE revisioncontent (
  uri blob NOT NULL,
  xnumber varchar(20) default NULL,
  content blob,
  KEY uri (uri(255))
)
# --------------------------------------------------------
CREATE TABLE revisions (
  uri blob NOT NULL,
  isversioned tinyint(1) default NULL,
  initialrevision varchar(10) default NULL,
  KEY uri (uri(255))
)
# --------------------------------------------------------
CREATE TABLE workingrevision (
  uri blob NOT NULL,
  baserevision varchar(20) default NULL,
  xnumber varchar(20) default NULL,
  KEY uri (uri(255))
)

---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org