Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed mysql index issue on tree_path #66

Merged
merged 1 commit into from
Jun 18, 2015

Conversation

pahko
Copy link
Contributor

@pahko pahko commented May 20, 2015

this solves #65

@pahko pahko force-pushed the fix-mysql-tree_path-index branch from 26e5256 to d4f88c1 Compare May 22, 2015 01:13
vdboor added a commit that referenced this pull request Jun 18, 2015
fixed mysql index issue on tree_path
@vdboor vdboor merged commit 4654bbd into honzakral:master Jun 18, 2015
# Adding model 'ThreadedComment'
db.create_table('threadedcomments_comment', (
('comment_ptr', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['comments.Comment'], unique=True, primary_key=True)),
('title', self.gf('django.db.models.fields.TextField')(blank=True)),
('parent', self.gf('django.db.models.fields.related.ForeignKey')(default=None, related_name='children', null=True, blank=True, to=orm['threadedcomments.ThreadedComment'])),
('last_child', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['threadedcomments.ThreadedComment'], null=True, blank=True)),
('tree_path', self.gf('django.db.models.fields.CharField')(db_index=True, max_length=500)),
('tree_path', self.gf('django.db.models.fields.CharField')(db_index=is_index, max_length=500)),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why have this option while you have db_index=False in other places?
That seems to contradict itself.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vdboor

db_index=False only when the connection.vendor == 'mysql' otherwise you still will get an error on the migrations for new installations.

we can't just drop the index in the first migration because we need to support existing installations and new ones, so if we drop the index in the initial migration the index still will be there for existing installations.

let me know if that makes sense..

@vdboor
Copy link
Collaborator

vdboor commented Jun 18, 2015

Sorry, I merged too soon. I've unmerged it, because I have a few questions about it.. Can you look into this?

vdboor added a commit that referenced this pull request Jun 19, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants