This project is read-only.

Any way to set Indentity seed through Migrations file?

Topics: Writing modules
May 28, 2013 at 2:36 PM
As the title suggests..

I would like to set the identity seed of the primary key of a table through the migrations file, is this possible?

If not, is there any way to do this with Orchard? I'd rather not have to resort to a SQL script.

May 29, 2013 at 12:20 AM
May 29, 2013 at 9:55 AM
I have an Order table where I use the Id of the Order table as the public facing Order number. The client would like the order numbers to start at 1000, rather than 1. So I thought I could seed the Id.
May 31, 2013 at 7:16 AM
Ids should never be exposed to your users. They are technical, internal implementation details. I would have a separate "friendly id" column instead.
Jun 18, 2013 at 2:23 PM
Yes, your right, thanks
Jun 18, 2013 at 3:19 PM
Not to mention that exposing database Ids directly can be a security hole, if not handled correctly (checking necessary permissions etc.)