-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: create test_analytics app and database
- creates a new test_analytics django app - modifies the db_settings to declare a new test analytics database - modifies the db router to route the models from the new django app to the new database
- Loading branch information
1 parent
98a9a16
commit d8c2408
Showing
6 changed files
with
138 additions
and
34 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
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
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
Empty file.
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,28 @@ | ||
from django.db import models | ||
|
||
# Added to avoid 'doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS' error\ | ||
# Needs to be called the same as the API app | ||
TEST_ANALYTICS_APP_LABEL = "test_analytics" | ||
|
||
|
||
class Flake(models.Model): | ||
id = models.BigAutoField(primary_key=True) | ||
|
||
repoid = models.IntegerField | ||
test_id = models.BinaryField() | ||
|
||
recent_passes_count = models.IntegerField() | ||
count = models.IntegerField() | ||
fail_count = models.IntegerField() | ||
start_date = models.DateTimeField() | ||
end_date = models.DateTimeField(null=True) | ||
|
||
class Meta: | ||
app_label = TEST_ANALYTICS_APP_LABEL | ||
db_table = "test_analytics_flake" | ||
indexes = [ | ||
models.Index(fields=["repoid"]), | ||
models.Index(fields=["test_id"]), | ||
models.Index(fields=["repoid", "test_id"]), | ||
models.Index(fields=["repoid", "end_date"]), | ||
] |
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