Skip to content
Snippets Groups Projects
Commit f5452023 authored by Laurent's avatar Laurent
Browse files

Merge branch 'hotline#49000_retour_bdp_apparaissent_a_l_opac_en_attente_export_total' into 'stable'

hotline #49000 fix items deletion on total import

See merge request !1850
parents a3a89440 95576f37
Branches
Tags
1 merge request!1840Dev#47780 digital ressources plugins
- ticket #49000 : correction de l'import total: des exemplaires n'étaient pas supprimés
\ No newline at end of file
<?php
error_reporting(E_ERROR | E_PARSE);
define("PATCH_LEVEL","306");
define("PATCH_LEVEL","307");
define("APPLI","cosmogramme");
define("COSMOPATH", "/var/www/html/vhosts/opac2/www/htdocs");
......
<?php
try {
$adapter = Zend_Db_Table_Abstract::getDefaultAdapter();
$adapter->query('alter table exemplaires modify column to_delete boolean not null default false');
} catch(Exception $e) {}
?>
......@@ -922,4 +922,28 @@ class UpgradeDB_306_Test extends UpgradeDBTestCase {
public function itemsTableShouldHaveColumnToDelete() {
$this->assertFieldType('exemplaires', 'to_delete', 'tinyint(1)');
}
}
class UpgradeDB_307_Test extends UpgradeDBTestCase {
public function prepare() {
try {
$this->query('alter table exemplaires modify column to_delete boolean null default null')
->query('update exemplaires set to_delete null');
} catch(Exception $e) {
}
}
/** @test */
public function itemsTableShouldHaveColumnToDeleteNotNullable() {
$this->assertFieldType('exemplaires', 'to_delete', 'tinyint(1)');
}
/** @test */
public function itemsTableShouldNotHaveItemsWithDeleteNull() {
$items = $this->query('select * from exemplaires where to_delete is null')->fetch();
$this->assertEmpty($items);
}
}
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment