Skip to content

Commit

Permalink
Use models.JSONField() from Django 3.1
Browse files Browse the repository at this point in the history
instead of the specialized postgres type available earlier
  • Loading branch information
atodorov committed Sep 13, 2020
1 parent b25cd5c commit 7182cd2
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
18 changes: 18 additions & 0 deletions tcms_github_marketplace/migrations/0004_models_jsonfield.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 3.1.1 on 2020-09-13 12:48

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('tcms_github_marketplace', '0003_sender_email_field'),
]

operations = [
migrations.AlterField(
model_name='purchase',
name='payload',
field=models.JSONField(),
),
]
5 changes: 2 additions & 3 deletions tcms_github_marketplace/models.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# Copyright (c) 2019 Alexander Todorov <atodorov@MrSenko.com>
# Copyright (c) 2019-2020 Alexander Todorov <atodorov@MrSenko.com>

# Licensed under the GPL 3.0: https://www.gnu.org/licenses/gpl-3.0.txt

from django.db import models
from django.contrib.postgres.fields import JSONField
from django.contrib.postgres.indexes import GinIndex


Expand All @@ -20,7 +19,7 @@ class Purchase(models.Model):
# this is for internal purposes
received_on = models.DateTimeField(db_index=True, auto_now_add=True)

payload = JSONField()
payload = models.JSONField()

class Meta:
indexes = [
Expand Down

0 comments on commit 7182cd2

Please sign in to comment.