Modify

Ticket #147 (closed defect: fixed)

Opened 5 years ago

Last modified 5 years ago

Double post_syncdb signal sending after migrate

Reported by: Sergey Belov <peimei@…> Owned by: andrew
Priority: major Milestone: 0.6
Component: migrations Version: 0.6-pre
Keywords: Cc:

Description

Here is console output:

 - Sending post_syncdb signal for tickets: ['Language']
 - Sending post_syncdb signal for tickets: ['Language']
 - Sending post_syncdb signal for tickets: ['File']
 - Sending post_syncdb signal for tickets: ['File']
 - Sending post_syncdb signal for tickets: ['JiraTicket']
 - Sending post_syncdb signal for tickets: ['JiraTicket']
 - Sending post_syncdb signal for tickets: ['SearchViewer']
 - Sending post_syncdb signal for tickets: ['SearchEngine']
 - Sending post_syncdb signal for tickets: ['SearchViewer']
 - Sending post_syncdb signal for tickets: ['SearchEngine']
 - Loading initial data for tickets.

Attachments

Change History

comment:1 Changed 5 years ago by andrew

  • Status changed from new to assigned

Any chance of more of the console output? How many migrations was it running through?

comment:2 Changed 5 years ago by Sergey Belov <peimei@…>

It was running for 7 migrations.
Here is all console output:

arikon@some-system:~/projects/tracker/src/tickets$ ./manage.py migrate tickets 0007
 - Soft matched migration 0007 to 0007_search_engines_viewers.
Running migrations for tickets:
 - Migrating forwards to 0007_search_engines_viewers.
 > tickets: 0002_ticket_attrs
   = ALTER TABLE `tickets_ticket` ADD COLUMN `misprint` bool NOT NULL DEFAULT False; []
   = ALTER TABLE `tickets_ticket` ADD COLUMN `vital_url` varchar(2048) NOT NULL; []
   = ALTER TABLE `tickets_ticket` ADD COLUMN `desc` longtext NOT NULL; []
 > tickets: 0003_language
   = CREATE TABLE `tickets_language` (`id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, `title` varchar(64) NOT NULL); []
   = ALTER TABLE `tickets_ticket` ADD COLUMN `language_id` integer NULL; []
   = ALTER TABLE `tickets_ticket` ADD CONSTRAINT `language_id_refs_id_3f539639` FOREIGN KEY (`language_id`) REFERENCES `tickets_language` (`id`); []
   = CREATE INDEX `tickets_ticket_language_id` ON `tickets_ticket` (`language_id`); []
 > tickets: 0004_tags
 > tickets: 0005_files
   = CREATE TABLE `tickets_file` (`ticket_id` integer NOT NULL, `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, `file` varchar(100) NOT NULL); []
   = ALTER TABLE `tickets_file` ADD CONSTRAINT `ticket_id_refs_id_3a8eb34f` FOREIGN KEY (`ticket_id`) REFERENCES `tickets_ticket` (`id`); []
   = CREATE INDEX `tickets_file_ticket_id` ON `tickets_file` (`ticket_id`); []
 > tickets: 0006_jira_tickets
   = CREATE TABLE `tickets_jiraticket` (`id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, `key` varchar(64) NOT NULL UNIQUE); []
   = CREATE TABLE `tickets_ticket_jira_tickets` (`id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, `ticket_id` integer NOT NULL, `jiraticket_id` integer NOT NULL); []
   = ALTER TABLE `tickets_ticket_jira_tickets` ADD CONSTRAINT `ticket_id_refs_id_874c64b` FOREIGN KEY (`ticket_id`) REFERENCES `tickets_ticket` (`id`); []
   = CREATE INDEX `tickets_ticket_jira_tickets_ticket_id` ON `tickets_ticket_jira_tickets` (`ticket_id`); []
   = ALTER TABLE `tickets_ticket_jira_tickets` ADD CONSTRAINT `jiraticket_id_refs_id_425c3fcb` FOREIGN KEY (`jiraticket_id`) REFERENCES `tickets_jiraticket` (`id`); []
   = CREATE INDEX `tickets_ticket_jira_tickets_jiraticket_id` ON `tickets_ticket_jira_tickets` (`jiraticket_id`); []
 > tickets: 0007_search_engines_viewers
   = CREATE TABLE `tickets_searchviewer` (`viewer_url` varchar(2048) NOT NULL, `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, `title` varchar(64) NOT NULL); []
   = CREATE TABLE `tickets_searchengine` (`search_url` varchar(2048) NOT NULL, `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, `title` varchar(64) NOT NULL); []
 - Sending post_syncdb signal for tickets: ['Language']
 - Sending post_syncdb signal for tickets: ['Language']
 - Sending post_syncdb signal for tickets: ['File']
 - Sending post_syncdb signal for tickets: ['File']
 - Sending post_syncdb signal for tickets: ['JiraTicket']
 - Sending post_syncdb signal for tickets: ['JiraTicket']
 - Sending post_syncdb signal for tickets: ['SearchViewer']
 - Sending post_syncdb signal for tickets: ['SearchEngine']
 - Sending post_syncdb signal for tickets: ['SearchViewer']
 - Sending post_syncdb signal for tickets: ['SearchEngine']
 - Loading initial data for tickets.

For example last migrations looks like this:

# -*- coding: utf-8 -*-

from south.db import db
from django.db import models
from tagging.fields import TagField

class Migration:

    def forwards(self, orm):
        # Adding model 'SearchViewer'
        db.create_table('tickets_searchviewer', (
            ('viewer_url', models.CharField(max_length=2048)),
            ('id', models.AutoField(primary_key=True)),
            ('title', models.CharField(max_length=64)),
        ))
        db.send_create_signal('tickets', ['SearchViewer'])
        
        # Adding model 'SearchEngine'
        db.create_table('tickets_searchengine', (
            ('search_url', models.CharField(max_length=2048)),
            ('id', models.AutoField(primary_key=True)),
            ('title', models.CharField(max_length=64)),
        ))
        db.send_create_signal('tickets', ['SearchEngine'])


    def backwards(self, orm):
        db.delete_table('tickets_searchviewer')
        db.delete_table('tickets_searchengine')


    models = {
        'auth.user': {
            '_stub': True,
            'id': ('models.AutoField', [], {'primary_key': 'True'}),
        },
        'tickets.geocontext': {
            'id': ('models.AutoField', [], {'primary_key': 'True'}),
            'title': ('models.CharField', [], {'max_length': '255'}),
        },
        'tickets.ticket': {
            'id': ('models.AutoField', [], {'primary_key': 'True'}),
            'state': ('models.CharField', [], {'default': "'new'", 'max_length': '10'}),
            'title': ('models.CharField', [], {'max_length': '4096'}),
            'geocontext': ('models.ForeignKey', ["'GeoContext'"], {}),
            'module': ('models.ForeignKey', ["'Module'"], {}),
            'creator': ('models.ForeignKey', ['User'], {'related_name': "'created_tickets'", 'null': 'True'}),
            'analyst': ('models.ForeignKey', ['User'], {'related_name': "'analysed_tickets'", 'null': 'True'}),
            'executor': ('models.ForeignKey', ['User'], {'related_name': "'executed_tickets'", 'null': 'True'}),
            'created_at': ('models.DateTimeField', [], {'auto_now_add': 'True'}),
            'modified_at': ('models.DateTimeField', [], {'auto_now': 'True'}),
            'analysed_at': ('models.DateTimeField', [], {'null': 'True'}),
            'executed_at': ('models.DateTimeField', [], {'null': 'True'}),
            'misprint': ('models.BooleanField', [], {'default': 'False'}),
            'vital_url': ('models.CharField', [], {'max_length': '2048', 'blank': 'True'}),
            'desc': ('models.TextField', [], {'blank': 'True'}),
            'language': ('models.ForeignKey', ["'Language'"], {'null': 'True'}),
            'tags': ('TagField', [], {}),
            'jira_tickets': ('models.ManyToManyField', ["'JiraTicket'"], {'null': 'True'}),
        },
        'tickets.language': {
            'id': ('models.AutoField', [], {'primary_key': 'True'}),
            'title': ('models.CharField', [], {'max_length': '64'}),
        },
        'tickets.module': {
            'id': ('models.AutoField', [], {'primary_key': 'True'}),
            'title': ('models.CharField', [], {'max_length': '64'}),
        },
        'tickets.file': {
            'file': ('models.FileField', [], {}),
            'id': ('models.AutoField', [], {'primary_key': 'True'}),
            'ticket': ('models.ForeignKey', ["'Ticket'"], {}),
        },
        'tickets.jiraticket': {
            'id': ('models.AutoField', [], {'primary_key': 'True'}),
            'key': ('models.CharField', [], {'unique': 'True', 'max_length': '64', 'db_index': 'True'}),
        },
        'tickets.searchviewer': {
            'id': ('models.AutoField', [], {'primary_key': 'True'}),
            'title': ('models.CharField', [], {'max_length': '64'}),
            'viewer_url': ('models.CharField', [], {'max_length': '2048'}),
        },
        'tickets.searchengine': {
            'id': ('models.AutoField', [], {'primary_key': 'True'}),
            'search_url': ('models.CharField', [], {'max_length': '2048'}),
            'title': ('models.CharField', [], {'max_length': '64'}),
        },
    }

    complete_apps = ['tickets']

I use only one call to db.send_create_signal() for each new model.

comment:3 Changed 5 years ago by andrew

  • Status changed from assigned to closed
  • Resolution set to fixed

This has been fixed in the interim.

View

Add a comment

Modify Ticket

Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.