From 26161102f55fda6e46e2a990a1d21865773765df Mon Sep 17 00:00:00 2001 From: neerholt Date: Wed, 3 Mar 2021 11:01:32 +0100 Subject: [PATCH] made migrations files --- Backend/Database/GameData.php | 11 +++++++++++ Backend/Database/GameJam.php | 14 ++++++++++++++ Backend/Database/Group.php | 14 +++++++++----- Backend/Database/KeyWord.php | 11 +++++++++++ Backend/Database/Password.php | 11 +++++++++++ Backend/Database/databaseMigration.php | 7 +++++++ Backend/Database/hasVoted.php | 9 +++++++++ Backend/bootstrap.php | 2 +- 8 files changed, 73 insertions(+), 6 deletions(-) create mode 100644 Backend/Database/GameData.php create mode 100644 Backend/Database/GameJam.php create mode 100644 Backend/Database/KeyWord.php create mode 100644 Backend/Database/Password.php create mode 100644 Backend/Database/databaseMigration.php create mode 100644 Backend/Database/hasVoted.php diff --git a/Backend/Database/GameData.php b/Backend/Database/GameData.php new file mode 100644 index 0000000..28b9e27 --- /dev/null +++ b/Backend/Database/GameData.php @@ -0,0 +1,11 @@ +create("Group", function (Blueprint $table){ + $table->id(); + $table->string("gameLink"); + $table->boolean("isWebBased"); +}); \ No newline at end of file diff --git a/Backend/Database/GameJam.php b/Backend/Database/GameJam.php new file mode 100644 index 0000000..4fb54b1 --- /dev/null +++ b/Backend/Database/GameJam.php @@ -0,0 +1,14 @@ +create("Group", function (Blueprint $table){ + $table->id(); + $table->string("name"); + $table->dateTime("startTime"); + $table->dateTime("endTime"); + $table->string("keyWord")->nullable(); + $table->text("description")->nullable(); +}); \ No newline at end of file diff --git a/Backend/Database/Group.php b/Backend/Database/Group.php index 3129b31..3da78c9 100644 --- a/Backend/Database/Group.php +++ b/Backend/Database/Group.php @@ -4,9 +4,13 @@ use Illuminate\Database\Capsule\Manager as Capsule; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -Capsule::schema()->create("Group", function ($tabel){ - $tabel->id(); - $tabel->string("groupName"); - $tabel->int("groupAmount"); - $tabel->int("votes"); +Capsule::schema()->create("Group", function (Blueprint $table){ + $table->id(); + $table->string("groupName"); + $table->integer("groupAmount"); + $table->foreignId("fkGameJam")->constrained("GameData"); + $table->integer("votes")->nullable(); + $table->foreignId("fkPassword")->constrained("Password"); + $table->foreignId("fkGameData")->nullable()->constrained("GameData"); + $table->timestamp(); }); \ No newline at end of file diff --git a/Backend/Database/KeyWord.php b/Backend/Database/KeyWord.php new file mode 100644 index 0000000..33498f7 --- /dev/null +++ b/Backend/Database/KeyWord.php @@ -0,0 +1,11 @@ +create("Group", function (Blueprint $table){ + $table->id(); + $table->string('keyWord'); + $table->foreignId("fkGroup")->constrained("Group"); +}); \ No newline at end of file diff --git a/Backend/Database/Password.php b/Backend/Database/Password.php new file mode 100644 index 0000000..7b1823e --- /dev/null +++ b/Backend/Database/Password.php @@ -0,0 +1,11 @@ +create("Group", function (Blueprint $table){ + $table->id(); + $table->string('password'); + $table->rememberToken(); +}); \ No newline at end of file diff --git a/Backend/Database/databaseMigration.php b/Backend/Database/databaseMigration.php new file mode 100644 index 0000000..85aa7b1 --- /dev/null +++ b/Backend/Database/databaseMigration.php @@ -0,0 +1,7 @@ +create("Group", function (Blueprint $table){ + $table->id(); +}); \ No newline at end of file diff --git a/Backend/bootstrap.php b/Backend/bootstrap.php index d7cf222..a09eca2 100644 --- a/Backend/bootstrap.php +++ b/Backend/bootstrap.php @@ -5,7 +5,7 @@ $capsule = new Capsule; $capsule->addConnection([ "driver" => "mysql", "host" =>"127.0.0.1", - "database" => "acl", + "database" => "gamejamdb", "username" => "root", "password" => "" ]);