سؤال

I am using Simple.Data as my Micro-ORM for my ASP.NET / MySQL website. I already know how to insert data when the primary key is auto incremental Int, but How can I insert data when I need to generate an idea using the uuid_short() function over a Bigint column?

هل كانت مفيدة؟

المحلول

You could use a trigger to set the column value, as in this answer: Can I use a function for a default value in MySql?

Or you can generate a value in your application code and insert it normally.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top