[Rt-commit] [svn] r979 - in rt/branches/rt-3.1: . bin etc lib lib/RT sbin

jesse at pallas.eruditorum.org jesse at pallas.eruditorum.org
Sat May 29 01:49:05 EDT 2004


Author: jesse
Date: Sat May 29 01:49:03 2004
New Revision: 979

Added:
   rt/branches/rt-3.1/etc/acl.Sybase
   rt/branches/rt-3.1/etc/schema.Sybase
Modified:
   rt/branches/rt-3.1/   (props changed)
   rt/branches/rt-3.1/bin/webmux.pl.in
   rt/branches/rt-3.1/configure.ac
   rt/branches/rt-3.1/lib/RT.pm.in
   rt/branches/rt-3.1/lib/RT/Handle.pm
   rt/branches/rt-3.1/releng.cnf
   rt/branches/rt-3.1/sbin/rt-setup-database.in
Log:
 ----------------------------------------------------------------------
 r1706 at tinbook:  jesse | 2004-05-28T02:10:56.309297Z
 
 
 ----------------------------------------------------------------------
 r1711 at tinbook:  jesse | 2004-05-28T02:47:49.277131Z
 
 
 ----------------------------------------------------------------------
 r1735 at tinbook:  jesse | 2004-05-29T05:43:52.525083Z
 
 First pass at sybase support. incomplete
 ----------------------------------------------------------------------


Modified: rt/branches/rt-3.1/bin/webmux.pl.in
==============================================================================
--- rt/branches/rt-3.1/bin/webmux.pl.in	(original)
+++ rt/branches/rt-3.1/bin/webmux.pl.in	Sat May 29 01:49:03 2004
@@ -31,7 +31,6 @@
     $ENV{'SHELL'}  = '/bin/sh' if defined $ENV{'SHELL'};
     $ENV{'ENV'}    = '' if defined $ENV{'ENV'};
     $ENV{'IFS'}    = '' if defined $ENV{'IFS'};
-    @ORACLE_ENV_PREF@
 
     eval { require Apache2; require Apache::compat }
         if $ENV{'MOD_PERL'} and $ENV{'MOD_PERL'} =~ m{mod_perl/(?:2|1\.9)};

Modified: rt/branches/rt-3.1/configure.ac
==============================================================================
--- rt/branches/rt-3.1/configure.ac	(original)
+++ rt/branches/rt-3.1/configure.ac	Sat May 29 01:49:03 2004
@@ -79,17 +79,23 @@
 	    		   [sort of database RT will use (default: mysql) (mysql, Pg, Oracle and Informix are valid)]), 
             DB_TYPE=$withval,
             DB_TYPE=mysql)
-if test "$DB_TYPE" != 'mysql' -a "$DB_TYPE" != 'Pg' -a "$DB_TYPE" != 'SQLite' -a "$DB_TYPE" != 'Oracle' -a "$DB_TYPE" != 'Informix' ; then
+if test "$DB_TYPE" != 'mysql' -a "$DB_TYPE" != 'Pg' -a "$DB_TYPE" != 'SQLite' -a "$DB_TYPE" != 'Oracle' -a "$DB_TYPE" != 'Informix' -a "$DB_TYPE" != 'Sybase' ; then
 	AC_MSG_ERROR([Only Oracle, Informix, Pg and mysql are valid db types])
 fi
 AC_SUBST(DB_TYPE)
 
-dnl ORACLE_ENV_PREF
+dnl DATABASE_ENV_PREF
 if test "$DB_TYPE" = 'Oracle'; then
 	test "x$ORACLE_HOME" = 'x' && AC_MSG_ERROR([Please declare the ORACLE_HOME environment variable])
-	ORACLE_ENV_PREF="\$ENV{'ORACLE_HOME'} = '$ORACLE_HOME';"
+	DATABASE_ENV_PREF="\$ENV{'ORACLE_HOME'} = '$ORACLE_HOME';"
 fi
-AC_SUBST(ORACLE_ENV_PREF)
+
+dnl DATABASE_ENV_PREF
+if test "$DB_TYPE" = 'Sybase'; then
+	test "x$SYBASE" = 'x' && AC_MSG_ERROR([Please declare the SYBASE_HOME environment variable])
+	DATABASE_ENV_PREF="\$ENV{'SYBASE'} = '$SYBASE';"
+fi
+AC_SUBST(DATABASE_ENV_PREF)
 
 dnl DB_HOST
 AC_ARG_WITH(db-host,

Added: rt/branches/rt-3.1/etc/acl.Sybase
==============================================================================
--- (empty file)
+++ rt/branches/rt-3.1/etc/acl.Sybase	Sat May 29 01:49:03 2004
@@ -0,0 +1,6 @@
+sub acl {
+return (
+"SP_ADDLOGIN ${RT::DatabaseUser}, ${RT::DatabasePassword}, ${RT::DatabaseName} ",
+);
+}
+1;

Added: rt/branches/rt-3.1/etc/schema.Sybase
==============================================================================
--- (empty file)
+++ rt/branches/rt-3.1/etc/schema.Sybase	Sat May 29 01:49:03 2004
@@ -0,0 +1,444 @@
+# {{{ Attachments
+
+CREATE TABLE rt3.Attachments (
+  id numeric(38,0) identity,
+  TransactionId integer NOT NULL  ,
+  Parent integer NOT NULL   ,
+  MessageId varchar(160) NULL  ,
+  Subject varchar(255) NULL  ,
+  Filename varchar(255) NULL  ,
+  ContentType varchar(80) NULL  ,
+  ContentEncoding varchar(80) NULL  ,
+  Content TEXT NULL  ,
+  Headers TEXT NULL  ,
+  Creator integer NOT NULL   ,
+  Created DATETIME NULL  ,
+  PRIMARY KEY (id)
+) ;
+
+CREATE INDEX Attachments1 ON Attachments (Parent) ;
+CREATE INDEX Attachments2 ON Attachments (TransactionId) ;
+CREATE INDEX Attachments3 ON Attachments (Parent, TransactionId) ;
+# }}}
+
+# {{{ Queues
+CREATE TABLE rt3.Queues (
+  id numeric(38,0) identity,
+  Name varchar(200) NOT NULL  ,
+  Description varchar(255) NULL  ,
+  CorrespondAddress varchar(120) NULL  ,
+  CommentAddress varchar(120) NULL  ,
+  InitialPriority integer NOT NULL   ,
+  FinalPriority integer NOT NULL   ,
+  DefaultDueIn integer NOT NULL   ,
+  Creator integer NOT NULL   ,
+  Created DATETIME NULL  ,
+  LastUpdatedBy integer NOT NULL   ,
+  LastUpdated DATETIME NULL  ,
+  Disabled numeric(1) NOT NULL  ,
+  PRIMARY KEY (id)
+) ;
+CREATE UNIQUE INDEX Queues1 ON Queues (Name) ;
+CREATE INDEX Queues2 ON Queues (Disabled) ;
+
+# }}}
+
+# {{{ Links
+
+CREATE TABLE rt3.Links (
+  id numeric(38,0) identity,
+  Base varchar(240) NULL  ,
+  Target varchar(240) NULL  ,
+  Type varchar(20) NOT NULL  ,
+  LocalTarget integer NOT NULL   ,
+  LocalBase integer NOT NULL   ,
+  LastUpdatedBy integer NOT NULL   ,
+  LastUpdated DATETIME NULL  ,
+  Creator integer NOT NULL   ,
+  Created DATETIME NULL  ,
+  PRIMARY KEY (id)
+) ;
+
+CREATE UNIQUE INDEX Links1 ON Links (Base, Target, Type) ;
+CREATE INDEX Links2 ON Links (Base,  Type) ;
+CREATE INDEX Links3 ON Links (Target,  Type) ;
+CREATE INDEX Links4 ON Links(Type,LocalBase);
+
+# }}}
+
+# {{{ Principals
+
+CREATE TABLE rt3.Principals (
+      id numeric(38,0) identity,
+        PrincipalType VARCHAR(16) not null,
+        ObjectId integer,         Disabled numeric(1) NOT NULL  ,
+        PRIMARY KEY (id)
+) ;
+
+CREATE INDEX Principals2 ON Principals (ObjectId);
+
+# }}}
+
+# {{{ Groups
+
+CREATE TABLE rt3.Groups (
+  id numeric(38,0) identity,
+  Name varchar(200) NULL  ,
+  Description varchar(255) NULL  ,
+  Domain varchar(64),
+  Type varchar(64),
+  Instance integer,
+  PRIMARY KEY (id)
+) ;
+
+CREATE INDEX Groups1 ON Groups (Domain,Instance,Type,id);
+CREATE INDEX Groups2 On Groups  (Type, Instance, Domain);   
+
+# }}}
+
+# {{{ ScripConditions
+
+CREATE TABLE rt3.ScripConditions (
+  id numeric(38,0) identity,
+  Name varchar(200) NULL  ,
+  Description varchar(255) NULL  ,
+  ExecModule varchar(60) NULL  ,
+  Argument varchar(255) NULL  ,
+  ApplicableTransTypes varchar(60) NULL  ,
+
+  Creator integer NOT NULL   ,
+  Created DATETIME NULL  ,
+  LastUpdatedBy integer NOT NULL   ,
+  LastUpdated DATETIME NULL  ,
+  PRIMARY KEY (id)
+) ;
+
+# }}}
+
+# {{{ Transactions
+CREATE TABLE rt3.Transactions (
+  id numeric(38,0) identity,
+  EffectiveTicket integer NOT NULL   ,
+  Ticket integer NOT NULL   ,
+  TimeTaken integer NOT NULL   ,
+  Type varchar(20) NULL  ,
+  Field varchar(40) NULL  ,
+  OldValue varchar(255) NULL  ,
+  NewValue varchar(255) NULL  ,
+  Data varchar(255) NULL  ,
+
+  Creator integer NOT NULL   ,
+  Created DATETIME NULL  ,
+  PRIMARY KEY (id)
+) ;
+CREATE INDEX Transactions1 ON Transactions (Ticket);
+CREATE INDEX Transactions2 ON Transactions (EffectiveTicket);
+
+# }}}
+
+# {{{ Scrips 
+
+CREATE TABLE rt3.Scrips (
+  id numeric(38,0) identity,
+  Description varchar(255),
+  ScripCondition integer NOT NULL   ,
+  ScripAction integer NOT NULL   ,
+  ConditionRules text NULL  ,
+  ActionRules text NULL  ,
+  CustomIsApplicableCode text NULL  ,
+  CustomPrepareCode text NULL  ,
+  CustomCommitCode text NULL  ,
+  Stage varchar(32) NULL  ,
+  Queue integer NOT NULL   ,
+  Template integer NOT NULL   ,
+  Creator integer NOT NULL   ,
+  Created DATETIME NULL  ,
+  LastUpdatedBy integer NOT NULL   ,
+  LastUpdated DATETIME NULL  ,
+  PRIMARY KEY (id)
+) ;
+
+# }}}
+
+# {{{ ACL
+CREATE TABLE rt3.ACL (
+  id numeric(38,0) identity,
+  PrincipalType varchar(25) NOT NULL, #"User" "Group", "Owner", "Cc" "AdminCc", "Requestor", "Requestor" 
+
+  PrincipalId integer NOT NULL  , #Foreign key to principals
+  RightName varchar(25) NOT NULL  ,
+  ObjectType varchar(25) NOT NULL  ,
+  ObjectId integer NOT NULL ,
+  DelegatedBy integer NOT NULL , #foreign key to principals with a userid
+  DelegatedFrom integer NOT NULL , #foreign key to ACL
+  PRIMARY KEY (id)
+) ;
+
+CREATE INDEX  ACL1 on ACL(RightName, ObjectType, ObjectId,PrincipalType,PrincipalId);
+
+# }}}
+
+# {{{ GroupMembers 
+
+CREATE TABLE rt3.GroupMembers (
+  id numeric(38,0) identity,
+  GroupId integer NOT NULL ,
+  MemberId integer NOT NULL ,  #Foreign key to Principals
+  PRIMARY KEY (id)
+) ;
+CREATE UNIQUE INDEX GroupMembers1 on GroupMembers (GroupId, MemberId);
+
+
+# }}}
+
+# {{{ GroupMembersCache
+
+CREATE TABLE rt3.CachedGroupMembers (
+  id numeric(38,0) identity,
+        GroupId int, # foreign key to Principals
+        MemberId int, # foreign key to Principals
+        Via int, #foreign key to CachedGroupMembers. (may point to $self->id)
+        ImmediateParentId int, #foreign key to prinicpals.         
+                               # this points to the group that the member is
+                               # a member of, for ease of deletes.
+        Disabled numeric(1) NOT NULL  , # if this cached group member is a member of this group by way of a disabled
+                                           # group or this group is disabled, this will be set to 1
+                                           # this allows us to not find members of disabled subgroups when listing off
+                                           # group members recursively.
+                                           # Also, this allows us to have the ACL system elide members of disabled groups
+        PRIMARY KEY (id)
+) ;
+
+CREATE INDEX DisGrouMem  on CachedGroupMembers (GroupId,MemberId,Disabled);
+CREATE INDEX GrouMem  on CachedGroupMembers (GroupId,MemberId);
+
+# }}}
+
+# {{{ Users
+
+CREATE TABLE rt3.Users (
+  id numeric(38,0) identity,
+  Name varchar(200) NOT NULL  ,
+  Password varchar(40) NULL  ,
+  Comments text NULL  ,
+  Signature text NULL  ,
+  EmailAddress varchar(120) NULL  ,
+  FreeformContactInfo text NULL  ,
+  Organization varchar(200) NULL  ,
+  RealName varchar(120) NULL  ,
+  NickName varchar(16) NULL  ,
+  Lang varchar(16) NULL  ,
+  EmailEncoding varchar(16) NULL  ,
+  WebEncoding varchar(16) NULL  ,
+  ExternalContactInfoId varchar(100) NULL  ,
+  ContactInfoSystem varchar(30) NULL  ,
+  ExternalAuthId varchar(100) NULL  ,
+  AuthSystem varchar(30) NULL  ,
+  Gecos varchar(16) NULL  ,
+  HomePhone varchar(30) NULL  ,
+  WorkPhone varchar(30) NULL  ,
+  MobilePhone varchar(30) NULL  ,
+  PagerPhone varchar(30) NULL  ,
+  Address1 varchar(200) NULL  ,
+  Address2 varchar(200) NULL  ,
+  City varchar(100) NULL  ,
+  State varchar(100) NULL  ,
+  Zip varchar(16) NULL  ,
+  Country varchar(50) NULL  ,
+  Timezone varchar(50) NULL  ,
+  PGPKey text NULL,
+
+  Creator integer NOT NULL   ,
+  Created DATETIME NULL  ,
+  LastUpdatedBy integer NOT NULL   ,
+  LastUpdated DATETIME NULL  ,
+  PRIMARY KEY (id)
+) ;
+
+
+CREATE UNIQUE INDEX Users1 ON Users (Name) ;
+CREATE INDEX Users2 ON Users (Name);
+CREATE INDEX Users3 ON Users (id, EmailAddress);
+CREATE INDEX Users4 ON Users (EmailAddress);
+
+
+# }}}
+
+# {{{ Tickets
+
+CREATE TABLE rt3.Tickets (
+  id numeric(38,0) identity,
+  EffectiveId integer NOT NULL   ,
+  Queue integer NOT NULL   ,
+  Type varchar(16) NULL  ,
+  IssueStatement integer NOT NULL   ,
+  Resolution integer NOT NULL   ,
+  Owner integer NOT NULL   ,
+  Subject varchar(200) NULL,
+  InitialPriority integer NOT NULL   ,
+  FinalPriority integer NOT NULL   ,
+  Priority integer NOT NULL   ,
+  TimeEstimated integer NOT NULL   ,
+  TimeWorked integer NOT NULL   ,
+  Status varchar(10) NULL  ,
+  TimeLeft integer NOT NULL   ,
+  Told DATETIME NULL  ,
+  Starts DATETIME NULL  ,
+  Started DATETIME NULL  ,
+  Due DATETIME NULL  ,
+  Resolved DATETIME NULL  ,
+
+
+  LastUpdatedBy integer NOT NULL   ,
+  LastUpdated DATETIME NULL  ,
+  Creator integer NOT NULL   ,
+  Created DATETIME NULL  ,
+  Disabled numeric(1) NOT NULL  ,
+  PRIMARY KEY (id)
+) ;
+
+CREATE INDEX Tickets1 ON Tickets (Queue, Status) ;
+CREATE INDEX Tickets2 ON Tickets (Owner) ;
+CREATE INDEX Tickets3 ON Tickets (EffectiveId) ;
+CREATE INDEX Tickets4 ON Tickets (id, Status) ;
+CREATE INDEX Tickets5 ON Tickets (id, EffectiveId) ;
+CREATE INDEX Tickets6 ON Tickets (EffectiveId, Type) ;
+
+# }}}
+
+# {{{ ScripActions
+
+CREATE TABLE rt3.ScripActions (
+  id numeric(38,0) identity,
+  Name varchar(200) NULL  ,
+  Description varchar(255) NULL  ,
+  ExecModule varchar(60) NULL  ,
+  Argument varchar(255) NULL  ,
+  Creator integer NOT NULL   ,
+  Created DATETIME NULL  ,
+  LastUpdatedBy integer NOT NULL   ,
+  LastUpdated DATETIME NULL  ,
+  PRIMARY KEY (id)
+) ;
+
+# }}}
+
+# {{{ Templates
+
+CREATE TABLE rt3.Templates (
+  id numeric(38,0) identity,
+  Queue integer NOT NULL  ,
+  Name varchar(200) NOT NULL  ,
+  Description varchar(255) NULL  ,
+  Type varchar(16) NULL  ,
+  Language varchar(16) NULL  ,
+  TranslationOf integer NOT NULL   ,
+  Content text NULL  ,
+  LastUpdated DATETIME NULL  ,
+  LastUpdatedBy integer NOT NULL   ,
+  Creator integer NOT NULL   ,
+  Created DATETIME NULL  ,
+  PRIMARY KEY (id)
+) ;
+
+# }}}
+
+# {{{ TicketCustomFieldValues 
+
+CREATE TABLE rt3.TicketCustomFieldValues (
+  id numeric(38,0) identity,
+  Ticket int NOT NULL  ,
+  CustomField int NOT NULL  ,
+  Content varchar(255) NULL  ,
+
+  Creator integer NOT NULL   ,
+  Created DATETIME NULL  ,
+  LastUpdatedBy integer NOT NULL   ,
+  LastUpdated DATETIME NULL  ,
+  PRIMARY KEY (id)
+) ;
+
+CREATE INDEX TicketCustomFieldValues1 ON TicketCustomFieldValues (CustomField,Ticket,Content); 
+CREATE INDEX TicketCustomFieldValues2 ON TicketCustomFieldValues (CustomField,Ticket); 
+
+# }}}
+
+# {{{ CustomFields
+
+CREATE TABLE rt3.CustomFields (
+  id numeric(38,0) identity,
+  Name varchar(200) NULL  ,
+  Type varchar(200) NULL  ,
+  Queue integer NOT NULL  ,
+  Description varchar(255) NULL  ,
+  SortOrder integer NOT NULL   ,
+
+  Creator integer NOT NULL   ,
+  Created DATETIME NULL  ,
+  LastUpdatedBy integer NOT NULL   ,
+  LastUpdated DATETIME NULL  ,
+  Disabled numeric(1) NOT NULL  ,
+  PRIMARY KEY (id)
+) ;
+
+CREATE INDEX CustomFields1 on CustomFields (Disabled, Queue);
+
+
+# }}}
+
+# {{{ CustomFieldValues 
+
+CREATE TABLE rt3.CustomFieldValues (
+  id numeric(38,0) identity,
+  CustomField int NOT NULL  ,
+  Name varchar(200) NULL  ,
+  Description varchar(255) NULL  ,
+  SortOrder integer NOT NULL   ,
+
+  Creator integer NOT NULL   ,
+  Created DATETIME NULL  ,
+  LastUpdatedBy integer NOT NULL   ,
+  LastUpdated DATETIME NULL  ,
+  PRIMARY KEY (id)
+) ;
+
+CREATE INDEX CustomFieldValues1 ON CustomFieldValues (CustomField);
+ 
+# }}}
+
+
+# {{{ Attributes
+
+CREATE TABLE rt3.Attributes (
+  id numeric(38,0) identity,
+  Name varchar(255) NULL  ,
+  Description varchar(255) NULL  ,
+  Content text,
+  ContentType varchar(16),
+  ObjectType varchar(64),
+  ObjectId integer, # foreign key to anything
+  Creator integer NOT NULL   ,
+  Created DATETIME NULL  ,
+  LastUpdatedBy integer NOT NULL   ,
+  LastUpdated DATETIME NULL  ,
+  PRIMARY KEY (id)
+) ;
+
+CREATE INDEX Attributes1 on Attributes(Name);
+CREATE INDEX Attributes2 on Attributes(ObjectType, ObjectId);
+
+# }}}
+
+# {{{ Sessions
+
+# sessions is used by Apache::Session to keep sessions in the database.
+# We should have a reaper script somewhere.
+
+CREATE TABLE rt3.sessions (
+    id char(32) NOT NULL,
+    a_session TEXT,
+    LastUpdated DATETIME,
+    PRIMARY KEY (id)
+);
+
+# }}}

Modified: rt/branches/rt-3.1/lib/RT.pm.in
==============================================================================
--- rt/branches/rt-3.1/lib/RT.pm.in	(original)
+++ rt/branches/rt-3.1/lib/RT.pm.in	Sat May 29 01:49:03 2004
@@ -51,6 +51,8 @@
 $CORE_CONFIG_FILE = "@CONFIG_FILE_PATH@/RT_Config.pm";
 $SITE_CONFIG_FILE = "@CONFIG_FILE_PATH@/RT_SiteConfig.pm";
 
+ at DATABASE_ENV_PREF@
+
 $BasePath = '@RT_PATH@';
 
 $EtcPath = '@RT_ETC_PATH@';

Modified: rt/branches/rt-3.1/lib/RT/Handle.pm
==============================================================================
--- rt/branches/rt-3.1/lib/RT/Handle.pm	(original)
+++ rt/branches/rt-3.1/lib/RT/Handle.pm	Sat May 29 01:49:03 2004
@@ -48,7 +48,13 @@
 
 eval "use DBIx::SearchBuilder::Handle::$RT::DatabaseType;
 \@ISA= qw(DBIx::SearchBuilder::Handle::$RT::DatabaseType);";
-#TODO check for errors here.
+
+if ($@) {
+    die "Unable to load DBIx::SearchBuilder database handle for '$RT::DatabaseType'.".
+        "\n".
+        "Perhaps you've picked an invalid database type or spelled it incorrectly.".
+        "\n". $@;
+}
 
 =head2 Connect
 

Modified: rt/branches/rt-3.1/releng.cnf
==============================================================================
--- rt/branches/rt-3.1/releng.cnf	(original)
+++ rt/branches/rt-3.1/releng.cnf	Sat May 29 01:49:03 2004
@@ -1,5 +1,5 @@
 PRODUCT			        = rt
-TAG			            = 3.1.16
+TAG			            = 3.1.15
 CANONICAL_REPO		    = svn+ssh://svn.bestpractical.com/svn/bps-public/rt/
 TAGS		            = tags/
 TRUNK	                = branches/rt-3.1/

Modified: rt/branches/rt-3.1/sbin/rt-setup-database.in
==============================================================================
--- rt/branches/rt-3.1/sbin/rt-setup-database.in	(original)
+++ rt/branches/rt-3.1/sbin/rt-setup-database.in	Sat May 29 01:49:03 2004
@@ -277,6 +277,10 @@
         do $base_path . "/acl.mysql"
           || die "Couldn't find ACLS for mysql in " . $RT::EtcPath . "\n" . $@;
     }
+    elsif ( $RT::DatabaseType =~ /^Sybase$/i ) {
+        do $base_path . "/acl.Sybase"
+          || die "Couldn't find ACLS for Sybase in " . $RT::EtcPath . "\n" . $@;
+    }
     elsif ( $RT::DatabaseType =~ /^informix$/i ) {
         do $base_path . "/acl.Informix"
           || die "Couldn't find ACLS for Informix in " . $RT::EtcPath . "\n" . $@;


More information about the Rt-commit mailing list