Files
space_profiles/migrations/m260401_141000_add_template_key.php
2026-04-04 13:11:50 -04:00

27 lines
778 B
PHP

<?php
use humhub\components\Migration;
class m260401_141000_add_template_key extends Migration
{
public function safeUp()
{
$schema = $this->db->getSchema()->getTableSchema('rescue_space_profile', true);
if ($schema === null) {
return;
}
if (!isset($schema->columns['template_key'])) {
$this->addColumn('rescue_space_profile', 'template_key', $this->string(64)->defaultValue('rescue_center')->notNull());
}
}
public function safeDown()
{
$schema = $this->db->getSchema()->getTableSchema('rescue_space_profile', true);
if ($schema !== null && isset($schema->columns['template_key'])) {
$this->dropColumn('rescue_space_profile', 'template_key');
}
}
}