accounts.migrations.0009_auto_20250610_1653

 1# Generated by Django 5.2.2 on 2025-06-10 11:23
 2
 3from django.db import migrations
 4# from accounts.models import User
 5
 6# def create_initial_data(apps, schema_editor):
 7#     User.objects.create_superuser(
 8#         institution_id='admin',
 9#         role=None,  # Assuming role is set to None for superuser
10#         phone_number='1234567890',
11#         hospital=None,  # Assuming hospital is set to None for superuser
12#         password='admin123',
13#     )
14
15class Migration(migrations.Migration):
16
17    dependencies = [
18        ('accounts', '0008_alter_user_hospital_alter_user_role'),
19    ]
20
21    operations = [
22        # migrations.RunPython(create_initial_data),
23    ]
class Migration(django.db.migrations.migration.Migration):
16class Migration(migrations.Migration):
17
18    dependencies = [
19        ('accounts', '0008_alter_user_hospital_alter_user_role'),
20    ]
21
22    operations = [
23        # migrations.RunPython(create_initial_data),
24    ]

The base class for all migrations.

Migration files will import this from django.db.migrations.Migration and subclass it as a class called Migration. It will have one or more of the following attributes:

  • operations: A list of Operation instances, probably from django.db.migrations.operations
  • dependencies: A list of tuples of (app_path, migration_name)
  • run_before: A list of tuples of (app_path, migration_name)
  • replaces: A list of migration_names

Note that all migrations come out of migrations and into the Loader or Graph as instances, having been initialized with their app label and name.

dependencies = [('accounts', '0008_alter_user_hospital_alter_user_role')]
operations = []