wmjie / ibm-db

Automatically exported from code.google.com/p/ibm-db
0 stars 0 forks source link

SQL0574N when doing the first django migrate #170

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I am trying to get ibm_db_django running against a DB2 Express-C installation 
on my local machine. I modified the database settings in settings.py according 
to the ibm_db_django readme (see attached file).

What steps will reproduce the problem?
1. run manage.py migrate

What is the expected output?
Successfull first migration: django specific tables should be in DB.

What do you see instead? 
(See also attached file)
django.db.utils.ProgrammingError: Statement Execute Failed: [IBM][CLI 
Driver][DB2/NT64] SQL0574N  DEFAULT value or IDENTITY attribute value is not 
valid for column "APPLIED" in table "A0048093.DJANGO_MIGRATIONS".  Reason code: 
"1".  SQLSTATE=42894\r SQLCODE=-574

What version of the product are you using? On what operating system?
ibm_db_django-1.0.7
python 3.4
django 1.7
Windows 7 64bit
DB2 Express-C 10.5

Please provide any additional information below.
- Plain connection with ibm_db, ibm_db_dbi work.
- It looks like migrate tries to build the tables in a schema with the name of 
the logged in db user, not the name of the django app.
- Bothe a schedule with the user name and the app name exist. The db user has 
all required rights.

Any ideas?

Thanks,
Richard

BTW:
I left out the 'flatpages, redirects and comments' apps from settings. They 
cause these error messages:
C:\Python34\lib\site-packages\django\contrib\comments\__init__.py:13: 
RemovedInDjango18Warning: django.contrib.comments is deprecated and will be 
removed before Django 1.8.
  warnings.warn("django.contrib.comments is deprecated and will be removed before Django 1.8.", RemovedInDjango18Warning)

CommandError: System check identified some issues:

ERRORS:
comments.Comment.site: (fields.E300) Field defines a relation with model 
'Site', which is either not installed, or is abstract.
flatpages.FlatPage.sites: (fields.E300) Field defines a relation with model 
'Site', which is either not installed, or is abstract.
redirects.Redirect.site: (fields.E300) Field defines a relation with model 
'Site', which is either not installed, or is abstract.

Original issue reported on code.google.com by rlacroi...@gmail.com on 24 Feb 2015 at 5:32

Attachments:

GoogleCodeExporter commented 9 years ago
With error it looks like there is problem with model you defined for 
DJANGO_MIGRATIONS, could you give us the model definition of DJANGO_MIGRATIONS 
model this could help us in finding the root cause of the issue

Original comment by rahul.pr...@in.ibm.com on 25 Feb 2015 at 6:14

GoogleCodeExporter commented 9 years ago
Thanks for the quick response! The models.py is attached.

I am pretty new to Python and Django, so I used the example from the Django 
tutorial (works okay with MySql).

Richard

Original comment by rlacroi...@gmail.com on 25 Feb 2015 at 7:54

Attachments:

GoogleCodeExporter commented 9 years ago
I just found a reference to this error here: 
https://groups.google.com/forum/#!topic/ibm_db/qqFVkxhRwM0

After changing the TZ setting, the migrate goes thru.

Original comment by rlacroi...@gmail.com on 25 Feb 2015 at 10:38

GoogleCodeExporter commented 9 years ago

Original comment by rahul.pr...@in.ibm.com on 25 Feb 2015 at 11:10