schema_0_9_10
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| schema_0_9_10 [2008/11/02 15:44] – created daniel | schema_0_9_10 [2008/11/02 22:30] (current) – daniel | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | SQL script | + | ====== Schema creation |
| - | The plpgsql language should | + | |
| + | 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 ('' | ||
| + | * The plpgsql language should | ||
| + | * 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:// | ||
| <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, | ||
| - | |||
| - | 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, | ||
| COMMIT; | COMMIT; | ||
| </ | </ | ||
schema_0_9_10.1225640673.txt.gz · Last modified: 2008/11/02 15:44 by daniel
