Skip to content
This repository has been archived by the owner on Dec 3, 2019. It is now read-only.

Commit

Permalink
Migration: change password column length
Browse files Browse the repository at this point in the history
  • Loading branch information
mik-laj committed Jul 7, 2016
1 parent 0a54453 commit fdb9022
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
29 changes: 29 additions & 0 deletions config/Migrations/20160707183301_ChangeSizeOfPasswordColumn.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php
use Migrations\AbstractMigration;

class ChangeSizeOfPasswordColumn extends AbstractMigration
{

public function up()
{

$this->table('users')
->changeColumn('password', 'string', [
'length' => 255,
])
->update();
}

public function down()
{

$this->table('users')
->changeColumn('password', 'string', [
'default' => null,
'length' => 40,
'null' => false,
])
->update();
}
}

2 changes: 1 addition & 1 deletion tests/Fixture/UsersFixture.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class UsersFixture extends TestFixture
public $fields = [
'id' => ['type' => 'integer', 'length' => 10, 'unsigned' => true, 'null' => false, 'default' => null, 'comment' => '', 'autoIncrement' => true, 'precision' => null],
'login' => ['type' => 'string', 'length' => 40, 'null' => false, 'default' => null, 'comment' => '', 'precision' => null, 'fixed' => null],
'password' => ['type' => 'string', 'length' => 40, 'null' => false, 'default' => null, 'comment' => '', 'precision' => null, 'fixed' => null],
'password' => ['type' => 'string', 'length' => 255, 'null' => false, 'default' => null, 'comment' => '', 'precision' => null, 'fixed' => null],
'email' => ['type' => 'string', 'length' => 40, 'null' => false, 'default' => null, 'comment' => '', 'precision' => null, 'fixed' => null],
'created' => ['type' => 'datetime', 'length' => null, 'null' => false, 'default' => 'CURRENT_TIMESTAMP', 'comment' => '', 'precision' => null],
'_constraints' => [
Expand Down

0 comments on commit fdb9022

Please sign in to comment.