Currently Mighty only supports the MySQL/MariaDB databases, as such the migrations are quite straightforward and although the Schematic's approach is being developed and part of the future pipeline, the current best practice is still raw.

In order to generate a new migration file:

php mighty make:migration MigrationNameHere

The above console command will scaffold a basic migration file under Database/Migrations.

Raw Query Approach

This is the easiest and still the best way to run your migrations with Mighty. Simply write your migration SQL script into the return array of the up or down method.

use \MightyCore\Database\Schema;
use \MightyCore\Database\Schematic;
class _2020_12_07_082601_AddUserTable{
public $timestamp=1607329561;
public $connection="default";
public function up(){
return [
CREATE TABLE `lm`.`user` (
`username` VARCHAR(45) NOT NULL,
`password` VARCHAR(45) NOT NULL,
PRIMARY KEY (`userId`));
public function down(){
return [
'DROP TABLE `lm`.`user`;'

Notice that the return for up and down are both in arrays. This is to ease the debugging process. You can choose to squeeze the entire SQL script into one index, or spread it all out. By spreading it down to different indexes, Mighty will run the query one at a time, which will stop and throw any relevant error if applicable.