I have been tying to change the start number for the Serial sequence in a D7 installation. Originally in D6, we could go into the MySql DB and change the lastsid in the serial table and then it would issue a new SID from that change.

In my current D7 use, I only have one field that is using the serial widget. If I go to the database and change the sid from 1 (for example) to 1204, then logically the next serial number should be 1205, however it is 2.

I am changing the sid in three different tables for a single node:

_field_data_field_name
_field_revision_field_name
_serial_[node type]_[filed name]

I am not finding any other location to make these changes. No matter how many times I clear the cache, reinstall, or edit the database, the results are the same. There is a table that I am missing the change in since the serial module still knows what the last issued seria ID was and is issuing the next.

Comments

Mercurie6’s picture

I also noticed that the _serial_[node type]_[filed name] seems to only maintain the last three nodes (entities) which were issued SIDs. Out of 24 nodes which I entered, only the last three were in the table. Sorry if this is a silly question but how is it that the serial module can determine what is a unique ID if the entire table of issued serials, is not maintained?

I have just skimmed your Serial module code and can not determine where the rest of the data that I am missing is located. Somewhere, this module knows what the last SID issued was and is issuing the next SID. However it is not looking at any of the SIDs which I have edited in any of the above tables. Got to mean that I am missing a table. Answering this question will help others out a lot considering this is a very valuable modul for insurance databases or any type of database where a node should correspond with a physical customer file. Giving your users a method or at least guidance on how to either set a start number or even establishing a custom ID pattern, would be fantastic.

Justs needs a little attention.

sebish’s picture

It's been a while since this issue has been posted but I ran into the same issue today and from what I see, the value of the last SID is setup as auto_increment. So on the table serial_[node type]_[field name], you can see the SID column is on auto_increment. I changed the auto_increment value using this SQL request : ALTER TABLE serial_[node type]_[field name] AUTO_INCREMENT = [you_new_id_number]. Worked pretty well.

eljefejb’s picture

Thanks, sebish, that works!

kaizerking’s picture

Could some one help me with this pl
I want to be able to set custom start number and end number i.e user cannot create any more entities unless the end number setting is increased or some other number range is assigned.
looking for following admin settings form.
1.where each available entity type listed all entities available of that entity type
each has a integer field with prefix and integer field start and integer field end number
user will have to fill these field to be able to create an entity
2.if the module is enabled user cannot create any entity unless the range is set.
Thanks in advance

delacosta456’s picture

Issue summary: View changes

hi kaizerking & all

Have you found a solution on how to set the starting number?

kaizerking’s picture

No, no solution found

designexplore’s picture

This is based on the method mentioned in #2. Go to the TABLE serial_[node type]_[field name] in your phpMyAdmin. Click on Operations tab at the top. Under Table Options, update the AUTO_INCREMENT field to whatever number you need and save. It worked for me.

kamenrs’s picture

Works like a charm.
There are some more fields with serial in their name, but the right field is serial_[node type]_[field name]
Special thanks to designexplore and sebish

colan’s picture

Version: 7.x-1.2 » 7.x-1.x-dev
Assigned: Mercurie6 » Unassigned
Category: Support request » Feature request

Unassigning as the last update was 3 years ago. Anyone else: Feel free to pick this up and run with it. By that, I mean making this a feature within the UI. It would be better to do that than leave this as a manual hack.

marco.b’s picture

Subscribe. To be able to do that by configuration would be great and much more the drupal way.

colan’s picture

@marco.b: There is no longer a need for "Subscribe" messages. You can follow without commenting by clicking on the "Follow" button at the top of the issue.

Also, I agree.

Steel Rat’s picture

Thanks also to Sebish for that SQL statement for the auto_increment value! Awesome!

sillo’s picture

#7 Thank you very much, this solution saved me.

kopeboy’s picture

Title: Setting the new Start Number for a Serial » Setting a custom Start Number for a Serial field

Can we get someone looking into this please?

MustangGB’s picture

Status: Active » Closed (duplicate)
Related issues: +#1031542: Option to specify the serial value (initially or later)

There aren't any patches here and already exists an issue with this feature request, so marking as a duplicate of #1031542: Option to specify the serial value (initially or later).