aboutsummaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
Diffstat (limited to 'db')
-rw-r--r--db/migrations/5.1.36_change_type_of_resource_property_definitions_type.php22
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);
+ }
+}