Skip to content

Commit

Permalink
chore: drop areas column from organisations table (#130)
Browse files Browse the repository at this point in the history
  • Loading branch information
andreiio authored Nov 24, 2023
1 parent e415f43 commit cf89e2b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
3 changes: 0 additions & 3 deletions app/Models/Organisation.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
use App\Models\Organisation\RiskCategory;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Casts\AsCollection;
use Illuminate\Database\Eloquent\Casts\AsEnumCollection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
Expand Down Expand Up @@ -67,12 +66,10 @@ public function registerMediaConversions(Media $media = null): void
'type_of_area',
'has_branches',
'social_services_accreditation',
'areas',
'area',
];

protected $casts = [
'areas' => AsEnumCollection::class . ':' . OrganisationAreaType::class,
'area' => OrganisationAreaType::class,
'type' => OrganisationType::class,
'ngo_type' => NGOType::class,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

declare(strict_types=1);

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('organisations', function (Blueprint $table) {
$table->dropColumn('areas');
});
}
};

0 comments on commit cf89e2b

Please sign in to comment.