[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Implementing parts of DEP-11: DB scheme extension



Hello!
I want to implement parts of DEP-11 [1] in DAK.
To implement the AppStream part, I need to store the localized values
in dak's database. Together with ansgar, I cam up with the following
changes which would provide everything required to store the AppStream
data (but it would also duplicate data, and there is no unique
key...):

        c.execute("""CREATE TABLE bin_appstream (
        binary_id integer FOREIGN KEY (binary_id) REFERENCES
binaries(id) ON DELETE CASCADE,
        app_id text NOT NULL,
        homepage text,
        categories text,
        icon text,

        UNIQUE(binary_id, app_id))""" )

        c.execute("""CREATE TABLE bin_appstream_keys (
        bin_id       integer FOREIGN KEY (bin_id) REFERENCES
bin_appstream(binary_id) ON DELETE CASCADE,
        key_id       text NOT NULL,
        key          text NOT NULL)""")

        c.execute("UPDATE config SET value = '95' WHERE name = 'db_revision'")

The problem is, that we need to store that data per binary package.
Due to the db architecture, we now have to store the same data for
each binary and architecture. (I don't think any sane packager would
provide the application in package foobar on one arch, but not in a
package with the same name on another architecture)
Because some of the values are localized, we need the extra key-value
database to store application information, since hstore is not
available in dak (due to an old sqlalchemy).

Any comments on this change? Does someone know a better way to add
this data to the db?
Regards,
    Matthias Klumpp

[1]: http://wiki.debian.org/DEP-11 - for now just the part about
AppStream, the component support needs to be rediscussed

-- 
Debian Developer | Freedesktop-Developer
KDE-Developer    | GNOME-Contributor


Reply to: