6

I am trying to use migrate command with yii2 basic template i have tried "yii migrate" and also "php yii migrate" but none of them are working. i also tried php init but it says "could not open input file: init".

  • windows 7 operating system –  Sep 11 '15 at 10:13
  • what path in cmd where to run command? – GAMITG Sep 11 '15 at 10:17
  • 3
    possible duplicate of [yii2 installation - migrate command not working](http://stackoverflow.com/questions/24531583/yii2-installation-migrate-command-not-working) – vishuB Sep 11 '15 at 10:20
  • I am using my path to my basic folder –  Sep 11 '15 at 10:29
  • `init` does not exists in basic template. And show what is the error you get (and everything that is required) otherwise your question may be closed for not being constructive. – ankitr Sep 11 '15 at 10:37
  • meanwhile read the documentation http://www.yiiframework.com/doc-2.0/guide-db-migrations.html – ankitr Sep 11 '15 at 10:44
  • **Yii2 basic** doesn't come with the start migration files as user migration files. You can import those files from **advanced template** and put inside a migration folder. – Thiago Augustus Oliveira Sep 11 '15 at 11:28

1 Answers1

8

Yii2 basic doesn't come with the start migration files as user migration files. You can import those files from advanced template and put inside a migration folder. After that and config your db you can run yii migrate.

  • 2
    thanks. That wasn't clear enough on documentation. Stuck on that for a little bit. – Alex Pogiba Nov 27 '15 at 07:42
  • Can you expand on this? What files do I need to import? Right now, my command line says that `migrate/create` isn't a command and plain old `migrate` says "Directory specified in migrationPath doesn't exist". I don't need the migration files necessarily, just the ability to create and execute new ones. – Ethan C Dec 29 '15 at 17:33
  • @EthanC I'll upgrade this answer soon as possible. :) – Thiago Augustus Oliveira Dec 29 '15 at 19:22
  • Thanks! While information on where to find the RBAC table migrations would be nice, the issue with `migrate/create` not recognized as a command (as well as all other sub commands) had something to do with Git Bash, as it works just fine in Windows CMD – Ethan C Dec 29 '15 at 19:59