Fix UNIQUE INDEX type,id on state table

Create index on state table. Index id,type unique index already exists on url
table.
Merge pull request #272 from openquery/unique_index_on_state

Unique index on state