Yii 2.0 Part 15 - Database Migrations
Channel: Luke Briner
Date: 2015-09-30

This brief video talks about how to use database migrations - storing your database changes in files so that they can be applied in order to a database, they can synchronize developers and help deploy to production sites without lots of manual work or manually running SQL directly on databases.

The reason my demo of $this-primaryKey didn't work is that the demo project is running on an older version of Yii2. Run "composer update" in the root of the project and it should give you a newer version with helpful shortcuts to use in migrations like:

:code examples not allowed:

etc. See http://www.yiiframework.com/doc-2.0/yii-db-schemabuildertrait.html for details

No new code was added but the demo project is here: https://github.com/lukos/yii2-tutorial