Answer the question
In order to leave comments, you need to log in
How to specify the default field value in Laravel migration, but write another one for existing values?
Good afternoon. We need to add a field to the table. Is it possible to somehow specify in the migration that the default value is false, but so that already existing records are set to true ?
Answer the question
In order to leave comments, you need to log in
Just right in the migration after creating the column with a separate query, update the value in the existing records.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question