Code

Opened 6 years ago

Closed 6 years ago

#6599 closed (wontfix)

Reset single application should load initial_data

Reported by: CHasenpflug Owned by: nobody
Component: Uncategorized Version: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

One can flush to reset all applications, it does not accept an argument for a single app name. Or one can reset and then loaddata for the initial_data fixture.

I would propose either allowing one to flush a single app, or have reset load the inital_data fixture for that app.

Attachments (0)

Change History (1)

comment:1 Changed 6 years ago by russellm

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to wontfix
  • Status changed from new to closed

This isn't as simple as you make it seem. Flush needs to operate on a 'all or nothing' basis because of cross-application dependencies. It's pretty much impossible to resolve cross-application dependencies in a completely generic fashion, especially once your tables contain data (and you use a database that enforces row-relational integrity).

The reset command exists for historical reasons, but it is essentially broken as designed; it doesn't take too many cross-application dependencies to cause all sorts of problems. I've been an advocate for deprecating it, but in the absence of an officially recommended schema-evolution mechanism, it can be useful occasionally.

On top of this - what is the 'initial_data fixture for an app'? Just loading the data in the fixture directory for a specific application would be a partial solution, but it won't be a complete solution, because fixture data isn't bound to a specific application. This is a good thing. Without it, it wouldn't be possible to insert default user accounts (or any other project specific data for contributed applications).

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


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

 
Note: See TracTickets for help on using tickets.