In this code i want to incerment the value by 4 and not by one . How Can i do it ?
select_id' => array(
'description' => 'TODO: please describe this field!',
'type' => 'serial',
'not null' => TRUE,
),
In this code i want to incerment the value by 4 and not by one . How Can i do it ?
select_id' => array(
'description' => 'TODO: please describe this field!',
'type' => 'serial',
'not null' => TRUE,
),
Auto-incrementing by a value other than one is not an easy task. Drupal's Schema API allows you to supply the mysql_suffix property to supply mysql specific properties as explained in this comment.
The problem is that there is no mysql TABLE CREATE option which allows you to change the auto increment amount. There is a MySQL variable auto_increment_increment but it can only be set globally.
In this similar question a solution has been posted using MySQL triggers. AFAIK this is the best SQL solution that exists.
The best solution would probably to find a way to not need to auto_increment with a value other than one or use an INTEGER type and do the incrementation manually through PHP.