3

I'm using South to manage my (MySQL) database tables for a Django 1.4 project, its working great.

This is a bit of a newbie question, but I'm now adding sorl.thumbnail (http://sorl-thumbnail.readthedocs.org/en/latest/installation.html#installation) to the list of installed apps in the settings file.

The instructions say that I now have to use syncdb if I'm using a "cached database key value store".

Is it OK to go ahead and use syncdb? I'm not quite sure if my MySQL+South installation counts as one. Will this mess anything up?

4

2 に答える 2

1

私が間違っていなければ、south を使い始めたら、二度と syncdb を使うべきではありません。代わりに、schemamigrationまたはその他の南の特定のコマンドを使用する必要があります。

ここでは、探していたものを見つけることができます。ここで、あなたの心をクリアにするフレーズを引用します。

schemamigration の主な用途は、光沢のある新しい models.py を完成させたばかりで、データベースをロードしたい場合です。通常の Django では、syncdb を実行するだけですが、マイグレーションでは、テーブルを作成するためにマイグレーションが必要になります。

このシナリオでは、次を実行するだけです。

./manage.py schemamigration myapp --initial

これにより、アプリ内のモデルのすべてのテーブルを作成する 1 つの大きな移行が作成されます。./manage.py migrate を実行して取得するだけで、syncdb よりも 1 ステップ多く行うだけで完了です。

それが役に立てば幸い!

于 2012-06-30T05:43:49.463 に答える
-2

syncdbはSouthに干渉しません。実際、新しいアプリをインストールするには、常にsyncdbを最初に使用してから、移行がある場合はSouthを適用する必要があります。ですから、はい、問題はありません。

于 2012-06-30T00:33:19.740 に答える