Documentation
Book
API
Videos
Reporting Security Issues
Privacy Policy
Logos & Trademarks
Business Solutions
Swag
Road Trip
Team
Community
Community
Get Involved
Issues (Github)
Bakery
Featured Resources
Training
Meetups
My CakePHP
CakeFest
Newsletter
Linkedin
YouTube
Facebook
Twitter
Mastodon
Help & Support
Forum
Stack Overflow
Slack
Paid Support
B
CakePHP Migrations 4.x
Book
A
Language:
en
fr
ja
pt
ru
Version:
4.x
2.x
3.x
4.x
Nav
Table of Contents
×
Improve This Doc
CakePHP Migrations
Migrations
Installation
Overview
Creating Migrations
Generating migration snapshots from an existing database
Generating a diff
Applying Migrations
Reverting Migrations
View Migrations Status
Marking a migration as migrated
Seeding your database
Generating a dump file
Using Migrations for Tests
Using Migrations In Plugins
Running Migrations in a non-shell environment
Feature Flags
Skipping the
schema.lock
file generation
Deployment
Alert of missing migrations
IDE autocomplete support
Writing Migrations
Creating a New Migration
The Change Method
The Up Method
The Down Method
The Init Method
The Should Execute Method
Working With Tables
Adding Columns
Checking Columns
Using the Query Builder
Selecting Fields
Where Conditions
Aggregates and SQL Functions
Getting Results out of a Query
Creating an Insert Query
Creating an update Query
Creating a Delete Query
Executing Queries
Fetching Rows
Inserting Data
Database Seeding
Creating a New Seed Class
The BaseSeed Class
The Run Method
The Init Method
The Should Execute Method
Foreign Key Dependencies
Calling a Seed from another Seed
Inserting Data
Truncating Tables
Executing Seed Classes
Upgrading to the builtin backend
What is the same?
What is different?
Problems with the new backend?
Migrations
→