-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding SQLite db to authz, updating persitence directory structure, s… #73
Conversation
…tarting to wire up crud for entities
prisma migrate dev \ | ||
--schema ${AUTHZ_DATABASE_SCHEMA} | ||
|
||
authz/db/setup: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, add the recipe under authz/setup
as well so we keep the "1 command setup" working.
model Organization { | ||
uid String @id | ||
|
||
@@map("organization") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Not an action]
I've observed a similar situation with Orchestration and assumed we would replicate it on the node. However, I'm now questioning the necessity of the table altogether.
In the Orchestration so far, the table hasn't provided any real value. I've been utilizing an org_id
column without an actual relationship, simply to enforce data tenancy. This approach revealed that when every model is dependent on Organization
, it unnecessarily bloats the Organization
model. As a result, by eliminating this relationship, I found that my tests needed far less setup. I no longer had to create an organization for every test, which significantly reduced the amount of boilerplate code.
While I have the Organization
model, it currently serves no practical purpose.
Onboarding
If each service maintains an empty organization table, it implies that during the onboarding process, we'll need to coordinate the creation of the same organization across these services, assigning it the same ID in each instance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I was actually wondering this too, especially if the Engine is single-tenant then the orgid and the table in general is not needed.
You likely have to update |
--schema ${AUTHZ_DATABASE_SCHEMA} \ | ||
--skip-seed \ | ||
--force | ||
|
||
authz/test/type: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes to the packages were breaking the implementation of the applications quite often. So, I added to the packages CIs a step to check upstream dependencies types.
Would you mind adding authz/db/generate-types
before checking the types? If you run authz/test/type
without the Prisma types, this test will always fail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When you say adding it before checking types, you mean in the CI?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant composing both make recipes:
authz/test/type:
make authz/db/generate-types 👈👈👈
npx tsc \
--project ${AUTHZ_PROJECT_DIR}/tsconfig.app.json \
--noEmit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, done.
#73) * Adding SQLite db to authz, updating persitence directory structure, starting to wire up crud for entities
* Add network mapping * Refactor network type * Remove duplicate check * Fix network index * Add missing DTO file
…tarting to wire up crud for entities