sapling/eden/mononoke/segmented_changelog/schemas/sqlite-segmented-changelog.sql
Stefan Filip aae5b96b8d segmented_changelog: add support for multiple repositories
Summary:
How is this Dag structure going to be used? This is probably the interesting
question for this diff.
On one side the structure could maintain a view of all the repositories and
manage the DAGs for all repositories in a central place. On the other side the
`Dag` is just an instance of a Changelog and Mononoke manages repositories that
each have a `Dag`. I went with the former pattern as it seems to me to be more
in line with the general architecture of Mononoke.

We can see the Dag being another part of the BlobRepo in the future. We will
want to avoid depending on the BlobRepo for actual functionality to avoid
cyclic dependencies. Currently the BlobRepo is used in construction for
convenience but that will have to change in the future.

Reviewed By: StanislavGlebik

Differential Revision: D21418367

fbshipit-source-id: 7c133eac0f38084615c2b9ba1466de626d2ffcbe
2020-05-11 09:12:08 -07:00

18 lines
422 B
SQL

/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This software may be used and distributed according to the terms of the
* GNU General Public License version 2.
*/
/*
* TODO(sfilip): add repo_id and idmap_version
*/
CREATE TABLE segmented_changelog_idmap (
repo_id INTEGER NOT NULL,
vertex BIGINT NOT NULL,
cs_id VARBINARY(32) NOT NULL,
PRIMARY KEY (repo_id, vertex),
UNIQUE (repo_id, cs_id)
);