I've got a plugin that works on Craft 4.5. It's been installed a long time, upgraded from 2.x to 3.x.
Now trying to use it on a new install of Craft 4.5.10, installing it does not create any tables. Below is one of the records. So, three questions:
- In the CP Plugins page, should clicking install or uninstall create tables or remove them, respectively?
- Is it necessary to have a migration in order for the tables to be created?
- Any suggestions where to look for what's the problem?
Thank for any hints!
<?php
namespace kr37\drycalendar\records;
use Craft;
use craft\db\ActiveRecord;
class Drycalendar extends ActiveRecord
{
public static function getTableName() :string
{
return '{{%drycalendar}}';
}
protected function defineAttributes() {
return array(
// Craft automatically creates 'id' as an autoincrement
'event_id' => AttributeType::Number,
'dateYmd' => AttributeType::String,
'timestr' => AttributeType::String,
'alt_text' => AttributeType::String,
'css_class' => AttributeType::String,
'userJson' => AttributeType::String,
);
}
public function defineIndexes() {
return array(
array('columns' => array('event_id', 'dateYmd'), 'key' => true),
);
}
}