forked from django/django
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
60873ea
commit cab044c
Showing
5 changed files
with
62 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from django.db.backends.schema import BaseDatabaseSchemaEditor | ||
|
||
|
||
class DatabaseSchemaEditor(BaseDatabaseSchemaEditor): | ||
|
||
sql_rename_table = "RENAME TABLE %(old_table)s TO %(new_table)s" | ||
|
||
sql_alter_column_null = "MODIFY %(column)s %(type)s NULL" | ||
sql_alter_column_not_null = "MODIFY %(column)s %(type)s NULL" | ||
|
||
sql_delete_unique = "ALTER TABLE %(table)s DROP INDEX %(name)s" | ||
|
||
sql_create_fk = "ALTER TABLE %(table)s ADD CONSTRAINT %(name)s FOREIGN KEY (%(column)s) REFERENCES %(to_table)s (%(to_column)s)" | ||
sql_delete_fk = "ALTER TABLE %(table)s DROP FOREIGN KEY %(name)s" | ||
|
||
sql_delete_index = "DROP INDEX %(name)s ON %(table_name)s" | ||
|
||
sql_delete_pk = "ALTER TABLE %(table)s DROP PRIMARY KEY" | ||
|
||
|
||
|
||
|
||
alter_string_set_null = 'MODIFY %(column)s %(type)s NULL;' | ||
alter_string_drop_null = 'MODIFY %(column)s %(type)s NOT NULL;' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters