We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents db4a86d + 8ea669b commit c285216Copy full SHA for c285216
database/migrations/2022_05_15_030940_control_score_to_int.php
@@ -13,9 +13,17 @@ class ControlScoreToInt extends Migration
13
*/
14
public function up()
15
{
16
- Schema::table('controls', function (Blueprint $table) {
17
- $table->integer('score')->nullable()->change();
18
- });
+ if (DB::getDriverName() !== 'pgsql') {
+ DB::statement('ALTER TABLE "controls"
+ ALTER COLUMN "score" TYPE integer USING (score)::integer,
19
+ ALTER COLUMN "score" DROP NOT NULL,
20
+ ALTER COLUMN "score" DROP DEFAULT,
21
+ ALTER COLUMN "score" DROP identity IF EXISTS);'
22
+ } else {
23
+ Schema::table('controls', function (Blueprint $table) {
24
+ $table->integer('score')->nullable()->change();
25
+ });
26
+ }
27
}
28
29
/**
0 commit comments