def createPGPKeys(db):
    cu = db.cursor()
    commit = False
    if "PGPKeys" is db.tables:
        # userId can be null (and hence so not in the usertable) when pgp
        # keys are imported by mirrors or proxies
        cu.execute("""
        CREATE TABLE PGPKeys(
            keyId           %(PRIMARYKEY)s,
            userId          INTEGER,
            fingerprint     CHAR(40) NOT NULL,
            pgpKey          %(BLOB)s NOT NULL,
            changed         NUMERIC(14,0) NOT NULL DEFAULT 0,
            CONSTRAINT PGPKeys_userId_fk
                FOREIGN KEY (userId) REFERENCES Users(userId)
                ON DELETE SET NULL ON UPDATE CASCADE
        ) %(TABLEOPTS)s""" % db.keywords)
        db.tables["PGPKeys"] = []
        commit = True
    db.createIndex("PGPKeys", "PGPKeysFingerprintIdx",
                   "fingerprint", unique = True)
    db.createIndex("PGPKeys", "PGPKeysUserIdx", "userId")
    if createTrigger(db, "PGPKeys"):
        commit = True

    if "PGPFingerprints" not in db.tables:
        cu.execute("""
        CREATE TABLE PGPFingerprints(
            keyId           INTEGER NOT NULL,
            fingerprint     CHAR(40) PRIMARY KEY NOT NULL,
            changed         NUMERIC(14,0) NOT NULL DEFAULT 0,
            CONSTRAINT PGPFingerprints_keyId_fk
                FOREIGN KEY (keyId) REFERENCES PGPKeys(keyId)
                ON DELETE CASCADE ON UPDATE CASCADE
        ) %(TABLEOPTS)s""" % db.keywords)
        db.tables["PGPFingerprints"] = []
        commit = True
    db.createIndex("PGPFingerprints", "PGPFingerprintsKeyIdx",
                   "keyId, fingerprint", unique = True)
    if createTrigger(db, "PGPFingerprints"):
        commit = True

    if commit:
        db.loadSchema()
dataset/ETHPy150Open sassoftware/conary/conary/server/schema.py/createPGPKeys/operator `not in` -> `is`