mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-08-15 14:04:10 +02:00
Remove our migrations to fix main
This commit is contained in:
parent
14fb918719
commit
be1f6558d0
2 changed files with 0 additions and 77 deletions
|
@ -1,40 +0,0 @@
|
||||||
# Generated by Django 4.2.10 on 2024-03-19 05:42
|
|
||||||
# This migration seeds the federal agency table with initial data and manually calls
|
|
||||||
# FederalAgency.create_federal_agencies to populate initial table values.
|
|
||||||
|
|
||||||
from django.db import migrations, models
|
|
||||||
from registrar.models import FederalAgency
|
|
||||||
from typing import Any
|
|
||||||
|
|
||||||
|
|
||||||
# For linting: RunPython expects a function reference.
|
|
||||||
def create_federal_agencies(apps, schema_editor) -> Any:
|
|
||||||
FederalAgency.create_federal_agencies(apps, schema_editor)
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
|
|
||||||
dependencies = [
|
|
||||||
("registrar", "0076_alter_domainrequest_current_websites_and_more"),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.CreateModel(
|
|
||||||
name="FederalAgency",
|
|
||||||
fields=[
|
|
||||||
("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
|
|
||||||
("created_at", models.DateTimeField(auto_now_add=True)),
|
|
||||||
("updated_at", models.DateTimeField(auto_now=True)),
|
|
||||||
("agency", models.CharField(blank=True, help_text="Federal agency", null=True)),
|
|
||||||
],
|
|
||||||
options={
|
|
||||||
"verbose_name": "Federal agency",
|
|
||||||
"verbose_name_plural": "Federal agencies",
|
|
||||||
},
|
|
||||||
),
|
|
||||||
migrations.RunPython(
|
|
||||||
create_federal_agencies,
|
|
||||||
reverse_code=migrations.RunPython.noop,
|
|
||||||
atomic=True,
|
|
||||||
),
|
|
||||||
]
|
|
|
@ -1,37 +0,0 @@
|
||||||
# This migration creates the create_full_access_group and create_cisa_analyst_group groups
|
|
||||||
# It is dependent on 0035 (which populates ContentType and Permissions)
|
|
||||||
# If permissions on the groups need changing, edit CISA_ANALYST_GROUP_PERMISSIONS
|
|
||||||
# in the user_group model then:
|
|
||||||
# [NOT RECOMMENDED]
|
|
||||||
# step 1: docker-compose exec app ./manage.py migrate --fake registrar 0035_contenttypes_permissions
|
|
||||||
# step 2: docker-compose exec app ./manage.py migrate registrar 0036_create_groups
|
|
||||||
# step 3: fake run the latest migration in the migrations list
|
|
||||||
# [RECOMMENDED]
|
|
||||||
# Alternatively:
|
|
||||||
# step 1: duplicate the migration that loads data
|
|
||||||
# step 2: docker-compose exec app ./manage.py migrate
|
|
||||||
|
|
||||||
from django.db import migrations
|
|
||||||
from registrar.models import UserGroup
|
|
||||||
from typing import Any
|
|
||||||
|
|
||||||
|
|
||||||
# For linting: RunPython expects a function reference,
|
|
||||||
# so let's give it one
|
|
||||||
def create_groups(apps, schema_editor) -> Any:
|
|
||||||
UserGroup.create_cisa_analyst_group(apps, schema_editor)
|
|
||||||
UserGroup.create_full_access_group(apps, schema_editor)
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
dependencies = [
|
|
||||||
("registrar", "0077_federalagency"),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.RunPython(
|
|
||||||
create_groups,
|
|
||||||
reverse_code=migrations.RunPython.noop,
|
|
||||||
atomic=True,
|
|
||||||
),
|
|
||||||
]
|
|
Loading…
Add table
Add a link
Reference in a new issue