2021-03-03 10:01:32 +00:00
|
|
|
<?php
|
2021-03-04 08:19:13 +00:00
|
|
|
//require bootstrap aka our database connection
|
2021-03-19 12:51:25 +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 password table with the rows as id, password, rememberToken and timestamps
|
2021-03-04 12:13:07 +00:00
|
|
|
Capsule::schema()->create("passwords", function (Blueprint $table){
|
2021-03-03 10:01:32 +00:00
|
|
|
$table->id();
|
2021-03-05 10:23:10 +00:00
|
|
|
$table->foreignId("group_id")->constrained("groups");
|
2021-03-03 10:01:32 +00:00
|
|
|
$table->string('password');
|
|
|
|
$table->rememberToken();
|
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
|
|
|
|
*/
|