Adding unique constraint and rewrite form template