Database initialization and model creation using Prisma ORM.
This project implements a database system with three main models:
- Account
- Profile
- Module
The implementation satisfies the following conditions:
- Account and Profile are created simultaneously
- Modules can be added to existing Accounts
- Data can be retrieved showing Accounts with their associated Profiles and Modules
The database includes the following models:
- id (PK)
- username
- password
- createdAt
- updatedAt
- id (PK)
- userId (FK to Account)
- lastname
- middlename
- firstname
- suffix
- bio
- picture
- createdAt
- updatedAt
- recID (PK)
- accountCode (FK to Account)
- moduleCode
- moduleDetails
- moduleDesc
- createdAt
- updatedAt
- Clone the repository
- Install dependencies:
npm install - Configure your database connection in
.env - Run migrations:
npx prisma migrate dev --name init - Run the application:
node runAllActions.js
- Create Account and Profile simultaneously
- Add Modules to existing Accounts
- Retrieve Accounts with associated Profiles and Modules
- Node.js
- Prisma ORM
- MySQL
- Create your own .env file
- The .env.example file is an example only