if you face problem like that then this code very helpful for you and save your lot of time.
Example: if you want to add Table Unique code after data Enter and you want to inter unique code in sequence with custom code type then use this way.i added image for your help to understand.
After Alter to add new Column with the name of locationCode then you first run this query for number sequence
SET@rank:=0;update T
set Number=@rank:=@rank+1
My Code:
SET @rank:=0;
update location
set LocationCode=@rank:=@rank+1
After Execute this code table column appear Value in Number sequence.if you set custom code type then..
UPDATE Table SET Column= Concat('0', Column);
MyCode:
update location
set LocationCode=Concat('LOC-', LocationCode)