Git Product home page Git Product logo

Comments (6)

sevein avatar sevein commented on June 30, 2024

Hi @orzel,

I didn't have much luck trying to reproduce the problem that you are reporting. Using qa/0.8.x here (038814b) I deleted my database (sudo rm /var/archivematica/storage-service/storage.db). Next I executed storage_service/manage.py runserver and saw the same error:

You have unapplied migrations; your app may not work properly until they are applied.
Run 'python manage.py migrate' to apply them.

storage_service/manage.py runserver returned No changes detected.
storage_service/manage.py migrate worked as expected:

Operations to perform:
  Synchronize unmigrated apps: common
  Apply all migrations: sessions, admin, tastypie, administration, locations, auth, sites, contenttypes
Synchronizing apps without migrations:
  Creating tables...
  Installing custom SQL...
  Installing indexes...
Running migrations:
  Applying contenttypes.0001_initial... OK
  Applying auth.0001_initial... OK
  Applying admin.0001_initial... OK
  Applying administration.0001_initial... OK
  Applying locations.0001_initial... OK
  Applying locations.0002_v0_4... OK
  Applying locations.0003_v0_5... OK
  Applying locations.0004_v0_7... OK
  Applying sessions.0001_initial... OK
  Applying sites.0001_initial... OK
  Applying tastypie.0001_initial... OK
********************************************************************************
Creating test user -- login: test, password: test
********************************************************************************

Once I did that I could run the webserver successfully (storage_service/manage.py runserver):

Performing system checks...

System check identified no issues (0 silenced).
April 12, 2016 - 11:07:32
Django version 1.7.11, using settings 'storage_service.settings.local'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.

from archivematica-storage-service.

sevein avatar sevein commented on June 30, 2024

Don't hesitate to write us if the problem persists, we could reopen it.

from archivematica-storage-service.

orzel avatar orzel commented on June 30, 2024

As said, the problem is NOT mentionned in the output of "./manage.py check". Only runserver will show it I think, and maybe even not always.

Here's how to reproduce it, starting from a clean directory (/tmp for example):

git clone https://github.com/artefactual/archivematica-storage-service -b qa/0.8.x
cd archivematica-storage-service/storage_service/
./manage.py migrate
# so far, so good, we have a working installation
# but the migration framework is NOT synced with actual models. You can easily check by performing
./manage.py  makemigrations

This command would not do/create anything in case migrations and models are coherent / synchronized. But in this case, you should have a migration that looks like

class Migration(migrations.Migration):

    dependencies = [
        ('locations', '0004_v0_7'),
    ]

    operations = [
        migrations.AlterField(
            model_name='location',
            name='pipeline',
            field=models.ManyToManyField(help_text=b'UUID of the Archivematica instance using this location.', to='locations.Pipeline', through='locations.LocationPipeline', blank=True),
            preserve_default=True,
        ),
        migrations.AlterField(
            model_name='pipeline',
            name='uuid',
            field=django_extensions.db.fields.UUIDField(auto=False, validators=[django.core.validators.RegexValidator(b'\\w{8}-\\w{4}-\\w{4}-\\w{4}-\\w{12}', b'Needs to be format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx where x is a hexadecimal digit.', b'Invalid UUID')], help_text=b'Identifier for the Archivematica pipeline', unique=True, verbose_name=b'UUID'),
            preserve_default=True,
        ),
    ]

This might seem unimportant to you, but it's not only about being 'clean'. It will mess with future migrations

from archivematica-storage-service.

Hwesta avatar Hwesta commented on June 30, 2024

I was able to reproduce the problem, though the migration I got was slightly different. Maybe we have different versions of the django_extensions dependency (1.1.1 in base.txt)?

class Migration(migrations.Migration):

    dependencies = [
        ('locations', '0004_v0_7'),
    ]

    operations = [
        migrations.AlterField(
            model_name='location',
            name='pipeline',
            field=models.ManyToManyField(help_text=b'UUID of the Archivematica instance using this location.', to='locations.Pipeline', through='locations.LocationPipeline', blank=True),
        ),
    ]


I made a branch to test the fix dev/issue-xxxx-migrations-fix #121 Do you still have the problem there?

from archivematica-storage-service.

sevein avatar sevein commented on June 30, 2024

I see it now!

cat storage_service/locations/migrations/0005_auto_20160425_1722.py

# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('locations', '0004_v0_7'),
    ]

    operations = [
        migrations.AlterField(
            model_name='location',
            name='pipeline',
            field=models.ManyToManyField(help_text=b'UUID of the Archivematica instance using this location.', to='locations.Pipeline', through='locations.LocationPipeline', blank=True),
        ),
    ]

from archivematica-storage-service.

Hwesta avatar Hwesta commented on June 30, 2024

This was fixed in #121

from archivematica-storage-service.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.