diff options
Diffstat (limited to 'database')
-rw-r--r-- | database/migrations/2020_06_20_162435_create_videos_table.php | 36 | ||||
-rw-r--r-- | database/seeds/DatabaseSeeder.php | 9 | ||||
-rw-r--r-- | database/seeds/VideoSeeder.php | 24 |
3 files changed, 65 insertions, 4 deletions
diff --git a/database/migrations/2020_06_20_162435_create_videos_table.php b/database/migrations/2020_06_20_162435_create_videos_table.php new file mode 100644 index 0000000..28f7377 --- /dev/null +++ b/database/migrations/2020_06_20_162435_create_videos_table.php @@ -0,0 +1,36 @@ +<?php + +use Illuminate\Database\Migrations\Migration; +use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; + +class CreateVideosTable extends Migration +{ + /** + * Run the migrations. + * + * @return void + */ + public function up() + { + Schema::create( + 'videos', function (Blueprint $table) { + $table->id(); + $table->dateTime('date')->nullable(); + $table->unsignedInteger('match_id')->nullable(); + $table->string('path'); + $table->timestamps(); + } + ); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('videos'); + } +} diff --git a/database/seeds/DatabaseSeeder.php b/database/seeds/DatabaseSeeder.php index 21ec948..ff5520a 100644 --- a/database/seeds/DatabaseSeeder.php +++ b/database/seeds/DatabaseSeeder.php @@ -11,9 +11,10 @@ class DatabaseSeeder extends Seeder */ public function run() { - $this->call(VenueSeeder::class); - $this->call(TeamSeeder::class); - $this->call(TournamentSeeder::class); - $this->call(MatchSeeder::class); + // $this->call(VenueSeeder::class); + // $this->call(TeamSeeder::class); + // $this->call(TournamentSeeder::class); + // $this->call(MatchSeeder::class); + $this->call(VideoSeeder::class); } } diff --git a/database/seeds/VideoSeeder.php b/database/seeds/VideoSeeder.php new file mode 100644 index 0000000..23d1d78 --- /dev/null +++ b/database/seeds/VideoSeeder.php @@ -0,0 +1,24 @@ +<?php + +use Illuminate\Database\Seeder; +use App\Rugby\Model; + +class VideoSeeder extends Seeder +{ + /** + * Run the database seeds. + * + * @return void + */ + public function run() + { + $video = Model\Video::create( + [ + 'path' => 'some/path', + 'match_id' => 1 + ] + ); + + $video->match()->associate(1); + } +} |