Project

General

Profile

Bug #105498

Updated by Benjamin Franzke 24 days ago

Example: fe_users.image 
 This field has been changed from @TINYTEXT DEFAULT NULL@ (in v12) to @INT UNSIGNED DEFAULT NOT NULL@ (in v13). 

 That means the following @ALTER TABLE@ statement is generated: 

 <pre> 
 ALTER TABLE `fe_users` CHANGE `image` `image` INT UNSIGNED DEFAULT 0 NOT NULL 
 </pre> 

 Which fails with: 

 <pre> 
  Error: Data truncated for column 'image' at row 1 
 </pre> 

 When there are columns (which was fine in v12) with @null@ values: 
 <pre> 
 select uid, pid, username, image from fe_users; 
 +-----+------+--------------------------+-------+ 
 | uid | pid    | username                   | image | 
 +-----+------+--------------------------+-------+ 
 |     1 |    178 | styleguide-frontend-demo | NULL    | 
 |     2 |    205 | styleguide-frontend-demo | NULL    | 
 |     3 |    771 | example_user               | NULL    | 
 |     4 | 1008 | admin                      | 0       | 
 |     5 | 1013 | admin                      | NULL    | 
 +-----+------+--------------------------+-------+ 
 </pre> 

 h2. Desired solution: 

 There should be an upgrade wizard that runs prior to this database updates, that sets all values of current nullable fields to the schema default value, when the desired schema is a non-nullable field with a default value.

Back