Merge remote-tracking branch 'origin/master'

This commit is contained in:
Anders
2020-08-06 14:47:28 +02:00
46 changed files with 961 additions and 144 deletions
@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateLocationsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('locations', function (Blueprint $table) {
$table->id();
$table->string("name")->unique();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('locations');
}
}
@@ -17,8 +17,11 @@ class CreateWashingMachines extends Migration
{
Schema::create('washing_machines', function (Blueprint $table) {
$table->id();
$table->string("name")->unique();
$table->string("name");
$table->foreignId("location_id")->constrained("locations", "id");
$table->timestamps();
$table->unique(['name', 'location_id']);
});
}
@@ -0,0 +1,33 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateNewsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('news', function (Blueprint $table) {
$table->id();
$table->string("name");
$table->text("content");
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('news');
}
}