Game-Jaming/Backend/Database/GameData.php

28 lines
796 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 game_data table with the rows as id, gameLink, isWebBased and timestamp
Capsule::schema()->create("game_data", function (Blueprint $table) {
$table->id();
$table->string('game_name');
$table->string("game_link");
$table->boolean("is_web_based");
$table->text("description")->nullable();
$table->string("img")->nullable();
$table->timestamps();
});
/*
Syntex to create table in database
$table->string("texts");
$table => valuable;
string => datatype;
("texts") => name for the row in the database;
*/