Game-Jaming/Backend/Database/KeyWord.php

27 lines
781 B
PHP

<?php
//require bootstrap aka our database connection
require_once realpath(dirname(__FILE__) ."/../../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('key_word');
$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;
*/