yii-starter-kit / yii2-starter-kit

Yii2 Starter Kit
http://yii2-starter-kit.terentev.net
Other
1.42k stars 648 forks source link

migration commands doesn't work. #700

Closed Ildar5 closed 4 years ago

Ildar5 commented 5 years ago

I am trying to run migration commands but they're not work. For example I am staying in console folder and run command php yii migrate/create but I see only this


This is Yii version 2.0.19.

The following commands are available:

- app                                         @author Eugene Terentev
                                              <eugene@terentev.net>
    app/alter-charset                         @param string $charset
    app/drop                                  Drops all tables in the database.
    app/set-executable                        Adds execute permissions
    app/set-keys                              Sets given keys to .env file
    app/set-writable                          Adds write permissions
    app/setup                                 @throws
                                              \yii\base\InvalidRouteException
    app/truncate                              Truncates all tables in the
                                              database.

- asset                                       Allows you to combine and compress
                                              your JavaScript and CSS files.
    asset/compress (default)                  Combines and compresses the asset
                                              files according to the given
                                              configuration.
    asset/template                            Creates template of configuration
                                              file for [[actionCompress]].

- cache                                       Allows you to flush cache.
    cache/flush                               Flushes given cache components.
    cache/flush-all                           Flushes all caches registered in
                                              the system.
    cache/flush-schema                        Clears DB schema cache for a given
                                              connection component.
    cache/index (default)                     Lists the caches that can be
                                              flushed.

- command-bus                                 Class BackgroundBusController
    command-bus/handle                        @param string $command serialized
                                              command object

- email-cron                                  

- extended-message                            Class ExtendedMessageController
    extended-message/config                   Creates a configuration file for
                                              the "extract" command using
                                              command line options specified.
    extended-message/config-template          Creates a configuration file
                                              template for the "extract"
                                              command.
    extended-message/extract (default)        Extracts messages to be translated
                                              from source code.
    extended-message/migrate                  @param string $inputConfigFile
    extended-message/replace-source-language  @param bool $configFile

- fixture                                     Manages fixture data loading and
                                              unloading.
    fixture/load (default)                    Loads the specified fixture data.
    fixture/unload                            Unloads the specified fixtures.

- gii                                         This is the command line version
                                              of Gii - a code generator.
    gii/controller                            Controller Generator
    gii/crud                                  CRUD Generator
    gii/extension                             Extension Generator
    gii/form                                  Form Generator
    gii/index (default)
    gii/model                                 Model Generator
    gii/module                                Module Generator

- help                                        Provides help information about
                                              console commands.
    help/index (default)                      Displays available commands or the
                                              detailed information
    help/list                                 List all available controllers and
                                              actions in machine readable
                                              format.
    help/list-action-options                  List all available options for the
                                              $action in machine readable
                                              format.
    help/usage                                Displays usage information for
                                              $action.

- message                                     Class ExtendedMessageController
    message/config                            Creates a configuration file for
                                              the "extract" command using
                                              command line options specified.
    message/config-template                   Creates a configuration file
                                              template for the "extract"
                                              command.
    message/extract (default)                 Extracts messages to be translated
                                              from source code.
    message/migrate                           @param string $inputConfigFile
    message/replace-source-language           @param bool $configFile

- migrate                                     Manages application migrations.
    migrate/create                            Creates a new migration.
    migrate/down                              Downgrades the application by
                                              reverting old migrations.
    migrate/fresh                             Truncates the whole database and
                                              starts the migration from the
                                              beginning.
    migrate/history                           Displays the migration history.
    migrate/mark                              Modifies the migration history to
                                              the specified version.
    migrate/new                               Displays the un-applied new
                                              migrations.
    migrate/redo                              Redoes the last few migrations.
    migrate/to                                Upgrades or downgrades till the
                                              specified version.
    migrate/up (default)                      Upgrades the application by
                                              applying new migrations.

- rbac-migrate                                @author Eugene Terentev
                                              <eugene@terentev.net>
    rbac-migrate/create                       Creates a new migration.
    rbac-migrate/down                         Downgrades the application by
                                              reverting old migrations.
    rbac-migrate/fresh                        Truncates the whole database and
                                              starts the migration from the
                                              beginning.
    rbac-migrate/history                      Displays the migration history.
    rbac-migrate/mark                         Modifies the migration history to
                                              the specified version.
    rbac-migrate/new                          Displays the un-applied new
                                              migrations.
    rbac-migrate/redo                         Redoes the last few migrations.
    rbac-migrate/to                           Upgrades or downgrades till the
                                              specified version.
    rbac-migrate/up (default)                 Upgrades the application by
                                              applying new migrations.

- serve                                       Runs PHP built-in web server.
    serve/index (default)                     Runs PHP built-in web server.

- three-days                                  

To see the help of each command, enter:

  yii help <command-name>

Please help me with this issue.

XzAeRo commented 5 years ago

Some questions for you:

Ildar5 commented 5 years ago

Some questions for you:

  • Are you running the application through Docker or installed directly onto your machine?
  • If you have the application installed in your machine directly, which PHP version are you running?
  • Are you trying to create a new migration?

Hello, the application was installed directly. My php version is 7.2.8. Yes I am trying to run migrate command but any other console commands doesn't work also. Now I figured out that when I tap php yii command the same window appear...