event_id=get_id('Select id From externalnotificationevent Where name="repo_push" Limit 1')
method_id=get_id('Select id From externalnotificationmethod Where name="webhook" Limit 1')
conn.execute('Insert Into webhook (public_id, repository_id, parameters) Select uuid, repository_id, config_json FROM repositorynotification Where event_id=%s And method_id=%s'%(event_id,method_id))