-
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.
Merge pull request #11 from bluzphp/develop
Fixed migrations (divided into structure and data migrations)
- Loading branch information
Showing
3 changed files
with
40 additions
and
12 deletions.
There are no files selected for viewing
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
39 changes: 39 additions & 0 deletions
39
data/migrations/20170317111412_module_categories_permissions.php
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,39 @@ | ||
<?php | ||
/** | ||
* @copyright Bluz PHP Team | ||
* @link https://github.com/bluzphp/skeleton | ||
*/ | ||
|
||
use Phinx\Migration\AbstractMigration; | ||
|
||
/** | ||
* CreateCategoriesTable | ||
*/ | ||
class ModuleCategoriesPermissions extends AbstractMigration | ||
{ | ||
/** | ||
* Migrate Up. | ||
*/ | ||
public function up() | ||
{ | ||
$data = [ | ||
[ | ||
'roleId' => 2, | ||
'module' => 'categories', | ||
'privilege' => 'Management' | ||
] | ||
]; | ||
|
||
$privileges = $this->table('acl_privileges'); | ||
$privileges->insert($data) | ||
->save(); | ||
} | ||
|
||
/** | ||
* Migrate Down. | ||
*/ | ||
public function down() | ||
{ | ||
$this->execute('DELETE FROM acl_privileges WHERE module = "categories"'); | ||
} | ||
} |