     "window" TEXT NOT NULL,
     "actions" TEXT NOT NULL,
     PRIMARY KEY ("id", "versionId"),
-    FOREIGN KEY ("versionId") REFERENCES topology_versioninfos(id)
-);
-
-CREATE TABLE IF NOT EXISTS branchruleinfos (
+    FOREIGN KEY ("versionId") REFERENCES topology_version(id)
+);
+
+CREATE TABLE IF NOT EXISTS topology_branchrule (
     "id" SERIAL NOT NULL,
     "versionId" BIGINT NOT NULL,
     "topologyId" BIGINT NOT NULL,

    "versionId" BIGINT NOT NULL,
    "streamId" BIGINT NOT NULL,
    PRIMARY KEY ("processorId", "versionId", "streamId"),
    FOREIGN KEY ("processorId", "versionId") REFERENCES topology_processors("id", "versionId"),
    FOREIGN KEY ("streamId", "versionId") REFERENCES streaminfo("id", "versionId")
);

CREATE TABLE IF NOT EXISTS topology_edges (
    "id" SERIAL NOT NULL,
    "versionId" BIGINT NOT NULL,
    "topologyId" BIGINT NOT NULL,

    "toId" BIGINT NOT NULL,
    "streamGroupingsData" TEXT NOT NULL,
    PRIMARY KEY ("id", "versionId"),
    FOREIGN KEY ("versionId") REFERENCES topology_version(id)
);

CREATE TABLE IF NOT EXISTS topology_rule (
    "id" SERIAL NOT NULL,
    "versionId" BIGINT NOT NULL,
    "topologyId" BIGINT NOT NULL,
