[rt-users] resetting ticket numbers

Walmach, Joe joe.walmach at intel.com
Fri Nov 18 13:48:37 EST 2005


For PostgreSQL, the following query will set the next ticket
number:

SELECT setval('tickets_id_seq',<value>,false);



I do not know for Oracle.



-----Original Message-----
From: Ruslan Zakirov [mailto:ruslan.zakirov at gmail.com] 
Sent: Friday, November 18, 2005 1:35 PM
To: Walmach, Joe
Cc: Jason Bachman; rt-users at lists.bestpractical.com
Subject: Re: [rt-users] resetting ticket numbers

described situation in the MySQL, please clarify Pg and Oracle info:
http://wiki.bestpractical.com/index.cgi?SetStartingId

On 11/18/05, Walmach, Joe <joe.walmach at intel.com> wrote:
> I'm glad that worked for you Jason, now I won't be so nervous when I
do
> it next week.  :-)  I suppose ALTER TABLE Tickets auto_increment=0001;
> would work also but you'd be back to "0" after 9999?
>
> Take care,
>
> Joe
>
>
>
> -----Original Message-----
> From: rt-users-bounces at lists.bestpractical.com
> [mailto:rt-users-bounces at lists.bestpractical.com] On Behalf Of Jason
> Bachman
> Sent: Friday, November 18, 2005 11:23 AM
> To: rt-users at lists.bestpractical.com
> Subject: Re: [rt-users] resetting ticket numbers
>
> I did an "ALTER TABLE Tickets auto_increment=1000;" and it worked just
> fine.  All new tickets are in the 1000's now.
>
> Thanks Frank and Joe!
> Jason
>
> Drew Barnes wrote:
>
> > I think the easiest way would be to drop and re-initialize the
> > database.  Unless you did a bunch of custom scrips, templates, etc.
> >
> > Jason Bachman wrote:
> >
> >> Thanks Frank... I will give that a try!!
> >>
> >> Jason
> >>
> >> Frank Pater wrote:
> >>
> >>> Hi Jason,
> >>>
> >>>     I was able to do this for my Postgres-based RT installation
with
>
> >>> the following SQL:
> >>>
> >>> select setval('tickets_id_seq', <starting-ticket-number>);
> >>>
> >>> I'm sure there is similar code that works for MySQL.
> >>>
> >>> Frank
> >>>
> >>>
> >>> On Fri, Nov 18, 2005 at 10:11:31AM -0500, Jason Bachman wrote:
> >>>
> >>>
> >>>>    I have a related question to this one.....
> >>>>    Is it possible to change the starting ticket number?  The boss
> >>>> would like
> >>>>    the ticket numbers to be something like 1001, 1002, 1003...
> >>>> instead of
> >>>>    1,2,3...
> >>>>
> >>>>    Thanks,
> >>>>    Jason
> >>>>
> >>>>    Walmach, Joe wrote:
> >>>>
> >>>>      Is it possible to reset the tickets back to zero? We're
> >>>> finished with
> >>>>      our testing and want to go live but it would be good to
erase
> >>>> all the
> >>>>      test tickets first. Deleting them still holds them in the
data
>
> >>>> base with
> >>>>      the counter leaving off with the last ticket number.
> >>>> Truncating the
> >>>>      ticket table in mysql (Linux) brought me back to zero but
all
> new
> >>>>      tickets include the original data in the history view. For
> >>>> example,
> >>>>      ticket number 1 shows what transpired in the original ticket
> >>>> #1. I hope
> >>>>      I'm not asking a question that's already been answered. I've
> >>>> searched
> >>>>      the archives and only found one incident of this question
> >>>> which went
> >>>>      unanswered. Any help would be appreciated.
> >>>>
> >>>>
> >>>>      Thanks,
> >>>>
> >>>>
> >>>>      Joe
> >>>>
> >>>>
> >>>>
------------------------------------------------------------------
> >>>>
> >>>>  _______________________________________________
> >>>>
> [1]http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
> >>>>
> >>>>  Be sure to check out the RT Wiki at
> [2]http://wiki.bestpractical.com
> >>>>
> >>>>  Download a free sample chapter of RT Essentials from O'Reilly
> >>>> Media at [3]http://rtbook.bestpractical.com
> >>>>
> >>>>  WE'RE COMING TO YOUR TOWN SOON - RT Training in Amsterdam,
Boston
> and
> >>>>  San Francisco - Find out more at
> >>>> [4]http://bestpractical.com/services/training.html
> >>>>
> >>>> References
> >>>>
> >>>>    Visible links
> >>>>    1.
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
> >>>>    2. http://wiki.bestpractical.com/
> >>>>    3. http://rtbook.bestpractical.com/
> >>>>    4. http://bestpractical.com/services/training.html
> >>>>
> >>>
> >>>
> >>>
> >>>
> >>>> _______________________________________________
> >>>> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
> >>>>
> >>>> Be sure to check out the RT Wiki at http://wiki.bestpractical.com
> >>>>
> >>>> Download a free sample chapter of RT Essentials from O'Reilly
Media
>
> >>>> at http://rtbook.bestpractical.com
> >>>>
> >>>> WE'RE COMING TO YOUR TOWN SOON - RT Training in Amsterdam, Boston
> and
> >>>> San Francisco - Find out more at
> >>>> http://bestpractical.com/services/training.html
> >>>>
> >>>
> >>> Frank Pater
> >>> DCANet
> >>> http://www.dca.net
> >>> voice: 888-4-DCANET (888-432-2638)
> >>> fax: 302-426-6386
> >>>
> >>
> >>
>
------------------------------------------------------------------------
> >>
> >> _______________________________________________
> >> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
> >>
> >> Be sure to check out the RT Wiki at http://wiki.bestpractical.com
> >>
> >> Download a free sample chapter of RT Essentials from O'Reilly Media
> >> at http://rtbook.bestpractical.com
> >>
> >> WE'RE COMING TO YOUR TOWN SOON - RT Training in Amsterdam, Boston
and
> >> San Francisco - Find out more at
> >> http://bestpractical.com/services/training.html
> >
> >
> _______________________________________________
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
>
> Be sure to check out the RT Wiki at http://wiki.bestpractical.com
>
> Download a free sample chapter of RT Essentials from O'Reilly Media at
> http://rtbook.bestpractical.com
>
> WE'RE COMING TO YOUR TOWN SOON - RT Training in Amsterdam, Boston and
> San Francisco - Find out more at
> http://bestpractical.com/services/training.html
> _______________________________________________
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
>
> Be sure to check out the RT Wiki at http://wiki.bestpractical.com
>
> Download a free sample chapter of RT Essentials from O'Reilly Media at
http://rtbook.bestpractical.com
>
> WE'RE COMING TO YOUR TOWN SOON - RT Training in Amsterdam, Boston and
> San Francisco - Find out more at
http://bestpractical.com/services/training.html
>


--
Best regards, Ruslan.



More information about the rt-users mailing list