staffmanager/database/migrations/2020_04_29_022421_create_vo...

41 lines
855 B
PHP
Raw Permalink Normal View History

<?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'
]);
$table->timestamps();
2020-04-29 20:16:05 +00:00
$table->foreign('userID')
->references('id')
->on('users');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('votes');
}
}