title: How to make a mysql field unique?
body: <p>Is there a way to make an existing txt field unique (do not accept duplicated values)?</p>
  
  <p>Field: post_title<br>
  Type: text<br>
  Collation: utf8_unicode_ci<br>
  Null: Sim<br>
  Default: NULL</p>
  
  <p>What gonna happens if someone tries to insert a post with an existing title?</p>
  
  <p>Could that affect some functionality of my site?</p>
  
  <p>Structure</p>
  
  <pre><code>CREATE TABLE IF NOT EXISTS `hotaru_posts` (
    `post_id` int(20) NOT NULL AUTO_INCREMENT,
    `post_archived` enum('Y','N') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'N',
    `post_updatedts` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    `post_author` int(20) NOT NULL DEFAULT '0',
    `post_date` timestamp NULL DEFAULT NULL,
    `post_pub_date` timestamp NULL DEFAULT NULL,
    `post_status` varchar(32) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'processing',
    `post_type` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL,
    `post_category` int(20) NOT NULL DEFAULT '1',
    `post_tags` text COLLATE utf8_unicode_ci,
    `post_title` text COLLATE utf8_unicode_ci,
    `post_orig_url` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
    `post_domain` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
    `post_url` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
    `post_content` text COLLATE utf8_unicode_ci,
    `post_votes_up` smallint(11) NOT NULL DEFAULT '0',
    `post_votes_down` smallint(11) NOT NULL DEFAULT '0',
    `post_comments` enum('open','closed') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'open',
    `post_media` varchar(20) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'text',
    `post_img` text COLLATE utf8_unicode_ci NOT NULL,
    `post_subscribe` tinyint(1) NOT NULL DEFAULT '0',
    `post_updateby` int(20) NOT NULL DEFAULT '0',
    `post_views` int(20) NOT NULL DEFAULT '0',
    `post_last_viewer_ip` varchar(32) COLLATE utf8_unicode_ci NOT NULL DEFAULT '111.111.111.111',
    PRIMARY KEY (`post_id`),
    KEY `post_archived` (`post_archived`),
    KEY `post_status` (`post_status`),
    KEY `post_type` (`post_type`),
    FULLTEXT KEY `post_title` (`post_title`,`post_domain`,`post_url`,`post_content`,`post_tags`)
  ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Story Posts' AUTO_INCREMENT=38275 ;
  </code></pre>