summaryrefslogtreecommitdiff
path: root/database
diff options
context:
space:
mode:
authorFbenas <philbeansburton@gmail.com>2020-06-20 21:07:45 +0100
committerFbenas <philbeansburton@gmail.com>2020-06-20 21:07:45 +0100
commit8d6e8b306d7836e4075a13ad98617bfe5afaa1a0 (patch)
tree99c44e28da231cac0d9e513aabc1ee0768972426 /database
parent897b68ac107f2fb0d4dc1d31ce96ce24c862eb27 (diff)
Add new scripts for youtube downloading and syncing with existing matches
Diffstat (limited to 'database')
-rw-r--r--database/migrations/2020_06_20_162435_create_videos_table.php36
-rw-r--r--database/seeds/DatabaseSeeder.php9
-rw-r--r--database/seeds/VideoSeeder.php24
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);
+ }
+}