Game-Jaming/Backend/Database/KeyWord.php

28 lines
798 B
PHP
Raw Permalink Normal View History

2021-03-03 10:01:32 +00:00
<?php
2021-03-04 08:19:13 +00:00
//require bootstrap aka our database connection
2021-04-19 07:15:15 +00:00
require_once realpath(dirname(__FILE__) . "/../../bootstrap.php");
2021-03-03 10:01:32 +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 key_words table with the rows as id, keyWord, fkGroup and timestamp
2021-04-19 07:15:15 +00:00
Capsule::schema()->create("key_words", function (Blueprint $table) {
2021-03-03 10:01:32 +00:00
$table->id();
2021-03-08 12:01:01 +00:00
$table->string('key_word');
2021-05-05 06:39:27 +00:00
$table->foreignId("registration_id")->constrained("registrations");
2021-03-03 13:04:46 +00:00
$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
foreignId => foreignId key row name in the database;
constrained => targeted table name;
*/