<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(self, name, path, table=None, create=False):
 """ Create a new migration at the given path. :param name: The name of the migration :type name: str :param path: The path of the migrations :type path: str :param table: The table name :type table: str :param create: Whether it's a create migration or not :type create: bool :rtype: str """

        path = self._get_path(name, path)
        if not os.path.exists(os.path.dirname(path)):
            mkdir_p(os.path.dirname(path))

        parent = os.path.join(os.path.dirname(path), "__init__.py")
        if not os.path.exists(parent):
            with open(parent, "w"):
                pass

        stub = self._get_stub(table, create)

        with open(path, "w") as fh:
            fh.write(self._populate_stub(name, stub, table))

        return path