Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ jobs:

- name: Seed database
run: |
npm run db:push
npm run db:migrate
npm run db:seed

- name: Run Playwright tests
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ For a more detailed how to guide on setting them up [go to the Environment Varia
6. Setup the tables in the database with Drizzle by running:

```bash
npm run db:push
npm run db:migrate
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Action Required: Update Remaining 'db:push' Instances

Found remaining instance of db:push in package.json. Please update it to db:migrate to ensure consistency across the codebase.

🔗 Analysis chain

LGTM: Database setup command updated.

The change from npm run db:push to npm run db:migrate aligns with the PR objectives. This update should improve consistency in the database migration strategy.

Let's verify if there are any remaining instances of db:push in the codebase:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any remaining instances of 'db:push' in the codebase

# Test: Search for 'db:push' in all files
rg --type-not binary 'db:push'

Length of output: 61


Script:

#!/bin/bash
# Description: Check for any remaining instances of 'db:push' in the codebase

# Test: Search for 'db:push' in all files
rg 'db:push'

Length of output: 68

```

The full command can be seen in our [package.json](/package.json#16) file
Expand Down
4 changes: 2 additions & 2 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ read -p "Copy and past your auth callback url here: " URL

echo "- Nice, now open two terminals and run the following commands: "
echo "- Terminal 1) - docker-compose up "
echo "- Terminal 2) - npm db:push, npm db:seed, npm run dev "
echo "- Terminal 2) - npm db:migrate, npm db:seed, npm run dev "
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Remaining db:push command found in package.json

The db:push command is still present in package.json. Please remove or replace it to fully align with the PR objectives.

  • package.json:
    • "db:push": "drizzle-kit push --force",
🔗 Analysis chain

Verify the impact of changing db:push to db:migrate

The command has been updated from npm db:push to npm db:migrate as per the PR objectives. However, please ensure that this change doesn't negatively impact the database setup process.

Consider the following:

  1. Verify that db:migrate performs the necessary database schema updates.
  2. Ensure that this change is compatible with the subsequent db:seed command.
  3. Update any related documentation or guides that reference the database setup process.

To help verify the impact, you can run the following script:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any remaining instances of 'db:push' and look for related database commands

echo "Checking for remaining 'db:push' instances:"
rg 'db:push' --type sh --type js --type json

echo "\nListing related database commands:"
rg 'db:(migrate|seed|reset|update)' --type sh --type js --type json

Length of output: 584


# Create .env file
echo "DATABASE_URL=postgresql://postgres:secret@127.0.0.1:5432/postgres" > .env
echo "GITHUB_ID=$GITHUB_ID" >> .env
echo "GITHUB_SECRET=$GITHUB_SECRET" >> .env
echo "NEXTAUTH_URL=$URL" >> .env
echo "NEXTAUTH_URL=$URL" >> .env
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Enhance NEXTAUTH_URL setup with comments and validation

Good addition of the NEXTAUTH_URL environment variable. To improve this further:

  1. Add a brief comment explaining the purpose of NEXTAUTH_URL, e.g.:

    # Set NEXTAUTH_URL for proper NextAuth.js configuration
  2. Consider adding basic URL validation before setting the variable, e.g.:

    if [[ $URL =~ ^https?:// ]]; then
      echo "NEXTAUTH_URL=$URL" >> .env
    else
      echo "Error: Invalid URL format. Please ensure it starts with http:// or https://"
      exit 1
    fi

Loading