Python south.db.db.alter_column() Examples
The following are 30
code examples of south.db.db.alter_column().
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: 0048_auto__add_userinfo__add_facebookuser__chg_field_invitecode_code.py From canvas with BSD 3-Clause "New" or "Revised" License | 6 votes |
def forwards(self, orm): # Adding model 'UserInfo' db.create_table('canvas_userinfo', ( ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ('user', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['auth.User'], unique=True)), ('free_invites', self.gf('django.db.models.fields.IntegerField')(default=0)), )) db.send_create_signal('canvas', ['UserInfo']) # Adding model 'FacebookUser' db.create_table('canvas_facebookuser', ( ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ('user', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['auth.User'], unique=True)), ('fb_uid', self.gf('django.db.models.fields.BigIntegerField')(unique=True)), )) db.send_create_signal('canvas', ['FacebookUser']) # Changing field 'InviteCode.code' db.alter_column('canvas_invitecode', 'code', self.gf('django.db.models.fields.CharField')(unique=True, max_length=32))
Example #2
Source File: 0003_auto__add_localdatasource__add_field_pendingdatasource_user__chg_field.py From builder with GNU Affero General Public License v3.0 | 6 votes |
def forwards(self, orm): # Adding model 'LocalDataSource' db.create_table(u'main_localdatasource', ( (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ('datasource', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['main.DataSource'], unique=True, null=True)), ('pendingdatasource', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['main.PendingDataSource'], unique=True, null=True)), ('json', self.gf('jsonfield.fields.JSONField')(null=True)), )) db.send_create_signal(u'main', ['LocalDataSource']) # Adding field 'PendingDataSource.user' db.add_column(u'main_pendingdatasource', 'user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True), keep_default=False) # Changing field 'PendingDataSource.params_json' db.alter_column(u'main_pendingdatasource', 'params_json', self.gf('jsonfield.fields.JSONField')()) # Changing field 'Event.details' db.alter_column(u'main_event', 'details', self.gf('django.db.models.fields.CharField')(max_length=256, null=True))
Example #3
Source File: 0003_auto__add_localdatasource__add_field_pendingdatasource_user__chg_field.py From builder with GNU Affero General Public License v3.0 | 6 votes |
def forwards(self, orm): # Adding model 'LocalDataSource' db.create_table(u'main_localdatasource', ( (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ('datasource', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['main.DataSource'], unique=True, null=True)), ('pendingdatasource', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['main.PendingDataSource'], unique=True, null=True)), ('json', self.gf('jsonfield.fields.JSONField')(null=True)), )) db.send_create_signal(u'main', ['LocalDataSource']) # Adding field 'PendingDataSource.user' db.add_column(u'main_pendingdatasource', 'user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True), keep_default=False) # Changing field 'PendingDataSource.params_json' db.alter_column(u'main_pendingdatasource', 'params_json', self.gf('jsonfield.fields.JSONField')()) # Changing field 'Event.details' db.alter_column(u'main_event', 'details', self.gf('django.db.models.fields.CharField')(max_length=256, null=True))
Example #4
Source File: 0002_auto__chg_field_reference_value.py From scirius with GNU General Public License v3.0 | 5 votes |
def backwards(self, orm): # Changing field 'Reference.value' db.alter_column(u'rules_reference', 'value', self.gf('django.db.models.fields.CharField')(max_length=100))
Example #5
Source File: 0002_auto__chg_field_audittrail_user_ip.py From django_audit_trail with Apache License 2.0 | 5 votes |
def backwards(self, orm): # Changing field 'AuditTrail.user_ip' db.alter_column('audit_trail_audittrail', 'user_ip', self.gf('django.db.models.fields.IPAddressField')(max_length=15, null=True))
Example #6
Source File: 0010_auto__del_field_rawcouncilquestion_asker__add_field_rawcouncilquestion.py From legco-watch with MIT License | 5 votes |
def backwards(self, orm): # Adding field 'RawCouncilQuestion.asker' db.add_column(u'raw_rawcouncilquestion', 'asker', self.gf('django.db.models.fields.CharField')(default='', max_length=255, blank=True), keep_default=False) # Deleting field 'RawCouncilQuestion.raw_asker' db.delete_column(u'raw_rawcouncilquestion', 'raw_asker') # Changing field 'RawCouncilQuestion.reply_link' db.alter_column(u'raw_rawcouncilquestion', 'reply_link', self.gf('django.db.models.fields.URLField')(max_length=200)) # Changing field 'RawCouncilQuestion.subject_link' db.alter_column(u'raw_rawcouncilquestion', 'subject_link', self.gf('django.db.models.fields.URLField')(max_length=200))
Example #7
Source File: 0066_auto__chg_field_bestof_comment__add_unique_bestof_comment.py From canvas with BSD 3-Clause "New" or "Revised" License | 5 votes |
def backwards(self, orm): # Removing unique constraint on 'BestOf', fields ['comment'] db.delete_unique('canvas_bestof', ['comment_id']) # Changing field 'BestOf.comment' db.alter_column('canvas_bestof', 'comment_id', self.gf('django.db.models.fields.related.ForeignKey')(null=True, to=orm['canvas.Comment']))
Example #8
Source File: 0066_auto__chg_field_bestof_comment__add_unique_bestof_comment.py From canvas with BSD 3-Clause "New" or "Revised" License | 5 votes |
def forwards(self, orm): # Changing field 'BestOf.comment' db.alter_column('canvas_bestof', 'comment_id', self.gf('django.db.models.fields.related.ForeignKey')(unique=True, to=orm['canvas.Comment'])) # Adding unique constraint on 'BestOf', fields ['comment'] db.create_unique('canvas_bestof', ['comment_id'])
Example #9
Source File: 0015_auto__add_field_parsedmembership_person__add_field_parsedmembership_st.py From legco-watch with MIT License | 5 votes |
def backwards(self, orm): # Deleting field 'ParsedMembership.person' db.delete_column(u'raw_parsedmembership', 'person_id') # Deleting field 'ParsedMembership.start_date' db.delete_column(u'raw_parsedmembership', 'start_date') # Deleting field 'ParsedMembership.end_date' db.delete_column(u'raw_parsedmembership', 'end_date') # Deleting field 'ParsedMembership.method_obtained' db.delete_column(u'raw_parsedmembership', 'method_obtained') # Deleting field 'ParsedMembership.position' db.delete_column(u'raw_parsedmembership', 'position') # Deleting field 'ParsedMembership.note' db.delete_column(u'raw_parsedmembership', 'note') # Changing field 'ParsedMembership.uid' db.alter_column(u'raw_parsedmembership', 'uid', self.gf('django.db.models.fields.CharField')(max_length=100, unique=True)) # Adding unique constraint on 'ParsedMembership', fields ['uid'] db.create_unique(u'raw_parsedmembership', ['uid']) # Changing field 'ParsedPerson.uid' db.alter_column(u'raw_parsedperson', 'uid', self.gf('django.db.models.fields.CharField')(max_length=100, unique=True)) # Adding unique constraint on 'ParsedPerson', fields ['uid'] db.create_unique(u'raw_parsedperson', ['uid'])
Example #10
Source File: 0003_auto__chg_field_rawcouncilquestion_crawled_from__chg_field_rawcouncilv.py From legco-watch with MIT License | 5 votes |
def backwards(self, orm): # Changing field 'RawCouncilQuestion.crawled_from' db.alter_column(u'raw_rawcouncilquestion', 'crawled_from', self.gf('django.db.models.fields.URLField')(max_length=200)) # Changing field 'RawCouncilVoteResult.crawled_from' db.alter_column(u'raw_rawcouncilvoteresult', 'crawled_from', self.gf('django.db.models.fields.URLField')(max_length=200)) # Changing field 'RawCouncilAgenda.crawled_from' db.alter_column(u'raw_rawcouncilagenda', 'crawled_from', self.gf('django.db.models.fields.URLField')(max_length=200)) # Changing field 'RawCouncilHansard.crawled_from' db.alter_column(u'raw_rawcouncilhansard', 'crawled_from', self.gf('django.db.models.fields.URLField')(max_length=200))
Example #11
Source File: 0003_auto__chg_field_rawcouncilquestion_crawled_from__chg_field_rawcouncilv.py From legco-watch with MIT License | 5 votes |
def forwards(self, orm): # Changing field 'RawCouncilQuestion.crawled_from' db.alter_column(u'raw_rawcouncilquestion', 'crawled_from', self.gf('django.db.models.fields.TextField')()) # Changing field 'RawCouncilVoteResult.crawled_from' db.alter_column(u'raw_rawcouncilvoteresult', 'crawled_from', self.gf('django.db.models.fields.TextField')()) # Changing field 'RawCouncilAgenda.crawled_from' db.alter_column(u'raw_rawcouncilagenda', 'crawled_from', self.gf('django.db.models.fields.TextField')()) # Changing field 'RawCouncilHansard.crawled_from' db.alter_column(u'raw_rawcouncilhansard', 'crawled_from', self.gf('django.db.models.fields.TextField')())
Example #12
Source File: 0020_auto__chg_field_parsedquestion_replier.py From legco-watch with MIT License | 5 votes |
def forwards(self, orm): # Changing field 'ParsedQuestion.replier' db.alter_column(u'raw_parsedquestion', 'replier', self.gf('django.db.models.fields.TextField')())
Example #13
Source File: 0002_auto__chg_field_audittrail_user_ip.py From django_audit_trail with Apache License 2.0 | 5 votes |
def forwards(self, orm): # Changing field 'AuditTrail.user_ip' db.alter_column('audit_trail_audittrail', 'user_ip', self.gf('django.db.models.fields.CharField')(default='', max_length=100))
Example #14
Source File: 0024_auto__chg_field_mmcscript_temporarily_disabled.py From django-mmc with GNU General Public License v2.0 | 5 votes |
def backwards(self, orm): # Changing field 'MMCScript.temporarily_disabled' db.alter_column('mmc_mmcscript', 'temporarily_disabled', self.gf('django.db.models.fields.BooleanField')())
Example #15
Source File: 0024_auto__chg_field_mmcscript_temporarily_disabled.py From django-mmc with GNU General Public License v2.0 | 5 votes |
def forwards(self, orm): # Changing field 'MMCScript.temporarily_disabled' db.alter_column('mmc_mmcscript', 'temporarily_disabled', self.gf('django.db.models.fields.SmallIntegerField')())
Example #16
Source File: 0003_auto__chg_field_suricata_ruleset.py From scirius with GNU General Public License v3.0 | 5 votes |
def forwards(self, orm): # Changing field 'Suricata.ruleset' db.alter_column(u'suricata_suricata', 'ruleset_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['rules.Ruleset'], null=True))
Example #17
Source File: 0004_auto__chg_field_incident_description.py From openduty with MIT License | 5 votes |
def forwards(self, orm): # Changing field 'Incident.description' db.alter_column(u'openduty_incident', 'description', self.gf('django.db.models.fields.CharField')(max_length=200))
Example #18
Source File: 0014_auto__chg_field_documentsetrankingdefinition_magnitude_field.py From crowdata with MIT License | 5 votes |
def forwards(self, orm): # Changing field 'DocumentSetRankingDefinition.magnitude_field' db.alter_column(u'crowdataapp_documentsetrankingdefinition', 'magnitude_field_id', self.gf('django.db.models.fields.related.ForeignKey')(null=True, to=orm['crowdataapp.DocumentSetFormField']))
Example #19
Source File: 0004_auto__chg_field_incident_description.py From openduty with MIT License | 5 votes |
def backwards(self, orm): # Changing field 'Incident.description' db.alter_column(u'openduty_incident', 'description', self.gf('django.db.models.fields.CharField')(max_length=100))
Example #20
Source File: 0002_auto__chg_field_reference_value.py From scirius with GNU General Public License v3.0 | 5 votes |
def forwards(self, orm): # Changing field 'Reference.value' db.alter_column(u'rules_reference', 'value', self.gf('django.db.models.fields.CharField')(max_length=1000))
Example #21
Source File: 0003_auto__del_reference__add_sourceupdate__chg_field_source_uri__del_field.py From scirius with GNU General Public License v3.0 | 5 votes |
def backwards(self, orm): # Adding model 'Reference' db.create_table(u'rules_reference', ( ('value', self.gf('django.db.models.fields.CharField')(max_length=1000)), (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ('key', self.gf('django.db.models.fields.CharField')(max_length=100)), )) db.send_create_signal(u'rules', ['Reference']) # Deleting model 'SourceUpdate' db.delete_table(u'rules_sourceupdate') # Changing field 'Source.uri' db.alter_column(u'rules_source', 'uri', self.gf('django.db.models.fields.CharField')(default=1, max_length=400)) # Adding field 'Rule.id' db.add_column(u'rules_rule', u'id', self.gf('django.db.models.fields.AutoField')(default=1, primary_key=True), keep_default=False) # Adding M2M table for field references on 'Rule' m2m_table_name = db.shorten_name(u'rules_rule_references') db.create_table(m2m_table_name, ( ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)), ('rule', models.ForeignKey(orm[u'rules.rule'], null=False)), ('reference', models.ForeignKey(orm[u'rules.reference'], null=False)) )) db.create_unique(m2m_table_name, ['rule_id', 'reference_id']) # Changing field 'Rule.sid' db.alter_column(u'rules_rule', 'sid', self.gf('django.db.models.fields.IntegerField')(unique=True))
Example #22
Source File: 0003_auto__del_reference__add_sourceupdate__chg_field_source_uri__del_field.py From scirius with GNU General Public License v3.0 | 5 votes |
def forwards(self, orm): # Deleting model 'Reference' db.delete_table(u'rules_reference') # Adding model 'SourceUpdate' db.create_table(u'rules_sourceupdate', ( (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ('source', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['rules.Source'])), ('created_date', self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime(2014, 7, 31, 0, 0), blank=True)), ('data', self.gf('django.db.models.fields.TextField')()), ('version', self.gf('django.db.models.fields.CharField')(max_length=42)), )) db.send_create_signal(u'rules', ['SourceUpdate']) # Changing field 'Source.uri' db.alter_column(u'rules_source', 'uri', self.gf('django.db.models.fields.CharField')(max_length=400, null=True)) # Deleting field 'Rule.id' db.delete_column(u'rules_rule', u'id') # Removing M2M table for field references on 'Rule' db.delete_table(db.shorten_name(u'rules_rule_references')) # Changing field 'Rule.sid' db.alter_column(u'rules_rule', 'sid', self.gf('django.db.models.fields.IntegerField')(primary_key=True))
Example #23
Source File: 0003_auto__chg_field_invoice_language.py From django-invoicing with GNU General Public License v2.0 | 5 votes |
def backwards(self, orm): # Changing field 'Invoice.language' db.alter_column('invoicing_invoices', 'language', self.gf('django.db.models.fields.CharField')(max_length=2))
Example #24
Source File: 0003_auto__chg_field_invoice_language.py From django-invoicing with GNU General Public License v2.0 | 5 votes |
def forwards(self, orm): # Changing field 'Invoice.language' db.alter_column('invoicing_invoices', 'language', self.gf('django.db.models.fields.CharField')(max_length=10))
Example #25
Source File: 0005_auto__chg_field_event_msg.py From baobab with GNU General Public License v3.0 | 5 votes |
def backwards(self, orm): # Changing field 'Event.msg' db.alter_column('backoffice_event', 'msg', self.gf( 'django.db.models.fields.CharField')(default='', max_length=255))
Example #26
Source File: 0005_auto__chg_field_event_msg.py From baobab with GNU General Public License v3.0 | 5 votes |
def forwards(self, orm): # Changing field 'Event.msg' db.alter_column('backoffice_event', 'msg', self.gf( 'django.db.models.fields.CharField')(max_length=255, null=True))
Example #27
Source File: 0006_auto__chg_field_eventlog_msg_id__chg_field_event_msg_id.py From baobab with GNU General Public License v3.0 | 5 votes |
def backwards(self, orm): # Changing field 'EventLog.msg_id' db.alter_column('backoffice_eventlog', 'msg_id', self.gf( 'django.db.models.fields.PositiveIntegerField')(null=True)) # Changing field 'Event.msg_id' db.alter_column('backoffice_event', 'msg_id', self.gf( 'django.db.models.fields.PositiveIntegerField')(null=True))
Example #28
Source File: 0006_auto__chg_field_eventlog_msg_id__chg_field_event_msg_id.py From baobab with GNU General Public License v3.0 | 5 votes |
def forwards(self, orm): # Changing field 'EventLog.msg_id' db.alter_column('backoffice_eventlog', 'msg_id', self.gf( 'django.db.models.fields.CharField')(max_length=30, null=True)) # Changing field 'Event.msg_id' db.alter_column('backoffice_event', 'msg_id', self.gf( 'django.db.models.fields.CharField')(max_length=30, null=True))
Example #29
Source File: 0003_auto__chg_field_event_title.py From baobab with GNU General Public License v3.0 | 5 votes |
def forwards(self, orm): db.alter_column('backoffice_event', 'title', self.gf( 'django.db.models.fields.CharField')(max_length=255))
Example #30
Source File: 0002_auto__chg_field_schedulednotification_incident.py From openduty with MIT License | 5 votes |
def forwards(self, orm): # Changing field 'ScheduledNotification.incident' db.alter_column('openduty_schedulednotification', 'incident_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['openduty.Incident'], null=True))