From 2076d6b9a7f7d1f8892fc87453d80f6caaa30650 Mon Sep 17 00:00:00 2001 From: Stefan Scheungrab Date: Wed, 22 Jul 2015 11:13:52 +0200 Subject: [PATCH] Import: renamed column imported_rowset_checksum TO rowset_checksum resolves: #9700 --- application/tables/ImportrunTable.php | 2 +- library/Director/Import/Import.php | 2 +- schema/mysql-changes/upgrade_26.sql | 4 ++++ schema/mysql.sql | 4 ++-- 4 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 schema/mysql-changes/upgrade_26.sql diff --git a/application/tables/ImportrunTable.php b/application/tables/ImportrunTable.php index 84c170a9..d676fd45 100644 --- a/application/tables/ImportrunTable.php +++ b/application/tables/ImportrunTable.php @@ -46,7 +46,7 @@ class ImportrunTable extends QuickTable array() )->joinLeft( array('rs' => 'imported_rowset'), - 'rs.checksum = r.imported_rowset_checksum', + 'rs.checksum = r.rowset_checksum', array() )->joinLeft( array('rsr' => 'imported_rowset_row'), diff --git a/library/Director/Import/Import.php b/library/Director/Import/Import.php index 8c67b8f7..9c29364a 100644 --- a/library/Director/Import/Import.php +++ b/library/Director/Import/Import.php @@ -105,7 +105,7 @@ class Import 'import_run', array( 'source_id' => $source->id, - 'imported_rowset_checksum' => $rowset, + 'rowset_checksum' => $rowset, 'start_time' => date('Y-m-d H:i:s'), 'succeeded' => 'y' ) diff --git a/schema/mysql-changes/upgrade_26.sql b/schema/mysql-changes/upgrade_26.sql new file mode 100644 index 00000000..d7f0c469 --- /dev/null +++ b/schema/mysql-changes/upgrade_26.sql @@ -0,0 +1,4 @@ +ALTER TABLE import_run DROP FOREIGN KEY import_run_rowset; +ALTER TABLE import_run CHANGE imported_rowset_checksum rowset_checksum varbinary(20) DEFAULT NULL; +ALTER TABLE import_run ADD CONSTRAINT import_run_rowset FOREIGN KEY rowset (rowset_checksum) REFERENCES imported_rowset (checksum) ON DELETE RESTRICT ON UPDATE CASCADE; + diff --git a/schema/mysql.sql b/schema/mysql.sql index 98fed078..d12b8cdd 100644 --- a/schema/mysql.sql +++ b/schema/mysql.sql @@ -831,7 +831,7 @@ CREATE TABLE imported_rowset ( CREATE TABLE import_run ( id INT(10) UNSIGNED AUTO_INCREMENT NOT NULL, source_id INT(10) UNSIGNED NOT NULL, - imported_rowset_checksum VARBINARY(20) DEFAULT NULL, + rowset_checksum VARBINARY(20) DEFAULT NULL, start_time DATETIME NOT NULL, end_time DATETIME DEFAULT NULL, succeeded ENUM('y', 'n') DEFAULT NULL, @@ -842,7 +842,7 @@ CREATE TABLE import_run ( ON DELETE RESTRICT ON UPDATE CASCADE, CONSTRAINT import_run_rowset - FOREIGN KEY rowset (imported_rowset_checksum) + FOREIGN KEY rowset (rowset_checksum) REFERENCES imported_rowset (checksum) ON DELETE RESTRICT ON UPDATE CASCADE