Skip to content
Snippets Groups Projects
Commit da4efaf7 authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms
Browse files

add migration that changes the type of resource_property_definitions.type to ENUM, fixes #1796

Closes #1796

Merge request studip/studip!1210
parent 42c9c67e
No related branches found
No related tags found
No related merge requests found
<?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);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment