From 77217186e56524baf352d83447964445b13398b5 Mon Sep 17 00:00:00 2001 From: Andreas <6977712+AndreasK79@users.noreply.github.com> Date: Sat, 5 Feb 2022 17:15:00 +0100 Subject: [PATCH] [Migration fix] Renames script 83 to avoid dupliate naming. Fixes script 85 with existing column and too long constraint on utf8mb4. --- ...83_create_station_logbook_relationship_table2.php} | 2 +- .../085_add_public_slug_to_stationlogbooks.php | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) rename application/migrations/{083_create_station_logbook_relationship_table.php => 083_create_station_logbook_relationship_table2.php} (97%) diff --git a/application/migrations/083_create_station_logbook_relationship_table.php b/application/migrations/083_create_station_logbook_relationship_table2.php similarity index 97% rename from application/migrations/083_create_station_logbook_relationship_table.php rename to application/migrations/083_create_station_logbook_relationship_table2.php index 1c3b7633..b6f48a27 100644 --- a/application/migrations/083_create_station_logbook_relationship_table.php +++ b/application/migrations/083_create_station_logbook_relationship_table2.php @@ -7,7 +7,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); * removing the need for lots of configuration files. */ -class Migration_create_station_logbook_relationship_table extends CI_Migration { +class Migration_create_station_logbook_relationship_table2 extends CI_Migration { public function up() { diff --git a/application/migrations/085_add_public_slug_to_stationlogbooks.php b/application/migrations/085_add_public_slug_to_stationlogbooks.php index 3ac511b1..e4967c85 100644 --- a/application/migrations/085_add_public_slug_to_stationlogbooks.php +++ b/application/migrations/085_add_public_slug_to_stationlogbooks.php @@ -15,15 +15,18 @@ class Migration_add_public_slug_to_stationlogbooks extends CI_Migration { $fields = array( 'public_slug' => array( 'type' => 'VARCHAR', - 'constraint' => '200', + 'constraint' => '191', 'null' => TRUE, 'unique' => TRUE ) - ); + ); - $this->dbforge->add_column('station_logbooks', $fields); + if (!$this->db->field_exists('public_slug', 'station_logbooks')) { + $this->dbforge->add_column('station_logbooks', $fields); - $this->dbforge->add_key('public_slug'); + $this->dbforge->add_key('public_slug'); + } + } }