diff options
| author | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2022-11-30 11:57:02 +0000 |
|---|---|---|
| committer | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2022-11-30 11:57:02 +0000 |
| commit | da4efaf78a5ed9506bb3c26d6c2967e3fff3aede (patch) | |
| tree | 26d113d099810613c748210522f3a8038bc57d13 /db | |
| parent | 42c9c67e4d9b1d424129d8110bc49d02fca82ecd (diff) | |
add migration that changes the type of resource_property_definitions.type to ENUM, fixes #1796
Closes #1796
Merge request studip/studip!1210
Diffstat (limited to 'db')
| -rw-r--r-- | db/migrations/5.1.36_change_type_of_resource_property_definitions_type.php | 22 |
1 files changed, 22 insertions, 0 deletions
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 0000000..1af2b45 --- /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); + } +} |
