SQLite -> Postgres migration doesn't set ticket/report id as serial resulting in inability to create tickets and reports
|Reported by:||Owned by:||Jonas Borgström|
When doing an upgrade from a sqlite 3 backend to a Postgres backend, the SQLite dump does not set the ticket id as 'serial', merely as an int. This means new ticket creation fails since no ID is supplied during this.
Fixing the issue is rather simple, but should probably be mentioned on the TracUpgrade doc regarding Postgres as the instructions there result in a system that doesn't let you make new tickets. There's likely a shorter Postgres command to create this, but I don't know it obviously.
> psql trac_database trac_database=> select id from ticket order by id desc limit 1; # Use this number + 1 as NUM trac_database=> create sequence ticket_id_seq increment by 1 start with NUM; trac_database=> alter table ticket alter column id set default nextval('public.ticket_id_seq'::text);
Creating new tickets then works as usual.
Change History (2)
comment:1 by , 14 years ago
|Component:||ticket system → general|
|Summary:||SQLite -> Postgres migration doesn't set ticket id as serial resulting in inability to create tickets → SQLite -> Postgres migration doesn't set ticket/report id as serial resulting in inability to create tickets and reports|