Project

Profile

Help

Story #7710

closed

As a user, I can use 'flush' after the migrations are applied and receive the required AccessPolicies

Added by bmbouter about 4 years ago. Updated almost 4 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
Category:
-
Sprint/Milestone:
Start date:
Due date:
% Done:

100%

Estimated time:
Platform Release:
Groomed:
Yes
Sprint Candidate:
No
Tags:
Sprint:
Sprint 86
Quarter:

Description

Problem

As a user experienced if a user does the following they will have a problem:

  1. User runs migration and receives the AccessPolicy via a data migration like this one
  2. User then later calls 'flush' which keeps migrations marked as "run" but drops all data including the AccessPolicy
  3. User then tries to use Pulp, but receives AccessPolicy matching query does not exist.

Solution 1

Change where we recommend the AccessPolicy data is created.

  1. Stop doing it in migrations
  2. Instead do it in a post-migrate signal
  3. If the AccessPolicy is already in the db catch the Duplicate entry and move on
  • This would need to be changed in the plugin writer docs here
  • Also any existing AccessPolicy made in migrations would also have to be put here too. Currently that is only one, created in migration 42.

Solution 2:

Use a fixtures approach instead.

Also available in: Atom PDF