UPDATE: Solved
I am using macOS, Django 2.0 on a virtualenv, and a Docker Container with the SQL Server 2017 up and running. I'm trying to use this package: https://github.com/michiya/django-pyodbc-azure
This is my DATABASES settings.py setup:
DATABASES = {
'default': {
'ENGINE': 'sql_server.pyodbc',
'NAME': 'TUTORIAS_DATOS',
'HOST': '0.0.0.0',
'PORT': '1402',
'USER': '***',
'PASSWORD': '***',
'OPTIONS': {
'driver': 'ODBC Driver 13 for SQL Server',
'driver_charset': 'iso-8859-1',
}
}
}
The problem is that when I do python manage.py makemigrations
the migration is made, but when I try to apply the migration to the database (python manage.py migrate
) I get:
Operations to perform:
Apply all migrations: admin, auth, contenttypes, menu, sessions
Running migrations:
No migrations to apply.
Instead of what I should get if I use the sqlite (default Django database), which is:
Operations to perform:
Apply all migrations: admin, auth, contenttypes, menu, sessions
Running migrations:
Applying contenttypes.0001_initial... OK
Applying auth.0001_initial... OK
Applying admin.0001_initial... OK
Applying admin.0002_logentry_remove_auto_add... OK
Applying contenttypes.0002_remove_content_type_name... OK
Applying auth.0002_alter_permission_name_max_length... OK
Applying auth.0003_alter_user_email_max_length... OK
Applying auth.0004_alter_user_username_opts... OK
Applying auth.0005_alter_user_last_login_null... OK
Applying auth.0006_require_contenttypes_0002... OK
Applying auth.0007_alter_validators_add_error_messages... OK
Applying auth.0008_alter_user_username_max_length... OK
Applying auth.0009_alter_user_last_name_max_length... OK
Applying menu.0001_initial... OK
Applying sessions.0001_initial... OK
I don't know what could be the problem, theoretically if I follow this steps (on Windows) it works just fine.
The ODBC connection apparently is working because if I setup an improper username/password I get an error. My database (of the container hosted on 0.0.0.0:1402) name is indeed TUTORIAS_DATOS
UPDATE: I was using TeamSQL app to "see" the tables on the database and make queries. Little I knew the app didn't work properly.. I've connected to the container and queried via sqlcmd
and the tables were there... That's why I wasn't getting any "creation" response from Django.
Issue solved, thanks anyways for the comments.