Hi Paul,
Since you are not very familiar with django or south, I will avoid the
technical details, but I will try to give you some hints, should you
want to look it further.
On Wed, May 9, 2012 at 5:19 AM, Paul Du Bois <
paul....@gmail.com> wrote:
> I'm not sure if this should be considered a Transifex issue, a South issue,
> or a MySQL issue. I almost reported it as a South bug but changed my mind at
> the last minute. Anyway, in (at least) MySQL 5.0.x and 5.1.x, foreign keys
> need to be "supported" by an index. If the user explicitly adds an index,
> MySQL will use that one. It will also not let you drop that index. This is a
> problem for webhooks migration 0002:
>
> def forwards(self, orm):
>
> # Removing unique constraint on 'WebHook', fields ['project']
> db.delete_unique('webhooks_webhook', ['project_id'])
>
> # Changing field 'WebHook.project'
> db.alter_column('webhooks_webhook', 'project_id',
>
self.gf('django.db.models.fields.related.ForeignKey')(to=orm['projects.Project']))
>
Let's just say that the above migration tries to change a 1-1
relationship (OneToOneField) to a 1-M relationship (ForeignKey).
Since the migration was generated automatically by south, this is a
south issue in the way it did the generation.
> As far as I can tell (having almost zero experience with either Django or
> South), either South needs to be smarter, or the migration needs to do
> something like
>
> def forwards(self, orm):
>
> # Removing unique constraint on 'WebHook', fields ['project']
> + # Remove the foreign key to avoid problems with MySQL; it'll get
> recreated.
> + db.delete_foreign_key('webhooks_webhook', 'project_id')
> db.delete_unique('webhooks_webhook', ['project_id'])
>
> # Changing field 'WebHook.project'
> db.alter_column('webhooks_webhook', 'project_id',
>
self.gf('django.db.models.fields.related.ForeignKey')(to=orm['projects.Project']))
>
Your patch could work. Can you create a pull request against Transifex
(aat Github) or at least open an issue with your patch?
> Thoughts?
Well, if you plan to use Transifex with MySQL, you should be aware of
https://docs.djangoproject.com/en/dev/ref/databases/#mysql-collation.
The above issue causes problems with translation strings and, as a
result, MySQL is not supported. That said, if you can live with that
issue, there should be no other problems using MySQL.
For the record, PostgreSQL is the preferred RDBMS for Transifex and
the one we use as well.
Regards,
Apostolis
--
Apostolis Bessas
Systems Engineer
https://www.transifex.com/