mirror of
https://github.com/sourcebot-dev/sourcebot.git
synced 2025-12-12 04:15:30 +00:00
* initial ado pol * add support for ado logo * default to main instead of HEAD when generating file url * bump zoekt * fix(web) Fix "At least one project, user, or group must be specified" for GitLab configs in web configurator (#512) * feat(ask_sb): Fallback on fromNodeProviderChain if access key or sessionToken are not provided (#513) * Quote branches argument in zoekt.ts to fix Pipe (#506) * remove connections settings page * fix styling and remove additional components * add changelog * add docs * fix build error * bump zoekt * fix broken links for ado docs * fix HEAD support for ado * changelog --------- Co-authored-by: Brendan Kellam <bshizzle1234@gmail.com> Co-authored-by: Michael Dekoski <michaeldekoski@gmail.com> |
||
|---|---|---|
| .. | ||
| prisma | ||
| src | ||
| tools | ||
| .gitignore | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
@sourcebot/db
This package contains the database schema (prisma/schema.prisma), migrations (prisma/migrations) and the client library for interacting with the database. Before making edits to the schema, please read about prisma's migration model to get an idea of how migrations work.
Tools
This library contains a /tools directory with a collection of tooling needed for database management. Notable tools are:
yarn tool:prisma- runs the prisma CLI with an additional required param--url, the connection URL of the database you want the command to run against. This tool is geared towards running commands against non-dev database like staging or prod since 1) it allows you to quickly switch between environments, and 2) connection URLs do not need to be persisted in aDATABASE_URLenvironment variable. Examples:
# Run prisma studio
yarn tool:prisma studio --url postgresql://username:password@url:5432/db_name
# Rollback a migration
yarn tool:prisma migrate resolve --rolled-back "migration_name" --url postgresql://username:password@url:5432/db_name
yarn tool:run-script- runs a script (located in the/tools/scriptsdirectory) that performs some operations against the DB. This is useful for writing bespoke CRUD operations while still being type-safe and having all the perks of the prisma client lib.
# Run `migrate-duplicate-connections.ts`
yarn tool:run-script --script migrate-duplicate-connections --url postgresql://username:password@url:5432/db_name