diff --git a/database/migrations/2026_07_30_000000_change_weight_column_back_to_integer_in_topic_projects_table.php b/database/migrations/2026_07_30_000000_change_weight_column_back_to_integer_in_topic_projects_table.php new file mode 100644 index 0000000..d21d74f --- /dev/null +++ b/database/migrations/2026_07_30_000000_change_weight_column_back_to_integer_in_topic_projects_table.php @@ -0,0 +1,22 @@ +unsignedInteger('weight')->default(1)->change(); + }); + } + + public function down(): void + { + Schema::table('topic_projects', function (Blueprint $table) { + $table->decimal('weight', 5, 2)->default(1)->change(); + }); + } +} diff --git a/src/Models/Project.php b/src/Models/Project.php index 87693e2..6939856 100644 --- a/src/Models/Project.php +++ b/src/Models/Project.php @@ -73,7 +73,7 @@ class Project extends AbstractTopicContent protected $casts = [ 'notify_users' => 'array', 'counts_to_grade' => 'boolean', - 'weight' => 'float', + 'weight' => 'integer', 'max_score' => 'float', ]; @@ -95,7 +95,7 @@ public static function rules(): array 'value' => ['required', 'string'], 'notify_users' => ['array'], 'counts_to_grade' => ['boolean'], - 'weight' => ['numeric', 'min:0', 'max:100'], + 'weight' => ['integer', 'min:0', 'max:100'], 'max_score' => ['nullable', 'numeric', 'min:1'], ]; }