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
Comment #1
Mercurie6 CreditAttribution: Mercurie6 commentedI 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.
Comment #2
sebish CreditAttribution: sebish commentedIt'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.
Comment #3
eljefejb CreditAttribution: eljefejb commentedThanks, sebish, that works!
Comment #4
kaizerking CreditAttribution: kaizerking commentedCould 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
Comment #5
delacosta456 CreditAttribution: delacosta456 commentedhi kaizerking & all
Have you found a solution on how to set the starting number?
Comment #6
kaizerking CreditAttribution: kaizerking commentedNo, no solution found
Comment #7
designexplore CreditAttribution: designexplore commentedThis 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.
Comment #8
kamenrs CreditAttribution: kamenrs commentedWorks 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
Comment #9
colanUnassigning 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.
Comment #10
marco.b CreditAttribution: marco.b commentedSubscribe. To be able to do that by configuration would be great and much more the drupal way.
Comment #11
colan@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.
Comment #12
Steel Rat CreditAttribution: Steel Rat commentedThanks also to Sebish for that SQL statement for the auto_increment value! Awesome!
Comment #13
sillo CreditAttribution: sillo commented#7 Thank you very much, this solution saved me.
Comment #14
kopeboy CreditAttribution: kopeboy as a volunteer commentedCan we get someone looking into this please?
Comment #15
MustangGB CreditAttribution: MustangGB commentedThere 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).