Column type and index not support by Django ORM - best way to alter/add them

21 views
Skip to first unread message

graeme

unread,
May 26, 2014, 2:06:36 AM5/26/14
to django...@googlegroups.com
I need to do the the following to Postgres tables for Django models:

1) Add a functional index
2) Have a bigserial primary key and a bigint foreign key point to it.

Given that I only want this on a single install, is there any reason not to just do it directly? I have found code snippets with "AutoBigInt" fields, but only one claims to support South and non mention Django migrations. I have not found anything to help with adding the index.

The best I can come up with is to directly alter the column type, and do the same to add the index, and write a migration to do that later IF we ever need more than one install - otherwise its more work that way.

Given that the primary key and the foreign keys pointing to it are unlikely to ever change, can I also guess that this is not likely to cause problems with migrations (South and the new Djnago ones in 1.7 when we upgrade) that change other fields of the model?
Reply all
Reply to author
Forward
0 new messages