Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
BootStrap only loads first table
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Matt Raible  
View profile  
 More options Oct 24 2011, 6:01 pm
From: Matt Raible <mrai...@gmail.com>
Date: Mon, 24 Oct 2011 16:01:29 -0600
Local: Mon, Oct 24 2011 6:01 pm
Subject: [Scala] BootStrap only loads first table
Hello all,

I have the following BootStrap.scala class in my project that I'm using to load default data:

class BootStrap extends Job {

  override def doJob() {

    import models._
    import play.test._

    // Import initial data if the database is empty
    if (Athlete.count().single() == 0) {
      Yaml[List[Any]]("initial-data.yml").foreach {
        _ match {
          case a: Athlete => Athlete.create(a)
          case w: Workout => Workout.create(w)
          case c: Comment => Comment.create(c)
        }
      }
    }
  }

}

For some reason, only my "athlete" table is getting populated and the others aren't. I tried turning on debugging and trace, but nothing shows up in the logs.

This was working fine when connecting to "db=mem", but since I've changed to PostgreSQL, this behavior is happening. Below is my initial-data.yml:

- !!models.Athlete
    id:             !!Id[Long] 1
    email:          mrai...@gmail.com
    password:       beer
    firstName:      Matt
    lastName:       Raible

- !!models.Athlete
    id:             !!Id[Long] 2
    email:          trishmcgin...@gmail.com
    password:       whiskey
    firstName:      Trish
    lastName:       McGinity

- !!models.Workout
    id:             !!Id[Long] 1
    title:          Chainsaw Trail
    distance:       7
    duration:       90
    athlete_id:     1
    postedAt:       2011-10-13
    description:    >
                    A beautiful fall ride: cool breezes, awesome views and yellow leaves.

                    Would do it again in a heartbeat.

- !!models.Workout
    id:             !!Id[Long] 2
    title:          Monarch Lake Trail
    distance:       4
    duration:       90
    athlete_id:     1
    postedAt:       2011-10-15
    description:    >
                    A beautiful afternoon of hiking with fishing along the way.

- !!models.Workout
    id:             !!Id[Long] 3
    title:          Creekside to Flume to Chainsaw
    distance:       12
    duration:       150
    athlete_id:     2
    postedAt:       2011-10-16
    description:    >
                    Awesome morning ride through falling yellow leaves and cool fall breezes.

- !!models.Comment
    id:             !!NotAssigned
    author:         Jim
    content:        >
                    Nice day for it!
    postedAt:       2011-10-16
    workout_id:     1

- !!models.Comment
    id:             !!NotAssigned
    author:         Joe
    content:        >
                    Love that trail.
    postedAt:       2011-10-15
    workout_id:     2


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Matt Raible  
View profile  
 More options Oct 25 2011, 1:36 am
From: Matt Raible <mrai...@gmail.com>
Date: Mon, 24 Oct 2011 22:36:38 -0700 (PDT)
Local: Tues, Oct 25 2011 1:36 am
Subject: Re: BootStrap only loads first table
AFAICT, this is happening because an insert statement is failing into
PostgreSQL. I only know this from looking at PostgreSQL logs. Does
Anorm have a way of printing these types of issues or at least
throwing exceptions?

On Oct 24, 4:01 pm, Matt Raible <mrai...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Matt Raible  
View profile  
 More options Oct 25 2011, 9:18 pm
From: Matt Raible <mrai...@gmail.com>
Date: Tue, 25 Oct 2011 18:18:55 -0700 (PDT)
Local: Tues, Oct 25 2011 9:18 pm
Subject: Re: BootStrap only loads first table

I was able to solve this issue by cloning play-scala on GitHub, building it
locally and then creating a symlink from my modules directory to the
compiled project.

$ ll modules/
total 8
drwxr-xr-x  12 mraible  staff   408B Oct 12 09:30 coffee-1.0
drwxr-xr-x  10 mraible  staff   340B Oct 12 09:29 less-0.3.compatibility
lrwxr-xr-x   1 mraible  staff    29B Oct 25 18:02 scala-0.9.1 ->
/Users/mraible/dev/play-scala

I'm guessing this was fixed in August by the following commit:

https://github.com/playframework/play-scala/commit/cbe162a0ecbf7996eb...

What's the best way to go about using this version of play-scala? I realize
I could setup a local module, but that's not going to help me much when I
deploy to Heroku.

Is it possible to get a new release of play-scala?

Thanks,

Matt


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Matt Raible  
View profile  
 More options Oct 25 2011, 10:26 pm
From: Matt Raible <mrai...@gmail.com>
Date: Tue, 25 Oct 2011 19:26:46 -0700
Local: Tues, Oct 25 2011 10:26 pm
Subject: Re: [play-framework] Re: BootStrap only loads first table

On Oct 25, 2011, at 6:18 PM, Matt Raible wrote:

> I was able to solve this issue by cloning play-scala on GitHub, building it locally and then creating a symlink from my modules directory to the compiled project.

> $ ll modules/
> total 8
> drwxr-xr-x  12 mraible  staff   408B Oct 12 09:30 coffee-1.0
> drwxr-xr-x  10 mraible  staff   340B Oct 12 09:29 less-0.3.compatibility
> lrwxr-xr-x   1 mraible  staff    29B Oct 25 18:02 scala-0.9.1 -> /Users/mraible/dev/play-scala

> I'm guessing this was fixed in August by the following commit:

> https://github.com/playframework/play-scala/commit/cbe162a0ecbf7996eb...

> What's the best way to go about using this version of play-scala? I realize I could setup a local module, but that's not going to help me much when I deploy to Heroku.

Figured it out. In dependencies.yml:

    - upgrades -> scala 0.9.1-20111025

repositories:
    - upgrades:
        type: http
        artifact: "http://static.raibledesigns.com/[module]-[revision].zip"
        contains:
            - upgrades -> *

Still interested in an answer to the following question...


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Manuel Bernhardt  
View profile  
 More options Oct 27 2011, 3:10 am
From: Manuel Bernhardt <bernhardt.man...@gmail.com>
Date: Thu, 27 Oct 2011 09:10:37 +0200
Local: Thurs, Oct 27 2011 3:10 am
Subject: Re: [play-framework] Re: BootStrap only loads first table
>> Is it possible to get a new release of play-scala?

Yes please! Guys, 0.9.1 was released in May.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »