Skip to content

Commit 19a5e7d

Browse files
committed
update doc
1 parent 763745e commit 19a5e7d

File tree

4 files changed

+42
-1
lines changed

4 files changed

+42
-1
lines changed

docs/index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ A database backed asynchronous tasks scheduler for django.
1010
This allows remembering scheduled tasks, their parameters, etc.
1111

1212
!!! Important
13+
Version 3.0.0 introduced a major design change. Instead of three separate models, there is one new `Task` model.
14+
The goal is to simplify.
15+
Make sure to follow [the migration guide](migrate_to_v3.md)
16+
1317

1418
## Terminology
1519

docs/migrate_to_v3.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
Migration from v2 to v3
2+
=======================
3+
4+
Version 3.0.0 introduced a major design change. Instead of three separate models, there is one new `Task` model. The
5+
goal is to have one centralized admin view for all your scheduled tasks, regardless of the scheduling type.
6+
7+
You need to migrate the scheduled tasks using the old models (`ScheduledTask`, `RepeatableTask`, `CronTask`) to the new
8+
model. It can be done using the export/import commands provided.
9+
10+
After upgrading to django-tasks-scheduler v3.0.0, you will notice you are not able to create new scheduled tasks in the
11+
old models, that is intentional. In the next version of django-tasks-scheduler (v3.1), the old models will be deleted,
12+
so make sure you migrate your old models.
13+
14+
!!! Note
15+
While we tested different scenarios heavily and left the code for old tasks, we could not account for all different
16+
use cases, therefore, please [open an issue][issues] if you encounter any.
17+
18+
There are two ways to migrate your existing scheduled tasks:
19+
20+
# Using the admin views of the old models
21+
22+
If you go to the admin view of the old models, you will notice there is a new action in the actions drop down menu for
23+
migrating the selected tasks. Use it, and you will also have a link to the new task to compare the migration result.
24+
25+
Note once you migrate using this method, the old task will be disabled automatically.
26+
27+
# Export/Import management commands
28+
29+
Run in your project directory:
30+
31+
```shell
32+
python manage.py export > scheduled_tasks.json
33+
python manage.py import --filename scheduled_tasks.json
34+
```
35+
36+
[issues]: https://github.com/django-commons/django-tasks-scheduler/issues

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ theme:
101101

102102
nav:
103103
- Home: index.md
104+
- Migrate v2 to v3: migrate_to_v3.md
104105
- Installation: installation.md
105106
- Configuration: configuration.md
106107
- Usage: usage.md

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ name = "django-tasks-scheduler"
77
packages = [
88
{ include = "scheduler" },
99
]
10-
version = "2.2.0"
10+
version = "3.0.0"
1111
description = "An async job scheduler for django using redis/valkey brokers"
1212
readme = "README.md"
1313
keywords = ["redis", "valkey", "django", "background-jobs", "job-queue", "task-queue", "redis-queue", "scheduled-jobs"]

0 commit comments

Comments
 (0)