Remove unused migration

This commit is contained in:
zandercymatics 2024-05-02 14:53:15 -06:00
parent 7c89edce09
commit e521309c43
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
4 changed files with 7 additions and 104 deletions

View file

@ -9,16 +9,12 @@ We use [django-waffle](https://waffle.readthedocs.io/en/stable/) for our feature
3. Click `Add waffle flag`.
4. Add the model as you would normally. Refer to waffle's documentation [regarding attributes](https://waffle.readthedocs.io/en/stable/types/flag.html#flag-attributes) for more information on them.
## Adding feature flags when migrations are ran
Given that we store waffle flags as a predefined list, this means that we need to create a new migration file when we want to add a set of feature flags programatically this way. Note that if `WAFFLE_CREATE_MISSING_FLAGS` is set to True, you may not need this step.
Follow these steps to achieve this:
1. Navigate to `registrar/models/waffle_flag.py`.
2. Modify the `get_default_waffle_flags` and add the desired name of your feature flag to the `default_flags` array.
3. Navigate to `registrar/migrationdata`.
4. Copy the migration named `0091_create_waffle_flags_v01`.
5. Rename the copied migration to match the increment. For instance, if `0091_create_waffle_flags_v01` exists, you will rename your migration to `0091_create_waffle_flags_v02`.
6. Modify the migration dependency to match the last migration in the stack.
### Enabling the profile_feature flag
1. On the app, navigate to `\admin`.
2. Under models, click `Waffle flags`.
3. Click the `profile_feature` record. This should exist by default, if not - create one with that name.
4. (Important) Set the field `Everyone` to `Unknown`. This field overrides all other settings when set to anything else.
5. Configure the settings as you see fit.
## Using feature flags as boolean values
Waffle [provides a boolean](https://waffle.readthedocs.io/en/stable/usage/views.html) called `flag_is_active` that you can use as you otherwise would a boolean. This boolean requires a request object and the flag name.