Modifying DB script to create constraint only if table is created too