Game-Jaming/Backend/Database/KeyWord.php

27 lines
750 B
PHP

<?php
//require bootstrap aka our database connection
require_once "../../bootstrap.php";
use Illuminate\Database\Capsule\Manager as Capsule;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
//Create key_words table with the rows as id, keyWord, fkGroup and timestamp
Capsule::schema()->create("key_words", function (Blueprint $table){
$table->id();
$table->string('keyWord');
$table->foreignId("group_id")->constrained("groups");
$table->timestamps();
});
/*
Syntex to create table in database
$table->string("texts");
$table => valuable;
string => datatype;
("texts") => name for the row in the database
foreignId => foreignId key row name in the database;
constrained => targeted table name;
*/