migration: adding password_link table.
This commit is contained in:
parent
e6290e7fdc
commit
58377273cc
1 changed files with 18 additions and 0 deletions
18
app/migrations/20180611202847_password_link.php
Normal file
18
app/migrations/20180611202847_password_link.php
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
|
||||
use Phinx\Migration\AbstractMigration;
|
||||
|
||||
class PasswordLink extends AbstractMigration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
$this->table('password_link')
|
||||
->addColumn('public_id', 'string', ['length' => 12 ])
|
||||
->addColumn('user_id', 'integer')
|
||||
->addForeignKey('user_id', 'user', ['id'], [ 'constraint' => 'FK_password_link_user' ])
|
||||
->addColumn('date', 'datetime', [ 'default' => 'CURRENT_TIMESTAMP' ])
|
||||
->addColumn('password', 'string', [ 'limit' => 255, 'null' => true ])
|
||||
->save();
|
||||
}
|
||||
}
|
||||
Reference in a new issue