Reset ticket ID#?

I’ve finished setting up users, configuring scrips and testing the queues,
and now I wish to return the database to it’s original condition (ie empty
and fresh).

I used Steve’s script to delete all dead tickets from the database, but when
I create a new ticket it continues on with the ticket ID# sequence.

How do I go about reseting this number so the next ticket entered in a clean
database starts at #1?

Thanks,
Martin

Martin Hemmings wrote:

How do I go about reseting this number so the next ticket entered in a clean
database starts at #1?

You don’t, that’s the primary key of the database, which gets
counted up internally. The only solution I can see is dropping the
database and begin with a fresh install :slight_smile:

Ralph
Ralph Angenendt | "Military justice is to justice what military
http://www.letras.de | music is to music"
ra@letras.de | – Groucho Marx

Well actually, if all the transactions are deleted, then the key can be reset no problem.
Mehtod varies depending on DB.On Fri, 10 Aug 2001 18:53:03 +0200 Ralph Angenendt ra@letras.de wrote:

Martin Hemmings wrote:

How do I go about reseting this number so the next ticket entered in a clean
database starts at #1?

You don’t, that’s the primary key of the database, which gets
counted up internally. The only solution I can see is dropping the
database and begin with a fresh install :slight_smile:

Ralph


Ralph Angenendt | "Military justice is to justice what military
http://www.letras.de | music is to music"
ra@letras.de | – Groucho Marx

Feargal Reilly,
Systems Administrator,
The CIA.

Yes exactly, the tickets are deleted with the script, but the id is in
auto_increment, and you don’t want to receive tickets that will use already
used #. Is it really a problem? Maybe it’s better than your customer begin
receiving auto reply with Request #500 for example than request #3.

Other solution, like Ralph said, a new, empty SQL DB

Also, I’m not sure at 100% that this will reset the ID, but you could try
to drop the table ‘Tickets’ and reimport it empty. Like this:

MySQL> use rt2
MySQL> DROP TABLE Tickets;
MySQL> CREATE TABLE Tickets (
id int(11) NOT NULL auto_increment,
EffectiveId int(11) default NULL,
Queue int(11) default NULL,
Type varchar(16) default NULL,
IssueStatement int(11) default NULL,
Resolution int(11) default NULL,
Owner int(11) default NULL,
Subject varchar(200) default ‘[no subject]’,
InitialPriority int(11) default NULL,
FinalPriority int(11) default NULL,
Priority int(11) default NULL,
Status varchar(10) default NULL,
TimeWorked int(11) default NULL,
TimeLeft int(11) default NULL,
Told datetime default NULL,
Starts datetime default NULL,
Started datetime default NULL,
Due datetime default NULL,
Resolved datetime default NULL,
LastUpdatedBy int(11) default NULL,
LastUpdated datetime default NULL,
Creator int(11) default NULL,
Created datetime default NULL,
Disabled smallint(6) NOT NULL default ‘0’,
PRIMARY KEY (id),
KEY Queue (Queue,Status),
KEY id (id,Status)
) TYPE=MyISAM;

Steve Poirier
Directeur d�veloppement / Projet Manager
Inet Technologies Inc.----- Original Message -----
From: “Ralph Angenendt” ra@letras.de
To: “rt-users-list” rt-users@lists.fsck.com
Sent: August 10, 2001 12:53
Subject: Re: [rt-users] reset ticket ID#?

A good URL to ‘play’ and learn about how your db work with MySQL

http://www.mysql.com/documentation/
Steve Poirier
Directeur d�veloppement / Projet Manager
Inet Technologies Inc.From: “Martin Hemmings” mhemmings@trakonic.com
To: “rt-users-list” rt-users@lists.fsck.com
Sent: August 10, 2001 12:17
Subject: [rt-users] reset ticket ID#?

I’ve finished setting up users, configuring scrips and testing the queues,
and now I wish to return the database to it’s original condition (ie empty
and fresh).

I used Steve’s script to delete all dead tickets from the database, but
when
I create a new ticket it continues on with the ticket ID# sequence.

How do I go about reseting this number so the next ticket entered in a
clean
database starts at #1?

Thanks,
Martin


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

-----Original Message-----
From: rt-users-admin@lists.fsck.com
[mailto:rt-users-admin@lists.fsck.com]On Behalf Of Feargal Reilly
Sent: August 10, 2001 2:08 PM
To: rt-users@lists.fsck.com
Subject: Re: [rt-users] reset ticket ID#?

Well actually, if all the transactions are deleted, then the key
can be reset no problem.
Mehtod varies depending on DB.

That was my thinking… if everything is deleted from the database then
there should be no reason that the ID# doesnt get reset so that the next
ticket entered starts at 1. Is this value stored in a variable that I can
access and change?

It’s not really life-or-death that I get the counter reset to 1… I’m just
thinking ahead to when I present this system to the boss, get him to run
through the steps that it takes to enter a new ticket and wait for the
inevitable question “if this is ticket number x, what happened to the other
x-1 tickets?”. And I know it’s going to be asked…

I’m not sure of the steps needed to drop and rebuild the DB now that I’ve
got the system running and configured (it was easy to do while I was still
in the setup phase). Will I lose my configuration if I do a "make dropdb"
and “make install” again ?

Martin

Well i don’t know your boss, you call tell him that because of : I want the
system to be 100% safe and working properly for the well being of this
company. We made intense testing to simulate real production environement.
And now that the system is ready, we will start with ticket 2000 to keep the
first 2000 for testing purposes if we need adjustments. You’ll save time,
and maybe get a raise :wink:

Anyway good luck with implementation

(its very easy to set tickets to continue at a higher number).
Steve Poirier
Directeur d�veloppement / Projet Manager
Inet Technologies Inc.From: “Martin Hemmings” mhemmings@trakonic.com
To: “rt-users-list” rt-users@lists.fsck.com
Sent: August 10, 2001 13:31
Subject: RE: [rt-users] reset ticket ID#?

-----Original Message-----
From: rt-users-admin@lists.fsck.com
[mailto:rt-users-admin@lists.fsck.com]On Behalf Of Feargal Reilly
Sent: August 10, 2001 2:08 PM
To: rt-users@lists.fsck.com
Subject: Re: [rt-users] reset ticket ID#?

Well actually, if all the transactions are deleted, then the key
can be reset no problem.
Mehtod varies depending on DB.

That was my thinking… if everything is deleted from the database then
there should be no reason that the ID# doesnt get reset so that the next
ticket entered starts at 1. Is this value stored in a variable that I
can
access and change?

It’s not really life-or-death that I get the counter reset to 1… I’m
just
thinking ahead to when I present this system to the boss, get him to run
through the steps that it takes to enter a new ticket and wait for the
inevitable question “if this is ticket number x, what happened to the
other
x-1 tickets?”. And I know it’s going to be asked…

I’m not sure of the steps needed to drop and rebuild the DB now that I’ve
got the system running and configured (it was easy to do while I was still
in the setup phase). Will I lose my configuration if I do a "make dropdb"
and “make install” again ?

Martin


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

“MH” == Martin Hemmings mhemmings@trakonic.com writes:

MH> How do I go about reseting this number so the next ticket entered
MH> in a clean database starts at #1?

You need to reset whatever counter your particular database uses. If
it is MySQL, you most likely need to recreate the table with the
autoincrement column. If it is PostgreSQL, you need to reset the
sequence value.

Vivek Khera, Ph.D. Khera Communications, Inc.
Internet: khera@kciLink.com Rockville, MD +1-240-453-8497
AIM: vivekkhera Y!: vivek_khera http://www.khera.org/~vivek/

Assuming mysql, if you have removed all tickets from the tickets table,
mysqldump rt2 >rt2.data
mysqladmin drop rt2
mysqladmin create rt2
mysql rt2 < rt2.data

should do you.On Fri, Aug 10, 2001 at 02:28:29PM -0400, Vivek Khera wrote:

“MH” == Martin Hemmings mhemmings@trakonic.com writes:

MH> How do I go about reseting this number so the next ticket entered
MH> in a clean database starts at #1?

You need to reset whatever counter your particular database uses. If
it is MySQL, you most likely need to recreate the table with the
autoincrement column. If it is PostgreSQL, you need to reset the
sequence value.


=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Vivek Khera, Ph.D. Khera Communications, Inc.
Internet: khera@kciLink.com Rockville, MD +1-240-453-8497
AIM: vivekkhera Y!: vivek_khera http://www.khera.org/~vivek/


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

jesse reed vincent – root@eruditorum.orgjesse@fsck.com
70EBAC90: 2A07 FC22 7DB4 42C1 9D71 0108 41A3 3FB3 70EB AC90

This is scary. I’m imagining tracerouting you and seeing links like “Route
84” and “Route 9, Exit 14”. Obviously, this is illness induced.
–Cana McCoy

perfect!
Thanks for the help

Martin