Created
April 25, 2017 13:27
-
-
Save lucassmacedo/e6528571a356eeaa358dc07c8e97d19c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Schema::create('person_types', function (Blueprint $table) { | |
$table->increments('id'); | |
$table->string('name'); | |
$table->string('slug')->nullable(); | |
$table->timestamps(); | |
}); | |
ex: Figurinista, Diretor, Ator, etc | |
Schema::create('people', function (Blueprint $table) { | |
$table->increments('id'); | |
$table->string('name'); | |
$table->string('slug')->nullable(); | |
$table->string('site')->nullable(); | |
$table->date('birth')->nullable(); | |
$table->enum('sex', ['Masculino', 'Feminino']); | |
$table->timestamps(); | |
}); | |
Schema::create('person_person_type', function($table) | |
{ | |
$table->integer('person_id')->unsigned(); | |
$table->foreign('person_id')->references('id')->on('people'); | |
$table->integer('person_type_id')->unsigned(); | |
$table->foreign('person_type_id')->references('id')->on('person_types'); | |
$table->timestamps(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment