migration

When I do "makemigrations" I get do "makemigrations"

When I do "makemigrations" I get do "makemigrations" Question: I removed all migration files from my django project and now when i want to re-create i get this ./manage.py makemigrations INFO: AXES: BEGIN LOG :: [axes.apps] 2022-09-15 16:51:59,923 – /home/mixnosha/work_MVD/MVD_LTP/MVD_LTP-ltp/venv/lib/python3.10/site- packages/axes/apps.py:33 INFO: AXES: Using django-axes version 5.31.0 :: [axes.apps] 2022-09-15 16:51:59,926 – /home/mixnosha/work_MVD/MVD_LTP/MVD_LTP-ltp/venv/lib/python3.10/site- packages/axes/apps.py:34 INFO: …

Total answers: 1

How to ignore migrations but __init_.py?

How to ignore migrations but __init_.py? Question: I’ve been thinking about this. See here: Should I be adding the Django migration files in the .gitignore file? I agree with Robert L, it says that we shouldn’t commit our migrations. My questions are: 1) How to ignore all migrations except for the init.py file that is …

Total answers: 2

Django 2.1 creates autotable

Django 2.1 creates autotable Question: I’m pretty new at Django 2.1 framework. and I am a week trying to setup the tables for my app. Settings are fine I listed my app in INSTALLED_APPS, but when I try to run manage.py migrate code it gives me one auto_table instead of the ones that was written …

Total answers: 1

Django Migration Database Column Order

Django Migration Database Column Order Question: I use Django 1.11, PostgreSQL 9.6 and Django migration tool. I couldn’t have found a way to specify the column orders. In the initial migration, changing the ordering of the fields is fine but what about migrations.AddField() calls? AddField calls can also happen for the foreign key additions for …

Total answers: 2

Drop and read index using SQLAlchemy

Drop and read index using SQLAlchemy Question: I want to do a bulk insertion in SQL alchemy and would prefer to remove an index prior to making the insertion, reading it when the insertion is complete. I see adding and removing indexes is supported by Alembic for migrations, but is this possible with SQLAlchemy? If …

Total answers: 2

Django migrate : doesn't create tables

Django migrate : doesn't create tables Question: After some errors, I dropped my database, deleted all my migration files (I left init.py). Now, when I run python migrate.py makemigrations // It creates migrations correctly python migrate.py migrate // It outputs “app.0001_initial OK” But absolutely NO table (related to my app) is created. Only those related …

Total answers: 15

django.db.migrations.RenameModel and AutoField sequence name

django.db.migrations.RenameModel and AutoField sequence name Question: I use Django 1.8.7 and PostgreSQL and have the following model: class Permission(models.Model): name = models.CharField(max_length=255) template = models.ForeignKey(Template, related_name=’permissions’) Then I have added RenameModel operation: migrations.RenameModel( old_name=’Permission’, new_name=’TemplatePermission’, ), It looks that everything works OK, but the sequence name for TemplatePermission.id field is still myapp_permission_id_seq: postgres=# d+ myapp_templatepermission …

Total answers: 1