Skip to content

Commit

Permalink
[TM-1620] add cohort field in v2 project table (#644)
Browse files Browse the repository at this point in the history
  • Loading branch information
cesarLima1 authored Jan 13, 2025
1 parent 3470f11 commit d38b053
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/Http/Resources/V2/Projects/ProjectResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public function toArray($request)
'update_request_status' => $this->update_request_status,
'readable_update_request_status' => $this->readable_update_request_status,
'framework_key' => $this->framework_key,
'cohort' => $this->cohort,
'framework_uuid' => $this->framework_uuid,
'organisation_id' => $this->organisation_id,
'boundary_geojson' => $this->boundary_geojson,
Expand Down
1 change: 1 addition & 0 deletions app/Models/V2/Projects/Project.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ class Project extends Model implements MediaModel, AuditableContract, EntityMode
'goal_trees_restored_direct_seeding',
'landscape',
'direct_seeding_survival_rate',
'cohort',
];

public $fileConfiguration = [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

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('v2_projects', function (Blueprint $table) {
$table->string('cohort')->nullable()->after('framework_key');
});
}

/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('v2_projects', function (Blueprint $table) {
$table->dropColumn('cohort');
});
}
};

0 comments on commit d38b053

Please sign in to comment.