且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Django模型:删除字段

更新时间:2023-12-06 14:04:22

我正在使用南方,但仍然我必须在朋友的帮助下进行以下操作-

I am using south but still I had to go through the following with the help of my friend -

他说我一定已经搞砸了,南部的一些内部步骤不是原子性的

He says I must have botched up something and some internal steps in south are not atomic


  1. 编辑models.py文件并从类中删除列

  2. BASH PROMPT $ python manage.py schemamigration core --auto

  3. MYSQL PROMPT>更改表core_tablename放置列xyz_json_old;提交;

  4. BASH PROMPT $ python manage.py core

  1. edit the models.py file and delete the column from the class
  2. BASH PROMPT$ python manage.py schemamigration core --auto
  3. MYSQL PROMPT> alter table core_tablename drop column xyz_json_old; commit;
  4. BASH PROMPT$ python manage.py core