229 lines
3.4 KiB
PHP
229 lines
3.4 KiB
PHP
![]() |
<?php
|
||
|
|
||
|
use Phinx\Seed\AbstractSeed;
|
||
|
|
||
|
class PermissionsSeeder extends AbstractSeed
|
||
|
{
|
||
|
public function run(): void
|
||
|
{
|
||
|
$data = [
|
||
|
[
|
||
|
'id' => 1,
|
||
|
'type' => 2,
|
||
|
'ext_id' => 4,
|
||
|
'action_id' => 1,
|
||
|
'status' => 0,
|
||
|
],
|
||
|
[
|
||
|
'id' => 2,
|
||
|
'type' => 2,
|
||
|
'ext_id' => 4,
|
||
|
'action_id' => 4,
|
||
|
'status' => 1,
|
||
|
],
|
||
|
[
|
||
|
'id' => 3,
|
||
|
'type' => 2,
|
||
|
'ext_id' => 4,
|
||
|
'action_id' => 27,
|
||
|
'status' => 1,
|
||
|
],
|
||
|
[
|
||
|
'id' => 4,
|
||
|
'type' => 2,
|
||
|
'ext_id' => 4,
|
||
|
'action_id' => 28,
|
||
|
'status' => 1,
|
||
|
],
|
||
|
[
|
||
|
'id' => 5,
|
||
|
'type' => 2,
|
||
|
'ext_id' => 4,
|
||
|
'action_id' => 29,
|
||
|
'status' => 1,
|
||
|
],
|
||
|
[
|
||
|
'id' => 6,
|
||
|
'type' => 2,
|
||
|
'ext_id' => 4,
|
||
|
'action_id' => 24,
|
||
|
'status' => 1,
|
||
|
],
|
||
|
[
|
||
|
'id' => 7,
|
||
|
'type' => 2,
|
||
|
'ext_id' => 4,
|
||
|
'action_id' => 7,
|
||
|
'status' => 1,
|
||
|
],
|
||
|
[
|
||
|
'id' => 8,
|
||
|
'type' => 2,
|
||
|
'ext_id' => 4,
|
||
|
'action_id' => 11,
|
||
|
'status' => 1,
|
||
|
],
|
||
|
[
|
||
|
'id' => 9,
|
||
|
'type' => 2,
|
||
|
'ext_id' => 3,
|
||
|
'action_id' => 9,
|
||
|
'status' => 1,
|
||
|
],
|
||
|
[
|
||
|
'id' => 10,
|
||
|
'type' => 2,
|
||
|
'ext_id' => 3,
|
||
|
'action_id' => 5,
|
||
|
'status' => 1,
|
||
|
],
|
||
|
[
|
||
|
'id' => 11,
|
||
|
'type' => 2,
|
||
|
'ext_id' => 3,
|
||
|
'action_id' => 2,
|
||
|
'status' => 1,
|
||
|
],
|
||
|
[
|
||
|
'id' => 12,
|
||
|
'type' => 2,
|
||
|
'ext_id' => 3,
|
||
|
'action_id' => 3,
|
||
|
'status' => 1,
|
||
|
],
|
||
|
[
|
||
|
'id' => 13,
|
||
|
'type' => 2,
|
||
|
'ext_id' => 3,
|
||
|
'action_id' => 13,
|
||
|
'status' => 1,
|
||
|
],
|
||
|
[
|
||
|
'id' => 14,
|
||
|
'type' => 2,
|
||
|
'ext_id' => 3,
|
||
|
'action_id' => 18,
|
||
|
'status' => 1,
|
||
|
],
|
||
|
[
|
||
|
'id' => 15,
|
||
|
'type' => 2,
|
||
|
'ext_id' => 2,
|
||
|
'action_id' => 6,
|
||
|
'status' => 1,
|
||
|
],
|
||
|
[
|
||
|
'id' => 16,
|
||
|
'type' => 2,
|
||
|
'ext_id' => 3,
|
||
|
'action_id' => 17,
|
||
|
'status' => 1,
|
||
|
],
|
||
|
[
|
||
|
'id' => 17,
|
||
|
'type' => 2,
|
||
|
'ext_id' => 3,
|
||
|
'action_id' => 25,
|
||
|
'status' => 1,
|
||
|
],
|
||
|
[
|
||
|
'id' => 18,
|
||
|
'type' => 2,
|
||
|
'ext_id' => 3,
|
||
|
'action_id' => 19,
|
||
|
'status' => 1,
|
||
|
],
|
||
|
[
|
||
|
'id' => 19,
|
||
|
'type' => 2,
|
||
|
'ext_id' => 3,
|
||
|
'action_id' => 23,
|
||
|
'status' => 1,
|
||
|
],
|
||
|
[
|
||
|
'id' => 20,
|
||
|
'type' => 2,
|
||
|
'ext_id' => 3,
|
||
|
'action_id' => 15,
|
||
|
'status' => 1,
|
||
|
],
|
||
|
[
|
||
|
'id' => 21,
|
||
|
'type' => 2,
|
||
|
'ext_id' => 3,
|
||
|
'action_id' => 22,
|
||
|
'status' => 1,
|
||
|
],
|
||
|
[
|
||
|
'id' => 22,
|
||
|
'type' => 2,
|
||
|
'ext_id' => 3,
|
||
|
'action_id' => 20,
|
||
|
'status' => 1,
|
||
|
],
|
||
|
[
|
||
|
'id' => 23,
|
||
|
'type' => 2,
|
||
|
'ext_id' => 3,
|
||
|
'action_id' => 26,
|
||
|
'status' => 1,
|
||
|
],
|
||
|
[
|
||
|
'id' => 24,
|
||
|
'type' => 2,
|
||
|
'ext_id' => 3,
|
||
|
'action_id' => 16,
|
||
|
'status' => 1,
|
||
|
],
|
||
|
[
|
||
|
'id' => 25,
|
||
|
'type' => 2,
|
||
|
'ext_id' => 3,
|
||
|
'action_id' => 21,
|
||
|
'status' => 1,
|
||
|
],
|
||
|
[
|
||
|
'id' => 26,
|
||
|
'type' => 2,
|
||
|
'ext_id' => 2,
|
||
|
'action_id' => 12,
|
||
|
'status' => 1,
|
||
|
],
|
||
|
[
|
||
|
'id' => 27,
|
||
|
'type' => 2,
|
||
|
'ext_id' => 2,
|
||
|
'action_id' => 8,
|
||
|
'status' => 1,
|
||
|
],
|
||
|
[
|
||
|
'id' => 28,
|
||
|
'type' => 2,
|
||
|
'ext_id' => 2,
|
||
|
'action_id' => 10,
|
||
|
'status' => 1,
|
||
|
],
|
||
|
[
|
||
|
'id' => 29,
|
||
|
'type' => 2,
|
||
|
'ext_id' => 2,
|
||
|
'action_id' => 14,
|
||
|
'status' => 1,
|
||
|
],
|
||
|
[
|
||
|
'id' => 30,
|
||
|
'type' => 2,
|
||
|
'ext_id' => 4,
|
||
|
'action_id' => 30,
|
||
|
'status' => 1,
|
||
|
],
|
||
|
];
|
||
|
|
||
|
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
|
||
|
$this->table('permissions')
|
||
|
->insert($data)
|
||
|
->saveData();
|
||
|
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
|
||
|
}
|
||
|
}
|