当前位置:   article > 正文

mysql update json字段,更新Mysql JSON字段

mysql update json字段,更新Mysql JSON字段

I'm using django 1.8.9 and MySQL 5.7.17. I've a following table:

+----------+--------------+------+-----+---------+----------------+

| Field | Type | Null | Key | Default | Extra |

+----------+--------------+------+-----+---------+----------------+

| brand | varchar(255) | YES | MUL | NULL | |

| new_info | json | YES | | NULL | |

| keywords | json | YES | | NULL | |

| notes | varchar(255) | YES | | NULL | |

| id | mediumint(9) | NO | MUL | NULL | auto_increment |

+----------+--------------+------+-----+---------+----------------+

In django I have this model (JSONField is from django_mysql):

class info_by_kw(Model):

brand = ForeignKey(Brand, on_delete=CASCADE, db_column='brand')

# n

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/weixin_40725706/article/detail/297053
推荐阅读
相关标签
  

闽ICP备14008679号