-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
douglas
committed
Feb 19, 2020
1 parent
b5be604
commit 29600c3
Showing
5 changed files
with
77 additions
and
2 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
|
||
use Phinx\Migration\AbstractMigration; | ||
|
||
class AddColumnUriRole extends AbstractMigration | ||
{ | ||
/** | ||
* Change Method. | ||
* | ||
* Write your reversible migrations using this method. | ||
* | ||
* More information on writing migrations is available here: | ||
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class | ||
* | ||
* The following commands can be used in this method and Phinx will | ||
* automatically reverse them when rolling back: | ||
* | ||
* createTable | ||
* renameTable | ||
* addColumn | ||
* addCustomColumn | ||
* renameColumn | ||
* addIndex | ||
* addForeignKey | ||
* | ||
* Any other destructive changes will result in an error when trying to | ||
* rollback the migration. | ||
* | ||
* Remember to call "create()" or "update()" and NOT "save()" when working | ||
* with the Table class. | ||
*/ | ||
public function change() | ||
{ | ||
$table = $this->table("roles"); | ||
$table->addColumn("uri","string",["limit" => 255]); | ||
$table->save(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,9 +24,28 @@ public function run() | |
'avatar' => '', | ||
'role_id' => 1, | ||
'created' => date('Y-m-d H:i:s') | ||
], | ||
[ | ||
'name' => 'professor', | ||
'email' => '[email protected]', | ||
'password' => '$2y$12$o0vmN5EMkgjEiBxtRot3T.JN.Yvhu1TxYpI3qfG0Xl4QvxImE0.ZC', | ||
'phone' => '21993725886', | ||
'avatar' => '', | ||
'role_id' => 2, | ||
'created' => date('Y-m-d H:i:s') | ||
], | ||
[ | ||
'name' => 'cliente', | ||
'email' => '[email protected]', | ||
'password' => '$2y$12$o0vmN5EMkgjEiBxtRot3T.JN.Yvhu1TxYpI3qfG0Xl4QvxImE0.ZC', | ||
'phone' => '21993725886', | ||
'avatar' => '', | ||
'role_id' => 3, | ||
'created' => date('Y-m-d H:i:s') | ||
] | ||
]; | ||
|
||
$this->table('users')->truncate(); | ||
$users = $this->table('users'); | ||
$users->insert($data)->saveData(); | ||
} | ||
|