mirror of
https://github.com/lemeow125/StudE-Backend.git
synced 2024-11-17 22:39:25 +08:00
15 lines
437 B
Python
15 lines
437 B
Python
|
from django.core.management.base import BaseCommand
|
||
|
from django.db import connection
|
||
|
from django.core.management import call_command
|
||
|
|
||
|
|
||
|
class Command(BaseCommand):
|
||
|
help = 'Run InitSpatialMetaData and then migrate'
|
||
|
|
||
|
def handle(self, *args, **kwargs):
|
||
|
with connection.cursor() as cursor:
|
||
|
cursor.execute('SELECT InitSpatialMetaData(1);')
|
||
|
|
||
|
# Call the Django migrate command
|
||
|
call_command('migrate')
|