Initial import of space_profiles module
This commit is contained in:
26
migrations/m260401_141000_add_template_key.php
Normal file
26
migrations/m260401_141000_add_template_key.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?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');
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user