class DatabaseSchemaEditor(BaseDatabaseSchemaEditor): (source)
Known subclasses: django.contrib.gis.db.backends.mysql.schema.MySQLGISSchemaEditor
Undocumented
Method | add |
Create a field on a model. Usually involves adding a column, but may involve adding a table instead (for M2M fields). |
Method | quote |
Return a quoted version of the value so it's safe to use in an SQL string. This is not safe against injection from user code; it is intended only for use in making SQL scripts or preparing default values for particularly tricky backends (defaults are not user-defined, though, so this is safe). |
Method | skip |
Some backends don't accept default values for certain columns types (i.e. MySQL longtext and longblob). |
Method | skip |
Some backends don't accept default values for certain columns types (i.e. MySQL longtext and longblob) in the ALTER COLUMN statement. |
Class Variable | sql |
Undocumented |
Class Variable | sql |
Undocumented |
Class Variable | sql |
Undocumented |
Class Variable | sql |
Undocumented |
Class Variable | sql |
Undocumented |
Class Variable | sql |
Undocumented |
Class Variable | sql |
Undocumented |
Class Variable | sql |
Undocumented |
Class Variable | sql |
Undocumented |
Class Variable | sql |
Undocumented |
Class Variable | sql |
Undocumented |
Class Variable | sql |
Undocumented |
Class Variable | sql |
Undocumented |
Class Variable | sql |
Undocumented |
Class Variable | sql |
Undocumented |
Property | sql |
Undocumented |
Property | sql |
Undocumented |
Method | _alter |
Hook to specialize column type alteration for different backends, for cases when a creation type is different to an alteration type (e.g. SERIAL in PostgreSQL, PostGIS fields). |
Method | _column |
Return the SQL to use in a DEFAULT clause. The resulting string should contain a '%s' placeholder for a default value. |
Method | _delete |
MySQL can remove an implicit FK index on a field when that field is covered by another index like a unique_together. "covered" here means that the more complex index starts like the simpler one. https://bugs... |
Method | _field |
Undocumented |
Method | _is |
Undocumented |
Method | _rename |
Undocumented |
Method | _set |
Keep the null property of the old field. If it has changed, it will be handled separately. |
Property | _supports |
Undocumented |
Inherited from BaseDatabaseSchemaEditor
:
Method | __enter__ |
Undocumented |
Method | __exit__ |
Undocumented |
Method | __init__ |
Undocumented |
Method | add |
Add a constraint to a model. |
Method | add |
Add an index on a model. |
Method | alter |
Rename the table a model points to. |
Method | alter |
Move a model's table between tablespaces. |
Method | alter |
Allow a field's type, uniqueness, nullability, default, column, constraints, etc. to be modified. `old_field` is required to compute the necessary changes. If `strict` is True, raise errors if the old column does not match `old_field` precisely. |
Method | alter |
Deal with a model changing its index_together. The input index_togethers must be doubly-nested, not the single-nested ["foo", "bar"] format. |
Method | alter |
Deal with a model changing its unique_together. The input unique_togethers must be doubly-nested, not the single-nested ["foo", "bar"] format. |
Method | column |
Return the column definition for a field. The field must already have had set_attributes_from_name() called. |
Method | create |
Create a table and any accompanying indexes or unique constraints for the given `model`. |
Method | delete |
Delete a model from the database. |
Method | effective |
Return a field's effective database default value. |
Method | execute |
Execute the given SQL statement, with optional parameters. |
Method | prepare |
Only used for backends which have requires_literal_defaults feature |
Method | quote |
Undocumented |
Method | remove |
Remove a constraint from a model. |
Method | remove |
Remove a field from a model. Usually involves deleting a column, but for M2Ms may involve deleting a table. |
Method | remove |
Remove an index from a model. |
Method | remove |
Undocumented |
Method | rename |
Undocumented |
Method | table |
Take a model and return its table definition. |
Class Variable | sql |
Undocumented |
Class Variable | sql |
Undocumented |
Class Variable | sql |
Undocumented |
Class Variable | sql |
Undocumented |
Class Variable | sql |
Undocumented |
Class Variable | sql |
Undocumented |
Class Variable | sql |
Undocumented |
Class Variable | sql |
Undocumented |
Class Variable | sql |
Undocumented |
Class Variable | sql |
Undocumented |
Class Variable | sql |
Undocumented |
Class Variable | sql |
Undocumented |
Class Variable | sql |
Undocumented |
Class Variable | sql |
Undocumented |
Class Variable | sql |
Undocumented |
Class Variable | sql |
Undocumented |
Class Variable | sql |
Undocumented |
Class Variable | sql |
Undocumented |
Instance Variable | atomic |
Undocumented |
Instance Variable | atomic |
Undocumented |
Instance Variable | collect |
Undocumented |
Instance Variable | collected |
Undocumented |
Instance Variable | connection |
Undocumented |
Instance Variable | deferred |
Undocumented |
Static Method | _effective |
Undocumented |
Method | _alter |
Undocumented |
Method | _alter |
Hook to specialize column default alteration. |
Method | _alter |
Hook to specialize column null alteration. |
Method | _alter |
Perform a "physical" (non-ManyToMany) field update. |
Method | _alter |
Alter M2Ms to repoint their to= endpoints. |
Method | _check |
Undocumented |
Method | _collate |
Undocumented |
Method | _constraint |
Return all constraint names matching the columns and conditions. |
Method | _create |
Undocumented |
Method | _create |
Undocumented |
Method | _create |
Generate a unique name for an index/unique constraint. |
Method | _create |
Return the SQL statement to create the index for one or several fields or expressions. `sql` can be specified if the syntax differs from the standard (GIS indexes, ...). |
Method | _create |
Undocumented |
Method | _create |
Undocumented |
Method | _deferrable |
Undocumented |
Method | _delete |
Undocumented |
Method | _delete |
Undocumented |
Method | _delete |
Undocumented |
Method | _delete |
Undocumented |
Method | _delete |
Undocumented |
Method | _delete |
Undocumented |
Method | _delete |
Undocumented |
Method | _field |
Undocumented |
Method | _field |
Return a list of all index SQL statements for the specified field. |
Method | _field |
Undocumented |
Method | _fk |
Undocumented |
Method | _get |
Undocumented |
Method | _index |
Undocumented |
Method | _index |
Undocumented |
Method | _index |
Undocumented |
Method | _iter |
Undocumented |
Method | _model |
Return a list of all index SQL statements (field indexes, index_together, Meta.indexes) for the specified model. |
Method | _rename |
Undocumented |
Method | _unique |
Undocumented |
Method | _unique |
Undocumented |
Method | _unique |
Undocumented |
Create a field on a model. Usually involves adding a column, but may involve adding a table instead (for M2M fields).
Return a quoted version of the value so it's safe to use in an SQL string. This is not safe against injection from user code; it is intended only for use in making SQL scripts or preparing default values for particularly tricky backends (defaults are not user-defined, though, so this is safe).
Some backends don't accept default values for certain columns types (i.e. MySQL longtext and longblob).
Some backends don't accept default values for certain columns types (i.e. MySQL longtext and longblob) in the ALTER COLUMN statement.
Hook to specialize column type alteration for different backends, for cases when a creation type is different to an alteration type (e.g. SERIAL in PostgreSQL, PostGIS fields). Return a two-tuple of: an SQL fragment of (sql, params) to insert into an ALTER TABLE statement and a list of extra (sql, params) tuples to run once the field is altered.
Return the SQL to use in a DEFAULT clause. The resulting string should contain a '%s' placeholder for a default value.
MySQL can remove an implicit FK index on a field when that field is covered by another index like a unique_together. "covered" here means that the more complex index starts like the simpler one. https://bugs.mysql.com/bug.php?id=37910 / Django ticket #24757 We check here before removing the [unique|index]_together if we have to recreate a FK index.