dcache: billing -- fix error in liquibase varchar changeset

module: dcache

The liquibase changeset 4.1.7 was discovered to contain an off-by-one error in the string used to test the condition for changing the varchar length in the billing tables (the actual length of the string was 256, not 257). As a result, 4.1.7. 4.1.8 and 4.1.9 never will run, and all billing installations created by liquibase (which hardcodes the default to 256) remained as such.

The reason for the requested change was that the path and errormessage attributes of certain tables can well exceed 256.

The new changesets correct the error.

Target: master
Patch: http://rb.dcache.org/r/5555
Require-book: no
Require-notes: yes
Request: 2.2
Request: 2.6
Acked-by: Dmitry

RELEASE NOTES:  Fixes incorrect sizes on billing table varchar attributes pnfsid, path and errormessage.  The problem arises with the billing databases that were generated by Liquibase and not by hand.
This is because Liquibase hardcodes the varchar default to 256, where postgresql leaves it undefined (unlimited).  A previous patch to correct this was discovered to contain a bug which prevented it
from running.

TESTING:

After liquibase, tables for pnfsid, path and errormessage now correct size:

billing=> \d billinginfo
              Table "public.billinginfo"
     Column     |           Type           | Modifiers
----------------+--------------------------+-----------
 client         | character varying(256)   |
 initiator      | character varying(256)   |
 isnew          | boolean                  |
 protocol       | character varying(256)   |
 transfersize   | bigint                   |
 fullsize       | bigint                   |
 storageclass   | character varying(256)   |
 connectiontime | bigint                   |
 action         | character varying(256)   |
 cellname       | character varying(256)   |
 datestamp      | timestamp with time zone |
 errorcode      | integer                  |
 errormessage   | character varying(8000)  |
 pnfsid         | character varying(36)    |
 transaction    | character varying(256)   |
 p2p            | boolean                  |
Indexes:
    "billinginfo_client_idx" btree (client)
    "billinginfo_date_idx" btree (datestamp)
    "billinginfo_initiator_idx" btree (initiator)
    "billinginfo_isnew_idx" btree (isnew)
    "billinginfo_p2p_idx" btree (p2p)
    "billinginfo_pnfsid_idx" btree (pnfsid)
    "billinginfo_storageclass_idx" btree (storageclass)
    "billinginfo_transaction_idx" btree (transaction)
Triggers:
    tgr_update_billinginfo_p2p_daily AFTER INSERT ON billinginfo FOR EACH ROW EXECUTE PROCEDURE f_update_billinginfo_p2p_daily()
    tgr_update_billinginfo_rd_daily AFTER INSERT ON billinginfo FOR EACH ROW EXECUTE PROCEDURE f_update_billinginfo_rd_daily()
    tgr_update_billinginfo_tm_daily AFTER INSERT ON billinginfo FOR EACH ROW EXECUTE PROCEDURE f_update_billinginfo_tm_daily()
    tgr_update_billinginfo_wr_daily AFTER INSERT ON billinginfo FOR EACH ROW EXECUTE PROCEDURE f_update_billinginfo_wr_daily()

billing=> \d doorinfo
                Table "public.doorinfo"
     Column     |           Type           | Modifiers
----------------+--------------------------+-----------
 client         | character varying(256)   |
 mappedgid      | integer                  |
 mappeduid      | integer                  |
 owner          | character varying(256)   |
 path           | character varying(8000)  |
 queuedtime     | bigint                   |
 connectiontime | bigint                   |
 action         | character varying(256)   |
 cellname       | character varying(256)   |
 datestamp      | timestamp with time zone |
 errorcode      | integer                  |
 errormessage   | character varying(8000)  |
 pnfsid         | character varying(36)    |
 transaction    | character varying(256)   |
Indexes:
    "doorinfo_date_idx" btree (datestamp)
    "doorinfo_owner_idx" btree (owner)
    "doorinfo_pnfsid_idx" btree (pnfsid)
    "doorinfo_transaction_idx" btree (transaction)

billing=> \d storageinfo
              Table "public.storageinfo"
     Column     |           Type           | Modifiers
----------------+--------------------------+-----------
 queuedtime     | bigint                   |
 fullsize       | bigint                   |
 storageclass   | character varying(256)   |
 connectiontime | bigint                   |
 action         | character varying(256)   |
 cellname       | character varying(256)   |
 datestamp      | timestamp with time zone |
 errorcode      | integer                  |
 errormessage   | character varying(8000)  |
 pnfsid         | character varying(36)    |
 transaction    | character varying(256)   |
Indexes:
    "storageinfo_action_idx" btree (action)
    "storageinfo_date_idx" btree (datestamp)
    "storageinfo_pnfsid_idx" btree (pnfsid)
    "storageinfo_storageclass_idx" btree (storageclass)
    "storageinfo_transaction_idx" btree (transaction)
Triggers:
    tgr_update_storageinfo_rd_daily AFTER INSERT ON storageinfo FOR EACH ROW EXECUTE PROCEDURE f_update_storageinfo_rd_daily()
    tgr_update_storageinfo_wr_daily AFTER INSERT ON storageinfo FOR EACH ROW EXECUTE PROCEDURE f_update_storageinfo_wr_daily()

billing=> \d hitinfo
               Table "public.hitinfo"
    Column    |           Type           | Modifiers
--------------+--------------------------+-----------
 filecached   | boolean                  |
 action       | character varying(256)   |
 cellname     | character varying(256)   |
 datestamp    | timestamp with time zone |
 errorcode    | integer                  |
 errormessage | character varying(8000)  |
 pnfsid       | character varying(36)    |
 transaction  | character varying(256)   |
Indexes:
    "hitinfo_date_idx" btree (datestamp)
    "hitinfo_pnfsid_idx" btree (pnfsid)
    "hitinfo_transaction_idx" btree (transaction)
Triggers:
    tgr_update_hitinfo_daily AFTER INSERT ON hitinfo FOR EACH ROW EXECUTE PROCEDURE f_update_hitinfo_daily()