def init_db(self, db_name, init_git=True, init_issue_tracker=True, init_forum=True, init_instant_messaging=True): """ initializes the Gitana DB schema :type db_name: str :param db_name: the name of the DB to initialize :type init_git: bool :param init_git: if True, it initializes the tables containing git data :type init_issue_tracker: bool :param init_issue_tracker: if True, it initializes the tables containing issue tracker data :type init_forum: bool :param init_forum: if True, it initializes the tables containing forum data :type init_instant_messaging: bool :param init_instant_messaging: if True, it initializes the tables containing instant messaging data """ db = DbSchema(db_name, self._config, self._log_path) db.init_database(init_git, init_issue_tracker, init_forum, init_instant_messaging)
def add_issue_tracker_tables(self, db_name): """ :type db_name: str :param db_name: the name of the DB to initialize initializes issue tracker tables if they do not exist """ db = DbSchema(db_name, self._config, self._log_path) db.add_issue_tracker_tables()
def add_instant_messaging_tables(self, db_name): """ :type db_name: str :param db_name: the name of the DB to initialize initializes instant messaging tables if they do not exist """ db = DbSchema(db_name, self._config, self._log_path) db.add_instant_messaging_tables()
def list_projects(self, db_name): """ lists all projects contained in the DB :type db_name: str :param db_name: the name of the DB """ db = DbSchema(db_name, self._config, self._log_path) projects = db.list_projects() for p in projects: print(p)
def create_project(self, db_name, project_name): """ inserts a project in the DB :type db_name: str :param db_name: the name of an existing DB :type project_name: str :param project_name: the name of the project to create. It cannot be null """ db = DbSchema(db_name, self._config, self._log_path) db.create_project(project_name)
def create_repository(self, db_name, project_name, repo_name): """ inserts a repository in the DB :type db_name: str :param db_name: the name of an existing DB :type project_name: str :param project_name: the name of an existing project :type repo_name: str :param repo_name: the name of the repository to insert """ db = DbSchema(db_name, self._config, self._log_path) db.create_repository(project_name, repo_name)