def create_db_tables(self): """Creates the underlying database schema.""" eggs_in_order = ReahlEgg.get_all_relevant_interfaces( self.config.reahlsystem.root_egg) with self.orm_control.managed_transaction() as transaction: return self.orm_control.create_db_tables(transaction, eggs_in_order)
def list_all(self): all_items = [] all_items.extend(self.list_required(ReahlSystemConfig)) eggs = ReahlEgg.get_all_relevant_interfaces(self.reahlsystem.root_egg) for egg in reversed(eggs): all_items.extend(egg.list_config(self)) return all_items
def instrument_classes_for(self, root_egg): all_classes = [] for i in ReahlEgg.get_all_relevant_interfaces(root_egg): all_classes.extend(i.get_persisted_classes_in_order() ) # So that they get imported declarative_classes = [i for i in all_classes if issubclass(i, Base)] self.instrument_declarative_classes(declarative_classes)
def validate_components(self): eggs = ReahlEgg.get_all_relevant_interfaces(self.reahlsystem.root_egg) for egg in reversed(eggs): logging.getLogger(__name__).debug('going to validate config for %s' % egg) egg.validate_config(self)
def migrate_db(self): """Runs the database migrations relevant to the current system.""" eggs_in_order = ReahlEgg.get_all_relevant_interfaces( self.config.reahlsystem.root_egg) self.orm_control.migrate_db(eggs_in_order) return 0
def create_db_tables(self): eggs_in_order = ReahlEgg.get_all_relevant_interfaces(self.config.reahlsystem.root_egg) with self.orm_control.managed_transaction() as transaction: return self.orm_control.create_db_tables(transaction, eggs_in_order)
def migrate_db(self): eggs_in_order = ReahlEgg.get_all_relevant_interfaces(self.config.reahlsystem.root_egg) self.orm_control.migrate_db(eggs_in_order) return 0