You can do this by altering the table through SQL console (if your database
is sql). The commands to do the job for you is :
*mysql -u root -p*
*
use database_name*;
//eg:-for adding new column email to table
ALTER TABLE table_name ADD email VARCHAR(200);
//for modifying a column
ALTER TABLE tab
On Mon, 2011-04-18 at 16:11 +0200, Kann Vearasilp wrote:
> That was one of my idea, but what if the table has already been
> populated
> and I don't want to lose the data in the table?
>
> Can I just change the column name manually using SQL and modify the
> models.py afterwards?
that is the rec
You can use South.
south.aeracode.org
You'd create a schema migration to create the new field, then a data
migration to populate the new field from the old, then another schema
migration to remove the original field.
Shawn
--
You received this message because you are subscribed to the Google G
Yes. That should be doable.
If you are on Oracle, you could manually change the Column Name using
the following Syntax (If you are on a different Database than Oracle
then the Syntax might differ but still doable).
ALTER TABLE RENAME COLUMN TO
And later you could change the models.py manually
Hi Anurag,
That was one of my idea, but what if the table has already been populated
and I don't want to lose the data in the table?
Can I just change the column name manually using SQL and modify the
models.py afterwards?
Kann
On Mon, Apr 18, 2011 at 4:06 PM, Anurag Chourasia <
anurag.choura..
Hi Kann,
Does Dropping the Table and Recreating using SyncDB work well in your setup?
Regards,
Anurag
On Mon, Apr 18, 2011 at 7:30 PM, Kann wrote:
> Dear all,
>
> I am new to django and have question about fixing the typo i made in
> the models.py. For example, I created tables with typo in the
Dear all,
I am new to django and have question about fixing the typo i made in
the models.py. For example, I created tables with typo in the column
name. So, I didn't realized the mistake and run the 'python manage.py
syncdb' which created the tables with the incorrect names. Later I
realized the
7 matches
Mail list logo