[Bps-public-commit] rt-extension-assets-import-csv branch, master, updated. 1.4-6-g3da34b7
Shawn Moore
shawn at bestpractical.com
Wed Mar 22 12:15:28 EDT 2017
The branch, master has been updated
via 3da34b773b5a3bad82d860e55481d3421d41bdd5 (commit)
from b226d1081d0504fb701f2a1472244a1c98cf8100 (commit)
Summary of changes:
lib/RT/Extension/Assets/Import/CSV.pm | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
- Log -----------------------------------------------------------------
commit 3da34b773b5a3bad82d860e55481d3421d41bdd5
Author: Shawn M Moore <shawn at bestpractical.com>
Date: Wed Mar 22 12:15:18 2017 -0400
Fix table and sequence names for Pg and Oracle
diff --git a/lib/RT/Extension/Assets/Import/CSV.pm b/lib/RT/Extension/Assets/Import/CSV.pm
index 0b3d6fc..eb36a27 100644
--- a/lib/RT/Extension/Assets/Import/CSV.pm
+++ b/lib/RT/Extension/Assets/Import/CSV.pm
@@ -228,16 +228,16 @@ sub run {
my $dbtype = RT->Config->Get('DatabaseType');
my $dbh = RT->DatabaseHandle->dbh;
if ( $dbtype eq "Pg" ) {
- $dbh->do("SELECT setval('rtxassets_id_seq', (SELECT MAX(id) FROM RTxAssets))");
+ $dbh->do("SELECT setval('assets_id_seq', (SELECT MAX(id) FROM Assets))");
} elsif ( $dbtype eq "Oracle" ) {
- my ($max) = $dbh->selectrow_array("SELECT MAX(id) FROM RTxAssets");
- my ($cur) = $dbh->selectrow_array("SELECT RTxAssets_seq.nextval FROM dual");
+ my ($max) = $dbh->selectrow_array("SELECT MAX(id) FROM Assets");
+ my ($cur) = $dbh->selectrow_array("SELECT Assets_seq.nextval FROM dual");
if ($max > $cur) {
- $dbh->do("ALTER SEQUENCE RTxAssets_seq INCREMENT BY ". ($max - $cur));
+ $dbh->do("ALTER SEQUENCE Assets_seq INCREMENT BY ". ($max - $cur));
# The next command _must_ be a select, and not a ->do,
# or Oracle doesn't actually fetch from the sequence.
- $dbh->selectrow_array("SELECT RTxAssets_seq.nextval FROM dual");
- $dbh->do("ALTER SEQUENCE RTxAssets_seq INCREMENT BY 1");
+ $dbh->selectrow_array("SELECT Assets_seq.nextval FROM dual");
+ $dbh->do("ALTER SEQUENCE Assets_seq INCREMENT BY 1");
}
}
}
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list