diff options
Diffstat (limited to 'lib/sisu/v3/db_create.rb')
-rw-r--r-- | lib/sisu/v3/db_create.rb | 45 |
1 files changed, 27 insertions, 18 deletions
diff --git a/lib/sisu/v3/db_create.rb b/lib/sisu/v3/db_create.rb index 9fe35193..e302a94f 100644 --- a/lib/sisu/v3/db_create.rb +++ b/lib/sisu/v3/db_create.rb @@ -99,7 +99,7 @@ module SiSU_DbCreate create tables metadata_and_text data import through ruby transfer } if @opt.cmd =~/[VM]/ - @conn.execute(%{ + create_metadata_and_text=%{ CREATE TABLE metadata_and_text ( tid BIGINT PRIMARY KEY, /* title */ @@ -201,8 +201,9 @@ module SiSU_DbCreate /* types CHAR(1) NULL, */ /* writing_focus_nationality VARCHAR(100) NULL, */ ); - }) - @comment.psql.metadata_and_text if @comment + } + @conn.execute(create_metadata_and_text) + @comment.psql.metadata_and_text if @comment end def doc_objects # create doc_objects base print %{ @@ -210,7 +211,7 @@ module SiSU_DbCreate create tables doc_objects data import through ruby transfer } if @opt.cmd =~/[VM]/ - @conn.execute(%{ + create_doc_objects=%{ CREATE TABLE doc_objects ( lid BIGINT PRIMARY KEY, metadata_tid BIGINT REFERENCES metadata_and_text, @@ -219,6 +220,7 @@ module SiSU_DbCreate ocns VARCHAR(6), clean TEXT NULL, body TEXT NULL, + book_idx TEXT NULL, seg VARCHAR(256) NULL, lev_an VARCHAR(1), lev SMALLINT NULL, @@ -242,8 +244,9 @@ module SiSU_DbCreate digest_all CHAR(#{@@dl}), types CHAR(1) NULL ); - }) - @comment.psql.doc_objects if @comment + } + @conn.execute(create_doc_objects) + @comment.psql.doc_objects if @comment end def endnotes print %{ @@ -251,7 +254,7 @@ module SiSU_DbCreate create tables endnotes data import through ruby transfer } if @opt.cmd =~/[VM]/ - @conn.execute(%{ + create_endnotes=%{ CREATE TABLE endnotes ( nid BIGINT PRIMARY KEY, document_lid BIGINT REFERENCES doc_objects, @@ -264,8 +267,9 @@ module SiSU_DbCreate digest_clean CHAR(#{@@dl}), metadata_tid BIGINT REFERENCES metadata_and_text ); - }) - @comment.psql.endnotes if @comment + } + @conn.execute(create_endnotes) + @comment.psql.endnotes if @comment end def endnotes_asterisk print %{ @@ -273,7 +277,7 @@ module SiSU_DbCreate create tables endnotes_asterisk data import through ruby transfer } if @opt.cmd =~/[VM]/ - @conn.execute(%{ + create_endnotes_asterisk=%{ CREATE TABLE endnotes_asterisk ( nid BIGINT PRIMARY KEY, document_lid BIGINT REFERENCES doc_objects, @@ -286,8 +290,9 @@ module SiSU_DbCreate digest_clean CHAR(#{@@dl}), metadata_tid BIGINT REFERENCES metadata_and_text ); - }) - @comment.psql.endnotes_asterisk if @comment + } + @conn.execute(create_endnotes_asterisk) + @comment.psql.endnotes_asterisk if @comment end def endnotes_plus print %{ @@ -295,7 +300,7 @@ module SiSU_DbCreate create tables endnotes_plus data import through ruby transfer } if @opt.cmd =~/[VM]/ - @conn.execute(%{ + create_endnotes_plus=%{ CREATE TABLE endnotes_plus ( nid BIGINT PRIMARY KEY, document_lid BIGINT REFERENCES doc_objects, @@ -308,8 +313,9 @@ module SiSU_DbCreate digest_clean CHAR(#{@@dl}), metadata_tid BIGINT REFERENCES metadata_and_text ); - }) - @comment.psql.endnotes_plus if @comment + } + @conn.execute(create_endnotes_plus) + @comment.psql.endnotes_plus if @comment end def urls # create doc_objects file links mapping print %{ @@ -318,7 +324,7 @@ module SiSU_DbCreate create tables urls data import through ruby transfer } if @opt.cmd =~/[VM]/ - @conn.execute(%{ + create_urls=%{ CREATE TABLE urls ( metadata_tid BIGINT REFERENCES metadata_and_text, plaintext varchar(512), @@ -338,8 +344,9 @@ module SiSU_DbCreate markup varchar(512), sisupod varchar(512) ); - }) - @comment.psql.urls if @comment + } + @conn.execute(create_urls) + @comment.psql.urls if @comment end self end @@ -483,6 +490,8 @@ module SiSU_DbCreate IS 'text object - substantive text: clean, stripped of markup';}, %{COMMENT ON COLUMN doc_objects.body IS 'text object - substantive text: light html markup';}, + %{COMMENT ON COLUMN doc_objects.book_idx + IS 'book index creation information for paragraph, if provided';}, %{COMMENT ON COLUMN doc_objects.lev1 IS 'document structure, level number 1';}, %{COMMENT ON COLUMN doc_objects.lev2 |