Not incrementing the primary key

%3CLINGO-SUB%20id%3D%22lingo-sub-3219807%22%20slang%3D%22en-US%22%3ENot%20incrementing%20the%20primary%20key%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3219807%22%20slang%3D%22en-US%22%3E%3CP%3EHello%2C%20everyone.%20I%20am%20using%20MS%20SQL%20server%20with%20django%20framework.%20I%20inspect%20the%20DB%20and%20got%20the%20models%20files.%20I%20have%20made%20a%20primary%20key%20and%20it%20is%20an%20auto-increment%20field.%20When%20I%20try%20to%20post%20data%20it%20throw%20error%20you%20cannot%20insert%20null%20in%20uniqid.%3CBR%20%2F%3Eeg%3A%E2%80%83%3C%2FP%3E%3CPRE%3Euniqid%20%3D%20models.BigAutoField%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3Eprimary_key%3C%2FSPAN%3E%3D%3CSPAN%3ETrue%2C%20%3C%2FSPAN%3E%3CSPAN%3Enull%3C%2FSPAN%3E%3D%3CSPAN%3EFalse%3C%2FSPAN%3E%3CSPAN%3E)%3C%2FSPAN%3E%3C%2FPRE%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Screenshot%202022-02-28%20at%2012.28.29%20PM.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F351653iEF61FAF66CA29287%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Screenshot%202022-02-28%20at%2012.28.29%20PM.png%22%20alt%3D%22Screenshot%202022-02-28%20at%2012.28.29%20PM.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EI%20attached%20the%20DB%20table.%3CBR%20%2F%3EIs%20anyone%20know%20how%20to%20do%20it.%20Thanks%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Visitor

Hello, everyone. I am using MS SQL server with django framework. I inspect the DB and got the models files. I have made a primary key and it is an auto-increment field. When I try to post data it throw error you cannot insert null in uniqid.
eg: 

uniqid = models.BigAutoField(primary_key=True, null=False)

Screenshot 2022-02-28 at 12.28.29 PM.png

I attached the DB table.
Is anyone know how to do it. Thanks

 

0 Replies