first
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateTaskCategoriesTable extends Migration
|
||||
{
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('task_categories', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('title')->comment('分类标题');
|
||||
$table->string('remark')->comment('分类描述');
|
||||
$table->string('cover')->nullable()->comment('展示图片');
|
||||
$table->boolean('status')->default(0)->comment('状态');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('task_categories');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateTaskLogsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('task_logs', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->unsignedBigInteger('user_id')->index();
|
||||
$table->unsignedBigInteger('task_id')->index();
|
||||
$table->json('source')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('task_logs');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateTaskUsersTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('task_users', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->unsignedBigInteger('user_id')->index();
|
||||
$table->unsignedBigInteger('task_id')->index();
|
||||
$table->timestamp('task_at')->index()->comment('做任务的日期');
|
||||
$table->integer('total')->default(1)->comment('任务量');
|
||||
$table->boolean('status')->default(0)->index()->comment('状态');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('task_users');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateTasksTable extends Migration
|
||||
{
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('tasks', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->unsignedBigInteger('category_id')->default(0)->index();
|
||||
$table->string('title', 100)->nullable()->comment('任务标题');
|
||||
$table->string('sub_title')->nullable()->comment('副标题');
|
||||
$table->string('key', 100)->nullable()->comment('任务标识');
|
||||
$table->string('ico', 200)->nullable()->comment('任务图标');
|
||||
$table->string('cover')->nullable()->comment('图片');
|
||||
$table->integer('position')->default(0)->comment('定位');
|
||||
$table->json('identity')->nullable()->comment('可用身份');
|
||||
$table->string('remark', 100)->nullable()->comment('任务描述');
|
||||
$table->string('tips', 100)->nullable()->comment('任务奖励提示');
|
||||
$table->text('description')->nullable()->comment('任务详细说明');
|
||||
$table->string('url', 200)->nullable()->comment('任务目标连接');
|
||||
$table->integer('rule_id')->nullable()->comment('对应账变规则');
|
||||
$table->decimal('rule_number', 8, 2)->default(0)->comment('任务发放的数值');
|
||||
$table->string('type', 20)->nullable()->comment('任务计量类型');
|
||||
$table->unsignedInteger('task_number')->default(0)->comment('任务数额');
|
||||
$table->boolean('company_certify')->nullable()->comment('是否企业认证');
|
||||
$table->string('cycle', 20)->nullable()->comment('周期');
|
||||
$table->boolean('status')->default(0)->comment('状态');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('tasks');
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user