Skip to content

[NFR] Support migration generation with timestamp based versions #144

Open
@dekiftw

Description

@dekiftw

The NFR format link isn't working so I'm going with the 'new issue' template. Regardless, this is a NFR to support migration generation with timestamp based versions.

Expected and Actual Behavior

Consider the following config file /app/config/migrations.php, with the following content:

<?php

declare(strict_types=1);

return [
    'application' => [
        'migrationsDir' => __DIR__ . '/database/migrations',
        'migrationsTsBased' => true,
    ],
    'database' => [
       // REDACTED
    ],
];

Expected

I expect that, when running:

vendor/bin/phalcon-migrations generate --config=/app/config/migrations.php

I would get (something like) the following output:

Phalcon Migrations

                                                                
  Success: Version 1701806603960851 was successfully generated

Saying that a migration with a timestamp based version of 1701806603960851 was generated.

This behavior is the same even when the config file doesn't contain the migrationsTsBased setting but a command line argument is provided, like so:

vendor/bin/phalcon-migrations generate --config=/app/config/migrations.php --ts-based

Actual

For the same config file, running:

vendor/bin/phalcon-migrations generate --config=/app/config/migrations.php

gives the following output:

Phalcon Migrations

                                                     
  Success: Version 1.0.0 was successfully generated

Saying that a migration with an incremental version of 1.0.0 was generated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions