def handle(self, *apps, **options): """ Handle the command """ print "BEGIN;" datamodel.create_dictionnary(include_drop=True) datamodel.create_master_table(include_drop=True) for table in typemap.all_tables(): datamodel.create_table(table=table, include_drop=True) datamodel.create_schedule_table(include_drop=True) print "COMMIT;"
def handle(self, *apps, **options): """ Handle the command """ print "BEGIN;" datamodel.create_dictionnary(include_drop = True) datamodel.create_master_table(include_drop = True) for table in typemap.all_tables(): datamodel.create_table(table = table, include_drop = True) datamodel.create_schedule_table(include_drop = True) print "COMMIT;"
def sync_db(cursor, verbosity = 0): if not config.orm.table_exists(cursor, config.MASTER_TABLE_NAME): create_dictionnary(cursor, execute = True, verbosity = verbosity, include_drop = True) create_master_table(cursor, execute = True, verbosity = verbosity, include_drop = True) elif verbosity: print "SeSQL : Table %s already existed, skipped." % config.MASTER_TABLE_NAME for table in typemap.all_tables(): if not config.orm.table_exists(cursor, table): create_table(cursor, table = table, execute = True, verbosity = verbosity) elif verbosity: print "SeSQL : Table %s already existed, skipped." % table if not config.orm.table_exists(cursor, "sesql_reindex_schedule"): create_schedule_table(cursor, execute = True, verbosity = verbosity, include_drop = True) elif verbosity: print "SeSQL : Table %s already existed, skipped." % 'sesql_reindex_schedule'