from django.core.management.base import BaseCommand
import subprocess
import crayons


class Command(BaseCommand):
    help = 'Hook Up'

    def handle(self, *args, **options):
        print(crayons.red('Migrating users'))
        subprocess.call(['python3', 'manage.py', 'migrate_users'])
        print(crayons.red('Migrating addresses'))
        subprocess.call(['python3', 'manage.py', 'migrate_addresses'])
        print(crayons.red('Migrating points'))
        subprocess.call(['python3', 'manage.py', 'migrate_points'])
        print(crayons.red('Migrating points'))
        subprocess.call(['python3', 'manage.py', 'migrate_pods'])
        print(crayons.red('Migrating coffees'))
        subprocess.call(['python3', 'manage.py', 'migrate_coffees'])
        print(crayons.red('Migrating subscriptions'))
        subprocess.call(['python3', 'manage.py', 'migrate_subscription'])
        print(crayons.red('Migrating coffee orders'))
        subprocess.call(['python3', 'manage.py', 'migrate_coffee_orders'])
        print(crayons.red('Migrating orders'))
        subprocess.call(['python3', 'manage.py', 'migrate_gear_orders'])
        print(crayons.red('Attaching subscriptions to orders'))
        subprocess.call(['python3', 'manage.py', 'subscription_to_orders'])
        print(crayons.red('Migrating reviews'))
        subprocess.call(['python3', 'manage.py', 'migrate_reviews'])
        print(crayons.red('Migrating stripe cards'))
        subprocess.call(['python3', 'manage.py', 'migrate_stripe'])
        print(crayons.red('Migrating Referrals'))
        subprocess.call(['python3', 'manage.py', 'migrate_referrals'])
