Download & Extend

Table shouldn't use CHAR(1) to store active, working, and private fields

Project:Filemanager
Version:master
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:active

Issue Summary

I've run into some serious wierdness with the table due to the active, working and private fields being stored as a CHAR(1) rather than TINYINT(1). Here's a patch to treat them differently and the (My)SQL needed to update the tables.

UPDATE file SET `active`= 1 WHERE `active`LIKE 't';
UPDATE file SET `active`= 0 WHERE `active`!= 1;
UPDATE file SET `working`= 1 WHERE `working`LIKE 't';
UPDATE file SET `working`= 0 WHERE `working`!= 1;
UPDATE file SET `private`= 1 WHERE `private`LIKE 't';
UPDATE file SET `private`= 0 WHERE `private`!= 1;

ALTER TABLE file MODIFY COLUMN `active` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0,
MODIFY COLUMN `working` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0,
MODIFY COLUMN `private` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0;
}
AttachmentSize
filemanager.module_boolean_fields.patch3.61 KB

Comments

#1

Priority:normal» critical