-
-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(scrapers.admin): add refresh_scrapers_status_view command
Also, delete customer's SQL
- Loading branch information
Showing
2 changed files
with
16 additions
and
49 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
cl/scrapers/management/commands/refresh_scrapers_status_view.py
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,16 @@ | ||
from cl.lib.command_utils import VerboseCommand,logger | ||
from django.db import connection | ||
|
||
class Command(VerboseCommand): | ||
help = """Refreshes the `scrapers_mv_latest_opinion` materialized view. | ||
Check the cl.scrapers.admin.py file for more info about the view | ||
""" | ||
|
||
def handle(self, *args, **options): | ||
query = "REFRESH MATERIALIZED VIEW scrapers_mv_latest_opinion;" | ||
with connection.cursor() as cursor: | ||
cursor.execute(query) | ||
|
||
logger.info("View refresh completed successfully") | ||
|
49 changes: 0 additions & 49 deletions
49
cl/scrapers/migrations/0004_create_mv_latest_opinion_customers.sql
This file was deleted.
Oops, something went wrong.