Skip to content
Snippets Groups Projects
Commit 01a4746d authored by Patrick Barroca's avatar Patrick Barroca :grin:
Browse files

rel #21694 : reference id between models and their pseudo records defaults no more to 0

parent 548779ca
Branches
Tags
4 merge requests!1132Hotline#29412 images des articles dans le resultat de recherche,!1120Master,!1071Dev #21694 stop delete notice,!1063Dev #21694 stop delete notice
<?php
$adapter = Zend_Db_Table::getDefaultAdapter();
$adapter->query('ALTER TABLE `album` MODIFY `notice_id` int(11) null default null');
$adapter->query('UPDATE `album` SET `notice_id`=null WHERE `notice_id`=0');
\ No newline at end of file
foreach([['table' => 'album', 'id' => 'notice_id'],
['table' => 'cms_article', 'id' => 'id_notice'],
['table' => 'rss_flux', 'id' => 'id_notice'],
['table' => 'sito_url', 'id' => 'id_notice']]
as $params) {
$adapter->query(sprinf('ALTER TABLE `%s` MODIFY `%s` int(11) null default null',
$params['table'], $params['id']));
$adapter->query(sprintf('UPDATE `%s` SET `%s`=null WHERE `%s`=0',
$params['table'], $params['id'], $params['id']));
}
\ 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