0

If the enums are modified in the enums.php file, how would I change the migration?

I have my migration file like the following-

    public function up()
    {
        Schema::create('increase_pond_height', function (Blueprint $table) {
            $table->increments('id');
            $table->float('height', 8, 2);
            $table->enum('purpose', Config::get('enums.increase_pond_height_purposes'));
            $table->string('comments', 500)->nullable();
            $table->timestamps();
        });
    }

I have the enum.php in Config like the following-

<?php

return [
    'increase_pond_height_purposes' => ['innoculum', 'harvest', 'media_addition']
];

1 Answer 1

1

Short answer : you can't

Each time you edit your enum.php config file Manually you must add a new migration to alter your increase_pond_height table

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.