Something went wrong on our end
Select Git revision
m171204_135754_create_table_videoconf_users_mm.php
-
Marcello Pivanti authoredMarcello Pivanti authored
m171204_135754_create_table_videoconf_users_mm.php 1.57 KiB
<?php
/**
* Copyright 2020 Art-ER S. Cons. P.A.
* EROI - Emilia Romagna Open Innovation is based on:
* https://www.open2.0.regione.lombardia.it
*
* @see https://repo.art-er.it Developers' community
* @license GPLv3
* @license https://opensource.org/licenses/gpl-3.0.html GNU General Public License version 3
*
* @package arter\amos\videoconference\migrations
* @category CategoryName
* @author Elite Division S.r.l.
*/
use arter\amos\core\migration\AmosMigrationTableCreation;
/**
* Class m171204_135754_create_table_videoconf_users_mm
*/
class m171204_135754_create_table_videoconf_users_mm extends AmosMigrationTableCreation
{
/**
* @inheritdoc
*/
protected function setTableName()
{
$this->tableName = '{{%videoconf_users_mm}}';
}
/**
* @inheritdoc
*/
protected function setTableFields()
{
$this->tableFields = [
'id' => $this->primaryKey(),
'videoconf_id' => $this->integer()->notNull(),
'user_profile_id' => $this->integer()->notNull()
];
}
/**
* @inheritdoc
*/
protected function beforeTableCreation()
{
parent::beforeTableCreation();
$this->setAddCreatedUpdatedFields(true);
}
/**
* @inheritdoc
*/
protected function addForeignKeys()
{
$this->addForeignKey('fk_videoconf_users_mm', $this->getRawTableName(), 'videoconf_id', '{{%videoconf}}', 'id');
$this->addForeignKey('fk_users_videoconf_mm', $this->getRawTableName(), 'user_profile_id', '{{%user_profile}}', 'id');
}
}