diff --git a/db/migrations/5.1.36_change_type_of_resource_property_definitions_type.php b/db/migrations/5.1.36_change_type_of_resource_property_definitions_type.php new file mode 100644 index 0000000000000000000000000000000000000000..1af2b45e00807de108895aaaef35bb4912ad0b6f --- /dev/null +++ b/db/migrations/5.1.36_change_type_of_resource_property_definitions_type.php @@ -0,0 +1,22 @@ +<?php +final class ChangeTypeOfResourcePropertyDefinitionsType extends Migration +{ + public function description() + { + return 'Changes the type of resource_property_definitions.type to ENUM'; + } + + protected function up() + { + $query = "ALTER TABLE `resource_property_definitions` + CHANGE COLUMN `type` `type` ENUM('bool', 'text', 'num', 'select', 'user', 'institute', 'position', 'fileref', 'url') COLLATE latin1_bin NOT NULL"; + DBManager::get()->exec($query); + } + + protected function down() + { + $query = "ALTER TABLE `resource_property_definitions` + CHANGE COLUMN `type` `type` SET('bool', 'text', 'num', 'select', 'user', 'institute', 'position', 'fileref', 'url', 'resource_ref_list') COLLATE latin1_bin DEFAULT NULL"; + DBManager::get()->exec($query); + } +}