Yii Framework Forum: Error with migrations: directory does not exist - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Error with migrations: directory does not exist Yii v1.1.8 Rate Topic: -----

#1 User is offline   Attilio 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 98
  • Joined: 10-May 11
  • Location:Bari, Italy and Guatemala, Guatemala

Posted 16 July 2011 - 07:11 PM

I'm trying to create a migration for the first time and I get "directory does not exist" error. I've read a few topics about the issue and I couldn't solve it.

I'm using linux and I'm executing the command from the "protected" directory:
php ../framework/yiic migrate create contactoMods


I get the following error:
The migration directory does not exist: application.migrations


Trying to debug where's the error I modified framework/cli/commands/MigrateCommand.php file to show me which directory is the app actually looking for:
$path=Yii::getPathOfAlias($this->migrationPath);
if($path===false || !is_dir($path))
    die('Error: The migration directory does not exist: '.$path."\n");
    //it was: die('Error: The migration directory does not exist: '.$this->migrationPath."\n");


Now I get this weird error:
Error: The migration directory does not exist: /home/attilio/Documenti/Development/contactos/framework/cli/migrations


Why is the application looking fot "migrations" directory under "framework/cli"? It should point to "protected/migrations"

Just for reference, this is my protected/config/console.php (I didn't change it, it's the default from the v1.1.8 release)
'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',

Extension yii-jpegcam: embed a webcam and take photos
0

#2 User is offline   tri 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 1,651
  • Joined: 20-November 08
  • Location:Stockholm, Sweden

Posted 16 July 2011 - 08:16 PM

It's recommended in the guide that you should use the applications instance of yiic.
Try without php ../framework and just type yiic migrate create contactoMods.

/Tommy
Don't forget to read The Definitive Guide to Yii (en) (sv) | The class reference has the details
0

#3 User is offline   Attilio 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 98
  • Joined: 10-May 11
  • Location:Bari, Italy and Guatemala, Guatemala

Posted 17 July 2011 - 02:02 AM

done; I always get the same error :(
Extension yii-jpegcam: embed a webcam and take photos
0

#4 User is offline   tri 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 1,651
  • Joined: 20-November 08
  • Location:Stockholm, Sweden

Posted 17 July 2011 - 04:17 AM

View PostAttilio, on 17 July 2011 - 02:02 AM, said:

done; I always get the same error :(


I can't find it in the documentation now, but I think the directory has to exist (and be writable).

/Tommy
Don't forget to read The Definitive Guide to Yii (en) (sv) | The class reference has the details
0

#5 User is offline   Weavora Team 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 141
  • Joined: 06-December 10

Posted 17 July 2011 - 07:13 AM

You should create directory protected/migrations and give "write" permissions to it.
0

#6 User is offline   Attilio 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 98
  • Joined: 10-May 11
  • Location:Bari, Italy and Guatemala, Guatemala

Posted 17 July 2011 - 12:52 PM

Done already! directory is there by default and I'm running the php command with the same user that owns the directory. The problem is not writing permissions, but which directory is the app looking for, as I wrote in my first post.

Other suggestions??
Extension yii-jpegcam: embed a webcam and take photos
0

#7 User is offline   phtamas 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 527
  • Joined: 26-February 11
  • Location:Mezőtúr, Hungary

Posted 17 July 2011 - 02:52 PM


Code from framework/yiic.php:

if(isset($config))
{
	$app=Yii::createConsoleApplication($config);
	//...
}
else
	$app=Yii::createConsoleApplication(array('basePath'=>dirname(__FILE__).'/cli'));


Make sure that protected/yiic.php contains the following line :

$config=dirname(__FILE__).'/config/console.php';


and (as tri already recommended) always execute protected/yiic rather than protected/framework/yiic.
0

#8 User is offline   Attilio 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 98
  • Joined: 10-May 11
  • Location:Bari, Italy and Guatemala, Guatemala

Posted 23 July 2011 - 11:42 PM

yiick! I didn't even notice there are two yiic, one in protected/ and the other in framework/ ! I was using the wrong one!

Thanks everybody for answering me!
Extension yii-jpegcam: embed a webcam and take photos
0

#9 User is offline   Pratik Shah 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 15
  • Joined: 21-November 12
  • Location:Ahmedabad

Posted 04 December 2012 - 01:45 AM

View PostAttilio, on 23 July 2011 - 11:42 PM, said:

yiick! I didn't even notice there are two yiic, one in protected/ and the other in framework/ ! I was using the wrong one!

Thanks everybody for answering me!



Where is the second yiic i have only one yiic thats in the framework folder only... i don't have the protected folder nor i was aware of such.. Can you guide me what you have done. i'm having the same error and unable to get rid of it.
0

#10 User is offline   LastDay 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 62
  • Joined: 06-March 11
  • Location:Russia

Posted 04 December 2012 - 05:46 AM

Follow this guide - http://www.yiiframew...start.first-app - to create new application within protected/ folder.
0

#11 User is offline   Andres Felipe Diaz 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 14
  • Joined: 13-August 12

Posted 01 February 2013 - 05:31 PM

View Postphtamas, on 17 July 2011 - 02:52 PM, said:


Code from framework/yiic.php:

if(isset($config))
{
	$app=Yii::createConsoleApplication($config);
	//...
}
else
	$app=Yii::createConsoleApplication(array('basePath'=>dirname(__FILE__).'/cli'));


Make sure that protected/yiic.php contains the following line :

$config=dirname(__FILE__).'/config/console.php';


and (as tri already recommended) always execute protected/yiic rather than protected/framework/yiic.



Thank you, that worked for me. You have to use your applications yiic which makes sense afterall =)
Andrés Felipe Díaz
Andrés Felipe Díaz Digital Geek Blog Trickortip.com
My LinkedIn Profile
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users