[dev] Patch for scripts/sql ...

Marc G. Fournier scrappy at hub.org
Sat Sep 25 11:09:06 PDT 2004


The attached patch changes the README to reflect recent changes in file 
names for the instructions on loading under PostgreSQL ... it also adds a 
horde_datatree.pgsql.sql file that includes the CREATE SEQUENCE that 
Pear::DB doesn't appear to be doing properly under PostgreSQL, as well as 
appropriate GRANT commands for those using the horde user :(



----
Marc G. Fournier           Hub.Org Networking Services (http://www.hub.org)
Email: scrappy at hub.org           Yahoo!: yscrappy              ICQ: 7615664
-------------- next part --------------
diff -Ncr webmail.base/scripts/sql/README webmail/scripts/sql/README
*** webmail.base/scripts/sql/README	Sat Sep 18 14:20:59 2004
--- webmail/scripts/sql/README	Sat Sep 25 15:06:51 2004
***************
*** 76,82 ****
  PostgreSQL
  ~~~~~~~~~~
  # su - postgres  (or whatever your database runs as... usually postgres)
! $ psql -d template1 -f pgsql_create.sql
  
  This script will create a "horde" database and a "horde" user.  You
  should set a password for this user with this command (if you didn't
--- 76,82 ----
  PostgreSQL
  ~~~~~~~~~~
  # su - postgres  (or whatever your database runs as... usually postgres)
! $ psql -d template1 -f create.pgsql.sql
  
  This script will create a "horde" database and a "horde" user.  You
  should set a password for this user with this command (if you didn't
***************
*** 86,94 ****
  
  Then create the tables within the "horde" database:
  
! $ psql -d horde -f auth.sql
! $ psql -d horde -f prefs.sql
! $ psql -d horde -f datatree.sql
  
  These scripts will also grant the "horde" user the necessary privileges to
  each of the tables.
--- 86,93 ----
  
  Then create the tables within the "horde" database:
  
! $ psql -d horde -f horde_prefs.sql
! $ psql -d horde -f horde_datatree.pgsql.sql
  
  These scripts will also grant the "horde" user the necessary privileges to
  each of the tables.
diff -Ncr webmail.base/scripts/sql/create.pgsql.sql webmail/scripts/sql/create.pgsql.sql
*** webmail.base/scripts/sql/create.pgsql.sql	Sat Sep 18 14:20:59 2004
--- webmail/scripts/sql/create.pgsql.sql	Fri Sep 24 21:59:26 2004
***************
*** 2,8 ****
  --
  -- Uncomment the ALTER line below, and change the password.  Then run as:
  --
! -- $ psql -d template1 -f pgsql_create.sql
  
  CREATE DATABASE horde;
  
--- 2,8 ----
  --
  -- Uncomment the ALTER line below, and change the password.  Then run as:
  --
! -- $ psql -d template1 -f create.pgsql.sql
  
  CREATE DATABASE horde;
  
diff -Ncr webmail.base/scripts/sql/horde_datatree.pgsql.sql webmail/scripts/sql/horde_datatree.pgsql.sql
*** webmail.base/scripts/sql/horde_datatree.pgsql.sql	Wed Dec 31 20:00:00 1969
--- webmail/scripts/sql/horde_datatree.pgsql.sql	Sat Sep 25 13:47:24 2004
***************
*** 0 ****
--- 1,35 ----
+ -- $Horde: horde/scripts/sql/horde_datatree.mysql.sql,v 1.1 2004/09/18 17:20:59 chuck Exp $
+ 
+ CREATE TABLE horde_datatree (
+        datatree_id INT NOT NULL,
+        group_uid VARCHAR(255) NOT NULL,
+        user_uid VARCHAR(255) NOT NULL,
+        datatree_name VARCHAR(255) NOT NULL,
+        datatree_parents VARCHAR(255) NOT NULL,
+        datatree_order INT,
+        datatree_data TEXT,
+        datatree_serialized SMALLINT DEFAULT 0 NOT NULL,
+        datatree_updated TIMESTAMP,
+        PRIMARY KEY (datatree_id)
+ );
+ 
+ CREATE INDEX datatree_datatree_name_idx ON horde_datatree (datatree_name);
+ CREATE INDEX datatree_group_idx ON horde_datatree (group_uid);
+ CREATE INDEX datatree_user_idx ON horde_datatree (user_uid);
+ CREATE INDEX datatree_serialized_idx ON horde_datatree (datatree_serialized);
+ 
+ CREATE TABLE horde_datatree_attributes (
+     datatree_id INT NOT NULL,
+     attribute_name VARCHAR(255) NOT NULL,
+     attribute_key VARCHAR(255) DEFAULT '' NOT NULL,
+     attribute_value TEXT
+ );
+ 
+ CREATE INDEX datatree_attribute_idx ON horde_datatree_attributes (datatree_id);
+ CREATE INDEX datatree_attribute_name_idx ON horde_datatree_attributes (attribute_name);
+ CREATE INDEX datatree_attribute_key_idx ON horde_datatree_attributes (attribute_key);
+ 
+ CREATE SEQUENCE horde_datatree_seq;
+ 
+ GRANT SELECT, INSERT, UPDATE, DELETE ON horde_datatree TO horde;
+ GRANT SELECT, INSERT, UPDATE, DELETE ON horde_datatree_attributes TO horde;


More information about the dev mailing list