Make the type of the sprites column in pokemon_v2_pokemonsprites jsonb

This is so Hasura automatically transforms the field into an array
instead of a JSON encoded in a string.

Migration was generated by the `makemigrations` command.
This commit is contained in:
Simón Oroño 2023-11-18 23:22:56 -04:00 committed by Simón Oroño
parent 7f3d32de57
commit 218864dfbc
2 changed files with 21 additions and 1 deletions

View file

@ -0,0 +1,19 @@
# Generated by Django 2.1.15 on 2023-11-19 03:03
import django.contrib.postgres.fields.jsonb
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('pokemon_v2', '0013_pokemonabilitypast'),
]
operations = [
migrations.AlterField(
model_name='pokemonsprites',
name='sprites',
field=django.contrib.postgres.fields.jsonb.JSONField(),
),
]

View file

@ -1,4 +1,5 @@
from django.db import models
from django.contrib.postgres.fields import JSONField
#####################
# ABSTRACT MODELS #
@ -1795,4 +1796,4 @@ class PokemonTypePast(HasPokemon, HasType, HasGeneration):
class PokemonSprites(HasPokemon):
sprites = models.CharField(max_length=20000)
sprites = JSONField()