title: Magento Doesn't Run SQL Install/Update Script
body: <p>I have problem with configuration or something else that magento never run my module's sql install/update script!</p>
  
  <p>I use magento-1.4.1.0</p>
  
  <p>Here is my structure folders and files:</p>
  
  <pre><code>\app\code\local\RN\ShortUrl
  \app\code\local\RN\ShortUrl\Block\ShortUrl.php
  
  \app\code\local\RN\ShortUrl\controllers\IndexController.php
  \app\code\local\RN\ShortUrl\controllers\UController.php
  
  \app\code\local\RN\ShortUrl\etc\config.xml
  
  \app\code\local\RN\ShortUrl\Helper\Url.php
  
  \app\code\local\RN\ShortUrl\Model\ShortUrl.php
  \app\code\local\RN\ShortUrl\Model\Mysql4\ShortUrl.php
  \app\code\local\RN\ShortUrl\Model\Mysql4\ShortUrl\Collection.php
  
  \app\code\local\RN\ShortUrl\Model
  \app\code\local\RN\ShortUrl\Model\Mysql4
  \app\code\local\RN\ShortUrl\Model\Mysql4\ShortUrl
  
  \app\code\local\RN\ShortUrl\sql\rn_shorturl_setup\mysql4-install-0.1.0.php
  </code></pre>
  
  <p>Here are the contents of <code>\app\etc\modules\RN_ShortUrl.xml</code>:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;    
  &lt;config&gt;
      &lt;modules&gt;
          &lt;RN_ShortUrl&gt;
              &lt;active&gt;true&lt;/active&gt;
              &lt;codePool&gt;local&lt;/codePool&gt;
          &lt;/RN_ShortUrl&gt;
      &lt;/modules&gt;
  &lt;/config&gt;
  </code></pre>
  
  <p>Here are the contents of <code>\app\code\local\RN\ShortUrl\etc\config.xml</code>:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;config&gt;
  &lt;modules&gt;
      &lt;RN_ShortUrl&gt;
          &lt;version&gt;0.1.0&lt;/version&gt;
      &lt;/RN_ShortUrl&gt;
  &lt;/modules&gt;
  &lt;frontend&gt;
      &lt;routers&gt;
          &lt;shorturl&gt;
              &lt;use&gt;standard&lt;/use&gt;
              &lt;args&gt;
                  &lt;module&gt;RN_ShortUrl&lt;/module&gt;
                  &lt;frontName&gt;shorturl&lt;/frontName&gt;
              &lt;/args&gt;
          &lt;/shorturl&gt;
      &lt;/routers&gt;
      &lt;layout&gt;
          &lt;updates&gt;
              &lt;shorturl&gt;
                  &lt;file&gt;shorturl.xml&lt;/file&gt;
              &lt;/shorturl&gt;
          &lt;/updates&gt;
      &lt;/layout&gt;
  &lt;/frontend&gt;
  &lt;global&gt;
      &lt;blocks&gt;
          &lt;rn_shorturl&gt;
              &lt;class&gt;RN_ShortUrl_Block&lt;/class&gt;
          &lt;/rn_shorturl&gt;
      &lt;/blocks&gt;
      &lt;rewrite&gt;
          &lt;rn_shorturl&gt;
              &lt;from&gt;#^/u/(.*)#&lt;/from&gt;
              &lt;to&gt;/shorturl/u/redirect/key/$1&lt;/to&gt;
          &lt;/rn_shorturl&gt;
      &lt;/rewrite&gt;
  
      &lt;models&gt;
          &lt;shorturl&gt;
              &lt;class&gt;RN_ShortUrl_Model&lt;/class&gt;
              &lt;resourceModel&gt;shorturl_mysql4&lt;/resourceModel&gt;
          &lt;/shorturl&gt;
          &lt;shorturl_mysql4&gt;
              &lt;class&gt;RN_ShortUrl_Model_Mysql4&lt;/class&gt;
              &lt;entities&gt;
                  &lt;shorturl&gt;
                      &lt;table&gt;shorturl&lt;/table&gt;
                  &lt;/shorturl&gt;
              &lt;/entities&gt;
          &lt;/shorturl_mysql4&gt;
      &lt;/models&gt;
      &lt;resources&gt;
          &lt;shorturl_setup&gt;
              &lt;setup&gt;
                  &lt;module&gt;RN_ShortUrl&lt;/module&gt;
              &lt;/setup&gt;
              &lt;connection&gt;
                  &lt;use&gt;core_setup&lt;/use&gt;
              &lt;/connection&gt;
          &lt;/shorturl_setup&gt;
          &lt;shorturl_write&gt;
              &lt;connection&gt;
                  &lt;use&gt;core_write&lt;/use&gt;
              &lt;/connection&gt;
          &lt;/shorturl_write&gt;
          &lt;shorturl_read&gt;
              &lt;connection&gt;
                  &lt;use&gt;core_read&lt;/use&gt;
              &lt;/connection&gt;
          &lt;/shorturl_read&gt;
      &lt;/resources&gt;
      &lt;helpers&gt;
          &lt;shorturl&gt;
              &lt;class&gt;RN_ShortUrl_Helper&lt;/class&gt;
          &lt;/shorturl&gt;
      &lt;/helpers&gt;
  &lt;/global&gt;
  </code></pre>
  
  <p></p>
  
  <p>Here is my install SQL script:</p>
  
  <pre><code>&lt;?php
      $installer = $this;
      $installer-&gt;startSetup();
  
      $installer-&gt;run("
              DROP TABLE IF EXISTS {$this-&gt;getTable('shorturl')};
              CREATE TABLE {$this-&gt;getTable('shorturl')} (
              `shorturl_id` INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
              `shorted_key` VARCHAR(255) COLLATE utf8_general_ci NOT NULL DEFAULT '',
              `long_url` VARCHAR(255) COLLATE utf8_general_ci NOT NULL DEFAULT '',
              PRIMARY KEY (`shorturl_id`),
              INDEX (shorted_key),
              INDEX (long_url)
              )ENGINE=InnoDB CHARACTER SET 'utf8' COLLATE 'utf8_general_ci';"
      );
  
      /* right before this */
      $installer-&gt;endSetup();
  </code></pre>
  
  <p>I have tried to change my module's version and created the upgrade script "mysql4-upgrade-1.0-1.1.php" but still not working, but I could run my module.</p>
  
  <p><a href="http://magento.test/shorturl/index/generate/?url=http://realestate.cambodiachic.com/property-detail-hotel-restaurant-on-kampot-river-93.html" rel="noreferrer">http://magento.test/shorturl/index/generate/?url=http://realestate.cambodiachic.com/property-detail-hotel-restaurant-on-kampot-river-93.html</a></p>
  
  <p>It's working except the problem I am asking.</p>
  
  <p>Thanks in advance,</p>
  
  <p>Rithy</p>