born 6 年之前
父節點
當前提交
c943170369
共有 31 個文件被更改,包括 636 次插入555 次删除
  1. 0 38
      database/migrations/2014_10_12_000000_create_users_table.php
  2. 0 32
      database/migrations/2014_10_12_100000_create_password_resets_table.php
  3. 0 37
      database/migrations/2018_04_26_171101_create_district_table.php
  4. 0 38
      database/migrations/2018_05_04_090903_create_members_table.php
  5. 0 33
      database/migrations/2018_05_04_103656_create_tags_table.php
  6. 0 34
      database/migrations/2018_05_04_134703_create_categories_table.php
  7. 0 38
      database/migrations/2018_05_04_135258_create_articles_table.php
  8. 0 33
      database/migrations/2018_05_07_160110_create_article_tag_table.php
  9. 0 33
      database/migrations/2018_05_14_091108_create_sites_table.php
  10. 0 33
      database/migrations/2018_05_14_115332_create_table_positions.php
  11. 0 37
      database/migrations/2018_05_14_115355_create_table_adverts.php
  12. 0 35
      database/migrations/2018_05_31_162020_create_icons_table.php
  13. 0 37
      database/migrations/2018_06_07_092825_create_messages_table.php
  14. 0 97
      database/migrations/2018_06_25_014048_create_permission_tables.php
  15. 39 0
      database/migrations/2019_05_08_160636_create_adverts_table.php
  16. 35 0
      database/migrations/2019_05_08_160636_create_article_tag_table.php
  17. 40 0
      database/migrations/2019_05_08_160636_create_articles_table.php
  18. 36 0
      database/migrations/2019_05_08_160636_create_categories_table.php
  19. 39 0
      database/migrations/2019_05_08_160636_create_districts_table.php
  20. 37 0
      database/migrations/2019_05_08_160636_create_icons_table.php
  21. 44 0
      database/migrations/2019_05_08_160636_create_members_table.php
  22. 39 0
      database/migrations/2019_05_08_160636_create_messages_table.php
  23. 36 0
      database/migrations/2019_05_08_160636_create_model_has_permissions_table.php
  24. 36 0
      database/migrations/2019_05_08_160636_create_model_has_roles_table.php
  25. 40 0
      database/migrations/2019_05_08_160636_create_permissions_table.php
  26. 35 0
      database/migrations/2019_05_08_160636_create_positions_table.php
  27. 34 0
      database/migrations/2019_05_08_160636_create_role_has_permissions_table.php
  28. 36 0
      database/migrations/2019_05_08_160636_create_roles_table.php
  29. 35 0
      database/migrations/2019_05_08_160636_create_sites_table.php
  30. 35 0
      database/migrations/2019_05_08_160636_create_tags_table.php
  31. 40 0
      database/migrations/2019_05_08_160636_create_users_table.php

+ 0 - 38
database/migrations/2014_10_12_000000_create_users_table.php

@@ -1,38 +0,0 @@
-<?php
-
-use Illuminate\Support\Facades\Schema;
-use Illuminate\Database\Schema\Blueprint;
-use Illuminate\Database\Migrations\Migration;
-
-class CreateUsersTable extends Migration
-{
-    /**
-     * Run the migrations.
-     *
-     * @return void
-     */
-    public function up()
-    {
-        Schema::create('users', function (Blueprint $table) {
-            $table->increments('id');
-            $table->string('username')->unique();
-            $table->string('phone')->unique();
-            $table->string('name');
-            $table->string('email')->unique();
-            $table->string('password');
-            $table->rememberToken();
-            $table->uuid('uuid');
-            $table->timestamps();
-        });
-    }
-
-    /**
-     * Reverse the migrations.
-     *
-     * @return void
-     */
-    public function down()
-    {
-        Schema::dropIfExists('users');
-    }
-}

+ 0 - 32
database/migrations/2014_10_12_100000_create_password_resets_table.php

@@ -1,32 +0,0 @@
-<?php
-
-use Illuminate\Support\Facades\Schema;
-use Illuminate\Database\Schema\Blueprint;
-use Illuminate\Database\Migrations\Migration;
-
-class CreatePasswordResetsTable extends Migration
-{
-    /**
-     * Run the migrations.
-     *
-     * @return void
-     */
-    public function up()
-    {
-        /*Schema::create('password_resets', function (Blueprint $table) {
-            $table->string('email')->index();
-            $table->string('token');
-            $table->timestamp('created_at')->nullable();
-        });*/
-    }
-
-    /**
-     * Reverse the migrations.
-     *
-     * @return void
-     */
-    public function down()
-    {
-        //Schema::dropIfExists('password_resets');
-    }
-}

+ 0 - 37
database/migrations/2018_04_26_171101_create_district_table.php

@@ -1,37 +0,0 @@
-<?php
-
-use Illuminate\Support\Facades\Schema;
-use Illuminate\Database\Schema\Blueprint;
-use Illuminate\Database\Migrations\Migration;
-
-class CreateDistrictTable extends Migration
-{
-    /**
-     * Run the migrations.
-     *
-     * @return void
-     */
-    public function up()
-    {
-        Schema::create('districts', function (Blueprint $table) {
-            $table->increments('id');
-            $table->string('adcode')->comment('行政编码');
-            $table->string('name')->comment('名字');
-            $table->string('center')->comment('经纬度');
-            $table->string('level')->comment('级别');
-            $table->integer('parent_id')->default(0);
-            $table->integer('sort')->default(0)->comment('排序');
-            $table->timestamps();
-        });
-    }
-
-    /**
-     * Reverse the migrations.
-     *
-     * @return void
-     */
-    public function down()
-    {
-        Schema::dropIfExists('districts');
-    }
-}

+ 0 - 38
database/migrations/2018_05_04_090903_create_members_table.php

@@ -1,38 +0,0 @@
-<?php
-
-use Illuminate\Support\Facades\Schema;
-use Illuminate\Database\Schema\Blueprint;
-use Illuminate\Database\Migrations\Migration;
-
-class CreateMembersTable extends Migration
-{
-    /**
-     * Run the migrations.
-     *
-     * @return void
-     */
-    public function up()
-    {
-        Schema::create('members', function (Blueprint $table) {
-            $table->increments('id');
-            $table->string('phone',100)->comment('手机');
-            $table->string('name',50)->comment('昵称')->nullable();
-            $table->string('password',255)->comment('密码');
-            $table->string('avatar',255)->comment('头像')->nullable();
-            $table->string('remember_token',150)->comment('记住我')->nullable();
-            $table->uuid('uuid');
-            $table->softDeletes();
-            $table->timestamps();
-        });
-    }
-
-    /**
-     * Reverse the migrations.
-     *
-     * @return void
-     */
-    public function down()
-    {
-        Schema::dropIfExists('members');
-    }
-}

+ 0 - 33
database/migrations/2018_05_04_103656_create_tags_table.php

@@ -1,33 +0,0 @@
-<?php
-
-use Illuminate\Support\Facades\Schema;
-use Illuminate\Database\Schema\Blueprint;
-use Illuminate\Database\Migrations\Migration;
-
-class CreateTagsTable extends Migration
-{
-    /**
-     * Run the migrations.
-     *
-     * @return void
-     */
-    public function up()
-    {
-        Schema::create('tags', function (Blueprint $table) {
-            $table->increments('id');
-            $table->string('name',100)->comment('名称');
-            $table->integer('sort')->default(0)->comment('排序');
-            $table->timestamps();
-        });
-    }
-
-    /**
-     * Reverse the migrations.
-     *
-     * @return void
-     */
-    public function down()
-    {
-        Schema::dropIfExists('tags');
-    }
-}

+ 0 - 34
database/migrations/2018_05_04_134703_create_categories_table.php

@@ -1,34 +0,0 @@
-<?php
-
-use Illuminate\Support\Facades\Schema;
-use Illuminate\Database\Schema\Blueprint;
-use Illuminate\Database\Migrations\Migration;
-
-class CreateCategoriesTable extends Migration
-{
-    /**
-     * Run the migrations.
-     *
-     * @return void
-     */
-    public function up()
-    {
-        Schema::create('categories', function (Blueprint $table) {
-            $table->increments('id');
-            $table->string('name',20)->comment('名称');
-            $table->integer('parent_id')->default(0)->comment('上级ID');
-            $table->integer('sort')->default(0)->comment('排序');
-            $table->timestamps();
-        });
-    }
-
-    /**
-     * Reverse the migrations.
-     *
-     * @return void
-     */
-    public function down()
-    {
-        Schema::dropIfExists('categories');
-    }
-}

+ 0 - 38
database/migrations/2018_05_04_135258_create_articles_table.php

@@ -1,38 +0,0 @@
-<?php
-
-use Illuminate\Support\Facades\Schema;
-use Illuminate\Database\Schema\Blueprint;
-use Illuminate\Database\Migrations\Migration;
-
-class CreateArticlesTable extends Migration
-{
-    /**
-     * Run the migrations.
-     *
-     * @return void
-     */
-    public function up()
-    {
-        Schema::create('articles', function (Blueprint $table) {
-            $table->increments('id');
-            $table->integer('category_id')->comment('分类id');
-            $table->string('title',200)->comment('标题');
-            $table->string('keywords',200)->comment('关键词');
-            $table->text('description')->comment('描述');
-            $table->text('content')->comment('内容');
-            $table->integer('click')->default(0)->comment('点击量');
-            $table->string('thumb',200)->nullable()->comment('缩略图');
-            $table->timestamps();
-        });
-    }
-
-    /**
-     * Reverse the migrations.
-     *
-     * @return void
-     */
-    public function down()
-    {
-        Schema::dropIfExists('articles');
-    }
-}

+ 0 - 33
database/migrations/2018_05_07_160110_create_article_tag_table.php

@@ -1,33 +0,0 @@
-<?php
-
-use Illuminate\Support\Facades\Schema;
-use Illuminate\Database\Schema\Blueprint;
-use Illuminate\Database\Migrations\Migration;
-
-class CreateArticleTagTable extends Migration
-{
-    /**
-     * Run the migrations.
-     *
-     * @return void
-     */
-    public function up()
-    {
-        Schema::create('article_tag', function (Blueprint $table) {
-            $table->increments('id');
-            $table->integer('article_id')->comment('资讯ID');
-            $table->integer('tag_id')->comment('标签ID');
-            $table->timestamps();
-        });
-    }
-
-    /**
-     * Reverse the migrations.
-     *
-     * @return void
-     */
-    public function down()
-    {
-        Schema::dropIfExists('article_tag');
-    }
-}

+ 0 - 33
database/migrations/2018_05_14_091108_create_sites_table.php

@@ -1,33 +0,0 @@
-<?php
-
-use Illuminate\Support\Facades\Schema;
-use Illuminate\Database\Schema\Blueprint;
-use Illuminate\Database\Migrations\Migration;
-
-class CreateSitesTable extends Migration
-{
-    /**
-     * Run the migrations.
-     *
-     * @return void
-     */
-    public function up()
-    {
-        Schema::create('sites', function (Blueprint $table) {
-            $table->increments('id');
-            $table->string('key');
-            $table->string('value');
-            $table->timestamps();
-        });
-    }
-
-    /**
-     * Reverse the migrations.
-     *
-     * @return void
-     */
-    public function down()
-    {
-        Schema::dropIfExists('sites');
-    }
-}

+ 0 - 33
database/migrations/2018_05_14_115332_create_table_positions.php

@@ -1,33 +0,0 @@
-<?php
-
-use Illuminate\Support\Facades\Schema;
-use Illuminate\Database\Schema\Blueprint;
-use Illuminate\Database\Migrations\Migration;
-
-class CreateTablePositions extends Migration
-{
-    /**
-     * Run the migrations.
-     *
-     * @return void
-     */
-    public function up()
-    {
-        Schema::create('positions', function (Blueprint $table) {
-            $table->increments('id');
-            $table->string('name')->comment('位置名称');
-            $table->tinyInteger('sort')->default(0)->comment('排序');
-            $table->timestamps();
-        });
-    }
-
-    /**
-     * Reverse the migrations.
-     *
-     * @return void
-     */
-    public function down()
-    {
-        Schema::dropIfExists('positions');
-    }
-}

+ 0 - 37
database/migrations/2018_05_14_115355_create_table_adverts.php

@@ -1,37 +0,0 @@
-<?php
-
-use Illuminate\Support\Facades\Schema;
-use Illuminate\Database\Schema\Blueprint;
-use Illuminate\Database\Migrations\Migration;
-
-class CreateTableAdverts extends Migration
-{
-    /**
-     * Run the migrations.
-     *
-     * @return void
-     */
-    public function up()
-    {
-        Schema::create('adverts', function (Blueprint $table) {
-            $table->increments('id');
-            $table->string('title')->comment('广告标题');
-            $table->string('thumb')->comment('图片链接');
-            $table->string('link')->nullable()->comment('跳转链接');
-            $table->tinyInteger('sort')->default(0)->comment('排序');
-            $table->integer('position_id')->comment('位置ID');
-            $table->text('description')->nullable()->comment('广告描述');
-            $table->timestamps();
-        });
-    }
-
-    /**
-     * Reverse the migrations.
-     *
-     * @return void
-     */
-    public function down()
-    {
-        Schema::dropIfExists('adverts');
-    }
-}

+ 0 - 35
database/migrations/2018_05_31_162020_create_icons_table.php

@@ -1,35 +0,0 @@
-<?php
-
-use Illuminate\Support\Facades\Schema;
-use Illuminate\Database\Schema\Blueprint;
-use Illuminate\Database\Migrations\Migration;
-
-class CreateIconsTable extends Migration
-{
-    /**
-     * Run the migrations.
-     *
-     * @return void
-     */
-    public function up()
-    {
-        Schema::create('icons', function (Blueprint $table) {
-            $table->increments('id');
-            $table->string('unicode')->nullable()->comment('unicode 字符');
-            $table->string('class')->nullable()->comment('类名');
-            $table->string('name')->nullable()->comment('名称');
-            $table->integer('sort')->default(0)->comment('排序');
-            $table->timestamps();
-        });
-    }
-
-    /**
-     * Reverse the migrations.
-     *
-     * @return void
-     */
-    public function down()
-    {
-        Schema::dropIfExists('icons');
-    }
-}

+ 0 - 37
database/migrations/2018_06_07_092825_create_messages_table.php

@@ -1,37 +0,0 @@
-<?php
-
-use Illuminate\Support\Facades\Schema;
-use Illuminate\Database\Schema\Blueprint;
-use Illuminate\Database\Migrations\Migration;
-
-class CreateMessagesTable extends Migration
-{
-    /**
-     * Run the migrations.
-     *
-     * @return void
-     */
-    public function up()
-    {
-        Schema::create('messages', function (Blueprint $table) {
-            $table->increments('id');
-            $table->string('title')->comment('消息标题');
-            $table->text('content')->comment('消息内容')->nullable();
-            $table->integer('read')->comment('1-未读,2-已读')->default(1);
-            $table->uuid('send_uuid')->default(1)->comment('消息发送者UUID,1表示系统发送');
-            $table->uuid('accept_uuid')->comment('消息接收者UUID');
-             $table->integer('flag')->comment('消息对应关系:12-系统推送给后台,13-系统推送给前台,22-后台推送给后台,23-后台推送给前台,32-前台推送给后台,33-前台推送给前台,');
-            $table->timestamps();
-        });
-    }
-
-    /**
-     * Reverse the migrations.
-     *
-     * @return void
-     */
-    public function down()
-    {
-        Schema::dropIfExists('messages');
-    }
-}

+ 0 - 97
database/migrations/2018_06_25_014048_create_permission_tables.php

@@ -1,97 +0,0 @@
-<?php
-
-use Illuminate\Support\Facades\Schema;
-use Illuminate\Database\Schema\Blueprint;
-use Illuminate\Database\Migrations\Migration;
-
-class CreatePermissionTables extends Migration
-{
-    /**
-     * Run the migrations.
-     *
-     * @return void
-     */
-    public function up()
-    {
-        $tableNames = config('permission.table_names');
-
-        Schema::create($tableNames['permissions'], function (Blueprint $table) {
-            $table->increments('id');
-            $table->string('name');
-            $table->string('guard_name');
-            $table->string('display_name');
-            $table->string('route')->nullable()->comment('路由名称');
-            $table->integer('icon_id')->nullable()->comment('图标ID');
-            $table->integer('parent_id')->default(0);
-            $table->integer('sort')->default(0)->comment('排序');
-            $table->timestamps();
-        });
-
-        Schema::create($tableNames['roles'], function (Blueprint $table) {
-            $table->increments('id');
-            $table->string('name');
-            $table->string('guard_name');
-            $table->string('display_name');
-            $table->timestamps();
-        });
-
-        Schema::create($tableNames['model_has_permissions'], function (Blueprint $table) use ($tableNames) {
-            $table->unsignedInteger('permission_id');
-            $table->morphs('model');
-
-            $table->foreign('permission_id')
-                ->references('id')
-                ->on($tableNames['permissions'])
-                ->onDelete('cascade');
-
-            $table->primary(['permission_id', 'model_id', 'model_type'], 'model_has_permissions_permission_model_type_primary');
-        });
-
-        Schema::create($tableNames['model_has_roles'], function (Blueprint $table) use ($tableNames) {
-            $table->unsignedInteger('role_id');
-            $table->morphs('model');
-
-            $table->foreign('role_id')
-                ->references('id')
-                ->on($tableNames['roles'])
-                ->onDelete('cascade');
-
-            $table->primary(['role_id', 'model_id', 'model_type']);
-        });
-
-        Schema::create($tableNames['role_has_permissions'], function (Blueprint $table) use ($tableNames) {
-            $table->unsignedInteger('permission_id');
-            $table->unsignedInteger('role_id');
-
-            $table->foreign('permission_id')
-                ->references('id')
-                ->on($tableNames['permissions'])
-                ->onDelete('cascade');
-
-            $table->foreign('role_id')
-                ->references('id')
-                ->on($tableNames['roles'])
-                ->onDelete('cascade');
-
-            $table->primary(['permission_id', 'role_id']);
-
-            app('cache')->forget('spatie.permission.cache');
-        });
-    }
-
-    /**
-     * Reverse the migrations.
-     *
-     * @return void
-     */
-    public function down()
-    {
-        $tableNames = config('permission.table_names');
-
-        Schema::drop($tableNames['role_has_permissions']);
-        Schema::drop($tableNames['model_has_roles']);
-        Schema::drop($tableNames['model_has_permissions']);
-        Schema::drop($tableNames['roles']);
-        Schema::drop($tableNames['permissions']);
-    }
-}

+ 39 - 0
database/migrations/2019_05_08_160636_create_adverts_table.php

@@ -0,0 +1,39 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+
+class CreateAdvertsTable extends Migration {
+
+	/**
+	 * Run the migrations.
+	 *
+	 * @return void
+	 */
+	public function up()
+	{
+		Schema::create('adverts', function(Blueprint $table)
+		{
+			$table->increments('id');
+			$table->string('title', 191)->comment('广告标题');
+			$table->string('thumb', 191)->comment('图片链接');
+			$table->string('link', 191)->nullable()->comment('跳转链接');
+			$table->boolean('sort')->default(0)->comment('排序');
+			$table->integer('position_id')->comment('位置ID');
+			$table->text('description', 65535)->nullable()->comment('广告描述');
+			$table->timestamps();
+		});
+	}
+
+
+	/**
+	 * Reverse the migrations.
+	 *
+	 * @return void
+	 */
+	public function down()
+	{
+		Schema::drop('adverts');
+	}
+
+}

+ 35 - 0
database/migrations/2019_05_08_160636_create_article_tag_table.php

@@ -0,0 +1,35 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+
+class CreateArticleTagTable extends Migration {
+
+	/**
+	 * Run the migrations.
+	 *
+	 * @return void
+	 */
+	public function up()
+	{
+		Schema::create('article_tag', function(Blueprint $table)
+		{
+			$table->increments('id');
+			$table->integer('article_id')->comment('资讯ID');
+			$table->integer('tag_id')->comment('标签ID');
+			$table->timestamps();
+		});
+	}
+
+
+	/**
+	 * Reverse the migrations.
+	 *
+	 * @return void
+	 */
+	public function down()
+	{
+		Schema::drop('article_tag');
+	}
+
+}

+ 40 - 0
database/migrations/2019_05_08_160636_create_articles_table.php

@@ -0,0 +1,40 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+
+class CreateArticlesTable extends Migration {
+
+	/**
+	 * Run the migrations.
+	 *
+	 * @return void
+	 */
+	public function up()
+	{
+		Schema::create('articles', function(Blueprint $table)
+		{
+			$table->increments('id');
+			$table->integer('category_id')->comment('分类id');
+			$table->string('title', 200)->comment('标题');
+			$table->string('keywords', 200)->comment('关键词');
+			$table->text('description', 65535)->comment('描述');
+			$table->text('content', 65535)->comment('内容');
+			$table->integer('click')->default(0)->comment('点击量');
+			$table->string('thumb', 200)->nullable()->comment('缩略图');
+			$table->timestamps();
+		});
+	}
+
+
+	/**
+	 * Reverse the migrations.
+	 *
+	 * @return void
+	 */
+	public function down()
+	{
+		Schema::drop('articles');
+	}
+
+}

+ 36 - 0
database/migrations/2019_05_08_160636_create_categories_table.php

@@ -0,0 +1,36 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+
+class CreateCategoriesTable extends Migration {
+
+	/**
+	 * Run the migrations.
+	 *
+	 * @return void
+	 */
+	public function up()
+	{
+		Schema::create('categories', function(Blueprint $table)
+		{
+			$table->increments('id');
+			$table->string('name', 20)->comment('名称');
+			$table->integer('parent_id')->default(0)->comment('上级ID');
+			$table->integer('sort')->default(0)->comment('排序');
+			$table->timestamps();
+		});
+	}
+
+
+	/**
+	 * Reverse the migrations.
+	 *
+	 * @return void
+	 */
+	public function down()
+	{
+		Schema::drop('categories');
+	}
+
+}

+ 39 - 0
database/migrations/2019_05_08_160636_create_districts_table.php

@@ -0,0 +1,39 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+
+class CreateDistrictsTable extends Migration {
+
+	/**
+	 * Run the migrations.
+	 *
+	 * @return void
+	 */
+	public function up()
+	{
+		Schema::create('districts', function(Blueprint $table)
+		{
+			$table->increments('id');
+			$table->string('adcode', 191)->comment('行政编码');
+			$table->string('name', 191)->comment('名字');
+			$table->string('center', 191)->comment('经纬度');
+			$table->string('level', 191)->comment('级别');
+			$table->integer('parent_id')->default(0);
+			$table->integer('sort')->default(0)->comment('排序');
+			$table->timestamps();
+		});
+	}
+
+
+	/**
+	 * Reverse the migrations.
+	 *
+	 * @return void
+	 */
+	public function down()
+	{
+		Schema::drop('districts');
+	}
+
+}

+ 37 - 0
database/migrations/2019_05_08_160636_create_icons_table.php

@@ -0,0 +1,37 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+
+class CreateIconsTable extends Migration {
+
+	/**
+	 * Run the migrations.
+	 *
+	 * @return void
+	 */
+	public function up()
+	{
+		Schema::create('icons', function(Blueprint $table)
+		{
+			$table->increments('id');
+			$table->string('unicode', 191)->nullable()->comment('unicode 字符');
+			$table->string('class', 191)->nullable()->comment('类名');
+			$table->string('name', 191)->nullable()->comment('名称');
+			$table->integer('sort')->default(0)->comment('排序');
+			$table->timestamps();
+		});
+	}
+
+
+	/**
+	 * Reverse the migrations.
+	 *
+	 * @return void
+	 */
+	public function down()
+	{
+		Schema::drop('icons');
+	}
+
+}

+ 44 - 0
database/migrations/2019_05_08_160636_create_members_table.php

@@ -0,0 +1,44 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+
+class CreateMembersTable extends Migration {
+
+	/**
+	 * Run the migrations.
+	 *
+	 * @return void
+	 */
+	public function up()
+	{
+		Schema::create('members', function(Blueprint $table)
+		{
+			$table->increments('id');
+			$table->string('phone', 100)->unique('phone')->comment('手机');
+			$table->string('name', 50)->unique('username')->comment('昵称');
+			$table->string('password')->comment('密码');
+			$table->string('avatar')->nullable()->comment('头像');
+			$table->string('remember_token', 150)->nullable()->comment('记住我');
+			$table->char('uuid', 36);
+			$table->softDeletes();
+			$table->timestamps();
+			$table->binary('status')->nullable()->comment('状态:1=正常,0=禁用');
+			$table->decimal('amount', 25, 4)->default(0.0000)->comment('金额');
+			$table->decimal('frozen_amount', 25, 4)->default(0.0000)->comment('冻结额度');
+			$table->string('solt', 20)->nullable()->comment('盐');
+		});
+	}
+
+
+	/**
+	 * Reverse the migrations.
+	 *
+	 * @return void
+	 */
+	public function down()
+	{
+		Schema::drop('members');
+	}
+
+}

+ 39 - 0
database/migrations/2019_05_08_160636_create_messages_table.php

@@ -0,0 +1,39 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+
+class CreateMessagesTable extends Migration {
+
+	/**
+	 * Run the migrations.
+	 *
+	 * @return void
+	 */
+	public function up()
+	{
+		Schema::create('messages', function(Blueprint $table)
+		{
+			$table->increments('id');
+			$table->string('title', 191)->comment('消息标题');
+			$table->text('content', 65535)->nullable()->comment('消息内容');
+			$table->integer('read')->default(1)->comment('1-未读,2-已读');
+			$table->char('send_uuid', 36)->default(1)->comment('消息发送者UUID,1表示系统发送');
+			$table->char('accept_uuid', 36)->comment('消息接收者UUID');
+			$table->integer('flag')->comment('消息对应关系:12-系统推送给后台,13-系统推送给前台,22-后台推送给后台,23-后台推送给前台,32-前台推送给后台,33-前台推送给前台,');
+			$table->timestamps();
+		});
+	}
+
+
+	/**
+	 * Reverse the migrations.
+	 *
+	 * @return void
+	 */
+	public function down()
+	{
+		Schema::drop('messages');
+	}
+
+}

+ 36 - 0
database/migrations/2019_05_08_160636_create_model_has_permissions_table.php

@@ -0,0 +1,36 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+
+class CreateModelHasPermissionsTable extends Migration {
+
+	/**
+	 * Run the migrations.
+	 *
+	 * @return void
+	 */
+	public function up()
+	{
+		Schema::create('model_has_permissions', function(Blueprint $table)
+		{
+			$table->integer('permission_id')->unsigned();
+			$table->integer('model_id')->unsigned();
+			$table->string('model_type', 191);
+			$table->primary(['permission_id','model_id','model_type']);
+			$table->index(['model_id','model_type']);
+		});
+	}
+
+
+	/**
+	 * Reverse the migrations.
+	 *
+	 * @return void
+	 */
+	public function down()
+	{
+		Schema::drop('model_has_permissions');
+	}
+
+}

+ 36 - 0
database/migrations/2019_05_08_160636_create_model_has_roles_table.php

@@ -0,0 +1,36 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+
+class CreateModelHasRolesTable extends Migration {
+
+	/**
+	 * Run the migrations.
+	 *
+	 * @return void
+	 */
+	public function up()
+	{
+		Schema::create('model_has_roles', function(Blueprint $table)
+		{
+			$table->integer('role_id')->unsigned();
+			$table->integer('model_id')->unsigned();
+			$table->string('model_type', 191);
+			$table->primary(['role_id','model_id','model_type']);
+			$table->index(['model_id','model_type']);
+		});
+	}
+
+
+	/**
+	 * Reverse the migrations.
+	 *
+	 * @return void
+	 */
+	public function down()
+	{
+		Schema::drop('model_has_roles');
+	}
+
+}

+ 40 - 0
database/migrations/2019_05_08_160636_create_permissions_table.php

@@ -0,0 +1,40 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+
+class CreatePermissionsTable extends Migration {
+
+	/**
+	 * Run the migrations.
+	 *
+	 * @return void
+	 */
+	public function up()
+	{
+		Schema::create('permissions', function(Blueprint $table)
+		{
+			$table->increments('id');
+			$table->string('name', 191);
+			$table->string('guard_name', 191);
+			$table->string('display_name', 191);
+			$table->string('route', 191)->nullable()->comment('路由名称');
+			$table->integer('icon_id')->nullable()->comment('图标ID');
+			$table->integer('parent_id')->default(0);
+			$table->integer('sort')->default(0)->comment('排序');
+			$table->timestamps();
+		});
+	}
+
+
+	/**
+	 * Reverse the migrations.
+	 *
+	 * @return void
+	 */
+	public function down()
+	{
+		Schema::drop('permissions');
+	}
+
+}

+ 35 - 0
database/migrations/2019_05_08_160636_create_positions_table.php

@@ -0,0 +1,35 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+
+class CreatePositionsTable extends Migration {
+
+	/**
+	 * Run the migrations.
+	 *
+	 * @return void
+	 */
+	public function up()
+	{
+		Schema::create('positions', function(Blueprint $table)
+		{
+			$table->increments('id');
+			$table->string('name', 191)->comment('位置名称');
+			$table->boolean('sort')->default(0)->comment('排序');
+			$table->timestamps();
+		});
+	}
+
+
+	/**
+	 * Reverse the migrations.
+	 *
+	 * @return void
+	 */
+	public function down()
+	{
+		Schema::drop('positions');
+	}
+
+}

+ 34 - 0
database/migrations/2019_05_08_160636_create_role_has_permissions_table.php

@@ -0,0 +1,34 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+
+class CreateRoleHasPermissionsTable extends Migration {
+
+	/**
+	 * Run the migrations.
+	 *
+	 * @return void
+	 */
+	public function up()
+	{
+		Schema::create('role_has_permissions', function(Blueprint $table)
+		{
+			$table->integer('permission_id')->unsigned();
+			$table->integer('role_id')->unsigned()->index('role_has_permissions_role_id_foreign');
+			$table->primary(['permission_id','role_id']);
+		});
+	}
+
+
+	/**
+	 * Reverse the migrations.
+	 *
+	 * @return void
+	 */
+	public function down()
+	{
+		Schema::drop('role_has_permissions');
+	}
+
+}

+ 36 - 0
database/migrations/2019_05_08_160636_create_roles_table.php

@@ -0,0 +1,36 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+
+class CreateRolesTable extends Migration {
+
+	/**
+	 * Run the migrations.
+	 *
+	 * @return void
+	 */
+	public function up()
+	{
+		Schema::create('roles', function(Blueprint $table)
+		{
+			$table->increments('id');
+			$table->string('name', 191);
+			$table->string('guard_name', 191);
+			$table->string('display_name', 191);
+			$table->timestamps();
+		});
+	}
+
+
+	/**
+	 * Reverse the migrations.
+	 *
+	 * @return void
+	 */
+	public function down()
+	{
+		Schema::drop('roles');
+	}
+
+}

+ 35 - 0
database/migrations/2019_05_08_160636_create_sites_table.php

@@ -0,0 +1,35 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+
+class CreateSitesTable extends Migration {
+
+	/**
+	 * Run the migrations.
+	 *
+	 * @return void
+	 */
+	public function up()
+	{
+		Schema::create('sites', function(Blueprint $table)
+		{
+			$table->increments('id');
+			$table->string('key', 191);
+			$table->string('value', 191);
+			$table->timestamps();
+		});
+	}
+
+
+	/**
+	 * Reverse the migrations.
+	 *
+	 * @return void
+	 */
+	public function down()
+	{
+		Schema::drop('sites');
+	}
+
+}

+ 35 - 0
database/migrations/2019_05_08_160636_create_tags_table.php

@@ -0,0 +1,35 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+
+class CreateTagsTable extends Migration {
+
+	/**
+	 * Run the migrations.
+	 *
+	 * @return void
+	 */
+	public function up()
+	{
+		Schema::create('tags', function(Blueprint $table)
+		{
+			$table->increments('id');
+			$table->string('name', 100)->comment('名称');
+			$table->integer('sort')->default(0)->comment('排序');
+			$table->timestamps();
+		});
+	}
+
+
+	/**
+	 * Reverse the migrations.
+	 *
+	 * @return void
+	 */
+	public function down()
+	{
+		Schema::drop('tags');
+	}
+
+}

+ 40 - 0
database/migrations/2019_05_08_160636_create_users_table.php

@@ -0,0 +1,40 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+
+class CreateUsersTable extends Migration {
+
+	/**
+	 * Run the migrations.
+	 *
+	 * @return void
+	 */
+	public function up()
+	{
+		Schema::create('users', function(Blueprint $table)
+		{
+			$table->increments('id');
+			$table->string('username', 191)->unique();
+			$table->string('phone', 191)->unique();
+			$table->string('name', 191);
+			$table->string('email', 191)->unique();
+			$table->string('password', 191);
+			$table->string('remember_token', 100)->nullable();
+			$table->char('uuid', 36);
+			$table->timestamps();
+		});
+	}
+
+
+	/**
+	 * Reverse the migrations.
+	 *
+	 * @return void
+	 */
+	public function down()
+	{
+		Schema::drop('users');
+	}
+
+}