make:migration command is able to guess the table name and creation
status from the passed migration name on the command line.
If the migration name begins with the create_ string then the create
migration stub will be used.
If the migration name contains the (to|from|in)_ pattern then the update
migration stub will be used.
In all other cases an empty migration stub will be used.
Migration classes can be named in two formats, CamelCase without the
datetime prefix and snake_case with the datetime prefix.
If the CamelCase name is used then the T_MIGRATION macro has to be
also used in the migration class.
- also added a new validations of the migration class names
- different render format for options with values --env[=ENV]
- printing a default value part after the description
- added some validations for option names, especially validate the size
- fixed default value name in all commands, it should be upper
Created own tomconstants for the Tom namespace (folder tom/) and used
them everywhere.
Others:
- removed Q_GLOBAL_STATIC_WITH_ARGS() in migrationcreator.cpp and used
getter with the local static const
User can provide a custom migrations path for the make:migration
command.
Default path is at database/migrations relative to the tom example
executable.
This allows to use the tom example as a real migration application and
the user doesn't have to create his own migration project.
Using:
- TomApplication::migrationsPath()
- TINYTOM_MIGRATIONS_PATH preprocessor macro, will be stringified
- TOM_MIGRATIONS_PATH CMake PATH option
Only partial names no matter of case can be passed, eg. mi:st for
the migrate:status, or m for the migrate command.
If the passed name is ambiguous then the error wall with all ambiguous
commands or namespaces is displayed, ambiguous commands also contain
a description.
Following positional arguments support guessing:
- main command name at 0 position
- command name passed to the help command
- namespace name passed to the list command
The vt100 processing is not enabled on the MSYS2 ucrt64 by default so
enable it explicitly.
- also moved terminal initialization code to the Tom::Terminal class