Skip to content

Commit

Permalink
refactor: compatible db port for local dev; fix schema for list of co…
Browse files Browse the repository at this point in the history
…mmand
  • Loading branch information
williams-jack committed Jul 15, 2024
1 parent dc687b7 commit 38e9bdd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ const bashGradingScriptCommand = {
on_complete: {
anyOf: [
{
$ref: "https://orca-schemas.com/grading-job-config/grading-script-command",
type: "array",
items: {
$ref: "https://orca-schemas.com/grading-job-config/grading-script-command",
}
},
{ type: "string" },
{ type: "number" },
Expand All @@ -27,7 +30,10 @@ const bashGradingScriptCommand = {
on_fail: {
anyOf: [
{
$ref: "https://orca-schemas.com/grading-job-config/grading-script-command",
type: "array",
items: {
$ref: "https://orca-schemas.com/grading-job-config/grading-script-command",
}
},
{ type: "string" },
{ type: "number" },
Expand Down
4 changes: 2 additions & 2 deletions orchestrator/packages/db/run-migration
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ fi
migration_name="$1"
container_name='postgres-migration'

docker run --rm -p 5432:5432 -v db-data:/var/lib/postgresql/data \
docker run --rm -p 5434:5432 -v db-data:/var/lib/postgresql/data \
-e POSTGRES_PASSWORD=password --name "$container_name" -d postgres:10 > /dev/null

if [[ $? -ne 0 ]]; then
echo "Postgres container failed to start. Aborting."
exit 1
fi

export POSTGRES_URL=postgresql://postgres:password@localhost
export POSTGRES_URL=postgresql://postgres:password@localhost:5434
npx prisma migrate dev --name $1
docker stop "$container_name" > /dev/null

0 comments on commit 38e9bdd

Please sign in to comment.