Add-on over standard migrations, which automatically creates migration rollback functions.
ΠΠ°Π΄ΡΡΡΠΎΠΉΠΊΠ° Π½Π°Π΄ ΡΡΠ°Π½Π΄Π°ΡΡΠ½ΡΠΌΠΈ ΠΌΠΈΠ³ΡΠ°ΡΠΈΡΠΌΠΈ, ΠΏΠΎΠ·Π²ΠΎΠ»ΡΡΡΠ°Ρ Π°Π²ΡΠΎΠΌΠ°ΡΠΈΡΠ΅ΡΠΊΠΈ ΡΠΎΠ·Π΄Π°Π²Π°ΡΡ ΡΡΠ½ΠΊΡΠΈΠΈ ΠΎΡΠΊΠ°ΡΠ° ΠΌΠΈΠ³ΡΠ°ΡΠΈΠΈ., (*1)
uses:
```
class m000000_000000_users extends \andkon\migrate\Migration
{
public function setTables()
{
return [
'users' => [
'id' => $this->primaryKey(),
'company_id' => $this->integer()->notNull(),
'position_id' => $this->integer(),
'department_id' => $this->integer(),
'login' => $this->string(255)->notNull(),
'password' => $this->string(255),
'password_salt' => $this->string(255),
'first_name' => $this->string(255),
'middle_name' => $this->string(255),
]
];
}, (*2)
public function setForeignKeys()
{
return [
// user
[
'user' => 'company_id',
'company' => 'id',
],
[
'user' => 'position_id',
'position' => 'id',
'delete' => 'RESTRICT',
],
];
}
}, (*3)