BezBartek / django-db-views

Creating automatic migrations for Views models witch working reverse and full command options like in normal makemigrations
MIT License
60 stars 12 forks source link

Generate migration SQL for views but do not apply. #34

Closed hcpatel closed 5 months ago

hcpatel commented 5 months ago

We can use 'sqlmigrate' to generate SQL for django migrations. But is it possible to have an option/flag to generate SQL for makeviewmigrations? or posible a sqlviewmigrate command line script?

The objective here would be to use this for large databases (ie. with 100s of views) , so I can generate SQL, run seperately and run 'fake django migrations' or update django_migrations seperately.

BezBartek commented 5 months ago

@hcpatel Hello, sure, I can add support for that (next week), I also accept PR-s, so if you would like to add it I will accept PR.

hcpatel commented 5 months ago

Happy to raise a PR. As I am new to this, let me know 'how' and 'what details' I should provide?

BezBartek commented 5 months ago

@hcpatel Hello, I found out that we just need to change flag on ViewRunPython, and the code of migration will appear at sqlmigrate output. I will add test for it and soon it will be on PyPi.

BezBartek commented 5 months ago

@hcpatel new version is available on PyPi https://pypi.org/project/django-db-views/0.1.8/