explorerhq / django-sql-explorer

Easily share data across your company via SQL queries.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Missing migration

spapas opened this issue · comments

Hello, this may be related with #332 :

When I integrate the latest version from master with a new project and run migrate I get the familiar message:

  Your models have changes that are not yet reflected in a migration, and so won't be applied.
  Run 'manage.py makemigrations' to make new migrations, and then re-run 'manage.py migrate' to apply them.

Here's the output of the makemigrations:

Migrations for 'explorer':
  /home/serafeim/suppl/venv/src/django-sql-explorer/explorer/migrations/0010_auto_20201009_1235.py
    - Change Meta options on query
    - Alter field connection on query

And the actual contents of the migration that was generated

cat ../venv/src/django-sql-explorer/explorer/migrations/0010_auto_20201009_1235.py

# Generated by Django 3.1.2 on 2020-10-09 09:35

from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('explorer', '0009_auto_20201006_0852'),
    ]

    operations = [
        migrations.AlterModelOptions(
            name='query',
            options={'ordering': ['title'], 'verbose_name': 'Query', 'verbose_name_plural': 'Queries'},
        ),
        migrations.AlterField(
            model_name='query',
            name='connection',
            field=models.CharField(blank=True, default='', help_text='Name of DB connection (as specified in settings) to use for this query.Will use EXPLORER_DEFAULT_CONNECTION if left blank', max_length=128),
        ),
    ]

Please include this migration when you do a new release, thank you!

It might just change model's state and makes zero updates in the database. We can just update field and model state in the migrations they where added, if so

Thanks @spapas

I noticed this one yesterday, but I think @Anton-Shutik is correct. There's no actual database change here.

#345 added some translation so this change is because gettext is on the help text now.

Migration 0009 hasn't been released, it came in through a recent PR, so I'm inclined to recreate that migration in master so that this release only gets 1 migration.