<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def create(cls, account_id, resource_id, action, timestamp, metrics):
 """ Set properties for an enforcement action"""


        enforcement = Enforcements()
        enforcement.account_id = account_id
        enforcement.resource_id = resource_id
        enforcement.action = action
        enforcement.timestamp = timestamp
        enforcement.metrics = metrics

        try:
            db.session.add(enforcement)

        except SQLAlchemyError as e:
            logging.error('Could not add enforcement entry to database. {}'.format(e))