diff --git a/app/MemberState.php b/app/MemberState.php new file mode 100644 index 0000000..14112b0 --- /dev/null +++ b/app/MemberState.php @@ -0,0 +1,10 @@ +increments('id'); + + // Ther person id the member dates belong to. + // IF the corresponding person is deleted, all the member dates are + // deleted, too. + $table->integer('person_id')->unsigned(); + $table->foreign('person_id')->references('id')->on('people') + ->onDelete('cascade'); + + // The date of joining + $table->date('joining_date'); + + // The date of leaving + $table->date('leaving_date')->nullable(); + + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('member_states'); + } +}