27 lines
778 B
PHP
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');
|
|
}
|
|
}
|
|
}
|