feat: 新增菜单能力权限表

This commit is contained in:
2025-02-28 13:42:34 +08:00
parent 9b32461226
commit 220bd0f6fb

View File

@@ -0,0 +1,37 @@
<?php
use think\migration\Migrator;
class CreateSysMenuAbilityPermission extends Migrator
{
/**
* 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
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('sys_menu_ability_permission', ['id' => false, 'engine' => 'InnoDB', 'comment' => '菜单能力权限表']);
$table->addColumn('menu_id', 'integer', ['null' => false, 'comment' => '菜单ID'])
->addColumn('ability_name', 'string', ['limit' => 64, 'null' => false, 'comment' => '能力名称'])
->addColumn('permission', 'string', ['limit' => 128, 'null' => false, 'comment' => '权限标志'])
->addColumn('sort', 'integer', ['limit' => 11, 'null' => false, 'default' => 0, 'comment' => '排序'])
->create();
}
}