The Craft 6 beta is out. Learn what's new and how Craft 6 works on Laravel. Explore Craft 6

Creating a Single Migration File with Multiple Steps

We combine all of the steps in previous videos into one self-contained migration file.

In a com­bined migra­tion file, the safeUp method would look like this:

    public function safeUp()
    {
        return($this->_addFormSection() &&
            $this->_addFormGroup() &&
            $this->_addFormFields() &&
            $this->_addFieldLayout()
        );
    }

The return state­ment would call the dif­fer­ent pri­vate meth­ods and run the code to do a part of the over­all migration.

Transcript

Premium

Follow along with the full transcript

Search every word, click any line to jump to that moment, and read along as you watch. A CraftQuest Premium feature.

Sign up for Premium
Instructor
Level
Intermediate
Date published
November 23, 2021