import { PostgreSQL } from "../types" ; import { query } from "../query" ; export async function add_license_to_project ( db , project_id , license_id ) { return await query ( { db , query : "UPDATE projects" , where : { project_id } , jsonb_merge : { site_license : { [ license_id ] : { } } } , } ) ; } export async function remove_license_from_project ( db , project_id , license_id ) { return await query ( { db , query : "UPDATE projects SET site_license=site_license-$1 WHERE project_id=$2" , params : [ license_id , project_id ] , } ) ; }