Django - South - Is There a way to view the SQL it runs?

后端 未结 5 1952
遥遥无期
遥遥无期 2021-02-02 09:19

Here\'s what I want to do.

Develop a Django project on a development server with a development database. Run the south migrations as necessary when I change the model.<

5条回答
  •  闹比i
    闹比i (楼主)
    2021-02-02 09:39

    I'd either do what Lutger suggested (and maybe write a log parser to strip out just the SQL), or I'd run my migration against a test database with logging enabled on the test DB.

    Of course, if you can run it against the test database, you're just a few steps away from validating the migration. If it passes, run it again against production.

提交回复
热议问题