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 CreateProfilesTable extends Migration
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Run the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function up()
|
|
|
|
{
|
|
|
|
Schema::create('profiles', function (Blueprint $table) {
|
|
|
|
$table->id();
|
2020-05-13 21:47:51 +00:00
|
|
|
$table->string('profileShortBio')->nullable();
|
|
|
|
$table->text('profileAboutMe')->nullable();
|
2020-04-29 17:15:54 +00:00
|
|
|
$table->enum('avatarPreference', [
|
|
|
|
'crafatar', // Mojang Profile
|
|
|
|
'gravatar' // Email profile
|
2020-05-13 21:47:51 +00:00
|
|
|
])->default('gravatar');
|
|
|
|
$table->text('socialLinks')->nullable();
|
2020-04-29 20:56:41 +00:00
|
|
|
$table->bigInteger('userID')->unsigned();
|
2020-04-29 17:15:54 +00:00
|
|
|
$table->timestamps();
|
|
|
|
|
2020-05-13 21:47:51 +00:00
|
|
|
$table->foreign('userID')
|
|
|
|
->references('id')
|
2020-06-26 23:32:33 +00:00
|
|
|
->on('users');
|
2020-04-29 17:15:54 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reverse the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function down()
|
|
|
|
{
|
|
|
|
Schema::dropIfExists('profiles');
|
|
|
|
}
|
|
|
|
}
|