diff --git a/src/main/resources/templates/db_scripts/po_line_table.sql b/src/main/resources/templates/db_scripts/po_line_table.sql index 5a2665a4..a6724387 100644 --- a/src/main/resources/templates/db_scripts/po_line_table.sql +++ b/src/main/resources/templates/db_scripts/po_line_table.sql @@ -2,11 +2,11 @@ CREATE INDEX IF NOT EXISTS po_line_customfields_recordservice_idx_gin ON ${myuni USING GIN ((jsonb->'customFields')); CREATE INDEX IF NOT EXISTS po_line_updated_date_sort ON ${myuniversity}_${mymodule}.po_line - (left(lower(f_unaccent(jsonb->'metadata'->>'updatedDate')),600) DESC, - lower(f_unaccent(jsonb->'metadata'->>'updatedDate')) DESC); + (left(lower(f_unaccent(jsonb->'metadata'->>'updatedDate')),600), + lower(f_unaccent(jsonb->'metadata'->>'updatedDate'))); CREATE INDEX IF NOT EXISTS po_line_title_or_package_sort ON ${myuniversity}_${mymodule}.po_line - (left(lower(f_unaccent(jsonb->>'titleOrPackage')),600) DESC, lower(f_unaccent(po_line.jsonb->>'titleOrPackage')) DESC); + (left(lower(f_unaccent(jsonb->>'titleOrPackage')),600), lower(f_unaccent(po_line.jsonb->>'titleOrPackage'))); CREATE INDEX IF NOT EXISTS po_line_po_line_number_sort ON ${myuniversity}_${mymodule}.po_line - (left(lower(f_unaccent(jsonb->>'poLineNumber')),600) DESC, lower(f_unaccent(po_line.jsonb->>'poLineNumber')) DESC); + (left(lower(f_unaccent(jsonb->>'poLineNumber')),600), lower(f_unaccent(po_line.jsonb->>'poLineNumber'))); diff --git a/src/main/resources/templates/db_scripts/schema.json b/src/main/resources/templates/db_scripts/schema.json index 428347ec..e612ad01 100644 --- a/src/main/resources/templates/db_scripts/schema.json +++ b/src/main/resources/templates/db_scripts/schema.json @@ -145,6 +145,11 @@ "run": "after", "snippetPath": "purchase_order_table.sql", "fromModuleVersion": "mod-orders-storage-13.8.0" + }, + { + "run": "after", + "snippetPath": "title_table.sql", + "fromModuleVersion": "mod-orders-storage-13.8.0" } ], "tables": [ @@ -238,6 +243,12 @@ }, { "fieldName": "acqUnitIds" + }, + { + "fieldName": "orderType" + }, + { + "fieldName": "workflowStatus" } ], "ginIndex": [ @@ -387,6 +398,11 @@ "removeAccents": false, "arraySubfield": "fundId", "arrayModifiers": ["fundId"] + }, + { + "fieldName": "orderFormat", + "caseSensitive": false, + "removeAccents": true } ], "ginIndex": [ @@ -559,6 +575,9 @@ "fullTextIndex": [ { "fieldName": "comment" + }, + { + "fieldName": "receivingStatus" } ], "ginIndex": [ diff --git a/src/main/resources/templates/db_scripts/title_table.sql b/src/main/resources/templates/db_scripts/title_table.sql new file mode 100644 index 00000000..308361ea --- /dev/null +++ b/src/main/resources/templates/db_scripts/title_table.sql @@ -0,0 +1,11 @@ +CREATE INDEX IF NOT EXISTS titles_title_sort ON ${myuniversity}_${mymodule}.titles + (left(lower(f_unaccent(titles.jsonb->>'title')), 600), lower(f_unaccent(titles.jsonb->>'title'))); + +CREATE INDEX IF NOT EXISTS titles_po_line_number_sort ON ${myuniversity}_${mymodule}.titles + (left(lower(f_unaccent(titles.jsonb->>'poLineNumber')), 600), lower(f_unaccent(titles.jsonb->>'poLineNumber'))); + +CREATE INDEX IF NOT EXISTS titles_receiving_note_sort ON ${myuniversity}_${mymodule}.titles + (left(lower(f_unaccent(titles.jsonb->'poLine'->>'receivingNote')), 600), lower(f_unaccent(titles.jsonb->'poLine'->>'receivingNote'))); + +CREATE INDEX IF NOT EXISTS titles_package_sort ON ${myuniversity}_${mymodule}.titles + (left(lower(f_unaccent(titles.jsonb->'poLine'->>'titleOrPackage')), 600), lower(f_unaccent(titles.jsonb->'poLine'->>'titleOrPackage')));