Yii Framework Forum: Database Migration ? - Yii Framework Forum

Jump to content

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

Database Migration ?

#1 User is offline   satyres 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 01-February 13

Posted 01 February 2013 - 02:25 PM

Hello ,
i have a question about the Yii migration tool ,when i add/Modify a table to the file generated in the public function up() and i retry the "yiic migration command" says
No new migration found. Your system is up-to-date.
0

#2 User is offline   mbi 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 608
  • Joined: 08-May 09

Posted 01 February 2013 - 02:38 PM

you have to create a new migration
0

#3 User is offline   satyres 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 01-February 13

Posted 01 February 2013 - 02:40 PM

View Postmbi, on 01 February 2013 - 02:38 PM, said:

you have to create a new migration

Thanks for you answer !
but i don't understand why when i modify the file to add new table and try the migration tool !
it says ,it's up to date, despite of ,i changed the content of the file ?
Ps:how do i remove the migration file? (Manually or automatically)?
0

#4 User is offline   mbi 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 608
  • Joined: 08-May 09

Posted 01 February 2013 - 02:43 PM

you can migrate down, then modify your migration script, then migrate again
but only in early development
0

#5 User is offline   satyres 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 01-February 13

Posted 01 February 2013 - 04:01 PM

View Postmbi, on 01 February 2013 - 02:43 PM, said:

you can migrate down, then modify your migration script, then migrate again
but only in early development

Ok thanks ;)
0

#6 User is offline   Jay Gilford 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 28-January 13

Posted 01 February 2013 - 06:09 PM

Have you already migrated up? If not, this is something I ran into when trying the safeUp and safeDown. Make sure if you're using those two methods that you remove the up() and down(). This isn't mentioned in the book but appears to be required to allow the safe methods to run
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