From: Jan Schneider Date: Fri, 28 Jan 2011 17:59:32 +0000 (+0100) Subject: No longer necessary, migrations are complete now. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=21accfc404b907a6d2b5422dcce34eb991f828c4;p=horde.git No longer necessary, migrations are complete now. --- diff --git a/horde/scripts/sql/README b/horde/scripts/sql/README deleted file mode 100644 index 70d9ba574..000000000 --- a/horde/scripts/sql/README +++ /dev/null @@ -1,167 +0,0 @@ -=================================== - Horde Database Installation Guide -=================================== - -:Contact: horde@lists.horde.org - - -Purpose of this file -~~~~~~~~~~~~~~~~~~~~ - -This file will hopefully ease the installation and configuration of your -database for use with Horde. The scope of the document deals primarily with -using your database with Horde and should not be considered a resource for -general database tasks. - - -Requirements for Horde -~~~~~~~~~~~~~~~~~~~~~~ - -Horde currently supports at least 7 databases: - - - MySQL http://www.mysql.com/ - - PostgreSQL http://www.postgresql.org/ - - Oracle http://www.oracle.com/ - - Sybase http://www.sybase.com/ - - SQLite http://www.sqlite.org/ - - MS SQL http://www.microsoft.com/sql/ - - MSDE http://www.microsoft.com/sql/msde/ - -MySQL and PostgreSQL are regularly used by the development team, and will work -with no problems. Oracle and SQLite support has been much improved recently -and works fine too. Sybase was reported working in the previous version of -Horde/IMP by some of our users, and is assumed to still work... but that -hasn't been verified recently. - - -Before You Begin -~~~~~~~~~~~~~~~~ - -You will need to have your database preconfigured and working on your system -before you even get to this stage. For help with this, please consult your -database specific help files. - -Before using any of the scripts listed below, please look over them to ensure -that any system-specific settings (or personal choices) are set to your -desired settings (eg. ``username``, etc.). - -In addition, if you create your own database user or change the -permissions for the ``horde`` user, you **MUST** ensure that the user -that Horde connects to the database as is able to create -tables. Otherwise Horde will be unable to create sequence tables for -tracking primary keys. - -**PLEASE NOTE** that the database configuration steps listed below **MUST** -match what is configured within Horde. - -Specifically, if you change the database name, user, or password while -configuring the database (below), you will need to make the same changes to -your Horde configuration files as well. - - -MySQL -~~~~~ - -The mysql_create.sql script will create a database called ``horde``, and a -user called ``horde`` (with password ``horde``) that has full rights to the -database. *Note that with MySQL, PEAR DB emulates sequences by automatically -creating extra tables ending in _seq, so the MySQL ``horde`` user must have -``CREATE`` privilege on the ``horde`` database. - -This script needs to be run as the MySQL root user (which is *NOT* the same as -the UNIX/Linux root user):: - - $ mysql --user=root --password= < create.mysql.sql - -After running this script, it's a good idea to restart your MySQL server:: - - $ mysqladmin --user=root --password= reload - -To check that this is working, the following command should connect without -errors:: - - $ mysql --user=horde --password=horde horde - -Type ``quit`` to quit MySQL. - - -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 uncomment the -one in create.pgsql.sql):: - - $ psql -qc "ALTER USER horde WITH PASSWORD 'pass';" template1 postgres - -Make sure to run any application SQL files as the ``horde`` user as well. - - -Oracle -~~~~~~ - -Run ``sqlplus``. Login, then [we need instructions for creating the database -and user here]. - -That should be it. Restart Oracle just to be sure, and try it. Then create -the tables within the ``horde`` database:: - -[Also need those instructions here.] - - -Sybase -~~~~~~ - -To create the database, from ``isql`` run:: - - create database horde - -Next, you should (recommended) create a login to use with this database. The -``isql`` command for this is:: - - sp_addlogin - -Next you need to change the ownership of the database to this new user. The -``isql`` command for this is:: - - sp_changedbowner - -After that, you just need to set up your tables within the database. To do -that, just run this command from the command line:: - - isql -i horde_users.sql -U -P - isql -i horde_prefs.sql -U -P - - -MSDE 2000 (and possibly MS SQL Server) -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -To create user and database, use the osql command:: - - C:\>osql -U sa -P admin_password -S localhost -i create.msde.sql - -Be sure to change the password for the horde user in the script file. To -specify a particular instance of the SQL server use the -/ for the -S flag. If you aren't using mixed SQL -authentication, then you'll need to modify the script to associate the horde -user with a windows user account and run the script in the following manner as -the Administrator:: - - C:\>osql -E -S localhost -i create.msde.sql - -If you're having problems running this script on a SQL server on the network, -be sure the server is set up to allow network access. - - -Additional Notes -~~~~~~~~~~~~~~~~ - -This is by far not a complete HOWTO. This is just a compiled list of what -people have contributed so far. If you have tips, ideas, suggestions or -anything else that you think could help others in setting up their database -for use with Horde, please let us know. - - diff --git a/horde/scripts/sql/README.OCI8 b/horde/scripts/sql/README.OCI8 deleted file mode 100644 index f7cac7d04..000000000 --- a/horde/scripts/sql/README.OCI8 +++ /dev/null @@ -1,244 +0,0 @@ -FIRST OF ALL: -This is not my first documentation! but my first in english. -Feel free to contact me at torsten@flammiger.org if you have -any suggestions or problems related to this docs - -All i will write about Oracle with Horde is based on Oracle >= 8i -though it should work with 9i too. - -I think (i'm sure) 'Up to date' available distributions -are capable to run Oracle. I have tested it on -Slackware 7.1/8.0 (8.1.6) and have running it on Gentoo 1.2 (8.1.7.4) -without any Problems. Some distributions are certified like SuSE or -RedHat. On Debian it should also run. - -Furthermore i'll assume, that no "normal" user is going to install -or is in need to install an Oracle DB (of course there are some freaks ;) -so knowledge about setting up and maintain an Oracle -DB is indispensable! Maybe this is the reason why no Admin -has ever posted any docs about getting Horde work with Oracle - -NOTE: all docs are available from www.oracle.com for free (AFAIK) - -Now let's begin: - -Case 1) -I'll assume that you do not have an instance running and therefore -are about to install a fresh instance "horde" . - --- check and if needed change shared memory parameters --- create at least the dba group --- create your oracle user, name it as you like - make sure your ora-user is in the group dba --- su - --- set up all the appropriate environment variables for oracle - take a close look at the install howto provided by oracle --- mount the CD (if it is your source media) --- run the script runInstaller - better to have X11 installed ;) - Attention: If you are about to install Oracle 9i - do NOT run the installer from directly from your CD! - like cd /cdrom and then start it by typing ./runInstaller - you won't be able to unmount the CD later on but you have to - because 9i is a 3CD-Set --- follow the instructions given by the installation programm - at the point where you are asked for an installation method - choose "user-defined". This ist especially VERY IMPORTENT if you - are about to install 8i since you have to patch the installation - BEFORE you create your database! If you not choose "user-defined" - the program "dbassist" will automatically start at the end of - the installation process and will hang and/or fail. --- at the end of your installation you have to configure your listener.ora, - tnsnames.ora and your sqlnet.ora This is all done by the - installation programm. --- Now: if you use 8.1.7 get the patch glibc-2.1.3-stubs.tar.gz from Oracle. - It's at the same page like the db-source. Install as described in README.stub - (it's in the package so first untar it somewhere else or use 'mc' ) --- Now create your database. Run "dbassist" - It's now on you to decide how big the initial tablespaces are, how many - control files you like, of course how it's name will be and what - option you plan to use like InterMedia. It's Your Decision ! - (BTW: the defaults will work and are very time consuming ;) - At the end let the dbasist program save the configuration. You can choose - location and name. Now you can close dbassist. --- change to the location where you stored the scripts and take a short look - at least into oraclerun.sh and oraclerun1.sh. If all is OK create the database: - run ./oraclerun.sh. - Sit back take a cup of coffee and hope all will be good ;) - - If you choosed the InterMedia option the creation process will take - about 2 and a half hour (on my 500MHz-P3 :-). Without Java it will take - about 1 hour. (this both ist short - 9i takes as min. twice that time !) - - NOTE: choosing InterMedia will give you enhanced possibilities for storing - and manipulating media files. Look at http://intermedia.as-dataservice.de/ - for an example... - - ANOTHER NOTE: if you installed 8.1.7 and afterwards applied an up to date - patchset (like 8.1.7.4) you MUST repatch your installation with the - glibc-stubs patch or your DB won't run - - PROBLEMS ?: Look at www.orafaq.com for your answer - -All went fine? Good, lets go ahead and create a new tablespace called horde - --- The database should run after it was succesfully created. Login as user system - or sys (like you prefer). The passwords where written to you on STDOUT. - Please change them! I know databases running for years storing important data - and still have the default password !! - (manager for system and change_on_install for sys) - --- sqlplus sys/change_on_install@ - if you properly set the ORACLE_SID environment variable you can ommit the - trailing @ when you are logged on to the machine which is running the DB. - --- create the tablespace for horde - sql> CREATE TABLESPACE HORDE - LOGGING - DATAFILE '/HORDE.dbf' SIZE M; - - This is indeed very simple but it works and nothing has to be in uppercase - letters. After a few seconds or minutes - depends on how many megabytes - you gave to that tablespace - a new datafile has been created. - --- We can now create a user with default tablespace HORDE, lets name him horde: - - CREATE USER HORDE PROFILE DEFAULT IDENTIFIED BY - TABLESPACE HORDE TEMPORARY TABLESPACE TEMP QUOTA UNLIMITED ON TEMP - QUOTA UNLIMITED ON HORDE ACCOUNT UNLOCK; - GRANT CONNECT TO HORDE; - --- commit your work: > commit; - and log out --- login as user horde: sqlplus horde/@ and create the tables - !/scripts/db/oracle_create.sql and commit your aktion: > commit; - the tables will be created in the default tablespace for your horde user - -OK now you can configure Horde to use your instance but after a reboot Oracle -will not start automaticly. That is what we are going to configure now. - --- logout of oracle, login as user sys or - and shutdown your instance: (hope your oracle user is in the group dba - - if not he can't shut down your instance) - > connect internal - > shutdown immediate - and logout... - --- test the script "dbstart" in $ORACLE_HOME/bin If the DB does not start - you have to edit it or create a link from $ORACLE_HOME/dbs/init.ora - to $ORACLE_HOME/admin//pfile/init.ora - ( dbstart will look for your sid-files in subdir "dbs" but these are stored - under $ORACLE_HOME/admin//pfile/ - this maybe is a bug or a - feature in the oracle installer ) - test "dbstart" again - now it should work, i hope - --- edit the file /etc/oratab - Change the line - ::N to - ::Y - --- now change or create a startup script which is executed at boot time. It should contain - something like this: - - su - -c "/bin/lsnrctl start" - su - -c "/bin/dbstart" - - and of course your instance should be stopped a regular way. Place this - in the appropriate script which is executed at shutdown time - - su - -c "/bin/lsnrctl stop" - su - -c "/bin/dbshut" - --- test it - -End of Case 1) - - -Case 2) - -Problem: You have an allready running oracle database and would like -to add a new instance. Solution is quiet easy. -For now, the new database' name will be --> horde - -Before i start i'll make some assumptions: -(PLEASE CHANGE THE PATHNAMES AS NECESSARY ) - -1. $ORACLE_HOME=/home/oracle -2. $ORACLE_BASE = $ORACLE_HOME -3. Your existing Database is installed under $ORACLE_HOME/oradata/ -4. Your existing Trace/Dump/pfile/bdump... - directories are installed under - $ORACLE_HOME/admin// - - Therefore your new horde database files will go into another directory: - $ORACLE_HOME/oradata/horde/ - - The Trace/Dump/pfile/bdump... - dirs go to: - $ORACLE_HOME/admin/horde/ - - The inithorde.ora file in $ORACLE_HOME/dbs should be a link to: - $ORACLE_HOME/admin/horde/pfile/init.ora - -Lets begin: - --- create the directories for your new db (as your ORACLE user): - #> mkdir -p $ORACLE_HOME/oradata/horde/archive - #> mkdir -p $ORACLE_HOME/admin/horde/adhoc \ - $ORACLE_HOME/admin/horde/bdump \ - $ORACLE_HOME/admin/horde/cdump \ - $ORACLE_HOME/admin/horde/create \ - $ORACLE_HOME/admin/horde/exp \ - $ORACLE_HOME/admin/horde/pfile \ - $ORACLE_HOME/admin/horde/udump - --- copy your existing init.ora file from $ORACLE_HOME/admin//pfile/ - to $ORACLE_HOME/admin/horde/pfile/ and make the appropriate changes in it - CHANGE AT LEAST THE PATHNAMES !!! - --- make the link from $ORACLE_HOME/dbs/inithorde.ora to - $ORACLE_HOME/admin/horde/pfile/init.ora - - #> ln -s $ORACLE_HOME/admin/horde/pfile/init.ora $ORACLE_HOME/dbs/inithorde.ora - --- set ORACLE_SID to horde - #> ORACLE_SID=horde - --- login and startup the instance - #> sqlplus /nolog - sql> startup pfile=/home/oracle/admin/horde/pfile/init.ora nomount - --- create the database from create_horde_db.sql - you should of course have saved it somwhere ;) - sql> !/path/to/create_horde_db.sql - - as template i took the script from - http://www.adp-gmbh.ch/ora/admin/creatingdbmanually.html#samplecreatedatabase - and made some minor changes. - --- create the data dictionary, etc. - sql> !/home/oracle/rdbms/admin/catalog.sql - sql> !/home/oracle/rdbms/admin/catproc.sql - sql> !/home/oracle/rdbms/admin/caths.sql - sql> commit; - sql> exit - --- now add a new line to /etc/oratab - - old ( only 1 instance ): - :/home/oracle:Y - - new ( with the new one ): - :/home/oracle:Y - horde:/home/oracle:Y - --- add the new instance to your tnsnames.ora - use the java gui net8assist or copy and paste the statements by yourself and - make the changes as needed - --- after all, the scripts dbstart und dbshut will then automaticly start and shutdown all - instances at once - -Creating the Tablespace and required user is the same as described above - - -I hope that there are not so many spelling mistakes ( my native language is german ) -and that this will be helpfull for someone - -End of Case 2) diff --git a/horde/scripts/sql/create.mssql.sql b/horde/scripts/sql/create.mssql.sql deleted file mode 100644 index a8b249836..000000000 --- a/horde/scripts/sql/create.mssql.sql +++ /dev/null @@ -1,286 +0,0 @@ -USE master -GO - -CREATE DATABASE horde -GO - -EXEC sp_addlogin 'horde', 'horde_mgr', 'horde' -GO - -USE horde -GO - -EXEC sp_grantdbaccess 'horde' -GO - -CREATE TABLE horde_users ( - user_uid VARCHAR(255) NOT NULL, - user_pass VARCHAR(255) NOT NULL, - user_soft_expiration_date INT, - user_hard_expiration_date INT, - - PRIMARY KEY (user_uid) -) -GO - -CREATE TABLE horde_signups ( - user_name VARCHAR(255) NOT NULL, - signup_date INT NOT NULL, - signup_host VARCHAR(255) NOT NULL, - signup_data TEXT NOT NULL, - PRIMARY KEY (user_name) -) -GO - -CREATE TABLE horde_groups ( - group_uid INT NOT NULL, - group_name VARCHAR(255) NOT NULL, - group_parents VARCHAR(255) NOT NULL, - group_email VARCHAR(255), - PRIMARY KEY (group_uid) -) -GO - -CREATE TABLE horde_groups_members ( - group_uid INT NOT NULL, - user_uid VARCHAR(255) NOT NULL -) -GO - -CREATE INDEX group_uid_idx ON horde_groups_members (group_uid) -CREATE INDEX user_uid_idx ON horde_groups_members (user_uid) -GO - -CREATE TABLE horde_perms ( - perm_id INT NOT NULL IDENTITY, - perm_name VARCHAR(255) NOT NULL, - perm_parents VARCHAR(255) NOT NULL, - perm_data TEXT, - PRIMARY KEY (perm_id) -) -GO - -CREATE TABLE horde_prefs ( - pref_uid VARCHAR(200) NOT NULL, - pref_scope VARCHAR(16) DEFAULT '' NOT NULL, - pref_name VARCHAR(32) NOT NULL, - pref_value TEXT NULL, - - PRIMARY KEY (pref_uid, pref_scope, pref_name) -) -GO - -CREATE INDEX pref_uid_idx ON horde_prefs (pref_uid) -CREATE INDEX pref_scope_idx ON horde_prefs (pref_scope) -GO - -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, - - PRIMARY KEY (datatree_id) -) -GO - -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 INDEX datatree_parents_idx ON horde_datatree (datatree_parents) -GO - -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 VARCHAR(MAX) -) -GO - -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) -GO - -CREATE TABLE horde_tokens ( - token_address VARCHAR(100) NOT NULL, - token_id VARCHAR(32) NOT NULL, - token_timestamp BIGINT NOT NULL, - - PRIMARY KEY (token_address, token_id) -) -GO - -CREATE TABLE horde_vfs ( - vfs_id INT NOT NULL, - vfs_type SMALLINT NOT NULL, - vfs_path VARCHAR(255) NOT NULL, - vfs_name VARCHAR(255) NOT NULL, - vfs_modified BIGINT NOT NULL, - vfs_owner VARCHAR(255) NOT NULL, - vfs_data TEXT, - - PRIMARY KEY (vfs_id) -) -GO - -CREATE INDEX vfs_path_idx ON horde_vfs (vfs_path) -CREATE INDEX vfs_name_idx ON horde_vfs (vfs_name) -GO - -CREATE TABLE horde_histories ( - history_id INT NOT NULL, - object_uid VARCHAR(255) NOT NULL, - history_action VARCHAR(32) NOT NULL, - history_ts BIGINT NOT NULL, - history_desc TEXT, - history_who VARCHAR(255), - history_extra TEXT, - - PRIMARY KEY (history_id) -) -GO - -CREATE INDEX history_action_idx ON horde_histories (history_action) -CREATE INDEX history_ts_idx ON horde_histories (history_ts) -CREATE INDEX history_uid_idx ON horde_histories (object_uid) -GO - -CREATE TABLE horde_syncml_map ( - syncml_syncpartner VARCHAR(255) NOT NULL, - syncml_db VARCHAR(255) NOT NULL, - syncml_uid VARCHAR(255) NOT NULL, - syncml_cuid VARCHAR(255), - syncml_suid VARCHAR(255), - syncml_timestamp BIGINT -) -GO - -CREATE INDEX syncml_syncpartner_idx ON horde_syncml_map (syncml_syncpartner); -CREATE INDEX syncml_db_idx ON horde_syncml_map (syncml_db); -CREATE INDEX syncml_uid_idx ON horde_syncml_map (syncml_uid); -CREATE INDEX syncml_cuid_idx ON horde_syncml_map (syncml_cuid); -CREATE INDEX syncml_suid_idx ON horde_syncml_map (syncml_suid); -GO - -CREATE TABLE horde_syncml_anchors( - syncml_syncpartner VARCHAR(255) NOT NULL, - syncml_db VARCHAR(255) NOT NULL, - syncml_uid VARCHAR(255) NOT NULL, - syncml_clientanchor VARCHAR(255), - syncml_serveranchor VARCHAR(255) -); -GO - -CREATE INDEX syncml_anchors_syncpartner_idx ON horde_syncml_anchors (syncml_syncpartner); -CREATE INDEX syncml_anchors_db_idx ON horde_syncml_anchors (syncml_db); -CREATE INDEX syncml_anchors_uid_idx ON horde_syncml_anchors (syncml_uid); -GO - -CREATE TABLE horde_alarms ( - alarm_id VARCHAR(255) NOT NULL, - alarm_uid VARCHAR(255), - alarm_start DATETIME NOT NULL, - alarm_end DATETIME, - alarm_methods VARCHAR(255), - alarm_params TEXT, - alarm_title VARCHAR(255) NOT NULL, - alarm_text TEXT, - alarm_snooze DATETIME, - alarm_dismissed SMALLINT DEFAULT 0 NOT NULL, - alarm_internal TEXT -); -GO - -CREATE INDEX alarm_id_idx ON horde_alarms (alarm_id); -CREATE INDEX alarm_user_idx ON horde_alarms (alarm_uid); -CREATE INDEX alarm_start_idx ON horde_alarms (alarm_start); -CREATE INDEX alarm_end_idx ON horde_alarms (alarm_end); -CREATE INDEX alarm_snooze_idx ON horde_alarms (alarm_snooze); -CREATE INDEX alarm_dismissed_idx ON horde_alarms (alarm_dismissed); -GO - -CREATE TABLE horde_cache ( - cache_id VARCHAR(32) NOT NULL, - cache_timestamp BIGINT NOT NULL, - cache_expiration BIGINT NOT NULL, - cache_data TEXT, - - PRIMARY KEY (cache_id) -); -GO - -CREATE TABLE horde_locks ( - lock_id VARCHAR(36) NOT NULL, - lock_owner VARCHAR(32) NOT NULL, - lock_scope VARCHAR(32) NOT NULL, - lock_principal VARCHAR(255) NOT NULL, - lock_origin_timestamp BIGINT NOT NULL, - lock_update_timestamp BIGINT NOT NULL, - lock_expiry_timestamp BIGINT NOT NULL, - lock_type SMALLINT NOT NULL, - - PRIMARY KEY (lock_id) -); -GO - -CREATE TABLE horde_activesync_state ( - sync_time INT, - sync_key VARCHAR(255) NOT NULL, - sync_data TEXT, - sync_devid VARCHAR(255), - sync_folderid VARCHAR(255), - sync_user VARCHAR(255) NOT NULL, --- - PRIMARY KEY (sync_key) -); -GO - -CREATE INDEX activesync_state_folder_idx ON horde_activesync_state (sync_folderid); -CREATE INDEX activesync_state_devid_idx ON horde_activesync_state (sync_devid); -GO - -CREATE TABLE horde_activesync_map ( - message_uid VARCHAR(255) NOT NULL, - sync_modtime INT, - sync_key VARCHAR(255) NOT NULL, - sync_devid VARCHAR(255) NOT NULL, - sync_folderid VARCHAR(255) NOT NULL, - sync_user VARCHAR(255) NOT NULL -); -GO - -CREATE INDEX activesync_map_user_idx ON horde_activesync_map (sync_user); -CREATE INDEX activesync_map_devid_idx ON horde_activesync_map (sync_devid); -CREATE INDEX activesync_map_message_idx ON horde_activesync_map (message_uid); -GO - -CREATE TABLE horde_activesync_device ( - device_id VARCHAR(255) NOT NULL, - device_type VARCHAR(255) NOT NULL, - device_agent VARCHAR(255) NOT NULL, - device_supported TEXT, - device_policykey BIGINT DEFAULT 0, - device_rwstatus INT, --- - PRIMARY KEY (device_id) -); -GO - -CREATE TABLE horde_activesync_device_users ( - device_id VARCHAR(255) NOT NULL, - device_user VARCHAR(255) NOT NULL, - device_ping TEXT, - device_folders TEXT -); -GO - -CREATE INDEX activesync_device_users_idx ON horde_activesync_device_users (device_user); -CREATE INDEX activesync_device_users_id_idx on horde_activesync_device_users (device_id); -GO \ No newline at end of file diff --git a/horde/scripts/sql/create.mysql.sql b/horde/scripts/sql/create.mysql.sql deleted file mode 100644 index 280395c2e..000000000 --- a/horde/scripts/sql/create.mysql.sql +++ /dev/null @@ -1,305 +0,0 @@ --- If you are installing Horde for the first time, you can simply --- direct this file to mysql as STDIN: --- --- $ mysql --user=root --password= < create.mysql.sql --- --- If you are upgrading from a previous version, you will need to comment --- out the the user creation steps below, as well as the schemas for any --- tables that already exist. --- --- If you choose to grant permissions manually, note that with MySQL, PEAR DB --- emulates sequences by automatically creating extra tables ending in _seq, --- so the MySQL "horde" user must have CREATE privilege on the "horde" --- database. --- --- If you are upgrading from Horde 1.x, the Horde tables you have from --- that version are no longer used; you may wish to either delete those --- tables or simply recreate the database anew. - -USE mysql; - -REPLACE INTO user (host, user, password) - VALUES ( - 'localhost', - 'horde', --- IMPORTANT: Change this password. - PASSWORD('horde') -); - -REPLACE INTO db (host, db, user, select_priv, insert_priv, update_priv, - delete_priv, create_priv, drop_priv, index_priv) - VALUES ( - 'localhost', - 'horde', - 'horde', - 'Y', 'Y', 'Y', 'Y', - 'Y', 'Y', 'Y' -); - --- Make sure that priviliges are reloaded. -FLUSH PRIVILEGES; - --- MySQL 3.23.x appears to have "CREATE DATABASE IF NOT EXISTS" and --- "CREATE TABLE IF NOT EXISTS" which would be a nice way to handle --- reinstalls gracefully (someday). For now, drop the database --- manually to avoid CREATE errors. -CREATE DATABASE IF NOT EXISTS horde; - -USE horde; - -CREATE TABLE IF NOT EXISTS horde_users ( - user_uid VARCHAR(255) NOT NULL, - user_pass VARCHAR(255) NOT NULL, - user_soft_expiration_date INT, - user_hard_expiration_date INT, - - PRIMARY KEY (user_uid) -); - -CREATE TABLE IF NOT EXISTS horde_signups ( - user_name VARCHAR(255) NOT NULL, - signup_date VARCHAR(255) NOT NULL, - signup_host VARCHAR(255) NOT NULL, - signup_data TEXT NOT NULL, - PRIMARY KEY user_name (user_name) -); - -CREATE TABLE IF NOT EXISTS horde_groups ( - group_uid INT(10) UNSIGNED NOT NULL, - group_name VARCHAR(255) NOT NULL, - group_parents VARCHAR(255) NOT NULL, - group_email VARCHAR(255), - PRIMARY KEY (group_uid), - UNIQUE KEY group_name (group_name) -); - -CREATE TABLE IF NOT EXISTS horde_groups_members ( - group_uid INT(10) UNSIGNED NOT NULL, - user_uid VARCHAR(255) NOT NULL -); - -CREATE INDEX group_uid_idx ON horde_groups_members (group_uid); -CREATE INDEX user_uid_idx ON horde_groups_members (user_uid); - -CREATE TABLE IF NOT EXISTS horde_perms ( - perm_id INT(11) NOT NULL AUTO_INCREMENT, - perm_name VARCHAR(255) NOT NULL, - perm_parents VARCHAR(255) NOT NULL, - perm_data TEXT, - PRIMARY KEY (perm_id), - UNIQUE KEY perm_name (perm_name) -); - -CREATE TABLE IF NOT EXISTS horde_prefs ( - pref_uid VARCHAR(200) NOT NULL, - pref_scope VARCHAR(16) DEFAULT '' NOT NULL, - pref_name VARCHAR(32) NOT NULL, - pref_value LONGTEXT NULL, - - PRIMARY KEY (pref_uid, pref_scope, pref_name) -); - -CREATE INDEX pref_uid_idx ON horde_prefs (pref_uid); -CREATE INDEX pref_scope_idx ON horde_prefs (pref_scope); - -CREATE TABLE IF NOT EXISTS horde_datatree ( - datatree_id INT UNSIGNED 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, - - 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 INDEX datatree_parents_idx ON horde_datatree (datatree_parents); - -CREATE TABLE IF NOT EXISTS horde_datatree_attributes ( - datatree_id INT UNSIGNED 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 INDEX datatree_attribute_value_idx ON horde_datatree_attributes (attribute_value(255)); - -CREATE TABLE IF NOT EXISTS horde_tokens ( - token_address VARCHAR(100) NOT NULL, - token_id VARCHAR(32) NOT NULL, - token_timestamp BIGINT NOT NULL, - - PRIMARY KEY (token_address, token_id) -); - -CREATE TABLE IF NOT EXISTS horde_vfs ( - vfs_id INT UNSIGNED NOT NULL, - vfs_type SMALLINT UNSIGNED NOT NULL, - vfs_path VARCHAR(255) NOT NULL, - vfs_name VARCHAR(255) NOT NULL, - vfs_modified BIGINT NOT NULL, - vfs_owner VARCHAR(255) NOT NULL, - vfs_data LONGBLOB, - - PRIMARY KEY (vfs_id) -); - -CREATE INDEX vfs_path_idx ON horde_vfs (vfs_path); -CREATE INDEX vfs_name_idx ON horde_vfs (vfs_name); - -CREATE TABLE IF NOT EXISTS horde_histories ( - history_id INT UNSIGNED NOT NULL, - object_uid VARCHAR(255) NOT NULL, - history_action VARCHAR(32) NOT NULL, - history_ts BIGINT NOT NULL, - history_desc TEXT, - history_who VARCHAR(255), - history_extra TEXT, - - PRIMARY KEY (history_id) -); - -CREATE INDEX history_action_idx ON horde_histories (history_action); -CREATE INDEX history_ts_idx ON horde_histories (history_ts); -CREATE INDEX history_uid_idx ON horde_histories (object_uid); - -CREATE TABLE IF NOT EXISTS horde_sessionhandler ( - session_id VARCHAR(32) NOT NULL, - session_lastmodified BIGINT NOT NULL, - session_data LONGBLOB, - - PRIMARY KEY (session_id) -) ENGINE = InnoDB; - -CREATE INDEX session_lastmodified_idx ON horde_sessionhandler (session_lastmodified); - - -CREATE TABLE IF NOT EXISTS horde_syncml_map ( - syncml_syncpartner VARCHAR(255) NOT NULL, - syncml_db VARCHAR(255) NOT NULL, - syncml_uid VARCHAR(255) NOT NULL, - syncml_cuid VARCHAR(255), - syncml_suid VARCHAR(255), - syncml_timestamp INT -); - -CREATE INDEX syncml_syncpartner_idx ON horde_syncml_map (syncml_syncpartner); -CREATE INDEX syncml_db_idx ON horde_syncml_map (syncml_db); -CREATE INDEX syncml_uid_idx ON horde_syncml_map (syncml_uid); -CREATE INDEX syncml_cuid_idx ON horde_syncml_map (syncml_cuid); -CREATE INDEX syncml_suid_idx ON horde_syncml_map (syncml_suid); - -CREATE TABLE IF NOT EXISTS horde_syncml_anchors( - syncml_syncpartner VARCHAR(255) NOT NULL, - syncml_db VARCHAR(255) NOT NULL, - syncml_uid VARCHAR(255) NOT NULL, - syncml_clientanchor VARCHAR(255), - syncml_serveranchor VARCHAR(255) -); - -CREATE INDEX syncml_anchors_syncpartner_idx ON horde_syncml_anchors (syncml_syncpartner); -CREATE INDEX syncml_anchors_db_idx ON horde_syncml_anchors (syncml_db); -CREATE INDEX syncml_anchors_uid_idx ON horde_syncml_anchors (syncml_uid); - -CREATE TABLE IF NOT EXISTS horde_alarms ( - alarm_id VARCHAR(250) NOT NULL, - alarm_uid VARCHAR(250) NOT NULL, - alarm_start DATETIME NOT NULL, - alarm_end DATETIME, - alarm_methods VARCHAR(255), - alarm_params TEXT, - alarm_title VARCHAR(255) NOT NULL, - alarm_text TEXT, - alarm_snooze DATETIME, - alarm_dismissed TINYINT(1) DEFAULT 0 NOT NULL, - alarm_internal TEXT -); - -CREATE INDEX alarm_id_idx ON horde_alarms (alarm_id); -CREATE INDEX alarm_user_idx ON horde_alarms (alarm_uid); -CREATE INDEX alarm_start_idx ON horde_alarms (alarm_start); -CREATE INDEX alarm_end_idx ON horde_alarms (alarm_end); -CREATE INDEX alarm_snooze_idx ON horde_alarms (alarm_snooze); -CREATE INDEX alarm_dismissed_idx ON horde_alarms (alarm_dismissed); - -CREATE TABLE IF NOT EXISTS horde_cache ( - cache_id VARCHAR(32) NOT NULL, - cache_timestamp BIGINT NOT NULL, - cache_expiration BIGINT NOT NULL, - cache_data LONGBLOB, - - PRIMARY KEY (cache_id) -); - -CREATE TABLE IF NOT EXISTS horde_locks ( - lock_id VARCHAR(36) NOT NULL, - lock_owner VARCHAR(32) NOT NULL, - lock_scope VARCHAR(32) NOT NULL, - lock_principal VARCHAR(255) NOT NULL, - lock_origin_timestamp BIGINT NOT NULL, - lock_update_timestamp BIGINT NOT NULL, - lock_expiry_timestamp BIGINT NOT NULL, - lock_type TINYINT UNSIGNED NOT NULL, - - PRIMARY KEY (lock_id) -); - -CREATE TABLE horde_activesync_state ( - sync_time INTEGER, - sync_key VARCHAR(255) NOT NULL, - sync_data LONGTEXT, - sync_devid VARCHAR(255), - sync_folderid VARCHAR(255), - sync_user VARCHAR(255) NOT NULL, --- - PRIMARY KEY (sync_key) -); - -CREATE INDEX activesync_state_folder_idx ON horde_activesync_state (sync_folderid); -CREATE INDEX activesync_state_devid_idx ON horde_activesync_state (sync_devid); - -CREATE TABLE horde_activesync_map ( - message_uid VARCHAR(255) NOT NULL, - sync_modtime INTEGER, - sync_key VARCHAR(255) NOT NULL, - sync_devid VARCHAR(255) NOT NULL, - sync_folderid VARCHAR(255) NOT NULL, - sync_user VARCHAR(255) NOT NULL -); - -CREATE INDEX activesync_map_devid_idx ON horde_activesync_map (sync_devid); -CREATE INDEX activesync_map_message_idx ON horde_activesync_map (message_uid); -CREATE INDEX activesync_map_user_idx ON horde_activesync_map (sync_user); - - -CREATE TABLE horde_activesync_device ( - device_id VARCHAR(255) NOT NULL, - device_type VARCHAR(255) NOT NULL, - device_agent VARCHAR(255) NOT NULL, - device_supported TEXT, - device_policykey BIGINT DEFAULT 0, - device_rwstatus INTEGER, --- - PRIMARY KEY (device_id) -); - -CREATE TABLE horde_activesync_device_users ( - device_id VARCHAR(255) NOT NULL, - device_user VARCHAR(255) NOT NULL, - device_ping TEXT, - device_folders TEXT -); - -CREATE INDEX activesync_device_users_idx ON horde_activesync_device_users (device_user); -CREATE INDEX activesync_device_users_id_idx on horde_activesync_device_users (device_id); - --- Done. diff --git a/horde/scripts/sql/create.oci8.sql b/horde/scripts/sql/create.oci8.sql deleted file mode 100644 index 3ac150943..000000000 --- a/horde/scripts/sql/create.oci8.sql +++ /dev/null @@ -1,336 +0,0 @@ -set doc off; -set sqlblanklines on; - -/** - * Oracle Table Creation Scripts. - * - * @author Miguel Ward - * - * This sql creates the Horde SQL tables in an Oracle 8.x database. Should - * work with Oracle 9.x (and Oracle7 using varchar2). - * - * Notes: - * - * * Obviously you must have Oracle installed on this machine AND you must - * have compiled PHP with Oracle (you included --with-oci8-instant - * --with-oci8 or in the build arguments for PHP, or uncommented the oci8 - * extension in php.ini). - * - * * If you don't use the Instant Client, make sure that the user that starts - * up Apache (usually nobody or www-data) has the following environment - * variables defined: - * - * export ORACLE_HOME=/home/oracle/OraHome1 - * export ORA_NLS=/home/oracle/OraHome1/ocommon/nls/admin/data - * export ORA_NLS33=/home/oracle/OraHome1/ocommon/nls/admin/data - * export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH - * - * YOU MUST CUSTOMIZE THESE VALUES TO BE APPROPRIATE TO YOUR INSTALLATION - * - * You can include these variables in the user's local .profile or in - * /etc/profile, etc. - * - * * No grants are necessary since we connect as the owner of the tables. If - * you wish you can adapt the creation of tables to include tablespace and - * storage information. Since we include none it will use the default - * tablespace values for the user creating these tables. Same with the - * indexes (in theory these should use a different tablespace). - * - * * There is no need to shut down and start up the database! - */ - -rem conn horde/&horde_password@database - -/** - * This is the Horde users table, needed only if you are using SQL - * authentication. - */ - -CREATE TABLE horde_users ( - user_uid VARCHAR2(255) NOT NULL, - user_pass VARCHAR2(255) NOT NULL, - user_soft_expiration_date NUMBER(16), - user_hard_expiration_date NUMBER(16), - - PRIMARY KEY (user_uid) -); - -CREATE TABLE horde_signups ( - user_name VARCHAR2(255) NOT NULL, - signup_date NUMBER(16) NOT NULL, - signup_host VARCHAR2(255) NOT NULL, - signup_data CLOB NOT NULL, - PRIMARY KEY (user_name) -); - -CREATE TABLE horde_groups ( - group_uid NUMBER(16) NOT NULL, - group_name VARCHAR2(255) NOT NULL UNIQUE, - group_parents VARCHAR2(255) NOT NULL, - group_email VARCHAR2(255), - PRIMARY KEY (group_uid) -); - -CREATE TABLE horde_groups_members ( - group_uid NUMBER(16) NOT NULL, - user_uid VARCHAR2(255) NOT NULL -); - -CREATE INDEX group_uid_idx ON horde_groups_members (group_uid); -CREATE INDEX user_uid_idx ON horde_groups_members (user_uid); - -CREATE TABLE horde_perms ( - perm_id NUMBER(16) NOT NULL, - perm_name VARCHAR2(255) NOT NULL UNIQUE, - perm_parents VARCHAR2(255) NOT NULL, - perm_data CLOB, - PRIMARY KEY (perm_id) -); -CREATE SEQUENCE horde_perms_id_seq; -CREATE TRIGGER horde_perms_id_trigger -BEFORE INSERT ON horde_perms -FOR EACH ROW -BEGIN -SELECT horde_perms_id_seq.nextval INTO :new.permid FROM dual; -END; - -/** - * This is the Horde preferences table, holding all of the user-specific - * options for every Horde user. - * - * pref_uid is the username. - * pref_scope is the application the pref belongs to. - * pref_name is the name of the variable to save. - * pref_value is the value saved (can be very long). - * - * We use a CLOB column so that longer column values are supported. - * - * If still using Oracle 7 this should work but you have to use - * VARCHAR2(2000) which is the limit imposed by said version. - */ - -CREATE TABLE horde_prefs ( - pref_uid VARCHAR2(255) NOT NULL, - pref_scope VARCHAR2(16) NOT NULL, - pref_name VARCHAR2(32) NOT NULL, --- See above notes on CLOBs. - pref_value CLOB, - - PRIMARY KEY (pref_uid, pref_scope, pref_name) -); - -CREATE INDEX pref_uid_idx ON horde_prefs (pref_uid); -CREATE INDEX pref_scope_idx ON horde_prefs (pref_scope); - - -/** - * The DataTree tables are used for holding hierarchical data such as Groups, - * Permissions, and data for some Horde applications. - */ - -CREATE TABLE horde_datatree ( - datatree_id NUMBER(16) NOT NULL, - group_uid VARCHAR2(255) NOT NULL, - user_uid VARCHAR2(255), - datatree_name VARCHAR2(255) NOT NULL, - datatree_parents VARCHAR2(255), - datatree_order NUMBER(16), - datatree_data CLOB, - datatree_serialized NUMBER(1) DEFAULT 0 NOT NULL, - - 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_order_idx ON horde_datatree (datatree_order); -CREATE INDEX datatree_serialized_idx ON horde_datatree (datatree_serialized); -CREATE INDEX datatree_parents_idx ON horde_datatree (datatree_parents); - -CREATE TABLE horde_datatree_attributes ( - datatree_id NUMBER(16) NOT NULL, - attribute_name VARCHAR2(255) NOT NULL, - attribute_key VARCHAR2(255), - attribute_value VARCHAR2(4000) -); - -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 INDEX datatree_attribute_value_idx ON horde_datatree_attributes (attribute_value); - - -CREATE TABLE horde_tokens ( - token_address VARCHAR2(100) NOT NULL, - token_id VARCHAR2(32) NOT NULL, - token_timestamp NUMBER(16) NOT NULL, - - PRIMARY KEY (token_address, token_id) -); - - -CREATE TABLE horde_vfs ( - vfs_id NUMBER(16) NOT NULL, - vfs_type NUMBER(8) NOT NULL, - vfs_path VARCHAR2(255), - vfs_name VARCHAR2(255) NOT NULL, - vfs_modified NUMBER(16) NOT NULL, - vfs_owner VARCHAR2(255), - vfs_data BLOB, - - PRIMARY KEY (vfs_id) -); - -CREATE INDEX vfs_path_idx ON horde_vfs (vfs_path); -CREATE INDEX vfs_name_idx ON horde_vfs (vfs_name); - - -CREATE TABLE horde_histories ( - history_id NUMBER(16) NOT NULL, - object_uid VARCHAR2(255) NOT NULL, - history_action VARCHAR2(32) NOT NULL, - history_ts NUMBER(16) NOT NULL, - history_desc CLOB, - history_who VARCHAR2(255), - history_extra CLOB, - - PRIMARY KEY (history_id) -); - -CREATE INDEX history_action_idx ON horde_histories (history_action); -CREATE INDEX history_ts_idx ON horde_histories (history_ts); -CREATE INDEX history_uid_idx ON horde_histories (object_uid); - - -CREATE TABLE horde_sessionhandler ( - session_id VARCHAR2(32) NOT NULL, - session_lastmodified NUMBER(16) NOT NULL, - session_data BLOB, - - PRIMARY KEY (session_id) -); - -CREATE INDEX session_lastmodified_idx ON horde_sessionhandler (session_lastmodified); - - -CREATE TABLE horde_syncml_map ( - syncml_syncpartner VARCHAR2(255) NOT NULL, - syncml_db VARCHAR2(255) NOT NULL, - syncml_uid VARCHAR2(255) NOT NULL, - syncml_cuid VARCHAR2(255), - syncml_suid VARCHAR2(255), - syncml_timestamp NUMBER(16) -); - -CREATE INDEX syncml_syncpartner_idx ON horde_syncml_map (syncml_syncpartner); -CREATE INDEX syncml_db_idx ON horde_syncml_map (syncml_db); -CREATE INDEX syncml_uid_idx ON horde_syncml_map (syncml_uid); -CREATE INDEX syncml_cuid_idx ON horde_syncml_map (syncml_cuid); -CREATE INDEX syncml_suid_idx ON horde_syncml_map (syncml_suid); - -CREATE TABLE horde_syncml_anchors( - syncml_syncpartner VARCHAR2(255) NOT NULL, - syncml_db VARCHAR2(255) NOT NULL, - syncml_uid VARCHAR2(255) NOT NULL, - syncml_clientanchor VARCHAR2(255), - syncml_serveranchor VARCHAR2(255) -); - -CREATE INDEX syncml_anchors_syncpartner_idx ON horde_syncml_anchors (syncml_syncpartner); -CREATE INDEX syncml_anchors_db_idx ON horde_syncml_anchors (syncml_db); -CREATE INDEX syncml_anchors_uid_idx ON horde_syncml_anchors (syncml_uid); - - -CREATE TABLE horde_alarms ( - alarm_id VARCHAR2(255) NOT NULL, - alarm_uid VARCHAR2(255), - alarm_start DATE NOT NULL, - alarm_end DATE, - alarm_methods VARCHAR2(255), - alarm_params CLOB, - alarm_title VARCHAR2(255) NOT NULL, - alarm_text CLOB, - alarm_snooze DATE, - alarm_dismissed NUMBER(1) DEFAULT 0 NOT NULL, - alarm_internal CLOB -); - -CREATE INDEX alarm_id_idx ON horde_alarms (alarm_id); -CREATE INDEX alarm_user_idx ON horde_alarms (alarm_uid); -CREATE INDEX alarm_start_idx ON horde_alarms (alarm_start); -CREATE INDEX alarm_end_idx ON horde_alarms (alarm_end); -CREATE INDEX alarm_snooze_idx ON horde_alarms (alarm_snooze); -CREATE INDEX alarm_dismissed_idx ON horde_alarms (alarm_dismissed); - -CREATE TABLE horde_cache ( - cache_id VARCHAR2(32) NOT NULL, - cache_timestamp NUMBER(16) NOT NULL, - cache_expiration NUMBER(16) NOT NULL, - cache_data BLOB, --- - PRIMARY KEY (cache_id) -); - -CREATE TABLE horde_locks ( - lock_id VARCHAR2(36) NOT NULL, - lock_owner VARCHAR2(32) NOT NULL, - lock_scope VARCHAR2(32) NOT NULL, - lock_principal VARCHAR2(255) NOT NULL, - lock_origin_timestamp NUMBER(16) NOT NULL, - lock_update_timestamp NUMBER(16) NOT NULL, - lock_expiry_timestamp NUMBER(16) NOT NULL, - lock_type NUMBER(8) NOT NULL, - - PRIMARY KEY (lock_id) -); - -CREATE TABLE horde_activesync_state ( - sync_time NUMBER(16), - sync_key VARCHAR2(255) NOT NULL, - sync_data CLOB, - sync_devid VARCHAR2(255), - sync_folderid VARCHAR2(255), - sync_user VARCHAR2(255) NOT NULL, --- - PRIMARY KEY (sync_key) -); - -CREATE INDEX activesync_state_folder_idx ON horde_activesync_state (sync_folderid); -CREATE INDEX activesync_state_devid_idx ON horde_activesync_state (sync_devid); - -CREATE TABLE horde_activesync_map ( - message_uid VARCHAR2(255) NOT NULL, - sync_modtime NUMBER(16), - sync_key VARCHAR2(255) NOT NULL, - sync_devid VARCHAR2(255) NOT NULL, - sync_folderid VARCHAR2(255) NOT NULL, - sync_user VARCHAR2(255) NOT NULL -); - -CREATE INDEX activesync_map_devid_idx ON horde_activesync_map (sync_devid); -CREATE INDEX activesync_map_message_idx ON horde_activesync_map (message_uid); -CREATE INDEX activesync_map_user_idx ON horde_activesync_map (sync_user); - - -CREATE TABLE horde_activesync_device ( - device_id VARCHAR2(255) NOT NULL, - device_type VARCHAR2(255) NOT NULL, - device_agent VARCHAR2(255) NOT NULL, - device_supported CLOB, - device_policykey NUMBER(16) DEFAULT 0, - device_rwstatus NUMBER(8), --- - PRIMARY KEY (device_id) -); - -CREATE TABLE horde_activesync_device_users ( - device_id VARCHAR2(255) NOT NULL, - device_user VARCHAR2(255) NOT NULL, - device_ping CLOB, - device_folders CLOB -); -CREATE INDEX activesync_device_users_idx ON horde_activesync_device_users (device_user); -CREATE INDEX activesync_device_users_id_idx on horde_activesync_device_users (device_id); - -exit diff --git a/horde/scripts/sql/create.pgsql.sql b/horde/scripts/sql/create.pgsql.sql deleted file mode 100644 index 582f889f3..000000000 --- a/horde/scripts/sql/create.pgsql.sql +++ /dev/null @@ -1,266 +0,0 @@ --- Uncomment the ALTER line below and change the password. Then run as: --- --- $ psql -d template1 -f create.pgsql.sql - -CREATE USER horde; --- ALTER USER horde WITH PASSWORD 'pass'; - -CREATE DATABASE horde OWNER horde; - -\c horde horde; - -BEGIN; - -CREATE TABLE horde_users ( - user_uid VARCHAR(255) NOT NULL, - user_pass VARCHAR(255) NOT NULL, - user_soft_expiration_date INTEGER, - user_hard_expiration_date INTEGER, --- - PRIMARY KEY (user_uid) -); - -CREATE TABLE horde_signups ( - user_name VARCHAR(255) NOT NULL, - signup_date INTEGER NOT NULL, - signup_host VARCHAR(255) NOT NULL, - signup_data TEXT NOT NULL, - PRIMARY KEY (user_name) -); - -CREATE TABLE horde_groups ( - group_uid INTEGER NOT NULL, - group_name VARCHAR(255) NOT NULL UNIQUE, - group_parents VARCHAR(255) NOT NULL, - group_email VARCHAR(255), - PRIMARY KEY (group_uid) -); - -CREATE TABLE horde_groups_members ( - group_uid INTEGER NOT NULL, - user_uid VARCHAR(255) NOT NULL -); - -CREATE INDEX group_uid_idx ON horde_groups_members (group_uid); -CREATE INDEX user_uid_idx ON horde_groups_members (user_uid); - -CREATE SEQUENCE horde_perms_id_seq; -CREATE TABLE horde_perms ( - perm_id SERIAL UNIQUE, - perm_name VARCHAR(255) NOT NULL UNIQUE, - perm_parents VARCHAR(255) NOT NULL, - perm_data TEXT, - PRIMARY KEY (perm_id) -); - -CREATE TABLE horde_prefs ( - pref_uid VARCHAR(255) NOT NULL, - pref_scope VARCHAR(16) DEFAULT '' NOT NULL, - pref_name VARCHAR(32) NOT NULL, --- BYTEA needed because Postgres TEXT type doesn't support null chars. - pref_value BYTEA, --- - PRIMARY KEY (pref_uid, pref_scope, pref_name) -); - -CREATE INDEX pref_uid_idx ON horde_prefs (pref_uid); -CREATE INDEX pref_scope_idx ON horde_prefs (pref_scope); - -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, - - 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_order_idx ON horde_datatree (datatree_order); -CREATE INDEX datatree_serialized_idx ON horde_datatree (datatree_serialized); -CREATE INDEX datatree_parents_idx ON horde_datatree (datatree_parents); - -CREATE TABLE horde_datatree_attributes ( - datatree_id INT NOT NULL, - attribute_name VARCHAR(255) NOT NULL, - attribute_key VARCHAR(255), - attribute_value TEXT -); - -CREATE INDEX datatree_attribute_idx ON horde_datatree_attributes USING HASH(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 INDEX datatree_attribute_value_idx ON horde_datatree_attributes (attribute_value); - -CREATE TABLE horde_tokens ( - token_address VARCHAR(100) NOT NULL, - token_id VARCHAR(32) NOT NULL, - token_timestamp BIGINT NOT NULL, --- - PRIMARY KEY (token_address, token_id) -); - -CREATE TABLE horde_vfs ( - vfs_id INT NOT NULL, - vfs_type SMALLINT NOT NULL, - vfs_path VARCHAR(255) NOT NULL, - vfs_name VARCHAR(255) NOT NULL, - vfs_modified BIGINT NOT NULL, - vfs_owner VARCHAR(255) NOT NULL, - vfs_data TEXT, - - PRIMARY KEY (vfs_id) -); - -CREATE INDEX vfs_path_idx ON horde_vfs (vfs_path); -CREATE INDEX vfs_name_idx ON horde_vfs (vfs_name); - -CREATE TABLE horde_histories ( - history_id INT NOT NULL, - object_uid VARCHAR(255) NOT NULL, - history_action VARCHAR(32) NOT NULL, - history_ts BIGINT NOT NULL, - history_desc TEXT, - history_who VARCHAR(255), - history_extra TEXT, --- - PRIMARY KEY (history_id) -); - -CREATE INDEX history_action_idx ON horde_histories (history_action); -CREATE INDEX history_ts_idx ON horde_histories (history_ts); -CREATE INDEX history_uid_idx ON horde_histories (object_uid); - -CREATE TABLE horde_sessionhandler ( - session_id VARCHAR(32) NOT NULL, - session_lastmodified BIGINT NOT NULL, - session_data TEXT, - PRIMARY KEY (session_id) -); - -CREATE INDEX session_lastmodified_idx ON horde_sessionhandler (session_lastmodified); - -CREATE TABLE horde_syncml_map ( - syncml_syncpartner VARCHAR(255) NOT NULL, - syncml_db VARCHAR(255) NOT NULL, - syncml_uid VARCHAR(255) NOT NULL, - syncml_cuid VARCHAR(255), - syncml_suid VARCHAR(255), - syncml_timestamp BIGINT -); - -CREATE INDEX syncml_syncpartner_idx ON horde_syncml_map (syncml_syncpartner); -CREATE INDEX syncml_db_idx ON horde_syncml_map (syncml_db); -CREATE INDEX syncml_uid_idx ON horde_syncml_map (syncml_uid); -CREATE INDEX syncml_cuid_idx ON horde_syncml_map (syncml_cuid); -CREATE INDEX syncml_suid_idx ON horde_syncml_map (syncml_suid); - -CREATE TABLE horde_syncml_anchors( - syncml_syncpartner VARCHAR(255) NOT NULL, - syncml_db VARCHAR(255) NOT NULL, - syncml_uid VARCHAR(255) NOT NULL, - syncml_clientanchor VARCHAR(255), - syncml_serveranchor VARCHAR(255) -); - -CREATE INDEX syncml_anchors_syncpartner_idx ON horde_syncml_anchors (syncml_syncpartner); -CREATE INDEX syncml_anchors_db_idx ON horde_syncml_anchors (syncml_db); -CREATE INDEX syncml_anchors_uid_idx ON horde_syncml_anchors (syncml_uid); - -CREATE TABLE horde_alarms ( - alarm_id VARCHAR(255) NOT NULL, - alarm_uid VARCHAR(255), - alarm_start TIMESTAMP NOT NULL, - alarm_end TIMESTAMP, - alarm_methods VARCHAR(255), - alarm_params TEXT, - alarm_title VARCHAR(255) NOT NULL, - alarm_text TEXT, - alarm_snooze TIMESTAMP, - alarm_dismissed SMALLINT DEFAULT 0 NOT NULL, - alarm_internal TEXT -); - -CREATE INDEX alarm_id_idx ON horde_alarms (alarm_id); -CREATE INDEX alarm_user_idx ON horde_alarms (alarm_uid); -CREATE INDEX alarm_start_idx ON horde_alarms (alarm_start); -CREATE INDEX alarm_end_idx ON horde_alarms (alarm_end); -CREATE INDEX alarm_snooze_idx ON horde_alarms (alarm_snooze); -CREATE INDEX alarm_dismissed_idx ON horde_alarms (alarm_dismissed); - -CREATE TABLE horde_cache ( - cache_id VARCHAR(32) NOT NULL, - cache_timestamp BIGINT NOT NULL, - cache_expiration BIGINT NOT NULL, - cache_data TEXT, --- - PRIMARY KEY (cache_id) -); - -CREATE TABLE horde_locks ( - lock_id VARCHAR(36) NOT NULL, - lock_owner VARCHAR(32) NOT NULL, - lock_scope VARCHAR(32) NOT NULL, - lock_principal VARCHAR(255) NOT NULL, - lock_origin_timestamp BIGINT NOT NULL, - lock_update_timestamp BIGINT NOT NULL, - lock_expiry_timestamp BIGINT NOT NULL, - lock_type SMALLINT NOT NULL, - - PRIMARY KEY (lock_id) -); - -CREATE TABLE horde_activesync_state ( - sync_time INT, - sync_key VARCHAR(255) NOT NULL, - sync_data TEXT, - sync_devid VARCHAR(255), - sync_folderid VARCHAR(255), - sync_user VARCHAR(255) NOT NULL, --- - PRIMARY KEY (sync_key) -); - -CREATE INDEX activesync_state_folder_idx ON horde_activesync_state (sync_folderid); -CREATE INDEX activesync_state_devid_idx ON horde_activesync_state (sync_devid); - -CREATE TABLE horde_activesync_map ( - message_uid VARCHAR(255) NOT NULL, - sync_modtime INT, - sync_key VARCHAR(255) NOT NULL, - sync_devid VARCHAR(255) NOT NULL, - sync_folderid VARCHAR(255) NOT NULL, - sync_user VARCHAR(255) NOT NULL -); - -CREATE INDEX activesync_map_devid_idx ON horde_activesync_map (sync_devid); -CREATE INDEX activesync_map_message_idx ON horde_activesync_map (message_uid); -CREATE INDEX activesync_map_user_idx ON horde_activesync_map (sync_user); - -CREATE TABLE horde_activesync_device ( - device_id VARCHAR(255) NOT NULL, - device_type VARCHAR(255) NOT NULL, - device_agent VARCHAR(255) NOT NULL, - device_supported TEXT, - device_policykey BIGINT DEFAULT 0, - device_rwstatus INT, --- - PRIMARY KEY (device_id) -); - -CREATE TABLE horde_activesync_device_users ( - device_id VARCHAR(255) NOT NULL, - device_user VARCHAR(255) NOT NULL, - device_ping TEXT, - device_folders TEXT); - -CREATE INDEX activesync_device_users_idx ON horde_activesync_device_users (device_user); -CREATE INDEX activesync_device_users_id_idx on horde_activesync_device_users (device_id); - -COMMIT; diff --git a/horde/scripts/sql/create.sql b/horde/scripts/sql/create.sql deleted file mode 100644 index e6eb5f19d..000000000 --- a/horde/scripts/sql/create.sql +++ /dev/null @@ -1,269 +0,0 @@ -CREATE TABLE horde_users ( - user_uid VARCHAR(255) NOT NULL, - user_pass VARCHAR(255) NOT NULL, - user_soft_expiration_date INTEGER, - user_hard_expiration_date INTEGER, --- - PRIMARY KEY (user_uid) -); - -CREATE TABLE horde_signups ( - user_name VARCHAR(255) NOT NULL, - signup_date INTEGER NOT NULL, - signup_host VARCHAR(255) NOT NULL, - signup_data TEXT NOT NULL, - PRIMARY KEY (user_name) -); - -CREATE TABLE horde_groups ( - group_uid INTEGER NOT NULL, - group_name VARCHAR(255) NOT NULL, - group_parents VARCHAR(255) NOT NULL, - group_email VARCHAR(255), - PRIMARY KEY (group_uid) -); - -CREATE TABLE horde_groups_members ( - group_uid INTEGER NOT NULL, - user_uid VARCHAR(255) NOT NULL -); - -CREATE INDEX group_uid_idx ON horde_groups_members (group_uid); -CREATE INDEX user_uid_idx ON horde_groups_members (user_uid); - - -CREATE TABLE horde_perms ( - perm_id INTEGER NOT NULL AUTO_INCREMENT, - perm_name VARCHAR(255) NOT NULL, - perm_parents VARCHAR(255) NOT NULL, - perm_data TEXT, - PRIMARY KEY (perm_id) -); - - -CREATE TABLE horde_prefs ( - pref_uid VARCHAR(255) NOT NULL, - pref_scope VARCHAR(16) DEFAULT '' NOT NULL, - pref_name VARCHAR(32) NOT NULL, - pref_value TEXT, --- - PRIMARY KEY (pref_uid, pref_scope, pref_name) -); - - -CREATE TABLE horde_datatree ( - datatree_id INT UNSIGNED 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, - --- There is no portable way to do this apparently. If your db doesn't --- allow TEXT columns, then maybe it allows large VARCHAR columns, so --- try the second line. --- - datatree_data TEXT, --- datatree_data VARCHAR(4096), - - datatree_serialized SMALLINT DEFAULT 0 NOT NULL, - - 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_order_idx ON horde_datatree (datatree_order); -CREATE INDEX datatree_serialized_idx ON horde_datatree (datatree_serialized); -CREATE INDEX datatree_parents_idx ON horde_datatree (datatree_parents); - -CREATE TABLE horde_datatree_attributes ( - datatree_id INT UNSIGNED NOT NULL, - attribute_name VARCHAR(255) NOT NULL, - attribute_key VARCHAR(255), - 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 INDEX datatree_attribute_value_idx ON horde_datatree_attributes (attribute_value); - - -CREATE TABLE horde_tokens ( - token_address VARCHAR(100) NOT NULL, - token_id VARCHAR(32) NOT NULL, - token_timestamp BIGINT NOT NULL, --- - PRIMARY KEY (token_address, token_id) -); - - -CREATE TABLE horde_vfs ( - vfs_id INT UNSIGNED NOT NULL, - vfs_type SMALLINT UNSIGNED NOT NULL, - vfs_path VARCHAR(255) NOT NULL, - vfs_name VARCHAR(255) NOT NULL, - vfs_modified BIGINT NOT NULL, - vfs_owner VARCHAR(255) NOT NULL, - vfs_data LONGBLOB, --- Or, on some DBMS systems: --- vfs_data IMAGE, - PRIMARY KEY (vfs_id) -); - -CREATE INDEX vfs_path_idx ON horde_vfs (vfs_path); -CREATE INDEX vfs_name_idx ON horde_vfs (vfs_name); - - -CREATE TABLE horde_histories ( - history_id INT UNSIGNED NOT NULL, - object_uid VARCHAR(255) NOT NULL, - history_action VARCHAR(32) NOT NULL, - history_ts BIGINT NOT NULL, - history_desc TEXT, - history_who VARCHAR(255), - history_extra TEXT, --- - PRIMARY KEY (history_id) -); - -CREATE INDEX history_action_idx ON horde_histories (history_action); -CREATE INDEX history_ts_idx ON horde_histories (history_ts); -CREATE INDEX history_uid_idx ON horde_histories (object_uid); - - -CREATE TABLE horde_sessionhandler ( - session_id VARCHAR(32) NOT NULL, - session_lastmodified BIGINT NOT NULL, - session_data LONGBLOB, --- Or, on some DBMS systems: --- session_data IMAGE, - - PRIMARY KEY (session_id) -); - -CREATE INDEX session_lastmodified_idx ON horde_sessionhandler (session_lastmodified); - - -CREATE TABLE horde_syncml_map ( - syncml_syncpartner VARCHAR(255) NOT NULL, - syncml_db VARCHAR(255) NOT NULL, - syncml_uid VARCHAR(255) NOT NULL, - syncml_cuid VARCHAR(255), - syncml_suid VARCHAR(255), - syncml_timestamp BIGINT -); - -CREATE INDEX syncml_syncpartner_idx ON horde_syncml_map (syncml_syncpartner); -CREATE INDEX syncml_db_idx ON horde_syncml_map (syncml_db); -CREATE INDEX syncml_uid_idx ON horde_syncml_map (syncml_uid); -CREATE INDEX syncml_cuid_idx ON horde_syncml_map (syncml_cuid); -CREATE INDEX syncml_suid_idx ON horde_syncml_map (syncml_suid); - -CREATE TABLE horde_syncml_anchors( - syncml_syncpartner VARCHAR(255) NOT NULL, - syncml_db VARCHAR(255) NOT NULL, - syncml_uid VARCHAR(255) NOT NULL, - syncml_clientanchor VARCHAR(255), - syncml_serveranchor VARCHAR(255) -); - -CREATE INDEX syncml_anchors_syncpartner_idx ON horde_syncml_anchors (syncml_syncpartner); -CREATE INDEX syncml_anchors_db_idx ON horde_syncml_anchors (syncml_db); -CREATE INDEX syncml_anchors_uid_idx ON horde_syncml_anchors (syncml_uid); - - -CREATE TABLE horde_alarms ( - alarm_id VARCHAR(255) NOT NULL, - alarm_uid VARCHAR(255), - alarm_start DATETIME NOT NULL, - alarm_end DATETIME, - alarm_methods VARCHAR(255), - alarm_params TEXT, - alarm_title VARCHAR(255) NOT NULL, - alarm_text TEXT, - alarm_snooze DATETIME, - alarm_dismissed SMALLINT DEFAULT 0 NOT NULL, - alarm_internal TEXT -); - -CREATE INDEX alarm_id_idx ON horde_alarms (alarm_id); -CREATE INDEX alarm_user_idx ON horde_alarms (alarm_uid); -CREATE INDEX alarm_start_idx ON horde_alarms (alarm_start); -CREATE INDEX alarm_end_idx ON horde_alarms (alarm_end); -CREATE INDEX alarm_snooze_idx ON horde_alarms (alarm_snooze); -CREATE INDEX alarm_dismissed_idx ON horde_alarms (alarm_dismissed); - - -CREATE TABLE horde_cache ( - cache_id VARCHAR(32) NOT NULL, - cache_timestamp BIGINT NOT NULL, - cache_expiration BIGINT NOT NULL, - cache_data LONGBLOB, --- Or on some other DBMS systems: --- cache_data IMAGE, - - PRIMARY KEY (cache_id) -); - -CREATE TABLE horde_locks ( - lock_id VARCHAR(36) NOT NULL, - lock_owner VARCHAR(32) NOT NULL, - lock_scope VARCHAR(32) NOT NULL, - lock_principal VARCHAR(255) NOT NULL, - lock_origin_timestamp BIGINT NOT NULL, - lock_update_timestamp BIGINT NOT NULL, - lock_expiry_timestamp BIGINT NOT NULL, - lock_type SMALLINT UNSIGNED NOT NULL, - - PRIMARY KEY (lock_id) -); - -CREATE TABLE horde_activesync_state ( - sync_time INTEGER, - sync_key VARCHAR(255) NOT NULL, - sync_data TEXT, - sync_devid VARCHAR(255), - sync_folderid VARCHAR(255), - sync_user VARCHAR(255) NOT NULL, --- - PRIMARY KEY (sync_key) -); - -CREATE INDEX activesync_state_folder_idx ON horde_activesync_state (sync_folderid); -CREATE INDEX activesync_state_devid_idx ON horde_activesync_state (sync_devid); - -CREATE TABLE horde_activesync_map ( - message_uid VARCHAR(255) NOT NULL, - sync_modtime INTEGER, - sync_key VARCHAR(255) NOT NULL, - sync_devid VARCHAR(255) NOT NULL, - sync_folderid VARCHAR(255) NOT NULL, - sync_user VARCHAR(255) NOT NULL -); - -CREATE INDEX activesync_map_devid_idx ON horde_activesync_map (sync_devid); -CREATE INDEX activesync_map_message_idx ON horde_activesync_map (message_uid); -CREATE INDEX activesync_map_user_idx ON horde_activesync_map (sync_user); - -CREATE TABLE horde_activesync_device ( - device_id VARCHAR(255) NOT NULL, - device_type VARCHAR(255) NOT NULL, - device_agent VARCHAR(255) NOT NULL, - device_supported TEXT, - device_policykey BIGINT DEFAULT 0, - device_rwstatus INTEGER, --- - PRIMARY KEY (device_id) -); - -CREATE TABLE horde_activesync_device_users ( - device_id VARCHAR(255) NOT NULL, - device_user VARCHAR(255) NOT NULL, - device_ping TEXT, - device_folders TEXT -); -CREATE INDEX activesync_device_users_idx ON horde_activesync_device_users (device_user); -CREATE INDEX activesync_device_users_id_idx on horde_activesync_device_users (device_id); diff --git a/horde/scripts/sql/create.sybase.sql b/horde/scripts/sql/create.sybase.sql deleted file mode 100644 index c56a24e4f..000000000 --- a/horde/scripts/sql/create.sybase.sql +++ /dev/null @@ -1,397 +0,0 @@ --- horde tables definitions : sql script --- 01/22/2003 - F. Helly --- command line syntax : isql -ihorde_sybase.sql --- warning : use nvarchar only if you need unicode encoding for some strings - -use horde -go - - -DROP TABLE horde_datatree -go - -DROP TABLE horde_prefs -go - -DROP TABLE horde_users -go - -DROP TABLE horde_signups -go - -DROP TABLE horde_groups -go - -DROP TABLE horde_groups_members -go - -DROP TABLE horde_sessionhandler -go - --- DROP TABLE horde_datatree_seq --- go - --- DROP TABLE horde_tokens --- go - --- DROP TABLE horde_vfs --- go - --- DROP TABLE horde_muvfs --- go - - -CREATE TABLE horde_users ( - user_uid varchar(256) NOT NULL, - user_pass varchar(256) NOT NULL, - user_soft_expiration_date numeric(10,0), - user_hard_expiration_date numeric(10,0), - PRIMARY KEY (user_uid) -) -go - -CREATE TABLE horde_signups ( - user_name VARCHAR(255) NOT NULL, - signup_date NUMERIC(10,0) NOT NULL, - signup_host VARCHAR(255) NOT NULL, - signup_data TEXT NOT NULL, - PRIMARY KEY (user_name) -) -go - -CREATE TABLE horde_groups ( - group_uid numeric(11,0) IDENTITY NOT NULL, - group_name varchar(256) NOT NULL, - group_parents varchar(256) NOT NULL, - group_email varchar(256), - PRIMARY KEY (group_uid) -) -go - -CREATE TABLE horde_groups_members ( - group_uid numeric(11,0) NOT NULL, - user_uid varchar(256) NOT NULL -) -go - -CREATE INDEX group_uid_idx ON horde_groups_members (group_uid) -CREATE INDEX user_uid_idx ON horde_groups_members (user_uid) -go - -CREATE TABLE horde_perms ( - perm_id numeric(11,0) NOT NULL, - perm_name varchar(256) NOT NULL, - perm_parents varchar(256) NOT NULL, - perm_data text, - PRIMARY KEY (perm_id) -) -go - -CREATE TABLE horde_datatree ( - datatree_id numeric(11,0) IDENTITY NOT NULL, - group_uid varchar(256) NOT NULL, - user_uid varchar(256) NOT NULL, - datatree_name varchar(256) NOT NULL, - datatree_parents varchar(256) NULL, - datatree_data text NULL, - datatree_serialized smallint DEFAULT 0 NOT NULL, - PRIMARY KEY (datatree_id), - FOREIGN KEY (user_uid) - REFERENCES horde_users(user_uid) -) -go - -CREATE TABLE horde_prefs ( - pref_uid varchar(256) NOT NULL, - pref_scope varchar(16) NOT NULL, - pref_name varchar(32) NOT NULL, - pref_value text NULL, - PRIMARY KEY (pref_uid,pref_scope,pref_name) -) -go - -CREATE TABLE horde_sessionhandler ( - session_id varchar(32) NOT NULL, - session_lastmodified numeric(11,0) NOT NULL, - session_data image NULL, - PRIMARY KEY (session_id) -) -go - -CREATE TABLE horde_syncml_map ( - syncml_syncpartner varchar(255) NOT NULL, - syncml_db varchar(255) NOT NULL, - syncml_uid varchar(255) NOT NULL, - syncml_cuid varchar(255), - syncml_suid varchar(255), - syncml_timestamp numeric(11,0) -); -go - -CREATE TABLE horde_syncml_anchors( - syncml_syncpartner varchar(255) NOT NULL, - syncml_db varchar(255) NOT NULL, - syncml_uid varchar(255) NOT NULL, - syncml_clientanchor varchar(255), - syncml_serveranchor varchar(255) -); -go - -CREATE TABLE horde_alarms ( - alarm_id varchar(255) NOT NULL, - alarm_uid varchar(255), - alarm_start timestamp NOT NULL, - alarm_end timestamp, - alarm_methods varchar(255), - alarm_params text, - alarm_title varchar(255) NOT NULL, - alarm_text text, - alarm_snooze timestamp, - alarm_dismissed smallint DEFAULT 0 NOT NULL, - alarm_internal text -) -go - -CREATE TABLE horde_cache ( - cache_id varchar(32) NOT NULL, - cache_timestamp numeric(11,0) NOT NULL, - cache_expiration numeric(11,0) NOT NULL, - cache_data image, - PRIMARY KEY (cache_id) -) -go - -CREATE TABLE horde_locks ( - lock_id varchar(36) NOT NULL, - lock_owner varchar(32) NOT NULL, - lock_scope varchar(32) NOT NULL, - lock_principal varchar(255) NOT NULL, - lock_origin_timestamp numeric(11, 0) NOT NULL, - lock_update_timestamp numeric(11, 0) NOT NULL, - lock_expiry_timestamp numeric(11, 0) NOT NULL, - lock_type numeric(11, 0) NOT NULL, - - PRIMARY KEY (lock_id) -) -go - -CREATE TABLE horde_activesync_state ( - sync_time numeric(10, 0), - sync_key varchar(255) NOT NULL, - sync_data text, - sync_devid varchar(255), - sync_folderid varchar(255), - sync_user varchar(255), --- - PRIMARY KEY (sync_key) -); -go - -CREATE TABLE horde_activesync_map ( - message_uid varchar(255) NOT NULL, - sync_modtime numeric(10, 0), - sync_key varchar(255) NOT NULL, - sync_devid varchar(255) NOT NULL, - sync_folderid varchar(255) NOT NULL, - sync_user varchar(255) -); -go - -CREATE TABLE horde_activesync_device ( - device_id varchar(255) NOT NULL, - device_type varchar(255) NOT NULL, - device_agent varchar(255) NOT NULL, - device_supported text, - device_policykey number(11, 0) DEFAULT 0, - device_rwstatus number(10, 0), --- - PRIMARY KEY (device_id) -); -go - -CREATE TABLE horde_activesync_device_users ( - device_id varchar(255) NOT NULL, - device_user varchar(255) NOT NULL, - device_ping text, - device_folders text -); -go - --- CREATE TABLE horde_datatree_seq ( --- id numeric(10,0) IDENTITY NOT NULL, --- PRIMARY KEY (id) --- ) --- go - --- CREATE TABLE horde_tokens ( --- token_address varchar(100) NOT NULL, --- token_id varchar(32) NOT NULL, --- token_timestamp numeric(20,0) NOT NULL, --- PRIMARY KEY (token_address,token_id) --- ) --- go - --- CREATE TABLE horde_vfs ( --- vfs_id numeric(20,0) NOT NULL, --- vfs_type numeric(8,0) NOT NULL, --- vfs_path varchar(256) NOT NULL, --- vfs_name nvarchar(256) NOT NULL, --- vfs_modified numeric(20,0) NOT NULL, --- vfs_owner varchar(256) NOT NULL, --- vfs_data image NULL, --- PRIMARY KEY (vfs_id) --- ) --- go - --- CREATE TABLE horde_muvfs ( --- vfs_id numeric(20,0) NOT NULL, --- vfs_type numeric(8,0) NOT NULL, --- vfs_path varchar(256) NOT NULL, --- vfs_name varchar(256) NOT NULL, --- vfs_modified numeric(8,0) NOT NULL, --- vfs_owner varchar(256) NOT NULL, --- vfs_perms smallint NOT NULL, --- vfs_data image NULL, --- PRIMARY KEY (vfs_id) --- ) --- go - - -CREATE INDEX pref_uid_idx ON horde_prefs (pref_uid) -go - -CREATE INDEX pref_scope_idx ON horde_prefs (pref_scope) -go - -CREATE INDEX datatree_datatree_name_idx ON horde_datatree (datatree_name) -go - -CREATE INDEX datatree_group_idx ON horde_datatree (group_uid) -go - -CREATE INDEX datatree_user_idx ON horde_datatree (user_uid) -go - -CREATE INDEX datatree_serialized_idx ON horde_datatree (datatree_serialized) -go - -CREATE INDEX datatree_parents_idx ON horde_datatree (datatree_parents) -go - -CREATE INDEX syncml_syncpartner_idx ON horde_syncml_map (syncml_syncpartner); -go - -CREATE INDEX syncml_db_idx ON horde_syncml_map (syncml_db); -go - -CREATE INDEX syncml_uid_idx ON horde_syncml_map (syncml_uid); -go - -CREATE INDEX syncml_cuid_idx ON horde_syncml_map (syncml_cuid); -go - -CREATE INDEX syncml_suid_idx ON horde_syncml_map (syncml_suid); -go - -CREATE INDEX syncml_anchors_syncpartner_idx ON horde_syncml_anchors (syncml_syncpartner); -go - -CREATE INDEX syncml_anchors_db_idx ON horde_syncml_anchors (syncml_db); -go - -CREATE INDEX syncml_anchors_uid_idx ON horde_syncml_anchors (syncml_uid); -go - -CREATE INDEX alarm_id_idx ON horde_alarms (alarm_id) -go - -CREATE INDEX alarm_user_idx ON horde_alarms (alarm_uid) -go - -CREATE INDEX alarm_start_idx ON horde_alarms (alarm_start) -go - -CREATE INDEX alarm_end_idx ON horde_alarms (alarm_end) -go - -CREATE INDEX alarm_snooze_idx ON horde_alarms (alarm_snooze) -go - -CREATE INDEX alarm_dismissed_idx ON horde_alarms (alarm_dismissed) -go - -CREATE INDEX session_lastmodified_idx ON horde_sessionhandler (session_lastmodified) -go - -CREATE INDEX activesync_state_folder_idx ON horde_activesync_state (sync_folderid); -go - -CREATE INDEX activesync_state_devid_idx ON horde_activesync_state (sync_devid); -go - -CREATE INDEX activesync_map_devid_idx ON horde_activesync_map (sync_devid); -go - -CREATE INDEX activesync_map_message_idx ON horde_activesync_map (message_uid); -go - -CREATE INDEX activesync_device_user_idx ON horde_activesync_device (device_user); -go - -CREATE INDEX activesync_device_users_idx ON horde_activesync_device_users (device_user); -go - -CREATE INDEX activesync_map_user_idx ON horde_activesync_map (sync_user); -go - --- CREATE INDEX vfs_path_idx ON horde_vfs (vfs_path) --- go - --- CREATE INDEX vfs_name_idx ON horde_vfs (vfs_name) --- go - --- CREATE INDEX vfs_path_idx ON horde_muvfs (vfs_path) --- go - --- CREATE INDEX vfs_name_idx ON horde_muvfs (vfs_name) --- go - - -grant select, insert, delete, update on editor to horde -go -grant select, insert, delete, update on host to horde -go -grant select, insert, delete, update on dbase to horde -go -grant select, insert, delete, update on site to horde -go -grant select, insert, delete, update on connection to horde -go -grant select, insert, delete, update on horde_datatree to horde -go -grant select, insert, delete, update on horde_prefs to horde -go -grant select, insert, delete, update on horde_sessionhandler to horde -go -grant select, insert, delete, update on horde_syncml_map to horde -go -grant select, insert, delete, update on horde_alarms to horde -go -grant select, insert, delete, update on horde_cache to horde -go - --- grant select, insert, delete, update on horde_datatree_seq to horde --- go --- grant select, insert, delete, update on horde_tokens to horde --- go --- grant select, insert, delete, update on horde_vfs to horde --- go --- grant select, insert, delete, update on horde_muvfs to horde --- go - - - --- add you admin_user_uid and admin_user_pass - --- insert into horde_users values ('your_admin_user_uid', 'your_admin_user_pass_md5_encrypted') --- go diff --git a/horde/scripts/sql/create.xml b/horde/scripts/sql/create.xml deleted file mode 100644 index 3651fdd6d..000000000 --- a/horde/scripts/sql/create.xml +++ /dev/null @@ -1,1546 +0,0 @@ - - - - name - create - - - - horde_alarms - - - - - alarm_id - text - 255 - true - - - - alarm_uid - text - 255 - - - - alarm_start - timestamp - true - - - - alarm_end - timestamp - - - - alarm_methods - text - 255 - - - - alarm_params - clob - - - - alarm_title - text - 255 - true - - - - alarm_text - clob - - - - alarm_snooze - timestamp - - - - alarm_dismissed - integer - 1 - true - 0 - - - - alarm_internal - clob - - - - alarm_id_idx - - alarm_id - - - - - alarm_user_idx - - alarm_uid - - - - - alarm_start_idx - - alarm_start - - - - - alarm_end_idx - - alarm_end - - - - - alarm_snooze_idx - - alarm_snooze - - - - - alarm_dismissed_idx - - alarm_dismissed - - - - - -
- - - - horde_cache - - - - - cache_id - text - 32 - true - - - - cache_timestamp - integer - true - - - - cache_expiration - integer - true - - - - cache_data - blob - - - - -
- - - - horde_datatree - - - - - datatree_id - integer - true - - - - group_uid - text - 255 - true - - - - user_uid - text - 255 - true - - - - datatree_name - text - 255 - true - - - - datatree_parents - text - 255 - true - - - - datatree_order - integer - - - - datatree_data - clob - - - - datatree_serialized - integer - 2 - true - - - - datatree_datatree_name - - datatree_name - - - - - datatree_group - - group_uid - - - - - datatree_user - - user_uid - - - - - datatree_serialized - - datatree_serialized - - - - - datatree_parents - - datatree_parents - - - - - datatree_primary - true - - datatree_id - - - - - -
- - - - horde_datatree_attributes - - - - - datatree_id - integer - true - - - - attribute_name - text - 255 - true - - - - attribute_key - text - 255 - true - - - - attribute_value - clob - - - - datatree_attribute - - datatree_id - - - - - datatree_attribute_name - - attribute_name - - - - - datatree_attribute_key - - attribute_key - - - - - datatree_attribute_value - - attribute_value - 255 - - - - - -
- - - - horde_histories - - - - - history_id - integer - true - - - - object_uid - text - 255 - true - - - - history_action - text - 32 - true - - - - history_ts - integer - true - - - - history_desc - clob - - - - history_who - text - 255 - - - - history_extra - clob - - - - history_action - - history_action - - - - - history_ts - - history_ts - - - - - history_uid - - object_uid - - - - - history_primary - true - - history_id - - - - - -
- - - - horde_prefs - - - - - pref_uid - text - 200 - true - - - - pref_scope - text - 16 - true - - - - pref_name - text - 32 - true - - - - pref_value - clob - - - - pref_primary - true - - pref_uid - - - pref_scope - - - pref_name - - - - - pref_uid - - pref_uid - - - - - pref_scope - - pref_scope - - - - - -
- - - - horde_sessionhandler - - - - - session_id - text - 32 - true - - - - session_lastmodified - integer - true - - - - session_data - blob - - - - session_primary - true - - session_id - - - - - session_lastmodified - - session_lastmodified - - - - - -
- - - - horde_signups - - - - - user_name - text - true - 255 - - - - signup_date - integer - true - 4 - - - - signup_host - text - true - 255 - - - - signup_data - clob - true - - - - signup_primary - true - - user_name - - - - - -
- - - - horde_syncml_anchors - - - - - syncml_syncpartner - text - 255 - true - - - - syncml_db - text - 255 - true - - - - syncml_uid - text - 255 - true - - - - syncml_clientanchor - text - 255 - - - - syncml_serveranchor - text - 255 - - - - syncml_anchors_syncpartner_idx - - syncml_syncpartner - - - - - syncml_anchors_db_idx - - syncml_db - - - - - syncml_anchors_uid_idx - - syncml_uid - - - - - -
- - - - horde_syncml_map - - - - - syncml_syncpartner - text - 255 - true - - - - syncml_db - text - 255 - true - - - - syncml_uid - text - 255 - true - - - - syncml_cuid - text - 255 - - - - syncml_suid - text - 255 - - - - syncml_timestamp - integer - - - - syncml_syncpartner_idx - - syncml_syncpartner - - - - - syncml_db_idx - - syncml_db - - - - - syncml_uid_idx - - syncml_uid - - - - - syncml_cuid_idx - - syncml_cuid - - - - - syncml_suid_idx - - syncml_suid - - - - - -
- - - - horde_tokens - - - - - token_address - text - 100 - true - - - - token_id - text - 32 - true - - - - token_timestamp - integer - true - - - - token_primary - true - - token_address - - - token_id - - - - - -
- - - - horde_users - - - - - user_uid - text - 255 - true - - - - user_pass - text - 255 - true - - - - user_soft_expiration_date - integer - - - - user_hard_expiration_date - integer - - - - user_primary - true - - user_uid - - - - - -
- - - - horde_groups - - - - - group_uid - integer - true - - - - group_name - text - 255 - true - - - - group_parents - text - 255 - true - - - - group_email - text - 255 - - - - group_primary - true - - group_uid - - - - - group_unique - true - - group_name - - - - - -
- - - - horde_groups_members - - - - - group_uid - integer - true - - - - user_uid - text - 255 - true - - - - group_uid - - group_uid - - - - - user_uid - - user_uid - - - - - -
- - - - horde_locks - - - - - lock_id - text - 36 - true - - - - lock_owner - text - 32 - true - - - - lock_scope - text - 32 - true - - - - lock_principal - text - 255 - true - - - - lock_origin_timestamp - integer - true - - - - lock_update_timestamp - integer - true - - - - lock_expiry_timestamp - integer - true - - - - lock_type - integer - true - - - - lock_primary - true - - lock_id - - - - - -
- - - - horde_perms - - - - - perm_id - integer - true - - - - perm_name - text - 255 - true - - - - perm_parents - text - 255 - true - - - - perm_data - clob - - - - perms_primary - true - - perm_id - - - - - perms_unique - true - - perm_name - - - - - -
- - - - horde_vfs - - - - - vfs_id - integer - true - - - - vfs_type - integer - 1 - true - - - - vfs_path - text - 255 - true - - - - vfs_name - text - 255 - true - - - - vfs_modified - integer - true - - - - vfs_owner - text - 255 - true - - - - vfs_data - blob - - - - vfs_primary - true - - vfs_id - - - - - vfs_path - - vfs_path - - - - - vfs_name - - vfs_name - - - - - -
- - - - metarAirports - - - - - id - integer - - false - 4 - - - - block - integer - - false - 4 - - - - station - integer - - false - 4 - - - - icao - text - - false - 4 - - - - name - text - - false - 80 - - - - state - text - true - - false - 2 - - - - country - text - - false - 50 - - - - wmo - integer - - false - 4 - - - - latitude - float - - false - - - - longitude - float - - false - - - - elevation - float - - false - - - - x - float - - false - - - - y - float - - false - - - - z - float - - false - - - - -
- - - - metarLocations - - - - - id - integer - - false - 4 - - - - block - integer - - false - 4 - - - - station - integer - - false - 4 - - - - icao - text - - false - 4 - - - - name - text - - false - 80 - - - - state - text - true - - false - 2 - - - - country - text - - false - 50 - - - - wmo - integer - - false - 4 - - - - latitude - float - - false - - - - longitude - float - - false - - - - elevation - float - - false - - - - x - float - - false - - - - y - float - - false - - - - z - float - - false - - - - -
- - - - horde_activesync_state - - - - - sync_time - integer - false - 0 - - - - sync_key - text - 255 - - - - sync_data - clob - - - - sync_devid - text - 255 - false - - - - sync_folderid - text - 255 - false - - - - sync_user - text - 255 - false - - - - activesync_state_primary - true - - sync_key - - - - - activesync_state_folder_idx - - sync_folderid - - - - - activesync_state_devid_idx - - sync_devid - - - - - -
- - - - horde_activesync_map - - - - - message_uid - text - 255 - - - - sync_modtime - integer - false - - - - sync_key - text - 255 - - - - sync_devid - text - 255 - false - - - - sync_folderid - text - 255 - false - - - - sync_user - text - 255 - false - - - - activesync_map_message_idx - - message_uid - - - - - activesync_map_devid_idx - - sync_devid - - - - - activesync_map_user_idx - - sync_user - - - - - -
- - - - horde_activesync_device - - - - - device_id - text - 255 - - - - device_type - text - 255 - - - - device_agent - text - 255 - - - - device_supported - clob - false - - - - device_policykey - integer - 0 - - - - device_rwstatus - integer - false - - - - activesync_device_primary - true - - device_id - - - - - -
- - - - horde_activesync_device_users - - - - - device_id - text - 255 - - - - device_ping - clob - false - - - - device_folders - clob - false - - - - device_user - text - 255 - false - - - - activesync_device_user_idx - - device_user - - - - - -
-