Use decimal on metric points
This commit is contained in:
@@ -16,7 +16,7 @@ class CreateMetricPointsTable extends Migration
|
|||||||
Schema::create('metric_points', function (Blueprint $table) {
|
Schema::create('metric_points', function (Blueprint $table) {
|
||||||
$table->increments('id');
|
$table->increments('id');
|
||||||
$table->integer('metric_id');
|
$table->integer('metric_id');
|
||||||
$table->integer('value');
|
$table->decimal('value', 10, 3);
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
|
|
||||||
$table->index('metric_id');
|
$table->index('metric_id');
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ class CreateMetricsTable extends Migration
|
|||||||
$table->string('name');
|
$table->string('name');
|
||||||
$table->string('suffix');
|
$table->string('suffix');
|
||||||
$table->text('description');
|
$table->text('description');
|
||||||
$table->integer('default_value');
|
$table->decimal('default_value', 10, 3);
|
||||||
$table->boolean('display_chart')->default(1);
|
$table->boolean('display_chart')->default(1);
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ class Metric extends Model implements TransformableInterface
|
|||||||
'name' => 'required',
|
'name' => 'required',
|
||||||
'suffix' => 'required',
|
'suffix' => 'required',
|
||||||
'display_chart' => 'boolean',
|
'display_chart' => 'boolean',
|
||||||
'default_value' => 'integer|required',
|
'default_value' => 'numeric|required',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ class MetricPoint extends Model
|
|||||||
* @var string[]
|
* @var string[]
|
||||||
*/
|
*/
|
||||||
protected $rules = [
|
protected $rules = [
|
||||||
'value' => 'integer|required',
|
'value' => 'numeric|required',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user