From 01e391d713627d1b5b933c43696ea2067b7242c0 Mon Sep 17 00:00:00 2001 From: nicod_ <nicod@lerebooteux.fr> Date: Wed, 24 May 2023 21:01:51 +0200 Subject: [PATCH] Rangement --- blocks_administrations.php | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/blocks_administrations.php b/blocks_administrations.php index aaeb524..4c250e3 100644 --- a/blocks_administrations.php +++ b/blocks_administrations.php @@ -31,15 +31,7 @@ function blocks_upgrade($nom_meta_base_version, $version_cible) { ]; $maj['1.1.0'] = [ - ['sql_alter', 'TABLE spip_blocs RENAME TO spip_blocks'], - ['sql_alter', 'TABLE spip_blocs_liens RENAME TO spip_blocks_liens'], - ['sql_alter', 'TABLE spip_blocs_types RENAME TO spip_blocktypes'], - - ['sql_alter', 'TABLE spip_blocks CHANGE id_bloc id_block bigint(21) NOT NULL AUTO_INCREMENT'], - ['sql_alter', 'TABLE spip_blocks CHANGE id_blocs_type id_blocktype bigint(21) NOT NULL DEFAULT 0'], - ['sql_alter', 'TABLE spip_blocks_liens CHANGE id_bloc id_block bigint(21) NOT NULL DEFAULT 0'], - ['sql_alter', 'TABLE spip_blocktypes CHANGE id_blocs_type id_blocktype bigint(21) NOT NULL AUTO_INCREMENT'], - + ['blocks_update_1_0_1'], ['maj_tables', ['spip_blocks', 'spip_blocks_liens', 'spip_blocktypes']], ]; @@ -146,3 +138,15 @@ function blocks_installe_config() { ] ); } + +function blocks_update_1_0_1(){ + // renommage des tables + sql_alter('TABLE spip_blocs RENAME TO spip_blocks'); + sql_alter('TABLE spip_blocs_liens RENAME TO spip_blocks_liens'); + sql_alter('TABLE spip_blocs_types RENAME TO spip_blocktypes'); + + sql_alter('TABLE spip_blocks CHANGE id_bloc id_block bigint(21) NOT NULL AUTO_INCREMENT'); + sql_alter('TABLE spip_blocks CHANGE id_blocs_type id_blocktype bigint(21) NOT NULL DEFAULT 0'); + sql_alter('TABLE spip_blocks_liens CHANGE id_bloc id_block bigint(21) NOT NULL DEFAULT 0'); + sql_alter('TABLE spip_blocktypes CHANGE id_blocs_type id_blocktype bigint(21) NOT NULL AUTO_INCREMENT'); +} -- GitLab