mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-25 10:49:30 -05:00
Try to add tz during migration
This commit is contained in:
parent
079bf8576c
commit
f500ec9da1
@ -2,7 +2,9 @@
|
||||
|
||||
|
||||
import datetime
|
||||
import os
|
||||
|
||||
import pytz
|
||||
from django.db import migrations
|
||||
from django.db import models
|
||||
from django.db.models.functions import TruncDate
|
||||
@ -10,7 +12,12 @@ from django.db.models.functions import TruncDate
|
||||
|
||||
def migrate_date(apps, schema_editor):
|
||||
Document = apps.get_model("documents", "Document")
|
||||
Document.objects.update(created_date=TruncDate("created"))
|
||||
Document.objects.update(
|
||||
created_date=TruncDate(
|
||||
"created",
|
||||
tzinfo=pytz.timezone(os.getenv("PAPERLESS_TIME_ZONE", "UTC")),
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
Loading…
x
Reference in New Issue
Block a user