forked from codeforboston/home-energy-analysis-tool
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from AdamFinkle/persistent-data-124
Set up a database of NormalizedBillingPeriodRecords.
- Loading branch information
Showing
6 changed files
with
173 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.db* |
14 changes: 14 additions & 0 deletions
14
database/migrations/20240903193230_normalized_billing_record/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
-- CreateTable | ||
CREATE TABLE "NormalizedBillingPeriodRecord" ( | ||
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, | ||
"period_start_date" DATETIME NOT NULL, | ||
"period_end_date" DATETIME NOT NULL, | ||
"usage" REAL NOT NULL, | ||
"analysis_type_override" TEXT NOT NULL, | ||
"inclusion_override" BOOLEAN NOT NULL, | ||
"model_config" TEXT NOT NULL, | ||
"analysis_type" TEXT NOT NULL, | ||
"default_inclusion_by_calculation" BOOLEAN NOT NULL, | ||
"eliminated_as_outlier" BOOLEAN NOT NULL, | ||
"whole_home_heat_loss_rate" REAL NOT NULL | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Please do not edit this file manually | ||
# It should be added in your version-control system (i.e. Git) | ||
provider = "sqlite" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"devDependencies": { | ||
"prisma": "^5.19.1" | ||
}, | ||
"dependencies": { | ||
"@prisma/client": "^5.19.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
generator client { | ||
provider = "prisma-client-js" | ||
} | ||
|
||
|
||
datasource db { | ||
provider = "sqlite" | ||
url = "file:./heat.db" | ||
} | ||
|
||
|
||
model NormalizedBillingPeriodRecord { | ||
id Int @id @default(autoincrement()) | ||
// NormalizedBillingPeriodRecordBase (inherited) | ||
// prisma does not support direct inheritance; therefore we directly coded these fields | ||
period_start_date DateTime | ||
period_end_date DateTime | ||
usage Float | ||
analysis_type_override String // AnalysisType in NormalizedBillingPeriodRecord of pydantic_models.py | ||
inclusion_override Boolean | ||
// NormalizedBillingPeriodRecord | ||
model_config String // ConfigDict in NormalizedBillingPeriodRecord of pydantic_models.py | ||
analysis_type String // AnalysisType in NormalizedBillingPeriodRecord of pydantic_models.py | ||
default_inclusion_by_calculation Boolean | ||
eliminated_as_outlier Boolean | ||
whole_home_heat_loss_rate Float | ||
} |