PHP code example of maxim-oleinik / blade-migrations-symfony

1. Go to this page and download the library: Download maxim-oleinik/blade-migrations-symfony library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

maxim-oleinik / blade-migrations-symfony example snippets


        cli.php
        -------
        #!/usr/bin/env php
        
            lication = new Application();
            
            // ... register commands
            $application->run();
    

        php cli.php migrate:install
    

    php cli.php migrate:make NAME

    php cli.php migrate:status

    +---+----+---------------------+------------------------+
    |   | ID | Date                | Name                   |
    +---+----+---------------------+------------------------+
    | Y | 6  | 28.08.2018 20:17:01 | 20180828_195348_M1.sql |
    | D | 7  | 28.08.2018 20:17:21 | 20180828_201639_M3.sql |
    | A |    |                     | 20180828_200950_M2.sql |
    +---+----+---------------------+------------------------+

    # Откатить последнюю Y-миграцию
    php cli.php migrate:rollback

    # Не спрашивать подтверждение
    php cli.php migrate:rollback -f

    # Откатить миграцию по ее номеру
    php cli.php migrate:rollback --id=N

    # Откатить миграцию, инструкции загрузить из файла, а не из БД (например, если в базу попала ошибка)
    php cli.php migrate:rollback --load-file