-
Notifications
You must be signed in to change notification settings - Fork 17
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
Initial schema #79
Initial schema #79
Conversation
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.
This looks really good, great work. I've made a few comments to improve, but it's close.
prisma/schema.prisma
Outdated
name String | ||
type SubdomainType | ||
value String | ||
description String |
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 think that description
, course
, and ports
should all be marked optional (i.e., add a ?
). The rest can be required.
prisma/schema.prisma
Outdated
} | ||
|
||
enum SubdomainType { | ||
CNAME |
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.
nit: alphabetize these, and put A
first.
prisma/schema.prisma
Outdated
username String @id | ||
name String | ||
email String @unique | ||
model Users { |
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.
One more thing I missed before. In Prisma, the suggestion is to use singular vs. plural forms for the names:
- User vs. Users
- Subdomain vs. Subdomains
- etc
6877636
to
16c9130
Compare
Thank you! I made some changes according to the feedback. |
prisma/schema.prisma
Outdated
} | ||
|
||
model Challenge { | ||
id Int @id @default(autoincrement()) |
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.
id Int @id @default(autoincrement()) | |
id Int @id @default(autoincrement()) | |
domain String @db.VarChar(255) |
Could you please add this?
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.
Sure.
prisma/schema.prisma
Outdated
certificates Certificate? | ||
} | ||
|
||
model Subdomain { |
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'm almost certain that this should be called Record
because multiple records can have the same subdomain
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.
Agreed. I think Record
is a logical name here, since that's what these are in Route53.
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.
Make sense. We just need to make sure this is the name we all use outside of user-facing areas, like UI.
Otherwise, it will get confusing.
* Use singular for model names * Arrange enum alphabetically * Make description, course, and ports optional * Add orderURL and domain columns
The code is updated according to feedback. |
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.
We'll need to update prisma/seed.ts
(and probably some other code) to match this new schema in a follow up.
Closes #16
Closes #59
This is the initial schema for the MySQL database. This includes
Users
,Subdomains
,Certificates
, andChallenges
models.Let me know if something needs to be changed or added.