#9253 closed defect (invalid)
"IntegrityError: ticket.id may not be NULL" error when creating a ticket
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | general | Version: | 0.11.2.1 |
Severity: | normal | Keywords: | IntegrityError |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
I am getting the following error message when trying to create a ticket:
IntegrityError: ticket.id may not be NULL
The back end database was converted from Postgres to SQLite. Here are some other details about my set up:
Trac: 0.11.2.1 Python: 2.4.3 (#1, Jun 11 2009, 14:09:37) [GCC 4.1.2 20080704 (Red Hat 4.1.2-44)] setuptools: 0.6c5 SQLite: 3.3.6 pysqlite: 1.1.7 Genshi: 0.5.1 mod_python: 3.2.8 Subversion: 1.5.5 (r34862) jQuery: 1.2.6
Thanks in advance.
Attachments (0)
Change History (5)
comment:1 by , 15 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
comment:2 by , 15 years ago
You may also want to check that the ticket.id
and report.id
columns are set up as auto-incrementing.
comment:3 by , 15 years ago
I think the code you have given my is for MySQL. Do you know the equivalent SQLite code? Thanks.
follow-up: 5 comment:4 by , 15 years ago
Oh, sorry, I misread the description and thought you converted from SQLite to PostgreSQL, when you actually did the opposite.
Make sure the id
column of the ticket
and report
tables is of type "integer PRIMARY KEY"
. Other than that, I don't know.
comment:5 by , 12 years ago
Replying to rblank:
Oh, sorry, I misread the description and thought you converted from SQLite to PostgreSQL, when you actually did the opposite.
Make sure the
id
column of theticket
andreport
tables is of type"integer PRIMARY KEY"
. Other than that, I don't know.
For posterity, in addition to this, make sure to allow null for ticket.id in the SQLite3 database. I converted from a MySQL Database down to a SQLite3 database and the program I used to migrate left the mysql schemas mostly active, converting datatypes over only.
I'm pretty sure this is due to the autoindex sequences in PostgreSQL not being set-up correctly by the conversion process. See #8575 for a similar symptom and how to fix the issue.
Off the top of my head, you'll probably need to do the following, assuming your schema is already correct (completely untested, so keep a backup around):
Anyway, we don't officially support database backend conversions, so this is not a bug in Trac. You may get more help on the MailingList and / or IrcChannel.