<p>Looks like overriding the <code>onAfterInstall()</code> method in the main Plugin class is where I should be adding this sort of stuff. Amazing what you find when you actually read the instructions!</p>

<p>More details <a href="http://buildwithcraft.com/docs/plugins/setting-things-up#methods" rel="nofollow">here</a></p>

CC BY-SA 3.0
2015-06-03T14:39:41.657Z
2015-06-03T14:39:41.657Z
Steve Holland
<p>I'm using <a href="http://buildwithcraft.com/docs/plugins/records" rel="nofollow">Records</a> to create some new tables for use by my plugin. I now need to add some initial data to one of the these tables. What's the best way of accomplishing this on install?</p>

<plugin-development>
Populate tables on Plugin install
# Populate tables on Plugin install

(Asked by: username_0 on 2015-06-03)

I'm using [Records](http://buildwithcraft.com/docs/plugins/records) to create some new tables for use by my plugin. I now need to add some initial data to one of the these tables. What's the best way of accomplishing this on install?

**Tags:** plugin-development


---

## 1 answers

### Answer by username_0 on 2015-06-03. Score: 4 | Accepted answer

Looks like overriding the `onAfterInstall()` method in the main Plugin class is where I should be adding this sort of stuff. Amazing what you find when you actually read the instructions!

More details [here](http://buildwithcraft.com/docs/plugins/setting-things-up#methods)


---

