• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python db.create_table函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中south.db.db.create_table函数的典型用法代码示例。如果您正苦于以下问题:Python create_table函数的具体用法?Python create_table怎么用?Python create_table使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了create_table函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: forwards

    def forwards(self, orm):
        # Adding model 'Collection'
        db.create_table('collection_collection', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('name', self.gf('django.db.models.fields.CharField')(max_length=100)),
            ('description', self.gf('django.db.models.fields.TextField')(blank=True)),
            ('owner', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])),
            ('creation_date', self.gf('django.db.models.fields.DateTimeField')()),
            ('modified_date', self.gf('django.db.models.fields.DateTimeField')()),
            ('is_public', self.gf('django.db.models.fields.BooleanField')(default=False)),
            ('is_locked', self.gf('django.db.models.fields.BooleanField')(default=False)),
            ('parent', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['collection.Collection'], null=True, blank=True)),
            ('creation_info', self.gf('django.db.models.fields.CharField')(max_length=200)),
        ))
        db.send_create_signal('collection', ['Collection'])

        # Adding unique constraint on 'Collection', fields ['owner', 'name']
        db.create_unique('collection_collection', ['owner_id', 'name'])

        # Adding M2M table for field images on 'Collection'
        db.create_table('collection_collection_images', (
            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
            ('collection', models.ForeignKey(orm['collection.collection'], null=False)),
            ('image', models.ForeignKey(orm['catamidb.image'], null=False))
        ))
        db.create_unique('collection_collection_images', ['collection_id', 'image_id'])
开发者ID:acfrmarine,项目名称:squidle,代码行数:26,代码来源:0001_initial.py


示例2: forwards

    def forwards(self, orm):
        # Adding model 'ProjectVideo'
        db.create_table(u'projects_projectvideo', (
            (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('video', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['videos.Video'])),
            ('project', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['projects.Project'])),
        ))
        db.send_create_signal(u'projects', ['ProjectVideo'])

        # Adding field 'Project.contractor'
        db.add_column(u'projects_project', 'contractor',
                      self.gf('django.db.models.fields.CharField')(max_length=400, null=True, blank=True),
                      keep_default=False)


        # Changing field 'Project.location_name'
        db.alter_column(u'projects_project', 'location_name', self.gf('django.db.models.fields.CharField')(max_length=400, null=True))

        # Changing field 'Project.estimated_cost'
        db.alter_column(u'projects_project', 'estimated_cost', self.gf('django.db.models.fields.FloatField')(null=True))

        # Changing field 'Project.summary'
        db.alter_column(u'projects_project', 'summary', self.gf('django.db.models.fields.TextField')(null=True))

        # Changing field 'Project.total_cost'
        db.alter_column(u'projects_project', 'total_cost', self.gf('django.db.models.fields.FloatField')(null=True))
开发者ID:Ufadhili,项目名称:Ajibika,代码行数:26,代码来源:0012_auto__add_projectvideo__add_field_project_contractor__chg_field_projec.py


示例3: forwards

    def forwards(self, orm):
        # Adding model 'UserProfile'
        db.create_table('accounts_userprofile', (
            ('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)),
            ('flickr_nsid', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True)),
            ('flickr_username', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True)),
            ('flickr_fullname', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True)),
            ('flickr_oauth_token', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True)),
            ('flickr_oauth_token_secret', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True)),
            ('flickr_user', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['flickr.FlickrUser'], unique=True, null=True, blank=True)),
            ('date_create', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
            ('date_update', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)),
        ))
        db.send_create_signal('accounts', ['UserProfile'])

        # Adding model 'FlickrContact'
        db.create_table('accounts_flickrcontact', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['accounts.UserProfile'])),
            ('flickr_user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['flickr.FlickrUser'])),
            ('friend', self.gf('django.db.models.fields.BooleanField')(default=False)),
            ('family', self.gf('django.db.models.fields.BooleanField')(default=False)),
        ))
        db.send_create_signal('accounts', ['FlickrContact'])
开发者ID:cjmartin,项目名称:thisismycam,代码行数:25,代码来源:0001_initial.py


示例4: forwards

 def forwards(self, orm):
     # Adding model 'ConsiglioComunaleEvent'
     db.create_table('pages4gov_consigliocomunaleevent', (
         ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
         ('keywords_string', self.gf('django.db.models.fields.CharField')(blank=True, max_length=500)),
         ('site', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['sites.Site'])),
         ('title', self.gf('django.db.models.fields.CharField')(max_length=500)),
         ('slug', self.gf('django.db.models.fields.CharField')(null=True, max_length=2000, blank=True)),
         ('_meta_title', self.gf('django.db.models.fields.CharField')(null=True, max_length=500, blank=True)),
         ('description', self.gf('django.db.models.fields.TextField')(blank=True)),
         ('gen_description', self.gf('django.db.models.fields.BooleanField')(default=True)),
         ('created', self.gf('django.db.models.fields.DateTimeField')(null=True)),
         ('updated', self.gf('django.db.models.fields.DateTimeField')(null=True)),
         ('status', self.gf('django.db.models.fields.IntegerField')(default=2)),
         ('publish_date', self.gf('django.db.models.fields.DateTimeField')(null=True, blank=True)),
         ('expiry_date', self.gf('django.db.models.fields.DateTimeField')(null=True, blank=True)),
         ('short_url', self.gf('django.db.models.fields.URLField')(null=True, max_length=200, blank=True)),
         ('in_sitemap', self.gf('django.db.models.fields.BooleanField')(default=True)),
         ('content', self.gf('mezzanine.core.fields.RichTextField')()),
         ('user', self.gf('django.db.models.fields.related.ForeignKey')(related_name='consigliocomunaleevents', to=orm['auth.User'])),
         ('data_of_performance', self.gf('django.db.models.fields.DateTimeField')()),
         ('news_url', self.gf('django.db.models.fields.URLField')(blank=True, max_length=200)),
         ('youtube_video_url', self.gf('django.db.models.fields.URLField')(blank=True, max_length=200)),
         ('youtube_video_url_query', self.gf('django.db.models.fields.CharField')(blank=True, max_length=200)),
         ('hangout_url', self.gf('django.db.models.fields.URLField')(blank=True, max_length=200)),
     ))
     db.send_create_signal('pages4gov', ['ConsiglioComunaleEvent'])
开发者ID:simodalla,项目名称:openpa-pages4gov,代码行数:27,代码来源:0002_auto__add_consigliocomunaleevent.py


示例5: forwards

    def forwards(self, orm):
        # Adding model 'CalendarGroup'
        db.create_table('schedule_calendargroup', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('name', self.gf('django.db.models.fields.CharField')(max_length=40)),
            ('color', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['main.Color'])),
        ))
        db.send_create_signal('schedule', ['CalendarGroup'])

        # Adding M2M table for field members on 'CalendarGroup'
        db.create_table('schedule_calendargroup_members', (
            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
            ('calendargroup', models.ForeignKey(orm['schedule.calendargroup'], null=False)),
            ('user', models.ForeignKey(orm['auth.user'], null=False))
        ))
        db.create_unique('schedule_calendargroup_members', ['calendargroup_id', 'user_id'])

        # Adding field 'Event.group'
        db.add_column('schedule_event', 'group',
                      self.gf('django.db.models.fields.related.ForeignKey')(to=orm['schedule.CalendarGroup'], null=True, blank=True),
                      keep_default=False)


        # Changing field 'Event.calendar'
        db.alter_column('schedule_event', 'calendar_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['schedule.Calendar'], null=True))
开发者ID:ejaury,项目名称:maitreya_van,代码行数:25,代码来源:0003_add_calendar_group.py


示例6: forwards

    def forwards(self, orm):
        
        # Deleting field 'Project.private'
        db.delete_column('gitlog_project', 'private')

        # Deleting field 'Project.source'
        db.delete_column('gitlog_project', 'source')

        # Adding field 'Project.public'
        db.add_column('gitlog_project', 'public', self.gf('django.db.models.fields.BooleanField')(default=False), keep_default=False)

        # Adding field 'Project.url'
        db.add_column('gitlog_project', 'url', self.gf('django.db.models.fields.URLField')(max_length=30, null=True, blank=True), keep_default=False)

        # Adding field 'Project.description'
        db.add_column('gitlog_project', 'description', self.gf('django.db.models.fields.TextField')(null=True, blank=True), keep_default=False)

        # Adding M2M table for field writable on 'Project'
        db.create_table('gitlog_project_writable', (
            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
            ('project', models.ForeignKey(orm['gitlog.project'], null=False)),
            ('user', models.ForeignKey(orm['auth.user'], null=False))
        ))
        db.create_unique('gitlog_project_writable', ['project_id', 'user_id'])

        # Adding M2M table for field readonly on 'Project'
        db.create_table('gitlog_project_readonly', (
            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
            ('project', models.ForeignKey(orm['gitlog.project'], null=False)),
            ('user', models.ForeignKey(orm['auth.user'], null=False))
        ))
        db.create_unique('gitlog_project_readonly', ['project_id', 'user_id'])

        # Changing field 'Project.owner'
        db.alter_column('gitlog_project', 'owner_id', self.gf('django.db.models.fields.related.ForeignKey')(null=True, to=orm['auth.User']))
开发者ID:masarliev,项目名称:gitlog,代码行数:35,代码来源:0002_auto__del_field_project_private__del_field_project_source__add_field_p.py


示例7: forwards

    def forwards(self, orm):
        # Adding model 'DynamicPage'
        db.create_table(u'main_dynamicpage', (
            (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('slug', self.gf('django.db.models.fields.SlugField')(max_length=50)),
            ('template', self.gf('django.db.models.fields.CharField')(max_length=256)),
            ('content_hebrew', self.gf('django.db.models.fields.TextField')()),
            ('content_english', self.gf('django.db.models.fields.TextField')()),
        ))
        db.send_create_signal(u'main', ['DynamicPage'])

        # Deleting field 'NavbarLink.url'
        db.delete_column(u'main_navbarlink', 'url')

        # Adding field 'NavbarLink.link_type'
        db.add_column(u'main_navbarlink', 'link_type',
                      self.gf('django.db.models.fields.CharField')(default='category', max_length=256),
                      keep_default=False)

        # Adding field 'NavbarLink.category'
        db.add_column(u'main_navbarlink', 'category',
                      self.gf('django.db.models.fields.related.ForeignKey')(to=orm['main.Category'], null=True, blank=True),
                      keep_default=False)

        # Adding field 'NavbarLink.page'
        db.add_column(u'main_navbarlink', 'page',
                      self.gf('django.db.models.fields.related.ForeignKey')(to=orm['main.DynamicPage'], null=True, blank=True),
                      keep_default=False)
开发者ID:hochbergg,项目名称:petulant-avenger,代码行数:28,代码来源:0013_auto__add_dynamicpage__del_field_navbarlink_url__add_field_navbarlink_.py


示例8: forwards

    def forwards(self, orm):
        # Adding model 'Currency'
        db.create_table(
            "stddata_currency",
            (
                ("id", self.gf("django.db.models.fields.AutoField")(primary_key=True)),
                ("code", self.gf("django.db.models.fields.CharField")(unique=True, max_length=3)),
                ("name", self.gf("django.db.models.fields.CharField")(max_length=100, db_index=True)),
                ("is_decimal", self.gf("django.db.models.fields.BooleanField")(default=True)),
            ),
        )
        db.send_create_signal("stddata", ["Currency"])

        # Adding model 'Date'
        db.create_table(
            "stddata_date",
            (
                ("id", self.gf("django.db.models.fields.AutoField")(primary_key=True)),
                ("year", self.gf("django.db.models.fields.CharField")(db_index=True, max_length=4, blank=True)),
                ("month", self.gf("django.db.models.fields.CharField")(db_index=True, max_length=2, blank=True)),
                ("day", self.gf("django.db.models.fields.CharField")(db_index=True, max_length=2, blank=True)),
                ("year_uncertain", self.gf("django.db.models.fields.BooleanField")(default=False)),
                ("month_uncertain", self.gf("django.db.models.fields.BooleanField")(default=False)),
                ("day_uncertain", self.gf("django.db.models.fields.BooleanField")(default=False)),
            ),
        )
        db.send_create_signal("stddata", ["Date"])
开发者ID:jadavbheda,项目名称:gcd-django,代码行数:27,代码来源:0001_initial.py


示例9: forwards

 def forwards(self, orm):
     # Adding model 'UploadedFile'
     db.create_table('musikovweb_uploadedfile', (
         ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
         ('uploadfile', self.gf('django.db.models.fields.files.FileField')(max_length=100)),
     ))
     db.send_create_signal('musikovweb', ['UploadedFile'])
开发者ID:tomoconnor,项目名称:musikov,代码行数:7,代码来源:0002_auto__add_uploadedfile.py


示例10: backwards

    def backwards(self, orm):
        # Adding M2M table for field comment on 'Event'
        m2m_table_name = db.shorten_name(u'event_event_comment')
        db.create_table(m2m_table_name, (
            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
            ('event', models.ForeignKey(orm[u'event.event'], null=False)),
            ('comment', models.ForeignKey(orm[u'comment.comment'], null=False))
        ))
        db.create_unique(m2m_table_name, ['event_id', 'comment_id'])


        # Changing field 'Event.category'
        db.alter_column(u'event_event', 'category_id', self.gf('django.db.models.fields.related.ForeignKey')(default=1, to=orm['event.EventCategory']))

        # Changing field 'Event.fr'
        db.alter_column(u'event_event', 'fr', self.gf('django.db.models.fields.DateTimeField')(default=1))

        # Changing field 'Event.cover'
        db.alter_column(u'event_event', 'cover', self.gf('django.db.models.fields.files.ImageField')(default=1, max_length=100))

        # Changing field 'Event.to'
        db.alter_column(u'event_event', 'to', self.gf('django.db.models.fields.DateTimeField')(default=1))

        # Changing field 'Event.place'
        db.alter_column(u'event_event', 'place', self.gf('django.db.models.fields.CharField')(default=1, max_length=250))
开发者ID:neudesk,项目名称:20thst,代码行数:25,代码来源:0015_auto__chg_field_event_category__chg_field_event_fr__chg_field_event_co.py


示例11: forwards

    def forwards(self, orm):
        # Adding model 'Field'
        db.create_table(u'oil_and_gas_field', (
            (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('name', self.gf('django.db.models.fields.CharField')(default='', unique=True, max_length=50)),
            ('country', self.gf('django.db.models.fields.CharField')(default='', unique=True, max_length=50)),
            ('production_oil', self.gf('django.db.models.fields.TextField')(default='')),
            ('production_gas', self.gf('django.db.models.fields.TextField')(default='')),
            ('production', self.gf('django.db.models.fields.TextField')(default='')),
            ('production_oil_smooth', self.gf('django.db.models.fields.TextField')(default='')),
            ('production_gas_smooth', self.gf('django.db.models.fields.TextField')(default='')),
            ('production_smooth', self.gf('django.db.models.fields.TextField')(default='')),
        ))
        db.send_create_signal(u'oil_and_gas', ['Field'])

        # Deleting field 'CountryProduction.depth'
        db.delete_column(u'oil_and_gas_countryproduction', 'depth')

        # Adding unique constraint on 'CountryProduction', fields ['date', 'name']
        db.create_unique(u'oil_and_gas_countryproduction', ['date', 'name'])

        # Adding unique constraint on 'FieldProduction', fields ['date', 'name']
        db.create_unique(u'oil_and_gas_fieldproduction', ['date', 'name'])

        # Adding unique constraint on 'WellProduction', fields ['date', 'name']
        db.create_unique(u'oil_and_gas_wellproduction', ['date', 'name'])
开发者ID:LucasFievet,项目名称:Tomorrow,代码行数:26,代码来源:0002_auto__add_field__del_field_countryproduction_depth__add_unique_country.py


示例12: forwards

    def forwards(self, orm):
        # Adding model 'EntrezTerm'
        db.create_table(u'entrez_entrezterm', (
            (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('name', self.gf('django.db.models.fields.CharField')(max_length=100)),
            ('slug', self.gf('django.db.models.fields.SlugField')(unique=True, max_length=50)),
            ('term', self.gf('django.db.models.fields.CharField')(max_length=512)),
            ('owner', self.gf('django.db.models.fields.related.ForeignKey')(related_name='term_owner', to=orm['auth.User'])),
            ('period', self.gf('django.db.models.fields.PositiveSmallIntegerField')(default=7)),
            ('db', self.gf('django.db.models.fields.CharField')(default='pubmed', max_length=30)),
            ('creation_date', self.gf('django.db.models.fields.DateField')(blank=True)),
            ('lastedit_date', self.gf('django.db.models.fields.DateField')(blank=True)),
        ))
        db.send_create_signal(u'entrez', ['EntrezTerm'])

        # Adding model 'EntrezEntry'
        db.create_table(u'entrez_entrezentry', (
            (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('eid', self.gf('django.db.models.fields.CharField')(max_length=20)),
            ('db', self.gf('django.db.models.fields.CharField')(max_length=30)),
            ('owner', self.gf('django.db.models.fields.related.ForeignKey')(related_name='entry_owner', to=orm['auth.User'])),
            ('term', self.gf('django.db.models.fields.related.ForeignKey')(related_name='entry_term', to=orm['entrez.EntrezTerm'])),
            ('content', self.gf('django.db.models.fields.TextField')()),
            ('content_html', self.gf('django.db.models.fields.TextField')()),
            ('title', self.gf('django.db.models.fields.CharField')(max_length=512)),
            ('magzine', self.gf('django.db.models.fields.CharField')(max_length=512, blank=True)),
            ('authors', self.gf('django.db.models.fields.CharField')(max_length=512, blank=True)),
            ('abstract', self.gf('django.db.models.fields.TextField')(blank=True)),
            ('read', self.gf('django.db.models.fields.BooleanField')(default=False)),
            ('creation_time', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
            ('lastedit_time', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)),
        ))
        db.send_create_signal(u'entrez', ['EntrezEntry'])
开发者ID:indexofire,项目名称:django-entrez,代码行数:33,代码来源:0001_initial.py


示例13: forwards

    def forwards(self, orm):
        # Adding model 'Tag'
        db.create_table(u'relax_tag', (
            (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('name', self.gf('django.db.models.fields.CharField')(unique=True, max_length=25)),
            ('tagid', self.gf('django.db.models.fields.IntegerField')(default=0, blank=True)),
            ('come_from', self.gf('django.db.models.fields.CharField')(max_length=25, blank=True)),
            ('ctime', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
        ))
        db.send_create_signal(u'relax', ['Tag'])

        # Adding model 'News'
        db.create_table(u'relax_news', (
            (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('docid', self.gf('django.db.models.fields.CharField')(unique=True, max_length=30)),
            ('title', self.gf('django.db.models.fields.CharField')(max_length=100)),
            ('big_pic', self.gf('django.db.models.fields.URLField')(max_length=200, blank=True)),
            ('list_pic', self.gf('django.db.models.fields.URLField')(max_length=200, blank=True)),
            ('abstract', self.gf('django.db.models.fields.CharField')(max_length=200, blank=True)),
            ('update_time', self.gf('django.db.models.fields.DateTimeField')()),
            ('content', self.gf('django.db.models.fields.TextField')()),
            ('comment_num', self.gf('django.db.models.fields.IntegerField')(default=0)),
            ('ctime', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
            ('tag', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['relax.Tag'])),
        ))
        db.send_create_signal(u'relax', ['News'])
开发者ID:saturnisbig,项目名称:_17relax,代码行数:26,代码来源:0001_initial.py


示例14: forwards

    def forwards(self, orm):
        # Deleting field 'SponsorshipLevel.content_type'
        db.delete_column(u'camp_sponsorshiplevel', 'content_type_id')

        # Deleting field 'SponsorshipLevel.object_id'
        db.delete_column(u'camp_sponsorshiplevel', 'object_id')

        # Adding M2M table for field events on 'SponsorshipLevel'
        db.create_table(u'camp_sponsorshiplevel_events', (
            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
            ('sponsorshiplevel', models.ForeignKey(orm[u'camp.sponsorshiplevel'], null=False)),
            ('event', models.ForeignKey(orm[u'sked.event'], null=False))
        ))
        db.create_unique(u'camp_sponsorshiplevel_events', ['sponsorshiplevel_id', 'event_id'])

        # Deleting field 'Sponsor.content_type'
        db.delete_column(u'camp_sponsor', 'content_type_id')

        # Deleting field 'Sponsor.object_id'
        db.delete_column(u'camp_sponsor', 'object_id')

        # Adding field 'Sponsor.event'
        db.add_column(u'camp_sponsor', 'event',
                      self.gf('django.db.models.fields.related.ForeignKey')(default=1, related_name='sponsors', to=orm['sked.Event']),
                      keep_default=False)
开发者ID:andergmartins,项目名称:tcamp,代码行数:25,代码来源:0003_auto__del_field_sponsorshiplevel_content_type__del_field_sponsorshiple.py


示例15: forwards

    def forwards(self, orm):
        # Adding model 'JellyfishIncident'
        db.create_table(u'data_jellyfishincident', (
            (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('date_observed', self.gf('django.db.models.fields.DateField')()),
            ('observation_station', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['data.ObservationStation'], on_delete=models.PROTECT)),
            ('source', self.gf('django.db.models.fields.CharField')(default='W', max_length=2)),
            ('sting_incidents', self.gf('django.db.models.fields.IntegerField')(default=0, blank=True)),
            ('total_incidents', self.gf('django.db.models.fields.IntegerField')(default=0, blank=True)),
            ('created_on', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
            ('created_by', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='created-incident', null=True, to=orm['auth.User'])),
            ('updated_on', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)),
            ('updated_by', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='updated-incident', null=True, to=orm['auth.User'])),
        ))
        db.send_create_signal(u'data', ['JellyfishIncident'])

        # Adding model 'FlagChange'
        db.create_table(u'data_flagchange', (
            (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('date', self.gf('django.db.models.fields.DateTimeField')()),
            ('observation_station', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['data.ObservationStation'], on_delete=models.PROTECT)),
            ('flag_status', self.gf('django.db.models.fields.CharField')(default='N', max_length=1)),
            ('jellyfish_flag', self.gf('django.db.models.fields.BooleanField')(default=False)),
            ('created_on', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
            ('created_by', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='created-flag', null=True, to=orm['auth.User'])),
            ('updated_on', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)),
            ('updated_by', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='updated-flag', null=True, to=orm['auth.User'])),
        ))
        db.send_create_signal(u'data', ['FlagChange'])

        # Adding field 'ObservationRoute.use_incident_form'
        db.add_column(u'data_observationroute', 'use_incident_form',
                      self.gf('django.db.models.fields.BooleanField')(default=False),
                      keep_default=False)
开发者ID:socib,项目名称:grumers,代码行数:34,代码来源:0010_auto__add_jellyfishincident__add_flagchange__add_field_observationrout.py


示例16: forwards

    def forwards(self, orm):

        # Adding model 'Decision'
        db.create_table(
            "publicweb_decision",
            (
                ("id", self.gf("django.db.models.fields.AutoField")(primary_key=True)),
                ("short_name", self.gf("django.db.models.fields.CharField")(max_length=255)),
                ("decided_date", self.gf("django.db.models.fields.DateField")(null=True, blank=True)),
                ("effective_date", self.gf("django.db.models.fields.DateField")(null=True, blank=True)),
                ("review_date", self.gf("django.db.models.fields.DateField")(null=True, blank=True)),
                ("expiry_date", self.gf("django.db.models.fields.DateField")(null=True, blank=True)),
                ("budget", self.gf("django.db.models.fields.CharField")(max_length=255, blank=True)),
                ("people", self.gf("django.db.models.fields.CharField")(max_length=255, blank=True)),
                ("description", self.gf("tinymce.models.HTMLField")(blank=True)),
            ),
        )
        db.send_create_signal("publicweb", ["Decision"])

        # Adding model 'Concern'
        db.create_table(
            "publicweb_concern",
            (
                ("id", self.gf("django.db.models.fields.AutoField")(primary_key=True)),
                ("short_name", self.gf("django.db.models.fields.CharField")(max_length=255)),
                ("decision", self.gf("django.db.models.fields.related.ForeignKey")(to=orm["publicweb.Decision"])),
                ("description", self.gf("tinymce.models.HTMLField")(blank=True)),
                ("resolved", self.gf("django.db.models.fields.BooleanField")(default=False)),
            ),
        )
        db.send_create_signal("publicweb", ["Concern"])
开发者ID:indigo79,项目名称:openconsent,代码行数:31,代码来源:0001_initial.py


示例17: forwards

    def forwards(self, orm):
        # Adding model 'TrackedUser'
        db.create_table(
            'sentry_trackeduser', (
                (
                    'id', self.gf('sentry.db.models.fields.bounded.BoundedBigAutoField')(
                        primary_key=True
                    )
                ), (
                    'project',
                    self.gf('sentry.db.models.fields.FlexibleForeignKey')(to=orm['sentry.Project'])
                ), ('ident', self.gf('django.db.models.fields.CharField')(max_length=200)),
                ('email', self.gf('django.db.models.fields.EmailField')(max_length=75, null=True)),
                ('data', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), (
                    'last_seen', self.gf('django.db.models.fields.DateTimeField')(
                        db_index=True
                    )
                ), (
                    'first_seen', self.gf('django.db.models.fields.DateTimeField')(
                        db_index=True
                    )
                ),
            )
        )
        db.send_create_signal('sentry', ['TrackedUser'])

        # Adding unique constraint on 'TrackedUser', fields ['project', 'ident']
        db.create_unique('sentry_trackeduser', ['project_id', 'ident'])
开发者ID:Kayle009,项目名称:sentry,代码行数:28,代码来源:0077_auto__add_trackeduser__add_unique_trackeduser_project_ident.py


示例18: backwards

 def backwards(self, orm):
     # Adding model 'Pic'
     db.create_table(u'exchange_pic', (
         ('image', self.gf('django.db.models.fields.files.ImageField')(max_length=100)),
         (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
     ))
     db.send_create_signal(u'exchange', ['Pic'])
开发者ID:the-viking,项目名称:replay,代码行数:7,代码来源:0006_auto__del_pic.py


示例19: backwards

    def backwards(self, orm):
        # Adding model 'Customer'
        db.create_table(u'attendees_customer', (
            ('conference', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['conference.Conference'], null=True, on_delete=models.PROTECT)),
            ('is_exported', self.gf('django.db.models.fields.BooleanField')(default=False)),
            ('email', self.gf('django.db.models.fields.EmailField')(max_length=250)),
            ('date_added', self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime.now)),
            ('customer_number', self.gf('django.db.models.fields.IntegerField')(blank=True)),
            (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
        ))
        db.send_create_signal(u'attendees', ['Customer'])

        # Adding unique constraint on 'Customer', fields ['customer_number', 'conference']
        db.create_unique(u'attendees_customer', ['customer_number', 'conference_id'])


        # User chose to not deal with backwards NULL issues for 'Purchase.customer'
        raise RuntimeError("Cannot reverse this migration. 'Purchase.customer' and its values cannot be restored.")
        
        # The following code is provided here to aid in writing a correct migration        # Adding field 'Purchase.customer'
        db.add_column(u'attendees_purchase', 'customer',
                      self.gf('django.db.models.fields.related.ForeignKey')(to=orm['attendees.Customer']),
                      keep_default=False)

        # Deleting field 'Purchase.email'
        db.delete_column(u'attendees_purchase', 'email')
开发者ID:DanielSzoska,项目名称:djep,代码行数:26,代码来源:0012_auto__del_customer__del_unique_customer_customer_number_conference__de.py


示例20: forwards

    def forwards(self, orm):
        # Adding model 'Subscriber'
        db.create_table(u'magazine_subscriber', (
            (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('name', self.gf('django.db.models.fields.CharField')(max_length=255)),
            ('email', self.gf('django.db.models.fields.CharField')(max_length=255)),
            ('streetAddress1', self.gf('django.db.models.fields.CharField')(max_length=255)),
            ('streetAddress2', self.gf('django.db.models.fields.CharField')(max_length=255)),
            ('city', self.gf('django.db.models.fields.CharField')(max_length=255)),
            ('state', self.gf('django.db.models.fields.CharField')(max_length=255)),
            ('country', self.gf('django.db.models.fields.CharField')(max_length=255)),
            ('zipCode', self.gf('django.db.models.fields.CharField')(max_length=255)),
            ('customerID', self.gf('django.db.models.fields.CharField')(max_length=255)),
            ('renew', self.gf('django.db.models.fields.BooleanField')()),
            ('subscriptionType', self.gf('django.db.models.fields.CharField')(max_length=255)),
            ('time', self.gf('django.db.models.fields.CharField')(max_length=255)),
        ))
        db.send_create_signal(u'magazine', ['Subscriber'])

        # Adding model 'Donation'
        db.create_table(u'magazine_donation', (
            (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('amount', self.gf('django.db.models.fields.IntegerField')()),
            ('name', self.gf('django.db.models.fields.CharField')(max_length=255)),
            ('email', self.gf('django.db.models.fields.CharField')(max_length=255)),
            ('streetAddress1', self.gf('django.db.models.fields.CharField')(max_length=255)),
            ('streetAddress2', self.gf('django.db.models.fields.CharField')(max_length=255)),
            ('city', self.gf('django.db.models.fields.CharField')(max_length=255)),
            ('state', self.gf('django.db.models.fields.CharField')(max_length=255)),
            ('country', self.gf('django.db.models.fields.CharField')(max_length=255)),
            ('zipCode', self.gf('django.db.models.fields.CharField')(max_length=255)),
            ('customerID', self.gf('django.db.models.fields.CharField')(max_length=255)),
            ('time', self.gf('django.db.models.fields.CharField')(max_length=255)),
        ))
        db.send_create_signal(u'magazine', ['Donation'])
开发者ID:sammysignal,项目名称:advo-sammy,代码行数:35,代码来源:0003_auto__add_subscriber__add_donation.py



注:本文中的south.db.db.create_table函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python db.create_unique函数代码示例发布时间:2022-05-27
下一篇:
Python db.create_primary_key函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap