2021-03-03 09:22:31 +00:00
|
|
|
<?php
|
2021-03-04 08:19:13 +00:00
|
|
|
//require bootstrap aka our database connection
|
2021-03-03 10:16:10 +00:00
|
|
|
require_once "../../bootstrap.php";
|
2021-03-03 09:22:31 +00:00
|
|
|
use Illuminate\Database\Capsule\Manager as Capsule;
|
|
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
|
2021-03-04 08:19:13 +00:00
|
|
|
//Create groups table with the rows as id, groupName, groupAmount, fkGameJam, votes, fkPassword, fkGameData and timestamp
|
2021-03-03 13:04:46 +00:00
|
|
|
Capsule::schema()->create("groups", function (Blueprint $table){
|
2021-03-03 10:01:32 +00:00
|
|
|
$table->id();
|
|
|
|
$table->string("groupName");
|
|
|
|
$table->integer("groupAmount");
|
2021-03-03 13:04:46 +00:00
|
|
|
$table->foreignId("fkGameJam")->constrained("game_jams");
|
2021-03-03 10:01:32 +00:00
|
|
|
$table->integer("votes")->nullable();
|
2021-03-03 13:04:46 +00:00
|
|
|
$table->foreignId("fkPassword")->constrained("password");
|
|
|
|
$table->foreignId("fkGameData")->nullable()->constrained("game_data");
|
|
|
|
$table->timestamps();
|
2021-03-04 08:19:13 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
Syntex to create table in database
|
|
|
|
|
|
|
|
$table->string("texts");
|
|
|
|
|
|
|
|
$table => valuable;
|
|
|
|
string => datatype;
|
|
|
|
("texts") => name for the row in the database;
|
|
|
|
nullable => is allowed to not have a value in the database;
|
|
|
|
foreignId => foreignId key row name in the database;
|
|
|
|
constrained => targeted table name;
|
|
|
|
*/
|