Skip to content

add an option to create raw SQL statement in tortoise makemigrations. #2242

Description

@axzxc1236

Is your feature request related to a problem? Please describe.
I wish to add a field like data = fields.JSONField(default=dict) and tweak SQL statement to make default not NULL. (with default '{}' in SQL statement)

Describe the solution you'd like
While this is possible to do manually now, I wish some command line options that populates ops.RunSQL instead of ops.AddField, so I don't need to run tortoise sqlmigrate and copy paste to migration file.
maybe tortoise makemigrations --raw or tortoise makemigrations --sql ?

Describe alternatives you've considered
Tweak the migration file manually, but would be quicker to do if I can have SQL statement generated with migration file.

Additional context
#2233

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions