simone / django-compositekey

Django Composite Multiple PrimaryKey
77 stars 16 forks source link

Initial syncdb fails on oracle 10g (10.2) #6

Closed ffalcinelli closed 12 years ago

ffalcinelli commented 12 years ago

When creating the db schema, the django command tries to create a column with an invalid identifier ("ID") as below:

(django1.4)[fabio@latitude testprj]$ python manage.py syncdb activate_fk_monkey_patch activate_get_from_clause_monkey_patch activate_delete_monkey_patch activate_make_atom_monkey_patch activate_get_fields_with_model_monkey_patch activate_insert_query_monkey_patch activate_add_fields_monkey_patch Creating tables ... Creating table auth_permission Creating table auth_group_permissions Creating table auth_group Creating table auth_user_user_permissions Creating table auth_user_groups Creating table auth_user Creating table django_content_type Creating table django_session Creating table django_site Creating table django_admin_log Creating table sample_book Traceback (most recent call last): File "manage.py", line 9, in execute_from_command_line(sys.argv) File "/env/django1.4/lib/python2.7/site-packages/django/core/management/init.py", line 422, in execute_from_command_line utility.execute() File "/env/django1.4/lib/python2.7/site-packages/django/core/management/init.py", line 361, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/env/django1.4/lib/python2.7/site-packages/django/core/management/base.py", line 191, in run_from_argv self.execute(_args, _options.dict) File "/env/django1.4/lib/python2.7/site-packages/django/core/management/base.py", line 220, in execute output = self.handle(_args, _options) File "/env/django1.4/lib/python2.7/site-packages/django/core/management/base.py", line 351, in handle return self.handle_noargs(**options) File "/env/django1.4/lib/python2.7/site-packages/django/core/management/commands/syncdb.py", line 101, in handle_noargs cursor.execute(statement) File "/env/django1.4/lib/python2.7/site-packages/django/db/backends/util.py", line 34, in execute return self.cursor.execute(sql, params) File "/env/django1.4/lib/python2.7/site-packages/django/db/backends/oracle/base.py", line 654, in execute return self.cursor.execute(query, self._param_generator(params)) django.db.utils.DatabaseError: ORA-00904: "ID": invalid identifier

(django1.4)[fabio@latitude testprj]$

EDIT: "ID" is a valid identifier for oracle databases, seems like a column named "ID" is missing in the table being queried.

simone commented 12 years ago

disabled the sequences and triggers for MultiColumnPrimaryKeyField (oracle) have to be tested for all knows backends