create_datatype_tables.pl - script to create postgres data tables and history tables for ontology annotator datatype-field tables.
Edit the arrays of users to grant permission to (both 'select' and 'all'), edit the datatype, edit the array of tables that list the table values, then run with
./create_datatype_tables.pl
The ontology_annotator.cgi requires some postgres data tables and postgres history tables for almost all fields. The 'id' field is required and doesn't have a corresponding set of postgres tables. Fields of type 'queryonly' also don't have a corresponding set of postgres tables. The tables have columns:
History tables are the same as normal tables with '_hst' appended to the table name, the second column name, and the index name.
For each table, the postgres table is '<datatype>_<table>', the history table is '<datatype>_<table>_hst' ; the indices are '<datatype>_<table>_idx' and '<datatype>_<table>_hst_idx', indexing on the data column. Tables are dropped in case they already exist and are then re-created, access is granted to postgres users, indices are created.
Edit the arrays of postgres database users to grant permission to (both 'select' and 'all'), edit the datatype, edit the array of tables that list the table values, then run with
./create_datatype_tables.pl