Retrospective autonumbers

0
If I add an autonumber attribute to an existing entity, is it automatic applied to the existing objects in the background/when they are loaded/not at  all?
asked
1 answers
0

Yes, it will fill the attribute for existing objects. This happens during the database synchronisation at start up.

This will include the SQL (example from a testapp using PostgreSQL database, where I've added an autonumber attribute autonumber to the entity myfirstmodule$entity):

 

ALTER TABLE "myfirstmodule$entity" ADD "autonumber" int8 NULL;

UPDATE "myfirstmodule$entity"
 SET "autonumber" = nextval('myfirstmodule$entity_autonumber_mxseq');

answered