[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb: [1258] trunk/sql/Pg-database.sql



Revision: 1258
          http://svn.sourceforge.net/ledger-smb/?rev=1258&view=rev
Author:   linuxpoet
Date:     2007-06-06 18:30:49 -0700 (Wed, 06 Jun 2007)

Log Message:
-----------
first run of new notes system, includes tsearch2 full text indexing

Modified Paths:
--------------
    trunk/sql/Pg-database.sql

Modified: trunk/sql/Pg-database.sql
===================================================================
--- trunk/sql/Pg-database.sql	2007-06-07 01:11:50 UTC (rev 1257)
+++ trunk/sql/Pg-database.sql	2007-06-07 01:30:49 UTC (rev 1258)
@@ -191,20 +191,25 @@
 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);
+CREATE TABLE note_class(id serial primary key, class text not null check (class ~ '[[:alnum:]_]'));
 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 UNIQUE INDEX note_class_idx ON note_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();
+CREATE TABLE note (id serial primary key, note_class integer not null references note_class(id), 
+                   note text not null, vector tsvector not null, 
+                   created timestamp not null default current_date);
+
+CREATE TABLE entity_note() INHERITS (note);
 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 UNIQUE INDEX entity_note_class_idx ON note_class(lower(class));
+CREATE INDEX entity_note_vectors_idx ON entity_note USING gist(vector);
+CREATE TABLE invoice_note() INHERITS (note);
 CREATE INDEX invoice_note_id_idx ON invoice_note(id);
+CREATE UNIQUE INDEX invoice_note_class_idx ON note_class(lower(class));
+CREATE INDEX invoice_note_vectors_idx ON invoice_note USING gist(vector);
 ALTER TABLE invoice_note ADD CHECK (id = 2);
-
-
 -- END entity   
 
 --


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.