Skip to content
Discussion options

You must be logged in to vote

Thank you @vsdudakov, I have now read the documentation further and figure out how to do it

There are two more documentation that I needed:

  1. tortoise sqlmigrate Print the SQL for a migration without executing it. https://tortoise.github.io/migration.html#sqlmigrate
  2. (ops.)RunSQL which lets you customize which sql statement to run https://tortoise.github.io/migration.html#runsql

I tweaked the statement printed by tortoise sqlmigrate and then write backward statement myself (because "--backwards" give a long list of SQL statement that looks like doing things in slower way)

I ended up with

class Migration(migrations.Migration):
    dependencies = [('models', '0001_initial')]

    initial = F…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by axzxc1236
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants