Introduction

Before knowing exactly how to code things to make them work, a conceptual introduction is necessary before using any type of addon. That being said, understanding at a broad level how Migration Core works is important before considering how to specifically code it's functions.

What is Migration Core?

Migration Core, as said above is an FW Addon, whose goal is to integrate Phinx more easily and consistently into all our apps. Any time the database needs to be changed, you are using Migration Core.

How does it work, conceptually?

Migration Core heavily incorporates Phinx, which is an open-source software designed to write database migrations in PHP so that they don't need to be written in Raw SQL. The only things that are added by Migration Core to this are the integration with the FW Installer, and the ability to add data to Group Control for Group Control dependent apps. We will discuss both the Migration Core specific things as well as how to write a simple Phinx Migration.

Parts of this documentation

The main part of this documentation is How to Write a Database Migration, which explains everything you should need to know about writing a database migration. There are a couple of extra documents, which are linked within the Writing Migrations Guide, but they should be discussed here:

  • FW Database API Docs - This is the API docs for the FW Installer command fw database, which is added by Migration Core.
  • Group Control Migration - This discusses the added commands by the GroupControlMigration classes which add the ability to add data to gc_app and gc_role.