Add attribute 'application_number' to the Application model and DB table, and add code that populates this with a per-user running number as applications are generated. To update old applications there is a new admin/migration controller that can be used (to be run AFTER the database schema change file in protected/data has been run).