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))