如何将 South 重新引入我的 Django 项目?

发布于 2024-11-02 16:18:14 字数 457 浏览 0 评论 0原文

我处于新手编码员的经典位置,事后看来,如果我重新开始我的项目,我会做很多不同的事情。我在项目中相对较早地使用了 South,由于缺乏知识而遇到了一些问题,然后放弃了它,将其从已安装的应用程序中删除,并同步了数据库。然后我学习了足够的 SQL 来进行我需要的基本更改,并且此后进行了许多小的更改。

我想在 South 再次尝试一下,看看是否可以重新组织我的代码以反映更好的编码实践。我在 stackoverflow 的帮助下搜索了 South 站点,并找到了创建者提供的指南,用于删除 South 的所有痕迹并重新开始 - 从已安装的应用程序中删除,使用 manage.py 工具重置数据库中的 South 表,并递归删除migrations子目录。但是,即使我已经很长时间没有使用南了(它没有出现在我安装的应用程序中),这仍然使我的数据库处于非功能状态——不太清楚为什么,因为我没有收到任何错误消息。

谁能向数据库新手解释一下南方会对我的数据库产生什么挥之不去的影响?

I'm in the classic position of the novice coder, where in hindsight I'd do many things differently if I were starting my project over. I used South relatively early in my project, ran into some problems due to my lack of knowledge, and abandoned it, removing it from installed apps, and syncing the DB. I then learned enough SQL to make the basic changes I needed, and have made many small changes since.

I'd like to take another stab at South to see if I could reorganize my code to reflect better coding practices. I've searched the South site, with help from stackoverflow, and found a guide from the creator for removing all traces of South and starting again-- remove from installed apps, use the manage.py tool to reset the south table in the db, and recursively delete the migrations subdirectories. But even though I've not been using south for a long time now (it hasn't been in my installed apps), this left my DB in an nonfunctional state-- not really sure why since I didn't get any error messages.

Can anyone explain to a database novice what lingering impact south would have had on my database?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

℉服软 2024-11-09 16:18:14

South 在数据库中创建一个表来跟踪已应用的迁移。该表是south_migrationhistory。您可能想要删除该表(并重新同步您的数据库)或删除它的内容。

我想目前南方认为它已经实施了移民,但实际上并没有,这可能会让人感到困惑。

South creates a table in your database to track migrations that have been applied. The table is south_migrationhistory. You probably want to either drop the table (and re-sync your db) or delete it's contents.

I imagine at the moment south thinks that it's applied migration that it hasn't, which may be confusing things.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文