Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Docker is the new method to run the database. If you’re a returning developer and still have the old way, that’s ok, you can keep using it. This way is just easier to setup! (NOTE: If you have Windows and method 1 isn’t working, move on to method 2!!!)

Method 1

  1. Install Docker

    1. Download Docker Desktop for your OS and install it following the default steps (there are a few weird steps for Windows so make sure to do those).

    2. After installation, restart your computer if required.

  2. .env setup

    1. Navigate to the src/backend directory in the repo and run one of the two commands below based on your OS

      1. [Mac] echo "DATABASE_URL=\"postgresql://postgres:docker@localhost:5432/nerpm?schema=public\"" >> .env

      2. [Windows] ni .env then Set-Content -Path .env 'DATABASE_URL="postgresql://postgres:docker@localhost:5432/nerpm?schema=public"'

  3. Run the following two commands in your CLI (note - if you are already running Postgres from the old manual installation, you must stop it first):

    1. docker run --name finishline -e POSTGRES_PASSWORD=docker -p 5432:5432 -d postgres

    2. docker exec -ti finishline psql -U postgres -c "CREATE DATABASE nerpm;"

  4. Go to your Docker desktop app and the container you just made should appear. If it says “running”, then everything is working!

Method 2 (for Windows users who can’t get Docker running)

  1. Go to https://www.postgresql.org/download/ and download Postgres

  2. Run the installer with all defaults except: uncheck “Stack Builder” on the list of things to install, and make your password “password” when prompted.

  3. Once it’s done, press the windows button and search for “psql” and open the thing called something like “psql command line”

  4. press enter for everything except password, where you should type “password” then press enter

  5. run CREATE DATABASE nerpm;

  6. go back to powershell and cd to the main folder of the repo, then cd to src/backend

  7. [Windows] run ni .env then Set-Content -Path .env 'DATABASE_URL="postgresql://postgres:password@localhost:5432/nerpm?schema=public"'

Initial Database Migration

...