1 (edited by Gilberto_Schiavinatto 2016-01-10 00:52:26)

Topic: Define a field as unique index !!!

For example, in a record of two fields, name and address, as I define to be the index name field, or give error message if you try to include existing name.

Re: Define a field as unique index !!!

You can create unique index using free tool SQLite Studio (http://sqlitestudio.pl/)


Open database file (sqlite.db) using SQLite Studio


Please look the screenshot for details.
http://myvisualdatabase.com/forum/misc.php?action=pun_attachment&item=1624&download=0

Post's attachments

Attachment icon index.png 92.08 kb, 374 downloads since 2016-01-10 

Dmitry.

Re: Define a field as unique index !!!

Is it planned to embed the unique index in MVDB? That would help a lot in developing databases with constraints to avoid a lot of script coding.

Having the option "Unique" in the database designer would be a big step forward big_smile

Re: Define a field as unique index !!!

tcoton
Planned, but now in the priority is Web grid.

Dmitry.

Re: Define a field as unique index !!!

+1 wink

Re: Define a field as unique index !!!

The problem of adding the UNIQUE constraint manually is that, when you delete your sqlite.db file and let your application recreate it, the constraint is gone.


Unless you add a check on first run, and perform an ALTER TABLE operation before anything else smile


Mathias

I'm a very good housekeeper !
Each time I get a divorce, I keep the house

Zaza Gabor