medal management

This commit is contained in:
xiaomlove
2022-01-19 23:54:55 +08:00
parent 3fa8fd19c0
commit 64a1f2bb0c
39 changed files with 1282 additions and 171 deletions

View File

@@ -0,0 +1,38 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateMedalsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('medals', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->integer('get_type');
$table->text('description')->nullable();
$table->string('image_large')->nullable();
$table->string('image_small')->nullable();
$table->integer('price')->default(0);
$table->integer('duration')->default(0);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('medals');
}
}

View File

@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateUserMedalsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('user_medals', function (Blueprint $table) {
$table->id();
$table->integer('uid')->index();
$table->integer('medal_id')->index();
$table->dateTime('expire_at')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('user_medals');
}
}