[Rt-commit] rt branch, 4.4/reset-sequences, updated. rt-4.4.2-44-gada197dac

Brian Duggan brian at bestpractical.com
Wed Jun 27 16:31:14 EDT 2018


The branch, 4.4/reset-sequences has been updated
       via  ada197dacd823489129f6efeb0c9232a96df648e (commit)
      from  6683b51c1753808a2221c0801b3050fdf2ad9987 (commit)

Summary of changes:
 etc/upgrade/reset-sequences.in | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

- Log -----------------------------------------------------------------
commit ada197dacd823489129f6efeb0c9232a96df648e
Author: Brian C. Duggan <brian at bestpractical.com>
Date:   Wed Jun 27 16:27:55 2018 -0400

    Use correct sequence name for Pg tables
    
    The Postgres schema uses '_id_seq' suffixes for all tables excect
    OBJECTCUSTOMFIELDS and OBJECTCUSTOMFIELDVALUES, which use '_id_s'.
    
    This change allows the reset-sequences script to use the correct suffix
    for the tables for Postgres.

diff --git a/etc/upgrade/reset-sequences.in b/etc/upgrade/reset-sequences.in
index 83da1a4da..7d7e5f968 100644
--- a/etc/upgrade/reset-sequences.in
+++ b/etc/upgrade/reset-sequences.in
@@ -137,8 +137,9 @@ print "Working with:\n"
     ."User:\t$db_user\nDBA:\t$dba_user" . ($args{'skip-create'} ? ' (No DBA)' : '') . "\n\n";
 
 foreach my $table ( keys %$found_tables ){
+    my $pg_seq = my $pg_seq = $table =~ /^OBJECTCUSTOMFIELD(S|VALUES)$/ ? '_id_s' : '_id_seq';
     fix_id_sequence($table, {
-        Pg     => lc($table) . '_id_seq',
+        Pg     => lc($table) . $pg_seq,
         Oracle => $table . '_seq',
     });
 }

-----------------------------------------------------------------------


More information about the rt-commit mailing list