increments('id'); $table->unsignedInteger('from_id')->comment('来源对象id'); $table->string('from_name', 100)->nullable()->comment('来源对象名称'); $table->string('op', 20)->comment('操作,charge:冲值,support:消耗,withdraw:提现'); $table->string('from_type', 20)->comment('操作类型,1、余额,2、梦想币,3、现金'); $table->unsignedInteger('from_amount')->comment('操作金额from'); $table->string('to_type', 20)->comment('操作类型,1、余额,2、梦想币,3、现金'); $table->unsignedInteger('to_id')->comment('目标对象id'); $table->string('to_name', 100)->nullable()->comment('来源目标对象名称'); $table->unsignedInteger('to_amount')->comment('操作金额to'); $table->nullableTimestamps(); $table->index(['from_id'], 'idx_from'); $table->index(['to_id'], 'idx_to'); $table->index('from_type', 'idx_from_type'); $table->index('to_type', 'idx_to_type'); $table->index('created_at', 'idx_created_at'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('account_logs'); } }