From a96d656d1b929feb25dbfe6374f04d8e28d4050e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B7=B4=E6=8E=8C?= Date: Wed, 10 Oct 2018 15:02:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=BB=BAsystembase=E8=A1=A8=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E8=BF=81=E7=A7=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- composer.json | 3 +- composer.lock | 47 ++++++++++++++++++- .../migrations/20181010035225_system_base.php | 43 +++++++++++++++++ 3 files changed, 91 insertions(+), 2 deletions(-) create mode 100644 database/migrations/20181010035225_system_base.php diff --git a/composer.json b/composer.json index 361d6f66..b9646184 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,8 @@ ], "require": { "php": ">=5.6.0", - "topthink/framework": "5.1.*" + "topthink/framework": "5.1.*", + "topthink/think-migration": "^2.0" }, "autoload": { "psr-4": { diff --git a/composer.lock b/composer.lock index ebf1b089..1b49a1f0 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "296bd8a1d28e39d56dcd80ce7be249f3", + "content-hash": "b3374c528fb4105b6d3f53e5e315910c", "packages": [ { "name": "topthink/framework", @@ -109,6 +109,51 @@ } ], "time": "2018-05-11T06:45:42+00:00" + }, + { + "name": "topthink/think-migration", + "version": "v2.0.3", + "source": { + "type": "git", + "url": "https://github.com/top-think/think-migration.git", + "reference": "70c89850ca29c2eab988c7c3475d1d5331901bb8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/top-think/think-migration/zipball/70c89850ca29c2eab988c7c3475d1d5331901bb8", + "reference": "70c89850ca29c2eab988c7c3475d1d5331901bb8", + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "topthink/framework": "5.1.*" + }, + "type": "library", + "autoload": { + "psr-4": { + "Phinx\\": "phinx/src/Phinx", + "think\\migration\\": "src" + }, + "files": [ + "src/config.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "yunwuxin", + "email": "448901948@qq.com" + } + ], + "time": "2017-12-31T16:32:22+00:00" } ], "packages-dev": [], diff --git a/database/migrations/20181010035225_system_base.php b/database/migrations/20181010035225_system_base.php new file mode 100644 index 00000000..9d5147c1 --- /dev/null +++ b/database/migrations/20181010035225_system_base.php @@ -0,0 +1,43 @@ +table('system_base'); + + // 给当前表添加字段 + $table->addColumn('title','string',['limit'=>50,'default'=>'学生成绩统计系统','null'=>'false','comment'=>'网站名称']) + ->addColumn('keywords','string',['limit'=>100,'default'=>'成绩统计,成绩管理','null'=>'false','comment'=>'关键词']) + ->addColumn('description','string',['limit'=>100,'default'=>'这是我们自己开发的系统','null'=>'false','comment'=>'网站说明']) + ->addColumn('copyright','string',['limit'=>15,'default'=>'2018-'.date('Y'),'null'=>'false','comment'=>'版权']) + ->addColumn('thinks','string',['limit'=>200,'default'=>'H-ui前端框架、ThinkPhp框架','null'=>'false','comment'=>'网站感谢']) + // ->addIndex(array('username'), array('unique' => true)) + ->create(); + } +}