Creating content migrations in Craft CMS | nystudio107

A useful primer on how to use migration files in Craft.

Migra­tions are PHP files that con­tain code which alters the data­base from one state to anoth­er.

The core commands are as follows.

Run any waiting migrations, specifically the safeUp() functions:

php craft up

Rerun the last migration (undoes the previous migration and runs the file(s) again, so any changes are automatically applied):

php craft migrate/redo --interactive=0

Revert the previous migration (runs the safeDown() function):

php craft migrate/down --interactive=0

Explore Other Notes

Newer

Look mum, no breakpoints!

An excellent overview of how to approach fluid design on the web. Lots of excellent references and techniques, particularly those around using Flex layout with flex-basis to control widths, or […]

Older

A loveletter to a tiny TV

Eric introduces the Tiny TV 2, an adorable piece of faux-retro tech that lets you load videos onto a tiny, replica cathode ray TV (which is obviously using an LED panel, digital files, and visual […]
  • A useful primer on how to use migration files in […]
  • Murray Adcock.
Journal permalink