Skip to content

Default values for boolean and integer come out as strings in migrations, #440

@roni-estein

Description

@roni-estein
  • Laravel Version: 8.31.0
  • PHP Version: 7.4.14
  • Blueprint Version: dev-master
  • Platform: Mac | Windows | Linux

Issue:

default for boolean and integer come out as strings, should be numeric or boolean per docs.

draft.yaml:

models:
  AppointmentQuestions:
    appointment_type_id: id foreign
    question_type_id: id foreign
    order: integer default:1
    required: bool default:true
    placeholder: string nullable
    question: string
    hint: string nullable
  Schema::create('appointment_questions', function (Blueprint $table) {
            $table->id();
            $table->foreignId('appointment_type_id')->constrained()->cascadeOnDelete()->cascadeOnUpdate();
            $table->foreignId('question_type_id')->constrained()->cascadeOnDelete()->cascadeOnUpdate();
            $table->integer('order')->default('1');
            $table->string('required')->default('true');
            $table->string('placeholder')->nullable();
            $table->string('question');
            $table->string('hint')->nullable();
            $table->timestamps();
        });

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpendingThis issue is pending review

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions