Python south.db.db.create_index() Examples
The following are 11
code examples of south.db.db.create_index().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
south.db.db
, or try the search function
.
Example #1
Source File: 0021_auto__chg_field_comment_parent_content__chg_field_comment_reply_conten.py From canvas with BSD 3-Clause "New" or "Revised" License | 6 votes |
def forwards(self, orm): # Renaming column for 'Comment.parent_content' to match new field type. db.rename_column('canvas_comment', 'parent_content', 'parent_content_id') # Changing field 'Comment.parent_content' db.alter_column('canvas_comment', 'parent_content_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['canvas.Content'])) # Adding index on 'Comment', fields ['parent_content'] db.create_index('canvas_comment', ['parent_content_id']) # Renaming column for 'Comment.reply_content' to match new field type. db.rename_column('canvas_comment', 'reply_content', 'reply_content_id') # Changing field 'Comment.reply_content' db.alter_column('canvas_comment', 'reply_content_id', self.gf('django.db.models.fields.related.ForeignKey')(null=True, to=orm['canvas.Content'])) # Adding index on 'Comment', fields ['reply_content'] db.create_index('canvas_comment', ['reply_content_id'])
Example #2
Source File: 0027_added_instance_is_deleted.py From kobo-predict with BSD 2-Clause "Simplified" License | 5 votes |
def forwards(self, orm): # Adding field 'Instance.is_deleted' db.add_column('odk_logger_instance', 'is_deleted', self.gf('django.db.models.fields.BooleanField')(default=False), keep_default=True) # Adding index on 'Instance', fields ['xform'] db.create_index('odk_logger_instance', ['xform_id', 'is_deleted'])
Example #3
Source File: 0002_auto__add_index_tweet_analyzed_by__add_index_tweet_created_at.py From django-twitter-stream with MIT License | 5 votes |
def forwards(self, orm): # Adding index on 'Tweet', fields ['analyzed_by'] db.create_index(u'twitter_stream_tweet', ['analyzed_by']) # Adding index on 'Tweet', fields ['created_at'] db.create_index(u'twitter_stream_tweet', ['created_at'])
Example #4
Source File: 0007_auto__add_field_event_last_update.py From baobab with GNU General Public License v3.0 | 5 votes |
def forwards(self, orm): # Adding field 'Event.last_update' db.add_column(u'backoffice_event', 'last_update', self.gf('django.db.models.fields.DateTimeField')( default=datetime.datetime.now), keep_default=False) db.create_index('backoffice_event', ['last_update'])
Example #5
Source File: 0014_auto__add_index_speaker_email.py From pyconkr-2014 with MIT License | 5 votes |
def forwards(self, orm): # Adding index on 'Speaker', fields ['email'] db.create_index(u'pyconkr_speaker', ['email'])
Example #6
Source File: 0095_add_index_followcategory_user.py From canvas with BSD 3-Clause "New" or "Revised" License | 5 votes |
def forwards(self, orm): pass # Adding index on 'FollowCategory', fields ['user'] #db.create_index('canvas_followcategory', ['user_id'])
Example #7
Source File: 0099_add_category_score_index.py From canvas with BSD 3-Clause "New" or "Revised" License | 5 votes |
def forwards(self, orm): db.create_index('canvas_comment', ['category_id', 'score'])
Example #8
Source File: 0089_add_index_CommentPin_comment.py From canvas with BSD 3-Clause "New" or "Revised" License | 5 votes |
def forwards(self, orm): # Adding index on 'CommentPin', fields ['comment_id', 'user_id'] db.create_index('canvas_commentpin', ['comment_id', 'user_id'])
Example #9
Source File: 0009_add_indexes_for_blacklisted_and_hidden.py From canvas with BSD 3-Clause "New" or "Revised" License | 5 votes |
def forwards(self, orm): db.create_index('canvas_post', ['thread_id', 'post_id', 'hidden']) db.create_index('canvas_post', ['content_id', 'blacklisted', 'hidden', 'timestamp']) db.create_index('canvas_post', ['author_id', 'anonymous', 'blacklisted', 'hidden', 'timestamp'])
Example #10
Source File: 0004_add_indexes_to_post_table.py From canvas with BSD 3-Clause "New" or "Revised" License | 5 votes |
def forwards(self, orm): db.create_index('canvas_post', ['thread_id', 'post_id'], unique='true') db.create_index('canvas_post', ['content_id', 'timestamp']) db.create_index('canvas_post', ['author_id', 'anonymous', 'timestamp'])
Example #11
Source File: 0038_add_score_and_timestamp_index.py From canvas with BSD 3-Clause "New" or "Revised" License | 5 votes |
def forwards(self, orm): db.create_index('canvas_content', ['score', 'timestamp'])