aerich icon indicating copy to clipboard operation
aerich copied to clipboard

Custom migrations

Open KhDenys opened this issue 4 years ago • 5 comments

Hi @long2ice! Can I write my own migrations and how to do it? And can I create table records using migrations?

Thank you very much.

KhDenys avatar Nov 08 '20 19:11 KhDenys

You can write custom sql in migration file after migrate

long2ice avatar Nov 09 '20 07:11 long2ice

You can write custom sql in migration file after migrate

@long2ice Ok, but can I write sql queries to insert or delete rows in the migration file? And what is needed for this?

KhDenys avatar Nov 09 '20 10:11 KhDenys

No, just add it in upgrade section

long2ice avatar Nov 10 '20 01:11 long2ice

And can we do that without returning SQL queries like we do in Django? Is there an example for that?

nejdetckenobi avatar Aug 16 '23 06:08 nejdetckenobi

Now we use .py file to store version files, so you can write everything in it use Python.

long2ice avatar Aug 16 '23 13:08 long2ice