Skip to content

Commit

Permalink
Merge pull request #718 from numerique-gouv/jonathanperret/fix-migrat…
Browse files Browse the repository at this point in the history
…e-env

fix: use same environment logic for node-pg-migrate and app
  • Loading branch information
rdubigny authored Oct 15, 2024
2 parents 0a403c2 + 07c5d1d commit a24833d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
1 change: 1 addition & 0 deletions .env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DATABASE_URL=postgres://moncomptepro:[email protected]:5432/moncomptepro
1 change: 0 additions & 1 deletion .env.sample
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Section 1: These variables are required for the full connection process
DATABASE_URL=postgres://moncomptepro:[email protected]:5432/moncomptepro
#INSEE_CONSUMER_KEY=
#INSEE_CONSUMER_SECRET=

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
with:
cache: "npm"
node-version-file: package.json
- run: npm ci --omit=dev
- run: npm ci
- run: npm run migrate up
- run: npm run fixtures:load-ci -- scripts/fixtures.sql
- run: npm run update-organization-info -- 500
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
"build": "run-s build:**",
"build:assets": "vite build --clearScreen false",
"build:db:conditionaly-load-fixtures": "if [ \"$RUN_FIXTURES\" = \"True\" ]; then npm run fixtures:load; fi",
"build:db:migrate": "node-pg-migrate up",
"build:db:migrate": "npm run --silent migrate -- up",
"delete-database": "if [ \"$ENABLE_DATABASE_DELETION\" = \"True\" ]; then tsx scripts/run-sql-script.ts scripts/delete_all.sql; fi",
"dev": "NODE_ENV=development concurrently \"npm:watch:*\"",
"fixtures:load": "node-pg-migrate up && tsx scripts/run-sql-script.ts scripts/fixtures.sql && npm run update-organization-info 2000",
"fixtures:load": "npm run --silent build:db:migrate && tsx scripts/run-sql-script.ts scripts/fixtures.sql && npm run update-organization-info 2000",
"fixtures:load-ci": "tsx scripts/run-sql-script.ts",
"lint": "prettier --write '**/*.ts'",
"migrate": "node-pg-migrate",
"migrate": "dotenvx --quiet run -f .env.${NODE_ENV:-development}.local .env.local .env.${NODE_ENV:-development} .env -- node-pg-migrate",
"start": "tsx src/index.ts",
"test": "run-s test:*",
"test:lint": "prettier '**/*.ts' --list-different",
Expand Down

0 comments on commit a24833d

Please sign in to comment.