Merge branch 'add_header_to_resume_template' into document

This commit is contained in:
iIronside
2022-11-15 12:08:09 +03:00
12 changed files with 185 additions and 86 deletions

View File

@ -0,0 +1,42 @@
<?php
use yii\db\Migration;
/**
* Class m221110_133204_add_header__to_resume_template
*/
class m221110_133204_add_header_to_resume_template extends Migration
{
/**
* {@inheritdoc}
*/
public function safeUp()
{
$this->addColumn('resume_template', 'header_text', $this->string());
$this->addColumn('resume_template', 'header_image', $this->string());
}
/**
* {@inheritdoc}
*/
public function safeDown()
{
$this->dropColumn('resume_template', 'header_text');
$this->dropColumn('resume_template', 'header_image');
}
/*
// Use up()/down() to run migration code without a transaction.
public function up()
{
}
public function down()
{
echo "m221110_133204_add_header__to_resume_template cannot be reverted.\n";
return false;
}
*/
}

View File

@ -0,0 +1,27 @@
<?php
use yii\db\Migration;
/**
* Handles adding columns to table `{{%user_card}}`.
*/
class m221111_124753_add_resume_template_id_column_to_user_card_table extends Migration
{
/**
* {@inheritdoc}
*/
public function safeUp()
{
$this->addColumn('user_card','resume_template_id', $this->integer());
$this->addForeignKey('resume_template_user_card', 'user_card', 'resume_template_id', 'resume_template', 'id');
}
/**
* {@inheritdoc}
*/
public function safeDown()
{
$this->dropForeignKey('resume_template_user_card', 'user_card');
$this->dropColumn('user_card', 'resume_template_id');
}
}