Yii Framework Forum: Migrate Down With Migrationpath Wont Work Properly - Yii Framework Forum

Jump to content

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

Migrate Down With Migrationpath Wont Work Properly want to migrate down that I just migrated up and it wont go Rate Topic: -----

#1 User is offline   gesti 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 23
  • Joined: 07-September 11
  • Location:Hungary

Posted 13 January 2014 - 03:17 AM

Started a new project in Yii and after I have added the DB tables for authManager and setted up the config, I also added the yii-user module.
The migration for the yii-user went well using the following command:
[gesti@laptop protected]$ ./yiic migrate up --migrationPath=application.modules.user.migrations

After this I have checked that yii-user works and it did. So then just to check if it goes both ways as it should I have issued the command to migrate down, but it doesn't want to see the yii-user's migrations.
Here are the commands and out puts:

[gesti@laptop protected]$ ls -l migrations/
total 8
-rw-r--r-- 1 gesti http 402 Jan 12 19:07 m140112_113637_yii_auth_tables.php
-rw-r--r-- 1 gesti http 968 Jan 12 19:07 yii_auth_tables.sql

[gesti@laptop protected]$ ls -l modules/user/migrations/
total 20
-rw-r--r-- 1 gesti http 9537 Jan 12 12:10 m110805_153437_installYiiUser.php
-rw-r--r-- 1 gesti http 5388 Jan 12 12:10 m110810_162301_userTimestampFix.php

[gesti@laptop protected]$ ./yiic migrate history

Yii Migration Tool v1.0 (based on Yii v1.1.15-dev)

Total 4 migrations have been applied before:
    (2014-01-12 19:44:11) m140112_113637_yii_auth_tables
    (2014-01-12 20:25:45) m110810_162301_userTimestampFix
    (2014-01-12 20:25:44) m110805_153437_installYiiUser
    (2014-01-12 12:35:42) m000000_000000_base

[gesti@laptop protected]$ php yiic.php migrate down --migrationPath=application.modules.user.migrations

Yii Migration Tool v1.0 (based on Yii v1.1.15-dev)

Total 1 migration to be reverted:
    m140112_113637_yii_auth_tables

Revert the above migration? (yes|no) [no]:


So my question is this: Am I looking at my screen too close and fail to see a mistake that I'm doing, or there is an undocumented bug in the Yii Migration Tool?
0

#2 User is offline   gesti 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 23
  • Joined: 07-September 11
  • Location:Hungary

Posted 13 January 2014 - 09:23 AM

Got it! It was both:
  • migration down withouth a number after will only migrate down one migration level, so by issuing migrate down 10 shows all my migrations that I could migrate down
  • and the Yii Migration Tool got a bug as well. When it retrives the migrations from the database it oders it by the version (filename) instead of the apply_time. Due to this it showed my first migration that I wrote in the past days instead of the yii-user migration that I mishamx wrote years ago, but I applied now as second and third migrations.


So I'll be filing a bug report. :)
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