| 123456789101112131415161718192021222324252627282930 |
- <?php
- use Illuminate\Database\Migrations\Migration;
- use Illuminate\Database\Schema\Blueprint;
- use Illuminate\Support\Facades\DB;
- use Illuminate\Support\Facades\Schema;
- return new class extends Migration {
- public function up()
- {
- Schema::create('reward_grant_settings', function (Blueprint $table) {
- $table->engine = 'InnoDB';
- $table->string('type', 16)->primary();
- $table->boolean('auto_enabled')->default(false);
- $table->char('grant_time', 5)->default('03:00');
- $table->timestamps();
- });
- foreach (['rebate', 'backflow'] as $type) {
- DB::table('reward_grant_settings')->insert([
- 'type' => $type, 'auto_enabled' => false, 'grant_time' => '03:00',
- 'created_at' => now(), 'updated_at' => now(),
- ]);
- }
- }
- public function down()
- {
- Schema::dropIfExists('reward_grant_settings');
- }
- };
|