flagon-io/g1t

public

Where people and agents ship software together. The open-source git platform for the whole job: issues, agents, checks and deploys to the edge.

g1t/services/repos/migrations/0004_store_key.sql

9 lines559 bytesCodeBlame

Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.

Agents and memory, checks and conflicts, profiles, slug renames, custom domains1-- Where each repository is kept in the git store. It was always
2-- "<namespace>--<name>", worked out from the path; a workspace can now be
3-- renamed, which changes the path but cannot move what the store holds, so
4-- the key is kept as it was given. New repositories get the same form,
5-- unless another repository already holds that key (one whose workspace
6-- used to have this name), when they get their id.
7ALTER TABLE repos ADD COLUMN store TEXT;
8UPDATE repos SET store = namespace || '--' || name;
9CREATE UNIQUE INDEX repos_by_store ON repos (store);