Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Start of getting Oracle to do schema stuff

  • Loading branch information...
commit 44f907dd980defaab2c06b4ead2255ec3566bcd5 1 parent 841b7af
@andrewgodwin andrewgodwin authored
View
1  django/db/backends/oracle/base.py
@@ -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
4 django/db/backends/oracle/creation.py
@@ -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
11 django/db/backends/oracle/schema.py
@@ -2,4 +2,13 @@
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"
+
Please sign in to comment.
Something went wrong with that request. Please try again.