Modify

Ticket #248 (closed defect: fixed)

Opened 5 years ago

Last modified 4 years ago

Verbosity=2 doesn't print create index statements in db-dry-run

Reported by: carmandrew@… Owned by: andrew
Priority: major Milestone: 0.7
Component: commands Version: 0.6
Keywords: Cc:

Description

If you have a model with a foreign key like:

class UserRecord(models.Model):
    user = models.ForeignKey(User)
    record = models.CharField(blank=True, max_length=32)

and you run ./manage.py migrate --db-dry-run --verbosity=2 you get:

...
   = CREATE TABLE "myapp_userrecord" ("id" integer NOT NULL PRIMARY KEY, "user_id" integer NOT NULL, "record" varchar(32) NOT NULL); []
...

But when you run ./manage.py migrate --verbosity=2 you get:

...
   = CREATE TABLE "myapp_userrecord" ("id" integer NOT NULL PRIMARY KEY, "user_id" integer NOT NULL, "record" varchar(32) NOT NULL); []
...
  = CREATE INDEX "myapp_userrecord_user_id" ON "myapp_userrecord" ("user_id"); []
...

It would be nice to be able to see all of the statements it's going to execute before it does.

Attachments

Change History

comment:1 Changed 5 years ago by andrew

  • Status changed from new to assigned
  • Milestone set to 0.7

Yes, the deferred SQL is not being run. We'll fix this after the migration engine refactor.

comment:2 Changed 4 years ago by andrew

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

Fixed in [b6bcef4bad1f].

View

Add a comment

Modify Ticket

Action
as closed
Author


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

 
Note: See TracTickets for help on using tickets.