class DatabaseSchemaEditor(BaseDatabaseSchemaEditor): (source)
Known subclasses: django.contrib.gis.db.backends.postgis.schema.PostGISSchemaEditor
Undocumented
Method | add |
Add an index on a model. |
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 | remove |
Remove an index from a model. |
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 | 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 | _alter |
Perform a "physical" (non-ManyToMany) field update. |
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 |
Return the statement to create an index with varchar operator pattern when the column type is 'varchar' or 'text', otherwise return None. |
Method | _delete |
Undocumented |
Method | _field |
Undocumented |
Method | _field |
Undocumented |
Method | _field |
Return a list of all index SQL statements for the specified field. |
Method | _get |
Undocumented |
Method | _index |
Undocumented |
Inherited from BaseDatabaseSchemaEditor
:
Method | __enter__ |
Undocumented |
Method | __exit__ |
Undocumented |
Method | __init__ |
Undocumented |
Method | add |
Add a constraint to a model. |
Method | add |
Create a field on a model. Usually involves adding a column, but may involve adding a table instead (for M2M fields). |
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 |
Undocumented |
Method | rename |
Undocumented |
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. |
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 |
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 |
Alter M2Ms to repoint their to= endpoints. |
Method | _check |
Undocumented |
Method | _collate |
Undocumented |
Method | _column |
Return the SQL to use in a DEFAULT clause. The resulting string should contain a '%s' placeholder for a default value. |
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 |
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 |
Undocumented |
Method | _field |
Undocumented |
Method | _fk |
Undocumented |
Method | _get |
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 | _rename |
Undocumented |
Method | _unique |
Undocumented |
Method | _unique |
Undocumented |
Method | _unique |
Undocumented |
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).
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.
Perform a "physical" (non-ManyToMany) field update.
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, ...).
Return the statement to create an index with varchar operator pattern when the column type is 'varchar' or 'text', otherwise return None.