2020-04-29 17:15:54 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
|
|
|
|
class CreateVotesTable extends Migration
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Run the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function up()
|
|
|
|
{
|
|
|
|
Schema::create('votes', function (Blueprint $table) {
|
|
|
|
$table->id();
|
2020-04-29 20:16:05 +00:00
|
|
|
$table->bigInteger('userID')->unsigned();
|
|
|
|
$table->enum('allowedVoteType', [
|
|
|
|
'VOTE_DENY',
|
|
|
|
'VOTE_APPROVE'
|
|
|
|
]);
|
2020-04-29 17:15:54 +00:00
|
|
|
$table->timestamps();
|
2020-04-29 20:16:05 +00:00
|
|
|
|
|
|
|
$table->foreign('userID')->references('id')->on('users');
|
2020-04-29 17:15:54 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reverse the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function down()
|
|
|
|
{
|
|
|
|
Schema::dropIfExists('votes');
|
|
|
|
}
|
|
|
|
}
|