Plugin uninstall only removes one table When uninstalling my plugin, only one table is removed. Two others are left behind.  Any suggestions what I'm doing wrong?  Could it be naming with and without the underscore?

The good:

&lt;?php
namespace Craft;

class Calendar37Record extends BaseRecord
{
    public function getTableName() {
        return 'calendar37';
    }
    protected function defineAttributes() { 
        return array(
            'event_id'   =&gt; AttributeType::Number,
            'dateYmd'    =&gt; AttributeType::String,
            'timestr'    =&gt; AttributeType::String,
            'alt_text'   =&gt; AttributeType::String,
            'css_class'  =&gt; AttributeType::String,
            'userJson'   =&gt; AttributeType::String,
        );
    }
    public function defineIndexes() {
        return array(
            array('columns' =&gt; array('event_id', 'dateYmd'), 'key' =&gt; true),
        );
    }
}


and the bad:

&lt;?php
namespace Craft;

class Calendar37_SubsetsRecord extends BaseRecord
{
    public function getTableName() {
        return 'calendar37_Subsets';
    }
    protected function defineAttributes() { 
        return array(
            'handle'              =&gt; AttributeType::String,
            'title'               =&gt; AttributeType::String,
            'categoriesToInclude' =&gt; AttributeType::String,
            'categoriesToExclude' =&gt; AttributeType::String,
            );
    }
    public function defineIndexes() {
        return array(
            array('columns' =&gt; array('handle'), 'unique' =&gt; true),
        );
    }
}


Bad #2:

&lt;?php
namespace Craft;

class Calendar37_ViewsRecord extends BaseRecord
{
    public function getTableName() {
        return 'calendar37_Views';
    }
    protected function defineAttributes() { 
        return array(
            'subsetId'     =&gt; AttributeType::String,
            'startDateYmd' =&gt; AttributeType::String,
            'endDateYmd'   =&gt; AttributeType::String,
            'htmlBefore'   =&gt; array(AttributeType::String, 'column' =&gt; ColumnType::Text, 'required' =&gt; false),
            'htmlAfter'    =&gt; array(AttributeType::String, 'column' =&gt; ColumnType::Text, 'required' =&gt; false),
        );
    }
    public function defineIndexes() {
        return array(
            array('columns' =&gt; array('subsetId', 'startDateYmd' ), 'key' =&gt; true),
        );
    }
}
Thanks for that tip, Lindsey, but here's what happened: I changed calendar37 to calendar37_Occurrences and then all three tables wouldn't uninstall.  It turns out that the issue is having a capital letter after the underscore.  So it seems like an "undocumented feature" that you can make plugin tables persist after uninstall by including a capital letter after the underscore.

return 'calendar37_Subsets';
return 'calendar37_Views';


needed to become:

return 'calendar37_subsets';
return 'calendar37_views';