django-mysql icon indicating copy to clipboard operation
django-mysql copied to clipboard

MariaDB virtual columns

Open adamchainz opened this issue 10 years ago • 3 comments

It may be useful to be able to define Django fields which are backed by virtual columns. They could be read-only but would allow you to control their schema in Django (add db_index, filter by them). I imagine you'd have to specify their functional SQL fragment.

adamchainz avatar Mar 21 '15 18:03 adamchainz

Also MySQL 5.7 introduces generated columns

adamchainz avatar Jun 05 '15 12:06 adamchainz

waiting for this feature ^ ^

FingerLiu avatar Sep 07 '16 09:09 FingerLiu

I think this might be more suitable in Django core, or it will probably need changes there at least.

What's your use case for virtual columns? I haven't had one myself. Have you tried to create them with a custom migration already?

adamchainz avatar Sep 11 '16 08:09 adamchainz