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 <david.v.villa...@gmail.com> 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 framework http://liftweb.net
Beginning Scala http://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 liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to