Skip to content

Commit

Permalink
Starting tournament DB schema, updated user schema
Browse files Browse the repository at this point in the history
  • Loading branch information
josh7951 committed Jun 10, 2021
1 parent 2293f17 commit 4c565a4
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 1 deletion.
18 changes: 18 additions & 0 deletions app/Models/Tournaments.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Tournaments extends Model
{
use HasFactory;
protected $fillable = [
'series',
'tournament',
'location',
'start_date',
'end_date',
];
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class CreateUsersTable extends Migration
public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->id();
$table->increments('id');
$table->string('name');
$table->string('email')->unique();
$table->timestamp('email_verified_at')->nullable();
Expand Down
36 changes: 36 additions & 0 deletions database/migrations/2021_06_10_191902_create_tournaments_table.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateTournamentsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('tournaments', function (Blueprint $table) {
$table->increments('id');
$table->string('series');
$table->string('tournament');
$table->string('location');
$table->date('start_date');
$table->date('end_date');
$table->timestamps();
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('tournaments');
}
}

0 comments on commit 4c565a4

Please sign in to comment.