summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorlinuxpoet <linuxpoet@4979c152-3d1c-0410-bac9-87ea11338e46>2007-06-07 01:11:50 +0000
committerlinuxpoet <linuxpoet@4979c152-3d1c-0410-bac9-87ea11338e46>2007-06-07 01:11:50 +0000
commit6dfea503b9df15043d20821d7adb3587e17e20cb (patch)
tree9337a658429c274cbe0c7b8f91b9e0f0e0353db8 /sql
parent2bc4e652903d4af47952c4d53db538bb5d802343 (diff)
added documentationm for tsearch2 requirement
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1257 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'sql')
-rw-r--r--sql/Pg-database.sql15
1 files changed, 14 insertions, 1 deletions
diff --git a/sql/Pg-database.sql b/sql/Pg-database.sql
index a599c3ad..43e6b657 100644
--- a/sql/Pg-database.sql
+++ b/sql/Pg-database.sql
@@ -97,7 +97,6 @@ CREATE TABLE company_to_location (
company_id integer references company(id) not null,
PRIMARY KEY(location_id,company_id));
-
CREATE TABLE salutation (
id serial unique,
salutation text primary key);
@@ -191,6 +190,20 @@ CREATE TABLE company_to_contact (
COMMENT ON TABLE company_to_contact IS $$ To keep track of the relationship between multiple contact methods and a single company $$;
+-- Begin rocking notes interface
+CREATE TABLE note_class(id serial primary key, class text not null check (class ~ '[[:alnum:]_]'), vectors tsvector not null, created date not null default current_date);
+INSERT INTO note_class(id,class) VALUES (1,'Entity');
+INSERT INTO note_class(id,class) VALUES (2,'Invoice');
+CREATE UNIQUE INDEX note_class_idx ON notes_class(lower(class));
+
+CREATE TABLE note (id serial primary key, note_class integer not null references note_class(id), note text not null);
+CREATE TABLE entity_note() INHERITS notes_class();
+ALTER TABLE entity_note ADD CHECK (id = 1);
+CREATE INDEX entity_note_id_idx ON entity_note(id);
+CREATE TABLE invoice_note() INHERITS notes_class();
+CREATE INDEX invoice_note_id_idx ON invoice_note(id);
+ALTER TABLE invoice_note ADD CHECK (id = 2);
+
-- END entity