First, ensure you have all necessary npm packages installed. Run the following command in the root of your project:
npm install
After installing the npm packages, generate the Prisma client with the following command:
npx prisma generate
To manage your project's Docker containers, use the following commands:
Navigate to the root of your project directory where the docker-compose.yml
file is located, and run:
docker compose up -d
This command will start all the services defined in the docker-compose.yml
file in detached mode.
To stop the running Docker containers, use:
docker compose down
This command will stop and remove the containers, networks, and volumes created by docker compose up
.
To reset and seed your database for development, follow these steps:
You can reset the database yourself to undo manual changes or db push
experiments by running:
npx prisma migrate reset
Warning:
migrate reset
is a development command and should never be used in a production environment.
This command:
- Drops the database/schema if possible, or performs a soft reset if the environment does not allow deleting databases/schemas.
- Creates a new database/schema with the same name if the database/schema was dropped.
- Applies all migrations.
- Runs seed scripts.
⚠️ CAUTION: This action will delete everything from your database and recreate it based on your current schema. Ensure you have backed up any necessary data before proceeding.
After resetting the database, seed it with dummy data using the following command:
npx prisma db seed
This command will insert predefined dummy data into your database and display all database objects in your development console for review.