refactor: 修改导航项链接类型字段
This commit is contained in:
@@ -32,7 +32,7 @@ class CreateSysNavigationItem extends Migrator
|
||||
->addColumn('pid', 'integer', ['null' => false, 'default' => 0, 'comment' => '父级ID'])
|
||||
->addColumn('name', 'string', ['limit' => 64, 'null' => false, 'comment' => '名称'])
|
||||
->addColumn('icon', 'string', ['limit' => 64, 'null' => true, 'default' => null, 'comment' => '图标'])
|
||||
->addColumn('link_to', 'string', ['limit' => 64, 'null' => false, 'comment' => '链接到(类型): article:文章, goods_category:商品分类, goods:商品, link:链接'])
|
||||
->addColumn('link_to', 'string', ['limit' => 64, 'null' => false, 'comment' => '链接到(类型): article:文章, article_category:文章分类, product:产品, product_category:产品分类, custom:自定义链接'])
|
||||
->addColumn('link', 'string', ['limit' => 255, 'null' => false, 'comment' => '链接'])
|
||||
->addColumn('sort', 'integer', ['limit' => 11, 'null' => false, 'default' => 0, 'comment' => '排序'])
|
||||
->addColumn('blank', 'boolean', ['limit' => 1, 'null' => false, 'default' => 0, 'comment' => '是否新窗口打开, 0否, 1是'])
|
||||
|
||||
@@ -36,7 +36,7 @@ class CreateSysBannerItem extends Migrator
|
||||
->addColumn('type', 'string', ['limit' => 16, 'null' => false, 'comment' => '类型: image为图片, video为视频'])
|
||||
->addColumn('image', 'string', ['limit' => 255, 'null' => false, 'comment' => '图片'])
|
||||
->addColumn('video', 'string', ['limit' => 255, 'null' => false, 'comment' => '视频'])
|
||||
->addColumn('link_to', 'string', ['limit' => 64, 'null' => false, 'comment' => '链接到(类型): article:文章, goods_category:商品分类, goods:商品, custom:自定义链接'])
|
||||
->addColumn('link_to', 'string', ['limit' => 64, 'null' => false, 'comment' => '链接到(类型): article:文章, article_category:文章分类, product:产品, product_category:产品分类, custom:自定义链接'])
|
||||
->addColumn('link', 'string', ['limit' => 255, 'null' => false, 'comment' => '链接'])
|
||||
->addColumn('sort', 'integer', ['limit' => 11, 'null' => false, 'default' => 0, 'comment' => '排序'])
|
||||
->addColumn('status', 'boolean', ['limit' => 1, 'null' => false, 'default' => 1, 'comment' => '-1为禁用, 1为启用'])
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
<?php
|
||||
|
||||
use think\migration\Migrator;
|
||||
|
||||
class SysNavigationLinkType 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_navigation_link_type', ['engine' => 'InnoDB', 'comment' => '系统导航链接类型']);
|
||||
$table->addColumn('type_name', 'string', ['limit' => 64, 'null' => false, 'comment' => '类型名称'])
|
||||
->addColumn('sort', 'integer', ['limit' => 11, 'null' => false, 'default' => 0, 'comment' => '排序'])
|
||||
->create();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user