added Arbeitszeit-Model

This commit is contained in:
chrosey 2017-06-10 14:31:20 +02:00
parent db293af560
commit 759e71b353
3 changed files with 50 additions and 1 deletions

10
app/Arbeitszeit.php Normal file
View File

@ -0,0 +1,10 @@
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Arbeitszeit extends Model
{
protected $table = "arbeitszeiten";
}

View File

@ -2,6 +2,7 @@
namespace App\Providers;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
@ -13,7 +14,7 @@ class AppServiceProvider extends ServiceProvider
*/
public function boot()
{
//
Schema::defaultStringLength(191);
}
/**

View File

@ -0,0 +1,38 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateArbeitszeitsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('arbeitszeiten', function (Blueprint $table) {
$table->increments('id');
$table->timestamps();
$table->dateTime("beginn");
$table->datetime("ende");
$table->integer('benutzer_id')->unsigned();
$table->foreign('benutzer_id')->references('id')->on('benutzer')->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('arbeitszeiten');
}
}