Skip to content

Commit 9a1dd48

Browse files
agrossOnatcer
authored andcommitted
Extend description to 5000 chars, closes #914
1 parent 1e985b7 commit 9a1dd48

File tree

8 files changed

+37
-7
lines changed

8 files changed

+37
-7
lines changed

app/Http/Requests/V1/TimeEntry/TimeEntryStoreRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public function rules(): array
7979
'description' => [
8080
'nullable',
8181
'string',
82-
'max:500',
82+
'max:5000',
8383
],
8484
// List of tag IDs
8585
'tags' => [

app/Http/Requests/V1/TimeEntry/TimeEntryUpdateMultipleRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public function rules(): array
7979
'changes.description' => [
8080
'nullable',
8181
'string',
82-
'max:500',
82+
'max:5000',
8383
],
8484
// List of tag IDs
8585
'changes.tags' => [

app/Http/Requests/V1/TimeEntry/TimeEntryUpdateRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public function rules(): array
7777
'description' => [
7878
'nullable',
7979
'string',
80-
'max:500',
80+
'max:5000',
8181
],
8282
// List of tag IDs
8383
'tags' => [

app/Service/Import/Importers/ClockifyTimeEntriesImporter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public function importData(string $data, string $timezone): void
112112
$timeEntry->project_id = $projectId;
113113
$timeEntry->client_id = $clientId;
114114
$timeEntry->organization_id = $this->organization->id;
115-
if (strlen($record['Description']) > 500) {
115+
if (strlen($record['Description']) > 5000) {
116116
throw new ImportException('Time entry description is too long');
117117
}
118118
$timeEntry->description = $record['Description'];

app/Service/Import/Importers/HarvestTimeEntriesImporter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public function importData(string $data, string $timezone): void
107107
$timeEntry->project_id = $projectId;
108108
$timeEntry->client_id = $clientId;
109109
$timeEntry->organization_id = $this->organization->id;
110-
if (strlen($record['Notes']) > 500) {
110+
if (strlen($record['Notes']) > 5000) {
111111
throw new ImportException('Time entry note is too long');
112112
}
113113
$timeEntry->description = $record['Notes'];

app/Service/Import/Importers/SolidtimeImporter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ public function importData(string $data, string $timezone): void
247247
$timeEntry->project_id = $projectId;
248248
$timeEntry->client_id = $clientId;
249249
$timeEntry->organization_id = $this->organization->id;
250-
if (strlen($timeEntryRow['description']) > 500) {
250+
if (strlen($timeEntryRow['description']) > 5000) {
251251
throw new ImportException('Time entry description is too long');
252252
}
253253
$timeEntry->description = $timeEntryRow['description'];
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Illuminate\Database\Migrations\Migration;
6+
use Illuminate\Database\Schema\Blueprint;
7+
use Illuminate\Support\Facades\Schema;
8+
9+
return new class extends Migration
10+
{
11+
/**
12+
* Run the migrations.
13+
*/
14+
public function up(): void
15+
{
16+
Schema::table('time_entries', function (Blueprint $table): void {
17+
$table->string('description', 5000)->change();
18+
});
19+
}
20+
21+
/**
22+
* Reverse the migrations.
23+
*/
24+
public function down(): void
25+
{
26+
Schema::table('time_entries', function (Blueprint $table): void {
27+
$table->string('description', 500)->change();
28+
});
29+
}
30+
};

database/schema/pgsql_test-schema.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ CREATE TABLE public.tasks (
435435

436436
CREATE TABLE public.time_entries (
437437
id uuid NOT NULL,
438-
description character varying(500) NOT NULL,
438+
description character varying(5000) NOT NULL,
439439
start timestamp(0) without time zone NOT NULL,
440440
"end" timestamp(0) without time zone,
441441
billable_rate integer,

0 commit comments

Comments
 (0)