- 論壇徽章:
- 1
|
本帖最后由 cc7756789w 于 2015-04-29 11:51 編輯
由于本人是菜鳥,在已經(jīng)生成了models.py中表的情況下,更改了modes.py中的表,但是syncdb不起作用報錯。 于是我用了個死方法,登錄MySQl手動把表刪了,也刪了應(yīng)用中migrations文件夾,然后再進(jìn)行 makemigrations , migrate 和 syncdb,但是去mysql中查看并沒有創(chuàng)建相應(yīng)的表。
后臺登錄顯示: ProgrammingError at /admin/home/article/ (1146, "Table 'alwme_db.home_article' doesn't exist")
(alwme)zhg@hang:~/alwme/alwme$ python manage.py makemigrations
home Migrations for 'home': 0001_initial.py: - Create model Article
(alwme)zhg@hang:~/alwme/alwme$ python manage.py migrate
Operations to perform: Apply all migrations: admin, home, contenttypes, auth, sessions Running migrations: No migrations to apply.
(alwme)zhg@hang:~/alwme/alwme$ python manage.py syncdb
Operations to perform: Apply all migrations: admin, home, contenttypes, auth, sessions Running migrations: No migrations to apply. |
|