diff --git a/database/migrations/2021_06_23_152229_create_company_modules_table.php b/database/migrations/2021_06_23_152229_create_company_modules_table.php new file mode 100644 index 00000000..ca7162d3 --- /dev/null +++ b/database/migrations/2021_06_23_152229_create_company_modules_table.php @@ -0,0 +1,37 @@ +id(); + $table->foreignId('company_id')->constrained(); + $table->integer('type')->default(CompanyType::COMPANY_BUSINESS); + $table->integer('status')->default(ApprovalStatus::PENDING_SUBMISSION); + $table->softDeletes(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('company_modules'); + } +} diff --git a/database/migrations/2021_06_23_152429_create_company_employees_table.php b/database/migrations/2021_06_23_152429_create_company_employees_table.php new file mode 100644 index 00000000..00ace570 --- /dev/null +++ b/database/migrations/2021_06_23_152429_create_company_employees_table.php @@ -0,0 +1,37 @@ +id(); + $table->foreignId('company_module_id')->constrained(); + $table->foreignId('user_id')->constrained(); + $table->foreignId('role_id')->unsigned(); + $table->integer('status')->default(ApprovalStatus::APPROVED); + $table->softDeletes(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('company_employees'); + } +} diff --git a/database/migrations/2021_06_25_014832_create_company_connections_table.php b/database/migrations/2021_06_25_014832_create_company_connections_table.php new file mode 100644 index 00000000..c1aee36b --- /dev/null +++ b/database/migrations/2021_06_25_014832_create_company_connections_table.php @@ -0,0 +1,40 @@ +id(); + $table->foreignId('inviter_id')->unsigned(); + $table->foreignId('invitee_id')->unsigned(); + $table->string('inviter_reference'); + $table->string('invitee_reference'); + $table->integer('status'); + $table->softDeletes(); + $table->timestamps(); + + $table->foreign('inviter_id')->references('id')->on('company_modules'); + $table->foreign('invitee_id')->references('id')->on('company_modules'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('company_connections'); + } +} diff --git a/database/migrations/2021_06_25_014835_create_connection_segments_table.php b/database/migrations/2021_06_25_014835_create_connection_segments_table.php new file mode 100644 index 00000000..33da1304 --- /dev/null +++ b/database/migrations/2021_06_25_014835_create_connection_segments_table.php @@ -0,0 +1,32 @@ +id(); + $table->foreignId('company_connection_id')->constrained(); + $table->foreignId('segment_id')->constrained(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('connection_segments'); + } +}