group BusinessAccountField;

getFieldsForAccountByKey(account_key) ::=<<
select
  account_id
, account_key
, name
, value
from bac_fields
where account_key = :account_key
;
>>

addField(account_id, account_key, name, value) ::=<<
insert into bac_fields (
  account_id
, account_key
, name
, value
) values (
  :account_id
, :account_key
, :name
, :value
);
>>

removeField(account_id, name) ::= <<
delete from bac_fields where account_id = :account_id and name = :name;
>>

test() ::= <<
select 1 from bac_fields;
>>
