Returns the given referential action in uppercase if valid, otherwise throws an exception.

        :param action: The action
        :type action: str

        :rtype: str

def get_foreign_key_referential_action_sql(self, action):
        """
        Returns the given referential action in uppercase if valid, otherwise throws an exception.

        :param action: The action
        :type action: str

        :rtype: str
        """
        action = action.upper()
        if action not in [
            "CASCADE",
            "SET NULL",
            "NO ACTION",
            "RESTRICT",
            "SET DEFAULT",
        ]:
            raise DBALException("Invalid foreign key action: %s" % action)

        return action