Makoto
Posts: 0
Joined: Fri Oct 10, 2014 8:15 am

Setting unique key in database column

Hello,

Is it possible to set unique key in one of or some of database columns?

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

Setting unique key in database column

Hello,

This definitely should be possible, but you will need to check its uniqueness before being set to database.

Makoto
Posts: 0
Joined: Fri Oct 10, 2014 8:15 am

Setting unique key in database column

Hello Alena,

Thank you for your quick reply.
I couldn't find any tutorials and documentations about it.
So, would you give me the way to set unique key in database column when using Appery.io.
Thank you.

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Setting unique key in database column

Hello,

It depends on what type column should have, e.g. "number":

1) Read max value of that column;
2) Increment it and write in the new row.

Makoto
Posts: 0
Joined: Fri Oct 10, 2014 8:15 am

Setting unique key in database column

Hello Sergly.

I am totally at a loss.
Is that the way to set "unique key" in database column?
How about when the type of column is "string"?

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Setting unique key in database column

The best way is use GUID for it. Please follow this topic: http://stackoverflow.com/questions/10...

Makoto
Posts: 0
Joined: Fri Oct 10, 2014 8:15 am

Setting unique key in database column

Hello Sergiy,

Thank you very much for your help.

Return to “Issues”