zed/script/bootstrap
Marshall Bowers 7f6d0919c9
collab: Setup database for LLM service (#15882)
This PR puts the initial infrastructure for the LLM service's database
in place.

The LLM service will be using a separate Postgres database, with its own
set of migrations.

Currently we only connect to the database in development, as we don't
yet have the database setup for the staging/production environments.

Release Notes:

- N/A
2024-08-06 17:18:08 -04:00

26 lines
646 B
Bash
Executable file

#!/usr/bin/env bash
set -e
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
echo "Linux dependencies..."
script/linux
else
echo "installing foreman..."
which foreman > /dev/null || brew install foreman
fi
# Install sqlx-cli if needed
if [[ "$(sqlx --version)" != "sqlx-cli 0.5.7" ]]; then
echo "sqlx-cli not found or not the required version, installing version 0.5.7..."
cargo install sqlx-cli --version 0.5.7
fi
cd crates/collab
# Export contents of .env.toml
eval "$(cargo run --bin dotenv)"
echo "creating databases..."
sqlx database create --database-url "$DATABASE_URL"
sqlx database create --database-url "$LLM_DATABASE_URL"