Those are both helpful pointers. I'm working out the details right now, I'll post my code as soon as I get it all worked out so that others can use it. Thanks again, David
On Feb 20, 2:41 pm, David Pollak <[email protected]> wrote: > In your meta mapper, if you override dbAddTable to return Full[() => Unit], > that function will be called after all the modifications have been made to > the tables, if your table was added as part of Schemifier's changes. > > On Fri, Feb 20, 2009 at 9:18 AM, DavidV <[email protected]> wrote: > > > I wondering how to populate rows of a DB table upon it's creation. > > First, where in the lift code are tables created? Is it in trait > > BaseMapper's dbAddTable method? I have an Array[String] I would like > > to add to the table when it is being created. Which method can I > > override to achieve this and how should I do so? > > You'd probably do something like: > > object MyTable extends MyTable with MetaMapper[MyTable] { > private val myArray = Array("foo", "bar") > private val writeToNewTable() { > for (s <- myArray) { > create.columnForString(s).save > } > } > > override def dbAddTable = Full(writeToNewTable _) > > } > > Does this help? > > Thanks, > > David > > > > > Thanks! > > -David > > -- > Lift, the simply functional web frameworkhttp://liftweb.net > Beginning Scalahttp://www.apress.com/book/view/1430219890 > Follow me:http://twitter.com/dpp > Git some:http://github.com/dpp --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~----------~----~----~----~------~----~------~--~---
