Commit a8329ca0 authored by psl4's avatar psl4
Browse files

Added migrations

parent 3fc00f66
Pipeline #2377 failed with stages
in 52 seconds
......@@ -9,9 +9,9 @@ LOG_CHANNEL=stack
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel
DB_DATABASE=unwto
DB_USERNAME=root
DB_PASSWORD=
DB_PASSWORD=root
BROADCAST_DRIVER=log
CACHE_DRIVER=file
......
This diff is collapsed.
......@@ -5,7 +5,7 @@ namespace PHPSTORM_META {
/**
* PhpStorm Meta file, to provide autocomplete information for PhpStorm
* Generated on 2020-05-02 14:10:52.
* Generated on 2020-05-03 06:00:45.
*
* @author Barry vd. Heuvel <barryvdh@gmail.com>
* @see https://github.com/barryvdh/laravel-ide-helper
......
......@@ -3,7 +3,7 @@
 
/**
* A helper file for Laravel, to provide autocomplete information to your IDE
* Generated for Laravel 7.9.2 on 2020-05-02 14:10:47.
* Generated for Laravel 7.9.2 on 2020-05-03 06:00:41.
*
* This file should not be included in your code, only analyzed by your IDE!
*
......
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Article extends Model
{
protected $table = 'articles';
protected $primaryKey = 'articleId';
protected $fillable = ['Header', 'Text', 'Description'];
public $timestamps = false;
public function links()
{
return $this->belongsToMany(Link::class);
}
public function pictures()
{
return $this->belongsToMany(Picture::class);
}
}
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Article_Has_Link extends Model
{
protected $table = 'atricle_has_link';
protected $fillable = ['Article_idArticle', 'Link_idLink'];
public $timestamps = false;
}
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Article_Has_Picture extends Model
{
protected $table = 'atricle_has_picture';
protected $fillable = ['Article_idArticle', 'Picture_idPicture'];
public $timestamps = false;
}
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class File extends Model
{
protected $table = 'files';
protected $primaryKey = 'idFile';
protected $fillable = ['FilePath'];
public $timestamps = false;
public function pages()
{
return $this->belongsToMany(File::class);
}
}
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Link extends Model
{
protected $table = 'links';
protected $primaryKey = 'idLink';
protected $fillable = ['LinkLocation'];
public $timestamps = false;
public function articles()
{
return $this->belongsToMany(Article::class);
}
}
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Page extends Model
{
protected $table = 'pages';
protected $primaryKey = 'idPage';
protected $fillable = ['PageLocation', 'Article_idArticle'];
public $timestamps = false;
public function articles()
{
return $this->belongsTo(Article::class);
}
public function files()
{
return $this->belongsToMany(File::class);
}
}
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Page_Has_File extends Model
{
protected $table = 'page_has_file';
protected $fillable = ['Page_idPage', 'File_idFile'];
public $timestamps = false;
}
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Picture extends Model
{
protected $table = 'pictures';
protected $primaryKey = 'idPicture';
protected $fillable = ['PictureLocation'];
public $timestamps = false;
public function articles()
{
return $this->belongsToMany(Article::class);
}
}
......@@ -9,7 +9,9 @@
"license": "MIT",
"require": {
"php": "^7.2.5",
"ext-openssl": "^7.2",
"fideloper/proxy": "^4.2",
"filp/whoops": "^2.7",
"fruitcake/laravel-cors": "^1.0",
"guzzlehttp/guzzle": "^6.3",
"laravel/framework": "^7.0",
......
......@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "ec760087767fa879077e6cbc48197cad",
"content-hash": "4adec018ea668595ca79e683cd573762",
"packages": [
{
"name": "asm89/stack-cors",
......@@ -438,6 +438,67 @@
],
"time": "2020-02-22T01:51:47+00:00"
},
{
"name": "filp/whoops",
"version": "2.7.1",
"source": {
"type": "git",
"url": "https://github.com/filp/whoops.git",
"reference": "fff6f1e4f36be0e0d0b84d66b413d9dcb0c49130"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/filp/whoops/zipball/fff6f1e4f36be0e0d0b84d66b413d9dcb0c49130",
"reference": "fff6f1e4f36be0e0d0b84d66b413d9dcb0c49130",
"shasum": ""
},
"require": {
"php": "^5.5.9 || ^7.0",
"psr/log": "^1.0.1"
},
"require-dev": {
"mockery/mockery": "^0.9 || ^1.0",
"phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0",
"symfony/var-dumper": "^2.6 || ^3.0 || ^4.0 || ^5.0"
},
"suggest": {
"symfony/var-dumper": "Pretty print complex values better with var-dumper available",
"whoops/soap": "Formats errors as SOAP responses"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.6-dev"
}
},
"autoload": {
"psr-4": {
"Whoops\\": "src/Whoops/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Filipe Dobreira",
"homepage": "https://github.com/filp",
"role": "Developer"
}
],
"description": "php error handling for cool kids",
"homepage": "https://filp.github.io/whoops/",
"keywords": [
"error",
"exception",
"handling",
"library",
"throwable",
"whoops"
],
"time": "2020-01-15T10:00:00+00:00"
},
{
"name": "fruitcake/laravel-cors",
"version": "v1.0.6",
......@@ -3621,20 +3682,20 @@
},
{
"name": "vlucas/phpdotenv",
"version": "v4.1.4",
"version": "v4.1.5",
"source": {
"type": "git",
"url": "https://github.com/vlucas/phpdotenv.git",
"reference": "feb6dad5ae24b1380827aee1629b730080fde500"
"reference": "539bb6927c101a5605d31d11a2d17185a2ce2bf1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/feb6dad5ae24b1380827aee1629b730080fde500",
"reference": "feb6dad5ae24b1380827aee1629b730080fde500",
"url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/539bb6927c101a5605d31d11a2d17185a2ce2bf1",
"reference": "539bb6927c101a5605d31d11a2d17185a2ce2bf1",
"shasum": ""
},
"require": {
"php": "^5.5.9 || ^7.0",
"php": "^5.5.9 || ^7.0 || ^8.0",
"phpoption/phpoption": "^1.7.2",
"symfony/polyfill-ctype": "^1.9"
},
......@@ -3691,7 +3752,7 @@
"type": "tidelift"
}
],
"time": "2020-04-12T15:20:09+00:00"
"time": "2020-05-02T14:08:57+00:00"
},
{
"name": "voku/portable-ascii",
......@@ -4786,67 +4847,6 @@
],
"time": "2019-08-30T14:06:08+00:00"
},
{
"name": "filp/whoops",
"version": "2.7.1",
"source": {
"type": "git",
"url": "https://github.com/filp/whoops.git",
"reference": "fff6f1e4f36be0e0d0b84d66b413d9dcb0c49130"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/filp/whoops/zipball/fff6f1e4f36be0e0d0b84d66b413d9dcb0c49130",
"reference": "fff6f1e4f36be0e0d0b84d66b413d9dcb0c49130",
"shasum": ""
},
"require": {
"php": "^5.5.9 || ^7.0",
"psr/log": "^1.0.1"
},
"require-dev": {
"mockery/mockery": "^0.9 || ^1.0",
"phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0",
"symfony/var-dumper": "^2.6 || ^3.0 || ^4.0 || ^5.0"
},
"suggest": {
"symfony/var-dumper": "Pretty print complex values better with var-dumper available",
"whoops/soap": "Formats errors as SOAP responses"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.6-dev"
}
},
"autoload": {
"psr-4": {
"Whoops\\": "src/Whoops/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Filipe Dobreira",
"homepage": "https://github.com/filp",
"role": "Developer"
}
],
"description": "php error handling for cool kids",
"homepage": "https://filp.github.io/whoops/",
"keywords": [
"error",
"exception",
"handling",
"library",
"throwable",
"whoops"
],
"time": "2020-01-15T10:00:00+00:00"
},
{
"name": "fzaninotto/faker",
"version": "v1.9.1",
......@@ -6949,7 +6949,8 @@
"prefer-stable": true,
"prefer-lowest": false,
"platform": {
"php": "^7.2.5"
"php": "^7.2.5",
"ext-openssl": "^7.2"
},
"platform-dev": [],
"plugin-api-version": "1.1.0"
......
File added
<?php
/** @var \Illuminate\Database\Eloquent\Factory $factory */
use App\User;
use Faker\Generator as Faker;
use Illuminate\Support\Str;
/*
|--------------------------------------------------------------------------
| Model Factories
|--------------------------------------------------------------------------
|
| This directory should contain each of the model factory definitions for
| your application. Factories provide a convenient way to generate new
| model instances for testing / seeding your application's database.
|
*/
$factory->define(\App\Article::class, function (Faker $faker) {
return [
'Header' => Str::random(500),
'Text' => Str::random(1000),
'Description' => Str::random(255),
];
});
<?php
/** @var \Illuminate\Database\Eloquent\Factory $factory */
use App\User;
use Faker\Generator as Faker;
use Illuminate\Support\Str;
/*
|--------------------------------------------------------------------------
| Model Factories
|--------------------------------------------------------------------------
|
| This directory should contain each of the model factory definitions for
| your application. Factories provide a convenient way to generate new
| model instances for testing / seeding your application's database.
|
*/
$factory->define(\App\Article_Has_Link::class, function (Faker $faker) {
return [
'Article_idArticle' => rand(1, 50),
'Link_idLink' => rand(1, 50),
];
});
<?php
/** @var \Illuminate\Database\Eloquent\Factory $factory */
use App\User;
use Faker\Generator as Faker;
use Illuminate\Support\Str;
/*
|--------------------------------------------------------------------------
| Model Factories
|--------------------------------------------------------------------------
|
| This directory should contain each of the model factory definitions for
| your application. Factories provide a convenient way to generate new
| model instances for testing / seeding your application's database.
|
*/
$factory->define(\App\Article_Has_Picture::class, function (Faker $faker) {
return [
'Article_idArticle' => rand(1, 50),
'Picture_idPicture' => rand(1, 50),
];
});
<?php
/** @var \Illuminate\Database\Eloquent\Factory $factory */
use App\User;
use Faker\Generator as Faker;
use Illuminate\Support\Str;
/*
|--------------------------------------------------------------------------
| Model Factories
|--------------------------------------------------------------------------
|
| This directory should contain each of the model factory definitions for
| your application. Factories provide a convenient way to generate new
| model instances for testing / seeding your application's database.
|
*/
$factory->define(\App\File::class, function (Faker $faker) {
return [
'FilePath' => Str::random(500),
];
});
<?php
/** @var \Illuminate\Database\Eloquent\Factory $factory */
use App\User;
use Faker\Generator as Faker;
use Illuminate\Support\Str;
/*
|--------------------------------------------------------------------------
| Model Factories
|--------------------------------------------------------------------------
|
| This directory should contain each of the model factory definitions for
| your application. Factories provide a convenient way to generate new
| model instances for testing / seeding your application's database.
|
*/
$factory->define(\App\Link::class, function (Faker $faker) {
return [
'LinkLocation' => Str::random(500),
];
});
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment