1 year ago

Cannot insert duplicate key row in object 'dbo.student' with unique index 'dept_id_room_id_roll_id_unique'. The duplicate key value is (<NULL>, <NULL>, <NULL>)

Posted 1 year ago by ssquare

I have created migration as

            $table->unique(['dept_id', 'room_id','roll_id']);

I am using MsSQL 2017 as the database. It is not allowing to have null value in these unique columns for more than once. What I am missing?

Please sign in or create an account to participate in this conversation.