1

I have added this migration to add fields to my admission table. The problem is that it creates some fields in postgres with double quotes.
Bellow are two fields from the same migration. One was created with quotes and the other without.

Why does this happen? I thought it might be todo with the data type, but I have other integer fields that where created with quotes aswell.

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class addReferralFields extends Migration
{
    public function up()
    {
        Schema::table('admission', function (Blueprint $table) {
            if (!Schema::hasColumn('admission', 'appointmentDate')) $table->timestampTz('appointmentDate')->nullable();
            if (!Schema::hasColumn('admission', 'appointment_pre_employment_status')) $table->integer('appointment_pre_employment_status')->nullable();



        });
    }
}

ADMISSION TABLE

  "apointmentDate" timestamp(0) with time zone,
  appointment_pre_employment_status integer,
morne
  • 4,035
  • 9
  • 50
  • 96

1 Answers1

0

All I did was run another migration to set all fields names to lowercase.

public function up()
{
    Schema::table('admission', function(Blueprint $table) {

        $table->renameColumn('"apointmentDate"', 'apointmentdate');

    });
}
morne
  • 4,035
  • 9
  • 50
  • 96