Tell me, pliz, like on Yii (in migration)
Rename the table.
Is there a built-in method,
or you need to do through the sql
such as such
\ yii :: $ app- & gt; db- & gt; createcommand ('Alter Table Newsletter Rename to Mail') - & gt ; execute ();
But I would like to know if there is a built-in method?
Answer 1, Authority 100%
There is a method for changing the title table. But I would like to warn from some incidents at once. It is recommended not to rename the table, but create a new and work with a new table instead of the old. This is done in order if you suddenly have to roll back the code changes, then there will be no errors of working with the database. The meaning is that the database structure must correspond to a new release and old. So there will be fewer problems on production. And in the next release you can already delete the old table.
$ this- & gt; renametable ('table_name', 'new_table_name');