Skip to content

Commit 039c85b

Browse files
committed
Migrate safemigrate (Safe.after_deploy -> `Safe.after_deploy())
1 parent 3cacb4a commit 039c85b

File tree

322 files changed

+330
-330
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

322 files changed

+330
-330
lines changed

docs/dev/migrations.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ You can achieve this by following these steps:
4141
self.fields["new_field"].empty_value = False
4242
4343
#. Create the migration file (let's call this migration ``app 0001``),
44-
and mark it as ``Safe.before_deploy``.
44+
and mark it as ``Safe.before_deploy()``.
4545

4646
.. code-block:: python
4747
@@ -50,10 +50,10 @@ You can achieve this by following these steps:
5050
5151
5252
class Migration(migrations.Migration):
53-
safe = Safe.before_deploy
53+
safe = Safe.before_deploy()
5454
5555
#. Create a data migration to populate all null values of the new field with a proper value (let's call this migration ``app 0002``),
56-
and mark it as ``Safe.after_deploy``.
56+
and mark it as ``Safe.after_deploy()``.
5757

5858
.. code-block:: python
5959
@@ -66,14 +66,14 @@ You can achieve this by following these steps:
6666
6767
6868
class Migration(migrations.Migration):
69-
safe = Safe.after_deploy
69+
safe = Safe.after_deploy()
7070
7171
operations = [
7272
migrations.RunPython(migrate),
7373
]
7474
7575
#. After the deploy has been completed, create a new migration to set the field as non-nullable (let's call this migration ``app 0003``).
76-
Run this migration on a new deploy, you can mark it as ``Safe.before_deploy`` or ``Safe.always``.
76+
Run this migration on a new deploy, you can mark it as ``Safe.before_deploy()`` or ``Safe.always()``.
7777
#. Remove any handling of the null case from the code.
7878

7979
At the end, the deploy should look like this:
@@ -102,7 +102,7 @@ You can achieve this by following these steps:
102102
field_to_delete = models.CharField(max_length=100, null=True, blank=True)
103103
104104
#. Create the migration file (let's call this migration ``app 0001``),
105-
and mark it as ``Safe.before_deploy``.
105+
and mark it as ``Safe.before_deploy()``.
106106

107107
.. code-block:: python
108108
@@ -111,10 +111,10 @@ You can achieve this by following these steps:
111111
112112
113113
class Migration(migrations.Migration):
114-
safe = Safe.before_deploy
114+
safe = Safe.before_deploy()
115115
116116
#. Create a migration to remove the field from the database (let's call this migration ``app 0002``),
117-
and mark it as ``Safe.after_deploy``.
117+
and mark it as ``Safe.after_deploy()``.
118118

119119
.. code-block:: python
120120
@@ -123,7 +123,7 @@ You can achieve this by following these steps:
123123
124124
125125
class Migration(migrations.Migration):
126-
safe = Safe.after_deploy
126+
safe = Safe.after_deploy()
127127
128128
At the end, the deploy should look like this:
129129

readthedocs/analytics/migrations/0001_initial.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99

1010
class Migration(migrations.Migration):
11-
safe = Safe.after_deploy
11+
safe = Safe.after_deploy()
1212
initial = True
1313

1414
dependencies = [

readthedocs/analytics/migrations/0002_track_status_code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77

88
class Migration(migrations.Migration):
9-
safe = Safe.after_deploy
9+
safe = Safe.after_deploy()
1010
dependencies = [
1111
("builds", "0041_track_task_id"),
1212
("projects", "0087_use_booleanfield_null"),

readthedocs/analytics/migrations/0003_remove_index.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88

99
class Migration(migrations.Migration):
10-
safe = Safe.after_deploy
10+
safe = Safe.after_deploy()
1111
dependencies = [
1212
("analytics", "0002_track_status_code"),
1313
]

readthedocs/analytics/migrations/0004_merge_duplicate_records.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def forwards_func(apps, schema_editor):
2929

3030

3131
class Migration(migrations.Migration):
32-
safe = Safe.after_deploy
32+
safe = Safe.after_deploy()
3333
dependencies = [
3434
("analytics", "0003_remove_index"),
3535
]

readthedocs/analytics/migrations/0005_add_unique_constraint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66

77
class Migration(migrations.Migration):
8-
safe = Safe.after_deploy
8+
safe = Safe.after_deploy()
99
dependencies = [
1010
("analytics", "0004_merge_duplicate_records"),
1111
]

readthedocs/analytics/migrations/0006_alter_pageview_id.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66

77
class Migration(migrations.Migration):
8-
safe = Safe.after_deploy
8+
safe = Safe.after_deploy()
99
dependencies = [
1010
("analytics", "0005_add_unique_constraint"),
1111
]

readthedocs/analytics/migrations/0007_index_on_pageview_date.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88

99
class Migration(migrations.Migration):
10-
safe = Safe.after_deploy
10+
safe = Safe.after_deploy()
1111
dependencies = [
1212
("analytics", "0006_alter_pageview_id"),
1313
]

readthedocs/api/v2/migrations/0001_initial.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77

88
class Migration(migrations.Migration):
9-
safe = Safe.after_deploy
9+
safe = Safe.after_deploy()
1010
initial = True
1111

1212
dependencies = [

readthedocs/audit/migrations/0001_initial.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010

1111
class Migration(migrations.Migration):
12-
safe = Safe.after_deploy
12+
safe = Safe.after_deploy()
1313
initial = True
1414

1515
dependencies = [

readthedocs/audit/migrations/0002_add_organization.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88

99
class Migration(migrations.Migration):
10-
safe = Safe.after_deploy
10+
safe = Safe.after_deploy()
1111
dependencies = [
1212
("organizations", "0006_add_assets_cleaned"),
1313
("audit", "0001_initial"),

readthedocs/audit/migrations/0003_update_ordering.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55

66
class Migration(migrations.Migration):
7-
safe = Safe.after_deploy
7+
safe = Safe.after_deploy()
88
dependencies = [
99
("audit", "0002_add_organization"),
1010
]

readthedocs/audit/migrations/0004_change_ip_field_type.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66

77
class Migration(migrations.Migration):
8-
safe = Safe.after_deploy
8+
safe = Safe.after_deploy()
99
dependencies = [
1010
("audit", "0003_update_ordering"),
1111
]

readthedocs/audit/migrations/0005_migrate_ip_field_values.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def forwards_func(apps, schema_editor):
2020

2121

2222
class Migration(migrations.Migration):
23-
safe = Safe.after_deploy
23+
safe = Safe.after_deploy()
2424
dependencies = [
2525
("audit", "0004_change_ip_field_type"),
2626
]

readthedocs/audit/migrations/0006_add_download_action.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66

77
class Migration(migrations.Migration):
8-
safe = Safe.after_deploy
8+
safe = Safe.after_deploy()
99
dependencies = [
1010
("audit", "0005_migrate_ip_field_values"),
1111
]

readthedocs/audit/migrations/0007_auditlog_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66

77
class Migration(migrations.Migration):
8-
safe = Safe.after_deploy
8+
safe = Safe.after_deploy()
99
dependencies = [
1010
("audit", "0006_add_download_action"),
1111
]

readthedocs/audit/migrations/0008_alter_auditlog_action.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66

77
class Migration(migrations.Migration):
8-
safe = Safe.after_deploy
8+
safe = Safe.after_deploy()
99
dependencies = [
1010
("audit", "0007_auditlog_data"),
1111
]

readthedocs/builds/migrations/0001_initial.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88

99
class Migration(migrations.Migration):
10-
safe = Safe.always
10+
safe = Safe.always()
1111
dependencies = [
1212
("projects", "0001_initial"),
1313
("taggit", "0001_initial"),

readthedocs/builds/migrations/0002_build_command_initial.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77

88
class Migration(migrations.Migration):
9-
safe = Safe.after_deploy
9+
safe = Safe.after_deploy()
1010
dependencies = [
1111
("builds", "0001_initial"),
1212
]

readthedocs/builds/migrations/0003_add-cold-storage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66

77
class Migration(migrations.Migration):
8-
safe = Safe.after_deploy
8+
safe = Safe.after_deploy()
99
dependencies = [
1010
("builds", "0002_build_command_initial"),
1111
]

readthedocs/builds/migrations/0004_add-apiversion-proxy-model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55

66
class Migration(migrations.Migration):
7-
safe = Safe.after_deploy
7+
safe = Safe.after_deploy()
88
dependencies = [
99
("builds", "0003_add-cold-storage"),
1010
]

readthedocs/builds/migrations/0005_remove-version-alias.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88

99
class Migration(migrations.Migration):
10-
safe = Safe.always
10+
safe = Safe.always()
1111
dependencies = [
1212
("builds", "0004_add-apiversion-proxy-model"),
1313
]

readthedocs/builds/migrations/0006_add_config_field.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66

77
class Migration(migrations.Migration):
8-
safe = Safe.after_deploy
8+
safe = Safe.after_deploy()
99
dependencies = [
1010
("builds", "0005_remove-version-alias"),
1111
]

readthedocs/builds/migrations/0007_add-automation-rules.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88

99
class Migration(migrations.Migration):
10-
safe = Safe.after_deploy
10+
safe = Safe.after_deploy()
1111
dependencies = [
1212
("projects", "0042_increase_env_variable_value_max_length"),
1313
("contenttypes", "0002_remove_content_type_name"),

readthedocs/builds/migrations/0008_remove-version-tags.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55

66
class Migration(migrations.Migration):
7-
safe = Safe.after_deploy
7+
safe = Safe.after_deploy()
88
dependencies = [
99
("builds", "0007_add-automation-rules"),
1010
]

readthedocs/builds/migrations/0009_added_external_version_type.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66

77
class Migration(migrations.Migration):
8-
safe = Safe.after_deploy
8+
safe = Safe.after_deploy()
99
dependencies = [
1010
("builds", "0008_remove-version-tags"),
1111
]

readthedocs/builds/migrations/0010_add-description-field-to-automation-rule.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66

77
class Migration(migrations.Migration):
8-
safe = Safe.after_deploy
8+
safe = Safe.after_deploy()
99
dependencies = [
1010
("builds", "0009_added_external_version_type"),
1111
]

readthedocs/builds/migrations/0011_version-media-availability.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66

77
class Migration(migrations.Migration):
8-
safe = Safe.after_deploy
8+
safe = Safe.after_deploy()
99
dependencies = [
1010
("builds", "0010_add-description-field-to-automation-rule"),
1111
]

readthedocs/builds/migrations/0012_add-predefined-match-arg-field.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66

77
class Migration(migrations.Migration):
8-
safe = Safe.after_deploy
8+
safe = Safe.after_deploy()
99
dependencies = [
1010
("builds", "0011_version-media-availability"),
1111
]

readthedocs/builds/migrations/0013_version_documentation_type.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66

77
class Migration(migrations.Migration):
8-
safe = Safe.after_deploy
8+
safe = Safe.after_deploy()
99
dependencies = [
1010
("builds", "0012_add-predefined-match-arg-field"),
1111
]

readthedocs/builds/migrations/0014_migrate-doctype-from-project-to-version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def forwards_func(apps, schema_editor):
1818

1919

2020
class Migration(migrations.Migration):
21-
safe = Safe.after_deploy
21+
safe = Safe.after_deploy()
2222
dependencies = [
2323
("builds", "0013_version_documentation_type"),
2424
]

readthedocs/builds/migrations/0015_uploading_build_state.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66

77
class Migration(migrations.Migration):
8-
safe = Safe.after_deploy
8+
safe = Safe.after_deploy()
99
dependencies = [
1010
("builds", "0014_migrate-doctype-from-project-to-version"),
1111
]

readthedocs/builds/migrations/0016_add_mkdocs_html_doctype.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66

77
class Migration(migrations.Migration):
8-
safe = Safe.after_deploy
8+
safe = Safe.after_deploy()
99
dependencies = [
1010
("builds", "0015_uploading_build_state"),
1111
]

readthedocs/builds/migrations/0017_builds_deterministic_order_index.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55

66
class Migration(migrations.Migration):
7-
safe = Safe.after_deploy
7+
safe = Safe.after_deploy()
88
dependencies = [
99
("builds", "0016_add_mkdocs_html_doctype"),
1010
]

readthedocs/builds/migrations/0018_add_hidden_field_to_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66

77
class Migration(migrations.Migration):
8-
safe = Safe.after_deploy
8+
safe = Safe.after_deploy()
99
dependencies = [
1010
("builds", "0017_builds_deterministic_order_index"),
1111
]

readthedocs/builds/migrations/0019_migrate_protected_versions_to_hidden.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def forwards_func(apps, schema_editor):
1010

1111

1212
class Migration(migrations.Migration):
13-
safe = Safe.after_deploy
13+
safe = Safe.after_deploy()
1414
dependencies = [
1515
("builds", "0018_add_hidden_field_to_version"),
1616
]

readthedocs/builds/migrations/0020_migrate_null_hidden_field.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def forwards_func(apps, schema_editor):
1010

1111

1212
class Migration(migrations.Migration):
13-
safe = Safe.after_deploy
13+
safe = Safe.after_deploy()
1414
dependencies = [
1515
("builds", "0019_migrate_protected_versions_to_hidden"),
1616
]

0 commit comments

Comments
 (0)