Answers.Body: <p>This might not be the answer you were looking for, but I don't think you need to go to great lengths trying to achieve something that in my opinion is not necessary. While it might seem to be not &quot;clean&quot; to have database table columns that are not required by your application/plugin, consider that todays ICT infrastructure is powerful enough to not slow down due to a few additional columns in a database and its tables.</p>
  <p>I would even consider it more risky trying to alter the &quot;base&quot; of Craft or the Yii framework than to live with a few autogenerated columns.</p>
  <p>If you are very sensitive to performance and have many database requests, you might not want to use active record since its higher level of abstraction <em>can</em> come with a performance penalty in certain situations.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-02-22T16:05:55.930Z
Answers.Text: Yeah you're probably right, I believe I'm gonna opt-out of the active records pattern. Thanks for your help
Answers.UserDisplayName: ovesco
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-02-22T08:07:14.147Z
Answers.LastActivityDate: 2021-02-22T08:07:14.147Z
Answers.UserDisplayName: MisterMike
Body: <p>I'm building a small analytics plugin and as such, I don't need the dateUpdated and uid columns in my records, but I dind't find any way of disabling them.</p>
  <p>Currently I have tried:</p>
  <ul>
  <li>Not setting them in the install::safeUp: doesn't work as Craft adds the attributes to the list and PDO complains &quot;column not found dateUpdated&quot;</li>
  <li>Making my record directly extend Yii2's active record and not craft's one</li>
  </ul>
  <p>Nothing worked.</p>
  <p>Is there any clean solution to this?</p>
  <p>Thanks a lot for your help!</p>
  
Tags: <plugin-development><plugins><updates><records>
Title: Plugin record no dateUpdated and uid
ThreadText: # Plugin record no dateUpdated and uid
  
  (Asked by: username_0 on 2021-02-21)
  
  I'm building a small analytics plugin and as such, I don't need the dateUpdated and uid columns in my records, but I dind't find any way of disabling them.
  
  Currently I have tried:
  
  * Not setting them in the install::safeUp: doesn't work as Craft adds the attributes to the list and PDO complains "column not found dateUpdated"
  * Making my record directly extend Yii2's active record and not craft's one
  
  Nothing worked.
  
  Is there any clean solution to this?
  
  Thanks a lot for your help!
  
  **Tags:** plugin-development, plugins, updates, records
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2021-02-22. Score: 2 | Accepted answer
  
  This might not be the answer you were looking for, but I don't think you need to go to great lengths trying to achieve something that in my opinion is not necessary. While it might seem to be not "clean" to have database table columns that are not required by your application/plugin, consider that todays ICT infrastructure is powerful enough to not slow down due to a few additional columns in a database and its tables.
  
  I would even consider it more risky trying to alter the "base" of Craft or the Yii framework than to live with a few autogenerated columns.
  
  If you are very sensitive to performance and have many database requests, you might not want to use active record since its higher level of abstraction *can* come with a performance penalty in certain situations.
  
  > **Comments:**
  > **username_0**: Yeah you're probably right, I believe I'm gonna opt-out of the active records pattern. Thanks for your help  
  
  ---
  
  