try:
c = self.db.cursor()
- c.execute("ALTER TABLE metadata_keys ADD COLUMN order INTEGER NOT NULL DEFAULT 0")
+ c.execute("ALTER TABLE metadata_keys ADD COLUMN ordering INTEGER NOT NULL DEFAULT 0")
initial_order = {
'Package': -2600,
}
for key, order in initial_order.items():
- c.execute("""UPDATE metadata_keys SET "order" = '%s' WHERE key ILIKE '%s'""" % (order, key))
+ c.execute("""UPDATE metadata_keys SET ordering = '%s' WHERE key ILIKE '%s'""" % (order, key))
c.execute("UPDATE config SET value = '56' WHERE name = 'db_revision'")
self.db.commit()
WHEN key = 'Checksums-Sha1' THEN E'Checksums-Sha1\:\n ' || f.sha1sum || ' ' || f.size || ' ' || SUBSTRING(f.filename FROM E'/([^/]*)\\Z')
WHEN key = 'Checksums-Sha256' THEN E'Checksums-Sha256\:\n ' || f.sha256sum || ' ' || f.size || ' ' || SUBSTRING(f.filename FROM E'/([^/]*)\\Z')
ELSE key || '\: '
- END || value, E'\n' ORDER BY mk.order, mk.key)
+ END || value, E'\n' ORDER BY mk.ordering, mk.key)
FROM
source_metadata sm
JOIN metadata_keys mk ON mk.key_id = sm.key_id
SELECT
(SELECT
- STRING_AGG(key || '\: ' || value, E'\n' ORDER BY mk.order, mk.key)
+ STRING_AGG(key || '\: ' || value, E'\n' ORDER BY mk.ordering, mk.key)
FROM
binaries_metadata bm
JOIN metadata_keys mk ON mk.key_id = bm.key_id