DATABASE MIGRATIONS

ColdBox offers a comprehensive database migration module that allows developers to easily manage changes to their database schema.

install commandbox-migrations
migrate init
migrate create create_users_table
migrate up

The migration modules supports a wide range of database systems and provides an intuitive API that makes it easy to create, track, and apply database migrations with source control. With its powerful features and flexible architecture, ColdBox's database migration system is an essential tool for any developer working with databases.

// 2024_01_01_122835_create_users_table.cfc
component {

    function up() {
        schema.create( "users", function( table ) {
        table.increments( "id" );
        table.string( "username" ).unique();
        table.string( "email" ).unique();
        table.string( "password" );
        table.timestamp( "createdDate" );
        table.timestamp( "updatedDate" );
      } );
    }
  
}

Read more about database migrations in ColdBox in our documentation.