diff --git a/database/migrations/2021_06_25_000000_create_jobs_table.php b/database/migrations/2021_06_25_000000_create_jobs_table.php new file mode 100644 index 00000000..1be9e8a8 --- /dev/null +++ b/database/migrations/2021_06_25_000000_create_jobs_table.php @@ -0,0 +1,36 @@ +bigIncrements('id'); + $table->string('queue')->index(); + $table->longText('payload'); + $table->unsignedTinyInteger('attempts'); + $table->unsignedInteger('reserved_at')->nullable(); + $table->unsignedInteger('available_at'); + $table->unsignedInteger('created_at'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('jobs'); + } +} diff --git a/database/migrations/2021_06_25_014731_create_segments_table.php b/database/migrations/2021_06_25_014731_create_segments_table.php new file mode 100644 index 00000000..2d524073 --- /dev/null +++ b/database/migrations/2021_06_25_014731_create_segments_table.php @@ -0,0 +1,37 @@ +id(); + $table->string('name'); + $table->integer('type')->default(SegmentConstants::STANDARD_SEGMENT); + $table->integer('status')->default(ApprovalStatus::APPROVED); + $table->softDeletes(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('segments'); + } +} diff --git a/database/migrations/2021_06_25_014830_create_segment_constants_table.php b/database/migrations/2021_06_25_014830_create_segment_constants_table.php new file mode 100644 index 00000000..85b8dc5e --- /dev/null +++ b/database/migrations/2021_06_25_014830_create_segment_constants_table.php @@ -0,0 +1,38 @@ +id(); + $table->foreignId('segment_id')->unsigned(); + $table->string('name'); + $table->string('reference'); + $table->json('detail'); + $table->softDeletes(); + $table->timestamps(); + + $table->foreign('segment_id')->references('id')->on('segments'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('segment_constants'); + } +} diff --git a/database/migrations/2021_06_25_014905_create_segment_companies_table.php b/database/migrations/2021_06_25_014905_create_segment_companies_table.php new file mode 100644 index 00000000..aca7358f --- /dev/null +++ b/database/migrations/2021_06_25_014905_create_segment_companies_table.php @@ -0,0 +1,43 @@ +foreignId('segment_id')->unsigned(); + $table->foreignId('company_id')->unsigned(); + $table->softDeletes(); + $table->timestamps(); + + $table->primary(['segment_id', 'company_id']); + $table->foreign('segment_id')->references('id')->on('segments'); + $table->foreign('company_id')->references('id')->on('companies'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('segment_companies', function (Blueprint $table) { + + $table->dropForeign('segment_companies_segment_id_foreign'); + $table->dropForeign('segment_companies_company_id_foreign'); + }); + + Schema::dropIfExists('segment_companies'); + } +} diff --git a/database/migrations/2021_06_25_020358_create_currencies_table.php b/database/migrations/2021_06_25_020358_create_currencies_table.php new file mode 100644 index 00000000..b550c86b --- /dev/null +++ b/database/migrations/2021_06_25_020358_create_currencies_table.php @@ -0,0 +1,38 @@ +id(); + $table->foreignId('country_id')->unsigned(); + $table->string('name'); + $table->string('short_code'); + $table->string('symbol')->nullable(); + $table->softDeletes(); + $table->timestamps(); + + $table->foreign('country_id')->references('id')->on('countries'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('currencies'); + } +}