question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Django creates migration for actstream after Foreign key to Action

See original GitHub issue

Hello!

I have created own model Notification. There is foreign key to actstream Action:

class Notification(models.Model):
    user = models.ForeignKey(User)
    action = models.ForeignKey(Action)
    is_read = models.BooleanField(default=False)

And when I run manage.py makemigrations myapp django creates one more migration for actstream. Here it is:

# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models

class Migration(migrations.Migration):

    dependencies = [
        ('actstream', '0001_initial'),
    ]

    operations = [
        migrations.RemoveField(
            model_name='action',
            name='data',
        ),
    ]

So what should I do?

Can I migrate it? But in which way will I migrate it in deploy?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
graupcommented, Mar 5, 2016

Here is my env. I installed actstream from git commit f725aaf73a42812793b5feeaa4900458e5e11edf

$ python --version
Python 3.5.1
>>> from actstream.settings import SETTINGS
>>> print(SETTINGS)
{}
$ pip freeze | grep act
django-activity-stream==0.6.1
$ pip freeze | grep Django
Django==1.9
1reaction
andyfoundicommented, Mar 4, 2016

Here is my environment,

Python version

$python --version
Python 2.7.6
In [1]: from actstream.settings import SETTINGS

In [2]: print(SETTINGS)
{}
$pip freeze | grep act
django-activity-stream==0.6.0

$pip freeze | grep Django
Django==1.8.8

Maybe this is worth mentioning that I recently upgraded from Django 1.7 to 1.8.8. I updated actstream at the same time.

Read more comments on GitHub >

github_iconTop Results From Across the Web

25551 (makemigrations when adding a ForeignKey to a newly ...
When adding a new model and a ForeignKey to it as well a unique_together constraint ... Django's migrations framework produces the following summary...
Read more >
Django activity stream filter Actions by foreignkey in target model
It seems you can just pass your filters as **kwargs : model_stream(FillingSystem, filling_system__client__slug='my-slug').
Read more >
Changing choices to a ForeignKey using Django migrations
The proper way to do it is in three distinct steps/migrations: Create the Category model and add a foreign key to it in...
Read more >
Migrating to a Custom User Model in Django - Caktus Group
If you have foreign keys in these other apps to Django's built-in auth.User model, you'll likely need to include them in the data...
Read more >
Designing the blog data schema | Django 2 by Example
Add the following lines to the models.py file of the blog application: ... For this field, Django will create a foreign key in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found