Rename a Table

45 views
Skip to first unread message

yamandu

unread,
Jul 14, 2010, 1:23:29 PM7/14/10
to web2py-users
Well, I´ve got in situation that could not ocurr but situations seem
not to respect some rules.

I need simply to rename a table.
I can imagine some ways to do that.

I tried rename in MySql and rename respective .table file but didn´t
worked.
I gives me error with keys.

Another way I think is create another table with the new name and copy
everything.
I think this is inneficient and might not work because of the ID if I
use DAL.
Use SQL so? And .table file?

mdipierro

unread,
Jul 14, 2010, 5:27:54 PM7/14/10
to web2py-users
I do not have an easy solution.

Alexandre Andrade

unread,
Jul 14, 2010, 5:41:12 PM7/14/10
to web...@googlegroups.com
it's not a ideal way, but you can backup your data to a csv file, rename the table, and import the csv.



2010/7/14 yamandu <yamand...@gmail.com>



--
Atenciosamente

--
=========================
Alexandre Andrade
Hipercenter.com

mdipierro

unread,
Jul 14, 2010, 5:57:09 PM7/14/10
to web2py-users
but references from other tables may be broken.

On 14 Lug, 16:41, Alexandre Andrade <alexandrema...@gmail.com> wrote:
> it's not a ideal way, but you can backup your data to a csv file, rename the
> table, and import the csv.
>
> 2010/7/14 yamandu <yamandu.co...@gmail.com>

Alexandre Andrade

unread,
Jul 14, 2010, 5:59:08 PM7/14/10
to web...@googlegroups.com
well, rename them too....



2010/7/14 mdipierro <mdip...@cs.depaul.edu>
Reply all
Reply to author
Forward
0 new messages