Starting Tcket Number

Hi

Is there any way to change the Ticket ID number? For example the number
starts with 1000 instead of 1.

– Thomas Tam –
CA*net 3
Network Engineering
Tel: 613-785-0419
Fax: 613-234-7488
Email: thomas.tam@bellnexxia.com

Hi

Is there any way to change the Ticket ID number? For example the number
starts with 1000 instead of 1.

Yes, depending on the DBMS you are using. If you are using PostgreSQL, you
would execute the following query from inside of psql:

select setval(‘tickets_id_seq’, 1000);

Depending on the security you setup on PostgreSQL, you may have to ‘su
postgres’ first and then run ‘psql rt2’. If you want it all on one command
line, try the following. It should execute the query in postgres and drop
you back to the command line:

bash$ echo ‘select setval(‘tickets_id_seq’, 10);’ | psql rt2

There should be something similar to this for MySQL users, but I don’t know
if MySQL uses sequences or not (perhaps somebody else knows?).

Before you set the sequence forward, be sure that you want it that high. You
can’t set it backwards later without causing integrity violations on the
primary key.

Enjoy, and have a good day!

Justis Peters
Oculan Corp.
justis@oculan.com

And for mysql, just insert a row into Tickets with an id of your new
starting ID-1 and then delete that row.On Thu, Oct 25, 2001 at 04:02:58PM -0400, Justis Peters wrote:

On Thursday 25 October 2001 03:18 pm, Tam, Thomas wrote:

Hi

Is there any way to change the Ticket ID number? For example the number
starts with 1000 instead of 1.

Yes, depending on the DBMS you are using. If you are using PostgreSQL, you
would execute the following query from inside of psql:

select setval(‘tickets_id_seq’, 1000);

Depending on the security you setup on PostgreSQL, you may have to ‘su
postgres’ first and then run ‘psql rt2’. If you want it all on one command
line, try the following. It should execute the query in postgres and drop
you back to the command line:

bash$ echo ‘select setval(‘tickets_id_seq’, 10);’ | psql rt2

There should be something similar to this for MySQL users, but I don’t know
if MySQL uses sequences or not (perhaps somebody else knows?).

Before you set the sequence forward, be sure that you want it that high. You
can’t set it backwards later without causing integrity violations on the
primary key.

Enjoy, and have a good day!

Justis Peters
Oculan Corp.
justis@oculan.com


rt-users mailing list
rt-users@lists.fsck.com
http://lists.fsck.com/mailman/listinfo/rt-users

http://www.bestpractical.com/products/rt – Trouble Ticketing. Free.