Opened 8 years ago

Closed 8 years ago

#4820 closed (duplicate)

add ability to report inconsistencies between Django models and configured database

Reported by: Gary Wilson <gary.wilson@…> Owned by: nobody
Component: Database layer (models, ORM) Version: master
Severity: Keywords:
Cc: Triage Stage: Design decision needed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Sort of taking inspectdb/syncdb a little further. This could be a step closer to having database migration/versioning.

For example, if I had the following Model:

class Book(models.Model):
    name = models.CharField(maxlength=50, unique=True)
    author = models.CharField(maxlength=100)

the function could report things like:

  • "name" field doesn't have UNIQUE specified
  • "name" field is varchar(100) instead of varchar(50)
  • "name" field is set NULL instead of NOT NULL
  • "author" field does not exist in the database

Change History (2)

comment:1 Changed 8 years ago by Gary Wilson <gary.wilson@…>

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Design decision needed

comment:2 Changed 8 years ago by ubernostrum

  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #3271.

Note: See TracTickets for help on using tickets.
Back to Top