Skip to content

Commit d7582ae

Browse files
authored
Added migration to move duration from varchar to decimal (#187)
* Added migration to move duration from varchar to decimal * Added doctrine dbal requirement * Updated from double to decimal
1 parent 6dea11f commit d7582ae

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

composer.json

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
],
1818
"require": {
1919
"php": ">=7.1",
20+
"doctrine/dbal": "^2.9",
2021
"illuminate/bus": "~5.8.0",
2122
"illuminate/console": "~5.8.0",
2223
"illuminate/contracts": "~5.8.0",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?php
2+
3+
use Illuminate\Support\Facades\Schema;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Studio\Totem\Database\TotemMigration;
6+
7+
class UpdateTaskResultsDurationType extends TotemMigration
8+
{
9+
/**
10+
* Run the migrations.
11+
*
12+
* @return void
13+
*/
14+
public function up()
15+
{
16+
Schema::connection(TOTEM_DATABASE_CONNECTION)
17+
->table(TOTEM_TABLE_PREFIX.'task_results', function (Blueprint $table) {
18+
$table->decimal('duration', 24, 14)->change();
19+
});
20+
}
21+
22+
/**
23+
* Reverse the migrations.
24+
*
25+
* @return void
26+
*/
27+
public function down()
28+
{
29+
Schema::connection(TOTEM_DATABASE_CONNECTION)
30+
->table(TOTEM_TABLE_PREFIX.'task_results', function (Blueprint $table) {
31+
$table->string('duration', 255)->change();
32+
});
33+
}
34+
}

0 commit comments

Comments
 (0)