class BaseDatabaseSchemaEditor:
Known subclasses: django.db.backends.mysql.schema.DatabaseSchemaEditor
, django.db.backends.oracle.schema.DatabaseSchemaEditor
, django.db.backends.postgresql.schema.DatabaseSchemaEditor
, django.db.backends.sqlite3.schema.DatabaseSchemaEditor
Method | add_constraint |
Add a constraint to a model. |
Method | add_field |
Create a field on a model. Usually involves adding a column, but may involve adding a table instead (for M2M fields). |
Method | add_index |
Add an index on a model. |
Method | alter_db_table |
Rename the table a model points to. |
Method | alter_db_tablespace |
Move a model's table between tablespaces. |
Method | alter_field |
No summary |
Method | alter_index_together |
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_unique_together |
Deal with a model changing its unique_together. The input unique_togethers must be doubly-nested, not the single-nested ["foo", "bar"] format. |
Method | create_model |
Create a table and any accompanying indexes or unique constraints for the given model . |
Method | delete_model |
Delete a model from the database. |
Method | execute |
Execute the given SQL statement, with optional parameters. |
Method | remove_constraint |
Remove a constraint from a model. |
Method | remove_field |
Remove a field from a model. Usually involves deleting a column, but for M2Ms may involve deleting a table. |
Method | remove_index |
Remove an index from a model. |
Static Method | _effective_default |
Undocumented |
Method | __enter__ |
Undocumented |
Method | __exit__ |
Undocumented |
Method | __init__ |
Undocumented |
Method | _alter_column_collation_sql |
Undocumented |
Method | _alter_column_default_sql |
Hook to specialize column default alteration. |
Method | _alter_column_null_sql |
Hook to specialize column null alteration. |
Method | _alter_column_type_sql |
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_field |
Perform a "physical" (non-ManyToMany) field update. |
Method | _alter_many_to_many |
Alter M2Ms to repoint their to= endpoints. |
Method | _check_sql |
Undocumented |
Method | _collate_sql |
Undocumented |
Method | _column_default_sql |
Return the SQL to use in a DEFAULT clause. The resulting string should contain a '%s' placeholder for a default value. |
Method | _constraint_names |
Return all constraint names matching the columns and conditions. |
Method | _create_check_sql |
Undocumented |
Method | _create_fk_sql |
Undocumented |
Method | _create_index_name |
Generate a unique name for an index/unique constraint. |
Method | _create_index_sql |
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_primary_key_sql |
Undocumented |
Method | _create_unique_sql |
Undocumented |
Method | _deferrable_constraint_sql |
Undocumented |
Method | _delete_check_sql |
Undocumented |
Method | _delete_composed_index |
Undocumented |
Method | _delete_constraint_sql |
Undocumented |
Method | _delete_fk_sql |
Undocumented |
Method | _delete_index_sql |
Undocumented |
Method | _delete_primary_key |
Undocumented |
Method | _delete_primary_key_sql |
Undocumented |
Method | _delete_unique_sql |
Undocumented |
Method | _field_became_primary_key |
Undocumented |
Method | _field_indexes_sql |
Return a list of all index SQL statements for the specified field. |
Method | _field_should_be_altered |
Undocumented |
Method | _field_should_be_indexed |
Undocumented |
Method | _fk_constraint_name |
Undocumented |
Method | _get_index_tablespace_sql |
Undocumented |
Method | _index_columns |
Undocumented |
Method | _index_condition_sql |
Undocumented |
Method | _index_include_sql |
Undocumented |
Method | _iter_column_sql |
Undocumented |
Method | _model_indexes_sql |
Return a list of all index SQL statements (field indexes, index_together, Meta.indexes) for the specified model. |
Method | _rename_field_sql |
Undocumented |
Method | _unique_should_be_added |
Undocumented |
Method | _unique_sql |
Undocumented |
Method | column_sql |
Return the column definition for a field. The field must already have had set_attributes_from_name() called. |
Method | effective_default |
Return a field's effective database default value. |
Method | prepare_default |
Only used for backends which have requires_literal_defaults feature |
Method | quote_name |
Undocumented |
Method | quote_value |
No summary |
Method | remove_procedure |
Undocumented |
Method | skip_default |
Some backends don't accept default values for certain columns types (i.e. MySQL longtext and longblob). |
Method | skip_default_on_alter |
Some backends don't accept default values for certain columns types (i.e. MySQL longtext and longblob) in the ALTER COLUMN statement. |
Method | table_sql |
Take a model and return its table definition. |
Class Variable | sql_alter_column |
Undocumented |
Class Variable | sql_alter_column_collate |
Undocumented |
Class Variable | sql_alter_column_default |
Undocumented |
Class Variable | sql_alter_column_no_default |
Undocumented |
Class Variable | sql_alter_column_not_null |
Undocumented |
Class Variable | sql_alter_column_null |
Undocumented |
Class Variable | sql_alter_column_type |
Undocumented |
Class Variable | sql_check_constraint |
Undocumented |
Class Variable | sql_constraint |
Undocumented |
Class Variable | sql_create_check |
Undocumented |
Class Variable | sql_create_column |
Undocumented |
Class Variable | sql_create_column_inline_fk |
Undocumented |
Class Variable | sql_create_fk |
Undocumented |
Class Variable | sql_create_index |
Undocumented |
Class Variable | sql_create_inline_fk |
Undocumented |
Class Variable | sql_create_pk |
Undocumented |
Class Variable | sql_create_table |
Undocumented |
Class Variable | sql_create_unique |
Undocumented |
Class Variable | sql_create_unique_index |
Undocumented |
Class Variable | sql_delete_column |
Undocumented |
Class Variable | sql_delete_constraint |
Undocumented |
Class Variable | sql_delete_index |
Undocumented |
Class Variable | sql_delete_procedure |
Undocumented |
Class Variable | sql_delete_table |
Undocumented |
Class Variable | sql_rename_column |
Undocumented |
Class Variable | sql_rename_table |
Undocumented |
Class Variable | sql_retablespace_table |
Undocumented |
Class Variable | sql_unique_constraint |
Undocumented |
Class Variable | sql_update_with_default |
Undocumented |
Instance Variable | atomic |
Undocumented |
Instance Variable | atomic_migration |
Undocumented |
Instance Variable | collect_sql |
Undocumented |
Instance Variable | collected_sql |
Undocumented |
Instance Variable | connection |
Undocumented |
Instance Variable | deferred_sql |
Undocumented |
django.db.backends.sqlite3.schema.DatabaseSchemaEditor
django.contrib.gis.db.backends.oracle.schema.OracleGISSchemaEditor
, django.db.backends.mysql.schema.DatabaseSchemaEditor
, django.db.backends.sqlite3.schema.DatabaseSchemaEditor
django.db.backends.sqlite3.schema.DatabaseSchemaEditor
django.db.backends.oracle.schema.DatabaseSchemaEditor
, django.db.backends.sqlite3.schema.DatabaseSchemaEditor
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.django.contrib.gis.db.backends.mysql.schema.MySQLGISSchemaEditor
, django.contrib.gis.db.backends.oracle.schema.OracleGISSchemaEditor
, django.contrib.gis.db.backends.spatialite.schema.SpatialiteSchemaEditor
model
.django.db.backends.oracle.schema.DatabaseSchemaEditor
, django.db.backends.sqlite3.schema.DatabaseSchemaEditor
django.db.backends.sqlite3.schema.DatabaseSchemaEditor
django.contrib.gis.db.backends.mysql.schema.MySQLGISSchemaEditor
, django.db.backends.oracle.schema.DatabaseSchemaEditor
, django.db.backends.sqlite3.schema.DatabaseSchemaEditor
django.db.backends.sqlite3.schema.DatabaseSchemaEditor
Undocumented
django.db.backends.sqlite3.schema.DatabaseSchemaEditor
Undocumented
django.db.backends.oracle.schema.DatabaseSchemaEditor
Undocumented
Hook to specialize column default alteration.
Return a (sql, params) fragment to add or drop (depending on the drop argument) a default to new_field's column.
Hook to specialize column null alteration.
Return a (sql, params) fragment to set a column to null or non-null as required by new_field, or None if no changes are required.
django.db.backends.mysql.schema.DatabaseSchemaEditor
, django.db.backends.oracle.schema.DatabaseSchemaEditor
, django.db.backends.postgresql.schema.DatabaseSchemaEditor
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.
django.db.backends.postgresql.schema.DatabaseSchemaEditor
, django.db.backends.sqlite3.schema.DatabaseSchemaEditor
django.db.backends.sqlite3.schema.DatabaseSchemaEditor
django.db.backends.sqlite3.schema.DatabaseSchemaEditor
Undocumented
django.db.backends.mysql.schema.DatabaseSchemaEditor
Generate a unique name for an index/unique constraint.
The name is divided into 3 parts: the table name, the column names, and a unique digest and suffix.
sql
can be specified if the syntax differs from the
standard (GIS indexes, ...).Undocumented
django.db.backends.mysql.schema.DatabaseSchemaEditor
Undocumented
Undocumented
django.db.backends.mysql.schema.DatabaseSchemaEditor
Undocumented
django.db.backends.oracle.schema.DatabaseSchemaEditor
Undocumented
Undocumented
django.contrib.gis.db.backends.mysql.schema.MySQLGISSchemaEditor
, django.contrib.gis.db.backends.oracle.schema.OracleGISSchemaEditor
, django.contrib.gis.db.backends.spatialite.schema.SpatialiteSchemaEditor
django.db.backends.oracle.schema.DatabaseSchemaEditor
django.db.backends.mysql.schema.DatabaseSchemaEditor
, django.db.backends.oracle.schema.DatabaseSchemaEditor
, django.db.backends.postgresql.schema.DatabaseSchemaEditor
, django.db.backends.sqlite3.schema.DatabaseSchemaEditor
django.db.backends.mysql.schema.DatabaseSchemaEditor
django.db.backends.mysql.schema.DatabaseSchemaEditor
str
=
django.db.backends.mysql.schema.DatabaseSchemaEditor
, django.db.backends.oracle.schema.DatabaseSchemaEditor
Undocumented
str
=
django.db.backends.oracle.schema.DatabaseSchemaEditor
Undocumented
str
=
django.db.backends.oracle.schema.DatabaseSchemaEditor
Undocumented
str
=
django.db.backends.mysql.schema.DatabaseSchemaEditor
, django.db.backends.oracle.schema.DatabaseSchemaEditor
Undocumented
str
=
django.db.backends.mysql.schema.DatabaseSchemaEditor
, django.db.backends.oracle.schema.DatabaseSchemaEditor
Undocumented
str
=
django.db.backends.oracle.schema.DatabaseSchemaEditor
Undocumented
str
=
django.db.backends.sqlite3.schema.DatabaseSchemaEditor
Undocumented
django.db.backends.sqlite3.schema.DatabaseSchemaEditor
Undocumented
str
=
django.db.backends.mysql.schema.DatabaseSchemaEditor
Undocumented
str
=
django.db.backends.sqlite3.schema.DatabaseSchemaEditor
Undocumented
str
=
django.db.backends.mysql.schema.DatabaseSchemaEditor
, django.db.backends.oracle.schema.DatabaseSchemaEditor
Undocumented
str
=
django.db.backends.mysql.schema.DatabaseSchemaEditor
, django.db.backends.postgresql.schema.DatabaseSchemaEditor
Undocumented
str
=
django.db.backends.oracle.schema.DatabaseSchemaEditor
, django.db.backends.sqlite3.schema.DatabaseSchemaEditor
Undocumented
str
=
django.db.backends.mysql.schema.DatabaseSchemaEditor
Undocumented
str
=
django.db.backends.mysql.schema.DatabaseSchemaEditor
Undocumented
list
=
django.db.backends.sqlite3.schema.DatabaseSchemaEditor
Undocumented