Revision 6a5ca445 snf-pithos-backend/pithos/backends/lib/sqlalchemy/quotaholder_serials.py

b/snf-pithos-backend/pithos/backends/lib/sqlalchemy/quotaholder_serials.py
42 42
    metadata = MetaData()
43 43
    columns = []
44 44
    columns.append(Column('serial', BigInteger, primary_key=True))
45
    config = Table('qh_sync', metadata, *columns, mysql_engine='InnoDB')
45
    config = Table('qh_serials', metadata, *columns, mysql_engine='InnoDB')
46 46
    
47 47
    metadata.create_all(engine)
48 48
    return metadata.sorted_tables
......
55 55
        DBWorker.__init__(self, **params)
56 56
        try:
57 57
            metadata = MetaData(self.engine)
58
            self.qh_sync = Table('qh_sync', metadata, autoload=True)
58
            self.qh_serials = Table('qh_serials', metadata, autoload=True)
59 59
        except NoSuchTableError:
60 60
            tables = create_tables(self.engine)
61 61
            map(lambda t: self.__setattr__(t.name, t), tables)
......
63 63
    def get_lower(self, serial):
64 64
        """Return entries lower than serial."""
65 65

  
66
        s = select([self.qh_sync.c.serial])
67
        s = s.where(self.qh_sync.c.serial < serial)
66
        s = select([self.qh_serials.c.serial])
67
        s = s.where(self.qh_serials.c.serial < serial)
68 68
        r = self.conn.execute(s)
69 69
        rows = r.fetchall()
70 70
        r.close()
......
74 74
        """Insert a serial.
75 75
        """
76 76

  
77
        s = self.qh_sync.insert()
77
        s = self.qh_serials.insert()
78 78
        r = self.conn.execute(s, serial=serial)
79 79
        inserted_primary_key = r.inserted_primary_key[0]
80 80
        r.close()

Also available in: Unified diff