Migration
This class defines a database migration that modifies the domain field of the site model. It updates the field to include a unique constraint, a specific maximum length, and a domain name validator while maintaining compatibility with the initial sites migration.
Attributes
| Attribute | Type | Description |
|---|---|---|
| dependencies | list = [("sites", "0001_initial")] | A list of migration identifiers that must be applied before this migration can be executed. |
| operations | list | A list of migration operation instances that define the schema changes to be applied to the database. |
Methods
dependencies()
def dependencies() - > list
Defines the list of migration identifiers that must be applied before this migration can be executed.
Returns
| Type | Description |
|---|---|
list | A list of tuples containing the app name and migration name dependencies. |
operations()
def operations() - > list
Specifies the list of database operations to be performed, such as altering the 'domain' field on the 'site' model to enforce uniqueness and validation.
Returns
| Type | Description |
|---|---|
list | A list of migration operation instances to be applied to the database schema. |