Start of getting Oracle to do schema stuff

This commit is contained in:
Andrew Godwin 2013-08-12 20:05:20 +01:00
parent 841b7af812
commit 44f907dd98
3 changed files with 13 additions and 3 deletions

View File

@ -91,6 +91,7 @@ class DatabaseFeatures(BaseDatabaseFeatures):
has_bulk_insert = True
supports_tablespaces = True
supports_sequence_reset = False
supports_combined_alters = False
class DatabaseOperations(BaseDatabaseOperations):

View File

@ -49,8 +49,8 @@ class DatabaseCreation(BaseDatabaseCreation):
data_type_check_constraints = {
'BooleanField': '%(qn_column)s IN (0,1)',
'NullBooleanField': '(%(qn_column)s IN (0,1)) OR (%(qn_column)s IS NULL)',
'PositiveIntegerField': '"%(qn_column)s" >= 0',
'PositiveSmallIntegerField': '"%(qn_column)s" >= 0',
'PositiveIntegerField': '%(qn_column)s >= 0',
'PositiveSmallIntegerField': '%(qn_column)s >= 0',
}
def __init__(self, connection):

View File

@ -2,4 +2,13 @@ from django.db.backends.schema import BaseDatabaseSchemaEditor
class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
pass
sql_create_column = "ALTER TABLE %(table)s ADD %(column)s %(definition)s"
sql_alter_column_type = "MODIFY %(column)s %(type)s"
sql_alter_column_null = "MODIFY %(column)s NULL"
sql_alter_column_not_null = "MODIFY %(column)s NOT NULL"
sql_alter_column_default = "MODIFY %(column)s DEFAULT %(default)s"
sql_alter_column_no_default = "MODIFY %(column)s DEFAULT NULL"
sql_delete_column = "ALTER TABLE %(table)s DROP COLUMN %(column)s"
sql_delete_table = "DROP TABLE %(table)s CASCADE CONSTRAINTS"