44 lines
1.2 KiB
PHP
44 lines
1.2 KiB
PHP
<?php
|
|
|
|
use Illuminate\Support\Facades\DB;
|
|
use Illuminate\Support\Facades\Schema;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Database\Migrations\Migration;
|
|
|
|
class CreateReward extends Migration
|
|
{
|
|
/**
|
|
* Run the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function up()
|
|
{
|
|
DB::statement("
|
|
CREATE TABLE `ufutx_reward_users` (
|
|
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
|
`merchant_id` int(10) unsigned NOT NULL,
|
|
`merchant_user_id` int(10) unsigned NOT NULL,
|
|
`dead_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
|
`price` decimal(10,2) NOT NULL,
|
|
`created_at` timestamp NULL DEFAULT NULL,
|
|
`updated_at` timestamp NULL DEFAULT NULL,
|
|
`deleted_at` timestamp NULL DEFAULT NULL,
|
|
PRIMARY KEY (`id`),
|
|
KEY `union` (`merchant_id`,`merchant_user_id`) USING BTREE,
|
|
KEY `id_union` (`id`,`merchant_id`,`merchant_user_id`) USING BTREE
|
|
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
|
|
");
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function down()
|
|
{
|
|
|
|
}
|
|
}
|