User Tools

Site Tools


schema_0_9_10

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
schema_0_9_10 [2008/11/02 15:44] – created danielschema_0_9_10 [2008/11/02 22:30] (current) daniel
Line 1: Line 1:
-SQL script that creates the database:+====== Schema creation script ======
  
-The plpgsql language should exist (CREATE LANGUAGE plpgsql)+ 
 +Below is the SQL script for PostgreSQL that creates from scratch all the database objects. 
 +Before running it through psql, those preconditions should be met: 
 +  * The database should exist and have UTF8 encoding (''createdb -E UTF8 name_of_database'' in shell or ''CREATE DATABASE name_of_database ENCODING 'UTF8''' under psql) 
 +  * The plpgsql language should be enabled (''createlang -d name_of_database plpgsql'' external command or ''CREATE LANGUAGE plpgsql'' under psql) 
 +  * The current directory should contain the SQL files that are referenced at the end of the script. These are the definitions of plpgsql functions. 
 + 
 +This script as well as all the SQL files are available in [[http://www.manitou-mail.org/source/manitou-sql-0.9.10.tar.gz]]
  
 <code sql> <code sql>
Line 176: Line 183:
 ); );
 CREATE UNIQUE INDEX runtime_info_pk ON runtime_info(rt_key); CREATE UNIQUE INDEX runtime_info_pk ON runtime_info(rt_key);
- 
-INSERT INTO runtime_info(rt_key,rt_value) VALUES ('schema_version','0.9.9'); 
- 
-CREATE SEQUENCE seq_tag_id; 
-CREATE SEQUENCE seq_mail_id; 
-CREATE SEQUENCE seq_thread_id; 
-CREATE SEQUENCE seq_addr_id; 
-CREATE SEQUENCE seq_attachment_id; 
- 
-\i triggers_on_mail.sql 
  
 CREATE TABLE identities ( CREATE TABLE identities (
Line 279: Line 276:
 CREATE UNIQUE INDEX jobs_pk_idx ON jobs_queue(job_id); CREATE UNIQUE INDEX jobs_pk_idx ON jobs_queue(job_id);
  
 +CREATE SEQUENCE seq_tag_id;
 +CREATE SEQUENCE seq_mail_id;
 +CREATE SEQUENCE seq_thread_id;
 +CREATE SEQUENCE seq_addr_id;
 +CREATE SEQUENCE seq_attachment_id;
 +
 +\i triggers_on_mail.sql
 \i delete_msg.sql \i delete_msg.sql
 \i delete_msg_set.sql \i delete_msg_set.sql
Line 284: Line 288:
 \i trash_msg_set.sql \i trash_msg_set.sql
 \i untrash_msg.sql \i untrash_msg.sql
 +
 +INSERT INTO runtime_info(rt_key,rt_value) VALUES ('schema_version','0.9.10');
  
 COMMIT; COMMIT;
 </code> </code>
  
schema_0_9_10.1225640673.txt.gz · Last modified: 2008/11/02 15:44 by daniel