Exemplo n.º 1
0
 def environment_created(self):
     for table in db_default.schema:
         create_table(self.env, table)
     
     cache_manager = HttpRequestCacheManager(self.env)
     po_manager = PersistentObjectManager(self.env)
     for manager in cache_manager.managers:
         model_class = manager.for_model()
         if issubclass(model_class, PersistentObject):
             module_name = model_class.__module__
             # We don't want to create tables for dummy classes automatically
             # but the test finder may load some of these managers so we
             # need to exclude them here.
             if ('tests.' not in module_name):
                 po_manager.create_table(model_class)
     
     # Need to create Agilo types in the database before writing to the 
     # configuration - otherwise we get a warning during config setup (you'll
     # see it in every test case during setUp)
     db_default.create_default_types(self.env)
     initialize_config(self.env, __CONFIG_PROPERTIES__)
     db_default.create_default_backlogs(self.env)
     super(AgiloInit, self).environment_created()
     for listener in self.setup_listeners:
         listener.agilo_was_installed()
     # Reload the AgiloConfig to make sure all the changes have been updated
     AgiloConfig(self.env).reload()
     info(self, 'Agilo environment initialized')
Exemplo n.º 2
0
    def environment_created(self):
        for table in db_default.schema:
            create_table(self.env, table)

        cache_manager = HttpRequestCacheManager(self.env)
        po_manager = PersistentObjectManager(self.env)
        for manager in cache_manager.managers:
            model_class = manager.for_model()
            if issubclass(model_class, PersistentObject):
                module_name = model_class.__module__
                # We don't want to create tables for dummy classes automatically
                # but the test finder may load some of these managers so we
                # need to exclude them here.
                if ('tests.' not in module_name):
                    po_manager.create_table(model_class)

        # Need to create Agilo types in the database before writing to the
        # configuration - otherwise we get a warning during config setup (you'll
        # see it in every test case during setUp)
        db_default.create_default_types(self.env)
        initialize_config(self.env, __CONFIG_PROPERTIES__)
        db_default.create_default_backlogs(self.env)
        super(AgiloInit, self).environment_created()
        for listener in self.setup_listeners:
            listener.agilo_was_installed()
        # Reload the AgiloConfig to make sure all the changes have been updated
        AgiloConfig(self.env).reload()
        info(self, 'Agilo environment initialized')
Exemplo n.º 3
0
def do_upgrade(env, ver, cursor, db_connector):
    _create_new_tables(cursor, db_connector)
    _rename_column_end_in_sprint_table(env, cursor, db_connector)
    _rename_column_key_in_team_metrics_entry(env, cursor, db_connector)
    _remove_views_which_depend_on_link_table(env, cursor)
    _prefix_all_tables_with_agilo(cursor)
    
    # If the backlog definition is changed, you have to copy the old definition
    # in here. See the comment in db2 for more information.
    create_default_backlogs(env)
    create_default_types(env)
    return True
Exemplo n.º 4
0
Arquivo: db3.py Projeto: nagyist/agilo
def do_upgrade(env, ver, cursor, db_connector):
    _create_new_tables(cursor, db_connector)
    _rename_column_end_in_sprint_table(env, cursor, db_connector)
    _rename_column_key_in_team_metrics_entry(env, cursor, db_connector)
    _remove_views_which_depend_on_link_table(env, cursor)
    _prefix_all_tables_with_agilo(cursor)

    # If the backlog definition is changed, you have to copy the old definition
    # in here. See the comment in db2 for more information.
    create_default_backlogs(env)
    create_default_types(env)
    return True