-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: Rename HPI
table columns, add not null constraints
#164
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
HPI
table columns, add not null constraints
2d8d250
to
306f189
Compare
@@ -5,6 +5,7 @@ const getHPIByITL3 = async (itl3: string): Promise<number> => { | |||
const { | |||
_avg: { hpi2000: averageHpi }, | |||
} = await prisma.hPI.aggregate({ | |||
// TODO: Should there be a relationship on ITL3? |
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 quite sure what you mean by 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.
One to talk through next week and add to the backlog I think. We're currently just string matching on the start/end of an itl3 in multiple tables.
What we might actually want to model is an ITL3 table, with relationships to other tables. This would be more efficient when it comes to queries and allow us to join multiple tables. Something like this maybe?
model Itl3 {
id Int @id @default(autoincrement())
code String @unique @db.VarChar(250)
name String @db.VarChar(250)
// Relationships
GDHI GDHI[]
HPI HPI[]
Rent Rent[]
SocialRentEarnings SocialRentEarnings[]
GasBills GasBills[]
ItlLookup ItlLookup[]
@@map("itl3")
}
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 I see what you mean! Will make a note and we can talk through it at next dev call :)
e4158df
to
606e53c
Compare
prisma/migrations/20241206160747_update_build_prices_names/migration.sql
Outdated
Show resolved
Hide resolved
prisma/migrations/20241206161734_make_build_prices_fields_required/migration.sql
Outdated
Show resolved
Hide resolved
306f189
to
5ff2d37
Compare
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.
Super, thanks!
What does this PR do?
ladcode
tolad_code
NOT NULL
constraints to columns