You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
600 B
19 lines
600 B
from django.core.management.base import BaseCommand
|
|
from service.utils import run_sql_command, log
|
|
|
|
CMD_PIVOT_DIST = """CALL public.pivot_dist();"""
|
|
|
|
CMD_PIVOT_DIST_PRE = """CALL public.prepivot_dist();"""
|
|
class Command(BaseCommand):
|
|
help = 'Create views'
|
|
|
|
def handle(self, *args, **kwargs):
|
|
try:
|
|
log('Creating views')
|
|
run_sql_command(CMD_PIVOT_DIST)
|
|
log('pivot_dist created')
|
|
run_sql_command(CMD_PIVOT_DIST_PRE)
|
|
log('prepivot_dist created')
|
|
except Exception as e:
|
|
log('Error creating views: ' + str(e))
|