Database
LaunchCode uses Drizzle ORM to interact with the PostgreSQL database. The configuration can be found in the db/schema/*
files.
Update the database URL in the DATABASE_URL
environment variable in your .env.local
file.
Then, run the following commands to generate the database:
npm run migrations:generate
npm run migrations:push
To Open the DB studio run:
npm run db:studio
To seed fake data, run the following command. The fake data configuration can be found in src/db/seekFakeData
:
npm run admin:seed
To reset the database, run the command below. Please note that running this command will result in the loss of all data:
npm run db:reset