Quellcode durchsuchen

migrations/seeders

kuaifan vor 5 Jahren
Ursprung
Commit
f8f4421e6a
24 geänderte Dateien mit 881 neuen und 72 gelöschten Zeilen
  1. 2 0
      composer.json
  2. 120 1
      composer.lock
  3. 0 36
      database/migrations/2014_10_12_000000_create_users_table.php
  4. 0 35
      database/migrations/2019_08_19_000000_create_failed_jobs_table.php
  5. 43 0
      database/migrations/2020_06_05_165357_create_pre_chat_dialog_table.php
  6. 37 0
      database/migrations/2020_06_05_165357_create_pre_chat_msg_table.php
  7. 34 0
      database/migrations/2020_06_05_165357_create_pre_docs_book_table.php
  8. 36 0
      database/migrations/2020_06_05_165357_create_pre_docs_content_table.php
  9. 38 0
      database/migrations/2020_06_05_165357_create_pre_docs_section_table.php
  10. 33 0
      database/migrations/2020_06_05_165357_create_pre_migrations_table.php
  11. 43 0
      database/migrations/2020_06_05_165357_create_pre_project_files_table.php
  12. 34 0
      database/migrations/2020_06_05_165357_create_pre_project_label_table.php
  13. 39 0
      database/migrations/2020_06_05_165357_create_pre_project_lists_table.php
  14. 38 0
      database/migrations/2020_06_05_165357_create_pre_project_log_table.php
  15. 53 0
      database/migrations/2020_06_05_165357_create_pre_project_task_table.php
  16. 37 0
      database/migrations/2020_06_05_165357_create_pre_project_users_table.php
  17. 35 0
      database/migrations/2020_06_05_165357_create_pre_report_ccuser_table.php
  18. 33 0
      database/migrations/2020_06_05_165357_create_pre_report_content_table.php
  19. 39 0
      database/migrations/2020_06_05_165357_create_pre_report_lists_table.php
  20. 34 0
      database/migrations/2020_06_05_165357_create_pre_setting_table.php
  21. 50 0
      database/migrations/2020_06_05_165357_create_pre_users_table.php
  22. 2 0
      database/seeds/DatabaseSeeder.php
  23. 31 0
      database/seeds/SettingTableSeeder.php
  24. 70 0
      database/seeds/UsersTableSeeder.php

+ 2 - 0
composer.json

@@ -22,8 +22,10 @@
         "barryvdh/laravel-ide-helper": "^2.7",
         "facade/ignition": "^2.0",
         "fzaninotto/faker": "^1.9.1",
+        "kitloong/laravel-migrations-generator": "^4.3",
         "mockery/mockery": "^1.3.1",
         "nunomaduro/collision": "^4.1",
+        "orangehill/iseed": "^2.6",
         "phpunit/phpunit": "^8.5"
     },
     "config": {

+ 120 - 1
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": "af4ee4c97e2d6a53979854c7482f60c4",
+    "content-hash": "fea720c8862d02af90e6a1ddcebbf77d",
     "packages": [
         {
             "name": "asm89/stack-cors",
@@ -5030,6 +5030,66 @@
             "time": "2019-09-25T14:49:45+00:00"
         },
         {
+            "name": "kitloong/laravel-migrations-generator",
+            "version": "4.3.1",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/kitloong/laravel-migrations-generator.git",
+                "reference": "61b761ff5f4d3592fbe7aa9c652a7ee5f916ac6d"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/kitloong/laravel-migrations-generator/zipball/61b761ff5f4d3592fbe7aa9c652a7ee5f916ac6d",
+                "reference": "61b761ff5f4d3592fbe7aa9c652a7ee5f916ac6d",
+                "shasum": ""
+            },
+            "require": {
+                "doctrine/dbal": "~2.4",
+                "illuminate/support": "^5.6|^6.0|^7.0",
+                "php": ">=7.1.3"
+            },
+            "require-dev": {
+                "mockery/mockery": "^1.0",
+                "orchestra/testbench": "^3.6|^4.0|^5.0",
+                "squizlabs/php_codesniffer": "^3.5"
+            },
+            "type": "library",
+            "extra": {
+                "laravel": {
+                    "providers": [
+                        "KitLoong\\MigrationsGenerator\\MigrationsGeneratorServiceProvider"
+                    ]
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "KitLoong\\MigrationsGenerator\\": "src/KitLoong/MigrationsGenerator",
+                    "Xethron\\MigrationsGenerator\\": "src/Xethron/MigrationsGenerator",
+                    "Way\\Generators\\": "src/Way/Generators"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Kit Loong",
+                    "email": "kitloong1008@gmail.com"
+                }
+            ],
+            "description": "Generates Laravel Migrations from an existing database",
+            "keywords": [
+                "artisan",
+                "generator",
+                "laravel",
+                "lumen",
+                "migration",
+                "migrations"
+            ],
+            "time": "2020-04-08T14:58:10+00:00"
+        },
+        {
             "name": "mockery/mockery",
             "version": "1.3.1",
             "source": {
@@ -5213,6 +5273,65 @@
             "time": "2020-04-04T19:56:08+00:00"
         },
         {
+            "name": "orangehill/iseed",
+            "version": "v2.6.3",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/orangehill/iseed.git",
+                "reference": "454d4aa0eacedf02d7bcbb2633e363170d3db49b"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/orangehill/iseed/zipball/454d4aa0eacedf02d7bcbb2633e363170d3db49b",
+                "reference": "454d4aa0eacedf02d7bcbb2633e363170d3db49b",
+                "shasum": ""
+            },
+            "require": {
+                "illuminate/support": "~5.5.0|~5.6.0|~5.7.0|~5.8.0|^6.0|^7.0",
+                "php": "^7.2"
+            },
+            "require-dev": {
+                "illuminate/filesystem": "~5.5.0|~5.6.0|~5.7.0|~5.8.0|^6.0|^7.0",
+                "laravel/framework": "~5.5.0|~5.6.0|~5.7.0|~5.8.0|^6.0|^7.0",
+                "mockery/mockery": "^1.0.0",
+                "phpunit/phpunit": "^8.0"
+            },
+            "type": "library",
+            "extra": {
+                "laravel": {
+                    "providers": [
+                        "Orangehill\\Iseed\\IseedServiceProvider"
+                    ]
+                }
+            },
+            "autoload": {
+                "psr-0": {
+                    "Orangehill\\Iseed": "src/"
+                },
+                "classmap": [
+                    "src/Orangehill/Iseed/Exceptions.php"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "BSD-2-Clause"
+            ],
+            "authors": [
+                {
+                    "name": "Tihomir Opacic",
+                    "email": "tihomir.opacic@orangehilldev.com"
+                }
+            ],
+            "description": "Generate a new Laravel database seed file based on data from the existing database table.",
+            "keywords": [
+                "artisan",
+                "generators",
+                "laravel",
+                "seed"
+            ],
+            "time": "2020-03-06T08:28:39+00:00"
+        },
+        {
             "name": "phar-io/manifest",
             "version": "1.0.3",
             "source": {

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

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

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

@@ -1,35 +0,0 @@
-<?php
-
-use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
-use Illuminate\Support\Facades\Schema;
-
-class CreateFailedJobsTable extends Migration
-{
-    /**
-     * Run the migrations.
-     *
-     * @return void
-     */
-    public function up()
-    {
-        Schema::create('failed_jobs', function (Blueprint $table) {
-            $table->id();
-            $table->text('connection');
-            $table->text('queue');
-            $table->longText('payload');
-            $table->longText('exception');
-            $table->timestamp('failed_at')->useCurrent();
-        });
-    }
-
-    /**
-     * Reverse the migrations.
-     *
-     * @return void
-     */
-    public function down()
-    {
-        Schema::dropIfExists('failed_jobs');
-    }
-}

+ 43 - 0
database/migrations/2020_06_05_165357_create_pre_chat_dialog_table.php

@@ -0,0 +1,43 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreatePreChatDialogTable extends Migration
+{
+	/**
+	 * Run the migrations.
+	 *
+	 * @return void
+	 */
+	public function up()
+	{
+		Schema::create('chat_dialog', function(Blueprint $table)
+		{
+			$table->bigIncrements('id');
+			$table->string('user1', 100)->nullable()->default('')->index('IDEX_user1')->comment('用户名1(发起对话者)');
+			$table->string('user2', 100)->nullable()->default('')->index('IDEX_user2')->comment('用户名2');
+			$table->integer('unread1')->nullable()->default(0)->comment('用户1未读信息数');
+			$table->integer('unread2')->nullable()->default(0)->comment('用户2未读信息数');
+			$table->boolean('del1')->nullable()->default(0)->comment('用户1删除');
+			$table->boolean('del2')->nullable()->default(0)->comment('用户2删除');
+			$table->bigInteger('lastid1')->nullable()->default(0)->comment('用户1删除到的聊天ID');
+			$table->bigInteger('lastid2')->nullable()->default(0)->comment('用户2删除到的聊天ID');
+			$table->text('lasttext')->nullable()->comment('最后消息');
+			$table->bigInteger('lastdate')->nullable()->default(0)->comment('最后消息时间');
+			$table->bigInteger('indate')->nullable()->default(0)->comment('数据生成时间');
+			$table->unique(['user1','user2'], 'IDEX_user1_user2');
+		});
+	}
+
+	/**
+	 * Reverse the migrations.
+	 *
+	 * @return void
+	 */
+	public function down()
+	{
+		Schema::drop('chat_dialog');
+	}
+}

+ 37 - 0
database/migrations/2020_06_05_165357_create_pre_chat_msg_table.php

@@ -0,0 +1,37 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreatePreChatMsgTable extends Migration
+{
+	/**
+	 * Run the migrations.
+	 *
+	 * @return void
+	 */
+	public function up()
+	{
+		Schema::create('chat_msg', function(Blueprint $table)
+		{
+			$table->bigIncrements('id');
+			$table->integer('did')->nullable()->default(0)->index('IDEX_did')->comment('对话ID');
+			$table->string('username', 100)->nullable()->default('')->index('IDEX_username')->comment('发送者');
+			$table->string('receive', 100)->nullable()->default('')->index('IDEX_receive')->comment('接受者');
+			$table->text('message')->nullable()->comment('详细内容');
+			$table->boolean('roger')->nullable()->default(0)->comment('是否已读');
+			$table->bigInteger('indate')->nullable()->default(0);
+		});
+	}
+
+	/**
+	 * Reverse the migrations.
+	 *
+	 * @return void
+	 */
+	public function down()
+	{
+		Schema::drop('chat_msg');
+	}
+}

+ 34 - 0
database/migrations/2020_06_05_165357_create_pre_docs_book_table.php

@@ -0,0 +1,34 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreatePreDocsBookTable extends Migration
+{
+	/**
+	 * Run the migrations.
+	 *
+	 * @return void
+	 */
+	public function up()
+	{
+		Schema::create('docs_book', function(Blueprint $table)
+		{
+			$table->increments('id');
+			$table->string('username', 100)->nullable()->default('');
+			$table->string('title', 100)->nullable()->default('');
+			$table->bigInteger('indate')->nullable()->default(0);
+		});
+	}
+
+	/**
+	 * Reverse the migrations.
+	 *
+	 * @return void
+	 */
+	public function down()
+	{
+		Schema::drop('docs_book');
+	}
+}

+ 36 - 0
database/migrations/2020_06_05_165357_create_pre_docs_content_table.php

@@ -0,0 +1,36 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreatePreDocsContentTable extends Migration
+{
+	/**
+	 * Run the migrations.
+	 *
+	 * @return void
+	 */
+	public function up()
+	{
+		Schema::create('docs_content', function(Blueprint $table)
+		{
+			$table->increments('id');
+			$table->integer('bookid')->nullable()->default(0)->comment('知识库ID');
+			$table->integer('sid')->nullable()->default(0)->index('IDEX_sid')->comment('章节ID');
+			$table->text('content')->nullable()->comment('内容');
+			$table->string('username', 100)->nullable()->default('');
+			$table->bigInteger('indate')->nullable()->default(0);
+		});
+	}
+
+	/**
+	 * Reverse the migrations.
+	 *
+	 * @return void
+	 */
+	public function down()
+	{
+		Schema::drop('docs_content');
+	}
+}

+ 38 - 0
database/migrations/2020_06_05_165357_create_pre_docs_section_table.php

@@ -0,0 +1,38 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreatePreDocsSectionTable extends Migration
+{
+	/**
+	 * Run the migrations.
+	 *
+	 * @return void
+	 */
+	public function up()
+	{
+		Schema::create('docs_section', function(Blueprint $table)
+		{
+			$table->increments('id');
+			$table->integer('bookid')->nullable()->default(0)->comment('知识库数据ID');
+			$table->integer('parentid')->nullable()->default(0)->comment('上级数据ID');
+			$table->string('username', 100)->nullable()->default('');
+			$table->string('title', 100)->nullable()->default('');
+			$table->string('type', 100)->nullable()->default('');
+			$table->integer('inorder')->nullable()->default(0)->comment('排序(DESC)');
+			$table->bigInteger('indate')->nullable()->default(0);
+		});
+	}
+
+	/**
+	 * Reverse the migrations.
+	 *
+	 * @return void
+	 */
+	public function down()
+	{
+		Schema::drop('docs_section');
+	}
+}

+ 33 - 0
database/migrations/2020_06_05_165357_create_pre_migrations_table.php

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

+ 43 - 0
database/migrations/2020_06_05_165357_create_pre_project_files_table.php

@@ -0,0 +1,43 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreatePreProjectFilesTable extends Migration
+{
+	/**
+	 * Run the migrations.
+	 *
+	 * @return void
+	 */
+	public function up()
+	{
+		Schema::create('project_files', function(Blueprint $table)
+		{
+			$table->increments('id');
+			$table->integer('projectid')->nullable()->default(0)->comment('项目ID');
+			$table->integer('taskid')->nullable()->default(0)->comment('任务ID');
+			$table->string('name', 100)->nullable()->default('')->comment('文件名称');
+			$table->integer('size')->nullable()->default(0)->comment('文件大小(B)');
+			$table->string('ext', 20)->nullable()->default('')->comment('文件格式');
+			$table->string('path')->nullable()->default('')->comment('文件地址');
+			$table->string('thumb')->nullable()->default('')->comment('缩略图');
+			$table->string('username')->nullable()->default('')->comment('上传用户');
+			$table->integer('download')->nullable()->default(0)->comment('下载次数');
+			$table->boolean('delete')->nullable()->default(0)->comment('是否删除');
+			$table->bigInteger('deletedate')->nullable()->default(0)->comment('删除时间');
+			$table->bigInteger('indate')->nullable()->default(0);
+		});
+	}
+
+	/**
+	 * Reverse the migrations.
+	 *
+	 * @return void
+	 */
+	public function down()
+	{
+		Schema::drop('project_files');
+	}
+}

+ 34 - 0
database/migrations/2020_06_05_165357_create_pre_project_label_table.php

@@ -0,0 +1,34 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreatePreProjectLabelTable extends Migration
+{
+	/**
+	 * Run the migrations.
+	 *
+	 * @return void
+	 */
+	public function up()
+	{
+		Schema::create('project_label', function(Blueprint $table)
+		{
+			$table->increments('id');
+			$table->integer('projectid')->nullable()->default(0)->comment('项目ID');
+			$table->string('title', 100)->nullable()->default('')->comment('分类名称');
+			$table->integer('inorder')->nullable()->comment('排序(ASC)');
+		});
+	}
+
+	/**
+	 * Reverse the migrations.
+	 *
+	 * @return void
+	 */
+	public function down()
+	{
+		Schema::drop('project_label');
+	}
+}

+ 39 - 0
database/migrations/2020_06_05_165357_create_pre_project_lists_table.php

@@ -0,0 +1,39 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreatePreProjectListsTable extends Migration
+{
+	/**
+	 * Run the migrations.
+	 *
+	 * @return void
+	 */
+	public function up()
+	{
+		Schema::create('project_lists', function(Blueprint $table)
+		{
+			$table->increments('id');
+			$table->string('title')->nullable()->default('')->comment('项目名称');
+			$table->string('createuser', 100)->nullable()->default('')->comment('项目创建者用户名');
+			$table->string('username', 100)->nullable()->default('')->comment('项目所有者用户名');
+			$table->integer('complete')->nullable()->default(0)->comment('已完成数量');
+			$table->integer('unfinished')->nullable()->default(0)->comment('未完成数量');
+			$table->bigInteger('indate')->nullable()->default(0)->comment('添加时间');
+			$table->boolean('delete')->nullable()->default(0)->index('IDEX_delete')->comment('是否删除');
+			$table->bigInteger('deletedate')->nullable()->default(0)->comment('删除时间');
+		});
+	}
+
+	/**
+	 * Reverse the migrations.
+	 *
+	 * @return void
+	 */
+	public function down()
+	{
+		Schema::drop('project_lists');
+	}
+}

+ 38 - 0
database/migrations/2020_06_05_165357_create_pre_project_log_table.php

@@ -0,0 +1,38 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreatePreProjectLogTable extends Migration
+{
+	/**
+	 * Run the migrations.
+	 *
+	 * @return void
+	 */
+	public function up()
+	{
+		Schema::create('project_log', function(Blueprint $table)
+		{
+			$table->increments('id');
+			$table->string('type', 50)->nullable()->default('')->comment('类型:评论、日志');
+			$table->integer('projectid')->nullable()->default(0)->comment('项目ID');
+			$table->integer('taskid')->nullable()->default(0)->comment('相关数据ID');
+			$table->string('username', 100)->nullable()->default('')->comment('关系用户名');
+			$table->string('detail', 500)->nullable()->default('')->comment('详细信息');
+			$table->bigInteger('indate')->nullable()->default(0)->comment('添加时间');
+			$table->text('other')->nullable()->comment('其他参数');
+		});
+	}
+
+	/**
+	 * Reverse the migrations.
+	 *
+	 * @return void
+	 */
+	public function down()
+	{
+		Schema::drop('project_log');
+	}
+}

+ 53 - 0
database/migrations/2020_06_05_165357_create_pre_project_task_table.php

@@ -0,0 +1,53 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreatePreProjectTaskTable extends Migration
+{
+	/**
+	 * Run the migrations.
+	 *
+	 * @return void
+	 */
+	public function up()
+	{
+		Schema::create('project_task', function(Blueprint $table)
+		{
+			$table->increments('id');
+			$table->integer('projectid')->nullable()->default(0)->index('IDEX_projectid')->comment('项目ID');
+			$table->integer('labelid')->nullable()->default(0)->comment('项目子分类ID');
+			$table->string('createuser', 100)->nullable()->default('')->comment('创建者用户名');
+			$table->string('username', 100)->nullable()->default('')->comment('负责人用户名');
+			$table->string('title')->nullable()->default('')->comment('标题');
+			$table->string('desc', 500)->nullable()->default('')->comment('描述');
+			$table->boolean('level')->nullable()->default(1)->comment('优先级别:1~4');
+			$table->boolean('complete')->nullable()->default(0)->index('IDEX_status')->comment('是否完成:0|1');
+			$table->bigInteger('completedate')->nullable()->default(0)->comment('完成时间');
+			$table->text('subtask')->nullable()->comment('子任务列表');
+			$table->text('follower')->nullable()->comment('关注人列表');
+			$table->integer('pushlid')->nullable()->default(0)->comment('已发送的最后动态ID');
+			$table->integer('filenum')->nullable()->default(0)->comment('附件数量');
+			$table->bigInteger('startdate')->nullable()->default(0)->comment('计划开始时间');
+			$table->bigInteger('enddate')->nullable()->default(0)->comment('计划结束时间');
+			$table->tinyInteger('archived')->nullable()->default(0)->comment('是否归档');
+			$table->bigInteger('archiveddate')->nullable()->default(0)->comment('归档时间');
+			$table->boolean('delete')->nullable()->default(0)->index('IDEX_delete')->comment('是否删除');
+			$table->bigInteger('deletedate')->nullable()->default(0)->comment('删除时间');
+			$table->integer('inorder')->nullable()->default(0)->comment('排序(DESC)');
+			$table->integer('userorder')->nullable()->default(0)->comment('会员自己的排序(DESC)');
+			$table->bigInteger('indate')->nullable()->default(0)->comment('添加时间');
+		});
+	}
+
+	/**
+	 * Reverse the migrations.
+	 *
+	 * @return void
+	 */
+	public function down()
+	{
+		Schema::drop('project_task');
+	}
+}

+ 37 - 0
database/migrations/2020_06_05_165357_create_pre_project_users_table.php

@@ -0,0 +1,37 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreatePreProjectUsersTable extends Migration
+{
+	/**
+	 * Run the migrations.
+	 *
+	 * @return void
+	 */
+	public function up()
+	{
+		Schema::create('project_users', function(Blueprint $table)
+		{
+			$table->increments('id');
+			$table->string('type', 50)->nullable()->default('')->index('IDEX_type')->comment('类型:成员、收藏、关注');
+			$table->integer('projectid')->nullable()->default(0)->index('IDEX_projectid')->comment('项目ID');
+			$table->integer('taskid')->nullable()->default(0)->index('IDEX_taskid')->comment('任务ID');
+			$table->boolean('isowner')->nullable()->default(0)->comment('是否项目所有者');
+			$table->string('username', 100)->nullable()->default('')->index('IDEX_username')->comment('关系用户名');
+			$table->bigInteger('indate')->nullable()->default(0)->comment('添加时间');
+		});
+	}
+
+	/**
+	 * Reverse the migrations.
+	 *
+	 * @return void
+	 */
+	public function down()
+	{
+		Schema::drop('project_users');
+	}
+}

+ 35 - 0
database/migrations/2020_06_05_165357_create_pre_report_ccuser_table.php

@@ -0,0 +1,35 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreatePreReportCcuserTable extends Migration
+{
+	/**
+	 * Run the migrations.
+	 *
+	 * @return void
+	 */
+	public function up()
+	{
+		Schema::create('report_ccuser', function(Blueprint $table)
+		{
+			$table->increments('id');
+			$table->integer('rid')->nullable()->default(0)->comment('汇报ID');
+			$table->string('username', 100)->nullable()->default('');
+			$table->boolean('cc')->nullable()->default(0)->comment('是否生效');
+			$table->unique(['rid','username'], 'IDEX_rid_username');
+		});
+	}
+
+	/**
+	 * Reverse the migrations.
+	 *
+	 * @return void
+	 */
+	public function down()
+	{
+		Schema::drop('report_ccuser');
+	}
+}

+ 33 - 0
database/migrations/2020_06_05_165357_create_pre_report_content_table.php

@@ -0,0 +1,33 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreatePreReportContentTable extends Migration
+{
+	/**
+	 * Run the migrations.
+	 *
+	 * @return void
+	 */
+	public function up()
+	{
+		Schema::create('report_content', function(Blueprint $table)
+		{
+			$table->increments('id');
+			$table->integer('rid')->nullable()->default(0)->unique('IDEX_rid')->comment('汇报ID');
+			$table->text('content')->nullable()->comment('内容');
+		});
+	}
+
+	/**
+	 * Reverse the migrations.
+	 *
+	 * @return void
+	 */
+	public function down()
+	{
+		Schema::drop('report_content');
+	}
+}

+ 39 - 0
database/migrations/2020_06_05_165357_create_pre_report_lists_table.php

@@ -0,0 +1,39 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreatePreReportListsTable extends Migration
+{
+	/**
+	 * Run the migrations.
+	 *
+	 * @return void
+	 */
+	public function up()
+	{
+		Schema::create('report_lists', function(Blueprint $table)
+		{
+			$table->increments('id');
+			$table->string('username', 100)->nullable()->default('');
+			$table->string('title', 100)->nullable()->default('');
+			$table->string('type', 100)->nullable()->default('');
+			$table->string('status', 100)->nullable()->default('');
+			$table->text('ccuser')->nullable()->comment('抄送人');
+			$table->string('date', 20)->nullable()->default('')->comment('日期');
+			$table->bigInteger('indate')->nullable()->default(0);
+			$table->unique(['username','type','date'], 'IDEX_username_type_date');
+		});
+	}
+
+	/**
+	 * Reverse the migrations.
+	 *
+	 * @return void
+	 */
+	public function down()
+	{
+		Schema::drop('report_lists');
+	}
+}

+ 34 - 0
database/migrations/2020_06_05_165357_create_pre_setting_table.php

@@ -0,0 +1,34 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreatePreSettingTable extends Migration
+{
+	/**
+	 * Run the migrations.
+	 *
+	 * @return void
+	 */
+	public function up()
+	{
+		Schema::create('setting', function(Blueprint $table)
+		{
+			$table->increments('id');
+			$table->string('title', 100)->nullable()->default('')->index('IDEX_TITLE');
+			$table->string('desc')->nullable()->default('')->comment('参数描述、备注');
+			$table->longText('setting')->nullable();
+		});
+	}
+
+	/**
+	 * Reverse the migrations.
+	 *
+	 * @return void
+	 */
+	public function down()
+	{
+		Schema::drop('setting');
+	}
+}

+ 50 - 0
database/migrations/2020_06_05_165357_create_pre_users_table.php

@@ -0,0 +1,50 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreatePreUsersTable extends Migration
+{
+	/**
+	 * Run the migrations.
+	 *
+	 * @return void
+	 */
+	public function up()
+	{
+		Schema::create('users', function(Blueprint $table)
+		{
+			$table->increments('id');
+			$table->string('identity')->nullable()->default('')->comment('身份');
+			$table->string('token', 100)->nullable()->default('')->index('IDEX_token');
+			$table->string('username', 100)->nullable()->default('')->unique('IDEX_username')->comment('用户名');
+			$table->string('nickname')->nullable()->comment('昵称');
+			$table->string('userimg')->nullable()->default('')->comment('已审核头像');
+			$table->string('profession')->nullable()->default('')->comment('职称/职位');
+			$table->string('encrypt', 50)->nullable()->default('');
+			$table->string('userpass', 50)->nullable()->default('')->comment('登录密码');
+			$table->integer('wsid')->nullable()->default(0)->index('IDEX_wsid')->comment('websocket');
+			$table->bigInteger('wsdate')->nullable()->default(0)->index('IDEX_wsdate')->comment('websocket最后刷新时间');
+			$table->integer('bgid')->nullable()->default(0)->comment('背景ID');
+			$table->integer('loginnum')->nullable()->default(0)->comment('累计登陆次数');
+			$table->string('lastip', 20)->nullable()->default('')->comment('最后登录IP');
+			$table->bigInteger('lastdate')->nullable()->default(0)->comment('最后登录时间');
+			$table->string('lineip', 20)->nullable()->default('')->index('IDEX_lineip')->comment('最后在线IP(接口)');
+			$table->bigInteger('linedate')->nullable()->default(0)->comment('最后在线时间(接口)');
+			$table->string('regip', 20)->nullable()->default('')->comment('注册IP');
+			$table->bigInteger('regdate')->nullable()->default(0)->comment('注册时间');
+			$table->text('setting')->nullable();
+		});
+	}
+
+	/**
+	 * Reverse the migrations.
+	 *
+	 * @return void
+	 */
+	public function down()
+	{
+		Schema::drop('users');
+	}
+}

+ 2 - 0
database/seeds/DatabaseSeeder.php

@@ -12,5 +12,7 @@ class DatabaseSeeder extends Seeder
     public function run()
     {
         // $this->call(UserSeeder::class);
+        $this->call(SettingTableSeeder::class);
+        $this->call(UsersTableSeeder::class);
     }
 }

+ 31 - 0
database/seeds/SettingTableSeeder.php

@@ -0,0 +1,31 @@
+<?php
+
+use Illuminate\Database\Seeder;
+
+class SettingTableSeeder extends Seeder
+{
+
+    /**
+     * Auto generated seed file
+     *
+     * @return void
+     */
+    public function run()
+    {
+        
+
+        \DB::table('setting')->delete();
+        
+        \DB::table('setting')->insert(array (
+            0 => 
+            array (
+                'id' => 1,
+                'title' => 'system',
+                'desc' => '',
+                'setting' => '{\\"reg\\":\\"open\\",\\"github\\":\\"show\\",\\"logo\\":\\"\\"}',
+            ),
+        ));
+        
+        
+    }
+}

+ 70 - 0
database/seeds/UsersTableSeeder.php

@@ -0,0 +1,70 @@
+<?php
+
+use Illuminate\Database\Seeder;
+
+class UsersTableSeeder extends Seeder
+{
+
+    /**
+     * Auto generated seed file
+     *
+     * @return void
+     */
+    public function run()
+    {
+        
+
+        \DB::table('users')->delete();
+        
+        \DB::table('users')->insert(array (
+            0 => 
+            array (
+                'id' => 1,
+                'identity' => '',
+                'token' => 'MUBhZG1pbkBPSHNKODhAMTU5MTM0Mzg1NUBzdkJ6UnU=',
+                'username' => 'admin',
+                'nickname' => '大乔',
+                'userimg' => '',
+                'profession' => '技术部',
+                'encrypt' => 'OHsJ88',
+                'userpass' => '3dd0e69a6da5b87a9de356cc8f22a1e3',
+                'wsid' => 9,
+                'wsdate' => 1591348505,
+                'bgid' => 1,
+                'loginnum' => 353,
+                'lastip' => '127.0.0.1',
+                'lastdate' => 1591343855,
+                'lineip' => '127.0.0.1',
+                'linedate' => 1591343909,
+                'regip' => '127.0.0.1',
+                'regdate' => 1589072625,
+                'setting' => NULL,
+            ),
+            1 => 
+            array (
+                'id' => 2,
+                'identity' => '',
+                'token' => 'MkBzeXN0ZW1AQUExbHN2QDE1OTEzNDI2OTBAQlZ5Z005',
+                'username' => 'system',
+                'nickname' => '小乔',
+                'userimg' => '',
+                'profession' => '技术部',
+                'encrypt' => 'AA1lsv',
+                'userpass' => '80c515b27ae42470a7c90e59586caaab',
+                'wsid' => 0,
+                'wsdate' => 1591343157,
+                'bgid' => 1,
+                'loginnum' => 345,
+                'lastip' => '127.0.0.1',
+                'lastdate' => 1591342690,
+                'lineip' => '127.0.0.1',
+                'linedate' => 1591343157,
+                'regip' => '127.0.0.1',
+                'regdate' => 1589072625,
+                'setting' => NULL,
+            ),
+        ));
+        
+        
+    }
+}