We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Ts based migration

Hello. pls, help. I'am trying to craete timestamp based migration. I execute following command:

    phalcon migration generate --table=my_table --log-in-db --ts-based

Migration folder was created and added one migration class, but not timebased:

  class MyTableMigration_100 extends Migration
  {
      /**
       * Define the table structure
       *
       * @return void
       */
      public function morph()
      {
          $this->morphTable('my_table', [
                  'columns' => [
                      ...
                  ],
          );
      }

      /**
       * Run the migrations
       *
       * @return void
       */
      public function up()
      {

      }

      /**
       * Reverse the migrations
       *
       * @return void
       */
      public function down()
      {

      }
  }

Then, I execute:

    phalcon migration run --log-in-db --ts-based

Got message:

  Phalcon DevTools (3.2.11)

  Migrations were not found at  /var/www/html/my_app_dir

If i execute:

    phalcon migration run --log-in-db

Then, I got:

    Success: Version 1.0.0 was successfully migrated

How can i create timestamp based migration?

OS: Linux

Versions: Phalcon DevTools Version: 3.2.11 Phalcon Version: 3.2.4 AdminLTE Version: 2.3.6

I found out that I need to add the --desc option. Is it normal?

phalcon migration generate --table=my_table --migrations=application/migrations --descr="some_description"

Looks like you need the description parameter when you use timestamp based migration version

 --descr=s              Migration description (used for timestamp based migration)
 --ts-based             Timestamp based migration version