I am loading the json data into database created by SQLAlchemy:
with open('test_data.json') as f:
data=f.read()
jsondata=json.loads(data)
for row in jsondata['rows']:
r = Review(row['business_id'])
session.add(r)
session.commit()
I am storing the business id of json file into business_id column but i always get an integrity error of this sort:
sqlalchemy.exc.IntegrityError: (IntegrityError) column business_id is not unique u'INSERT INTO rev (business_id) VALUES (?)' (u'vcNAWiLM4dR7D2nwwJ7RPCA',)
My Entire script of Database created using sqlalchemy is
and this is my entire script to load business_id from json file to my column(business_id) in this datbase.