Skip to content

Commit e432594

Browse files
committed
[SHARE-511][Fix] Add migrations for disabled harvesters
1 parent fff760d commit e432594

7 files changed

Lines changed: 122 additions & 1 deletion

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# -*- coding: utf-8 -*-
2+
# Generated by Django 1.9.7 on 2017-02-10 14:32
3+
from __future__ import unicode_literals
4+
5+
from django.db import migrations
6+
import share.robot
7+
8+
9+
class Migration(migrations.Migration):
10+
11+
dependencies = [
12+
('com.biomedcentral', '0001_initial'),
13+
('share', '0018_store_favicons'),
14+
]
15+
16+
operations = [
17+
migrations.RunPython(
18+
code=share.robot.RobotFaviconMigration('com.biomedcentral'),
19+
),
20+
]
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# -*- coding: utf-8 -*-
2+
# Generated by Django 1.9.7 on 2017-02-10 14:32
3+
from __future__ import unicode_literals
4+
5+
from django.db import migrations
6+
import share.robot
7+
8+
9+
class Migration(migrations.Migration):
10+
11+
dependencies = [
12+
('com.dailyssrn', '0001_initial'),
13+
('share', '0018_store_favicons'),
14+
]
15+
16+
operations = [
17+
migrations.RunPython(
18+
code=share.robot.RobotFaviconMigration('com.dailyssrn'),
19+
),
20+
]
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# -*- coding: utf-8 -*-
2+
# Generated by Django 1.9.7 on 2017-02-10 14:32
3+
from __future__ import unicode_literals
4+
5+
from django.db import migrations
6+
import share.robot
7+
8+
9+
class Migration(migrations.Migration):
10+
11+
dependencies = [
12+
('org.erudit', '0001_initial'),
13+
('share', '0018_store_favicons'),
14+
]
15+
16+
operations = [
17+
migrations.RunPython(
18+
code=share.robot.RobotFaviconMigration('org.erudit'),
19+
),
20+
]
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# -*- coding: utf-8 -*-
2+
# Generated by Django 1.9.7 on 2017-02-10 14:32
3+
from __future__ import unicode_literals
4+
5+
from django.db import migrations
6+
import share.robot
7+
8+
9+
class Migration(migrations.Migration):
10+
11+
dependencies = [
12+
('org.stepic', '0001_initial'),
13+
('share', '0018_store_favicons'),
14+
]
15+
16+
operations = [
17+
migrations.RunPython(
18+
code=share.robot.RobotFaviconMigration('org.stepic'),
19+
),
20+
]
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# -*- coding: utf-8 -*-
2+
# Generated by Django 1.9.7 on 2017-02-10 14:32
3+
from __future__ import unicode_literals
4+
5+
from django.db import migrations
6+
import share.robot
7+
8+
9+
class Migration(migrations.Migration):
10+
11+
dependencies = [
12+
('org.zenodo', '0001_initial'),
13+
('share', '0018_store_favicons'),
14+
]
15+
16+
operations = [
17+
migrations.RunPython(
18+
code=share.robot.RobotFaviconMigration('org.zenodo'),
19+
),
20+
]
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# -*- coding: utf-8 -*-
2+
# Generated by Django 1.9.7 on 2017-02-10 14:32
3+
from __future__ import unicode_literals
4+
5+
from django.db import migrations
6+
import share.robot
7+
8+
9+
class Migration(migrations.Migration):
10+
11+
dependencies = [
12+
('tr.edu.hacettepe', '0001_initial'),
13+
('share', '0018_store_favicons'),
14+
]
15+
16+
operations = [
17+
migrations.RunPython(
18+
code=share.robot.RobotFaviconMigration('tr.edu.hacettepe'),
19+
),
20+
]

share/management/commands/makeprovidermigrations.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class Command(BaseCommand):
1616

1717
def add_arguments(self, parser):
1818
parser.add_argument('providers', nargs='*', type=str, help='App label(s) of the provider(s) to make migration(s) for')
19+
parser.add_argument('--disabled', action='store_true', help='Generate migrations for disabled providers as well')
1920

2021
def write_migration(self, migration):
2122
loader = MigrationLoader(None, ignore_no_migrations=True)
@@ -35,7 +36,7 @@ def handle(self, *args, **options):
3536
configs = apps.get_app_configs()
3637

3738
for config in configs:
38-
if isinstance(config, RobotAppConfig) and not getattr(config, 'disabled', False):
39+
if isinstance(config, RobotAppConfig) and (options.get('disabled') or not getattr(config, 'disabled', False)):
3940
changes[config.name] = RobotMigrations(config).migrations()
4041

4142
for migrations in changes.values():

0 commit comments

Comments
 (0)