Added people migration.

This commit is contained in:
Lukas Halbritter
2018-09-03 11:15:44 +02:00
parent 8d09512669
commit 3fc303e815
2 changed files with 60 additions and 0 deletions
+10
View File
@@ -0,0 +1,10 @@
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Person extends Model
{
//
}
@@ -0,0 +1,50 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreatePeopleTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('people', function (Blueprint $table) {
$table->increments('id');
// Name
$table->enum('title', array('Herr', 'Frau', 'Firma'));
$table->string('name_or_company');
$table->string('surname')->nullable();
// Date of birth
$table->date('date_of_birth')->nullable();
// Adress
$table->string('city')->nullable();
$table->string('street')->nullable();
$table->string('postal_code')->nullable();
// Further contact information
$table->string('email')->nullable();
$table->string('mobile')->nullable();
$table->string('phone')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('people');
}
}