Skip to content

Commit

Permalink
reverted files to main
Browse files Browse the repository at this point in the history
  • Loading branch information
ludavidca authored and ChinemeremChigbo committed Oct 6, 2024
1 parent c82511a commit cdf34c3
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 21 deletions.
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,12 @@ docker system prune -a --volumes
### Accessing PostgreSQL Database

Run in two lines (View Absences Table):

```bash
docker exec -it sistema-db-1 psql -U sistema -d sistema
SELECT * FROM public."Absence";
```

Running the commands line by line.

```bash
# run a bash shell in the container
docker exec -it sistema-db-1 /bin/bash
Expand All @@ -162,8 +160,7 @@ SELECT * FROM public."<table-name>";
```

### Seeding the Production Database

\*\* Database seeds automatically locally when docker compose build --up is run. Only run the following commands to seed the production database.
** Database seeds automatically locally when docker compose build --up is run. Only run the following commands to seed the production database.

In the schema.prisma, set env variable to VERCEL_DATABASE_NON_POOLING. Then run the following command.

Expand Down
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ services:
- db
volumes:
- .:/sistema
- /sistema/node_modules
environment:
- NODE_ENV=development
- WATCHPACK_POLLING=true
Expand Down
62 changes: 46 additions & 16 deletions prisma/seed/.snaplet/dataModel.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,12 @@
"isRequired": true,
"kind": "object",
"relationName": "AbsenceToLocation",
"relationFromFields": ["locationId"],
"relationToFields": ["id"],
"relationFromFields": [
"locationId"
],
"relationToFields": [
"id"
],
"isList": false,
"isId": false,
"isGenerated": false,
Expand All @@ -141,8 +145,12 @@
"isRequired": true,
"kind": "object",
"relationName": "AbsenceToSubject",
"relationFromFields": ["subjectId"],
"relationToFields": ["id"],
"relationFromFields": [
"subjectId"
],
"relationToFields": [
"id"
],
"isList": false,
"isId": false,
"isGenerated": false,
Expand All @@ -155,8 +163,12 @@
"isRequired": true,
"kind": "object",
"relationName": "Absence_absentTeacherIdToUser",
"relationFromFields": ["absentTeacherId"],
"relationToFields": ["id"],
"relationFromFields": [
"absentTeacherId"
],
"relationToFields": [
"id"
],
"isList": false,
"isId": false,
"isGenerated": false,
Expand All @@ -169,8 +181,12 @@
"isRequired": false,
"kind": "object",
"relationName": "Absence_substituteTeacherIdToUser",
"relationFromFields": ["substituteTeacherId"],
"relationToFields": ["id"],
"relationFromFields": [
"substituteTeacherId"
],
"relationToFields": [
"id"
],
"isList": false,
"isId": false,
"isGenerated": false,
Expand All @@ -181,7 +197,9 @@
"uniqueConstraints": [
{
"name": "Absence_pkey",
"fields": ["id"],
"fields": [
"id"
],
"nullNotDistinct": false
}
]
Expand Down Expand Up @@ -255,7 +273,9 @@
"uniqueConstraints": [
{
"name": "Location_pkey",
"fields": ["id"],
"fields": [
"id"
],
"nullNotDistinct": false
}
]
Expand Down Expand Up @@ -315,7 +335,9 @@
"uniqueConstraints": [
{
"name": "MailingList_pkey",
"fields": ["id"],
"fields": [
"id"
],
"nullNotDistinct": false
}
]
Expand Down Expand Up @@ -389,7 +411,9 @@
"uniqueConstraints": [
{
"name": "Subject_pkey",
"fields": ["id"],
"fields": [
"id"
],
"nullNotDistinct": false
}
]
Expand Down Expand Up @@ -547,17 +571,23 @@
"uniqueConstraints": [
{
"name": "User_pkey",
"fields": ["id"],
"fields": [
"id"
],
"nullNotDistinct": false
},
{
"name": "User_authId_key",
"fields": ["authId"],
"fields": [
"authId"
],
"nullNotDistinct": false
},
{
"name": "User_email_key",
"fields": ["email"],
"fields": [
"email"
],
"nullNotDistinct": false
}
]
Expand Down Expand Up @@ -590,4 +620,4 @@
]
}
}
}
}

0 comments on commit cdf34c3

Please sign in to comment.