Migrations not getting picked up

19 views
Skip to first unread message

rpr...@sprypoint.com

unread,
Jan 14, 2015, 2:59:49 PM1/14/15
to activate-p...@googlegroups.com
Just wondering what might be some causes for Migrations not getting picked up?  I have an issue with a completely fresh database and they don't get run.

Flavio W. Brasil

unread,
Jan 14, 2015, 3:02:35 PM1/14/15
to rpr...@sprypoint.com, activate-p...@googlegroups.com
Take a look at the StorageVersion table, is it empty?

Best,

-- 
Flavio W. Brasil

On Wednesday, January 14, 2015 at 8:59 PM, rpr...@sprypoint.com wrote:

Just wondering what might be some causes for Migrations not getting picked up?  I have an issue with a completely fresh database and they don't get run.

--
You received this message because you are subscribed to the Google Groups "Activate Persistence Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to activate-persist...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Message has been deleted

Flavio W. Brasil

unread,
Jan 14, 2015, 3:06:09 PM1/14/15
to rpr...@sprypoint.com, activate-p...@googlegroups.com
Does the application work using a non-empty database?

-- 
Flavio W. Brasil

On Wednesday, January 14, 2015 at 9:03 PM, rpr...@sprypoint.com wrote:

It doesn't exist.  After running it gets added with a single row.

"";"activateExampleContext";-1;-1


On Wednesday, January 14, 2015 at 3:59:49 PM UTC-4, rpr...@sprypoint.com wrote:
Just wondering what might be some causes for Migrations not getting picked up?  I have an issue with a completely fresh database and they don't get run.

--

Ryan Proud

unread,
Jan 14, 2015, 3:08:35 PM1/14/15
to Flavio W. Brasil, activate-p...@googlegroups.com
If the table structure already exists it runs fine, but when running on a fresh database I get relation not found errors because the migration fails to run.  At one point they ran fine, but something has changed to prevent them from getting recognized.  What class checks the class path for migrations?  I can try and debug to see what I’m missing.

-- 
Ryan Proud
Sent with Airmail

Ryan Proud

unread,
Jan 14, 2015, 3:23:56 PM1/14/15
to Flavio W. Brasil, activate-p...@googlegroups.com
It looks like

Reflection.getAllImplementorsNames(List(classOf[Migration], context.getClass), classOf[Migration])

comes up with just the following migrations

net.fwbrasil.activate.migration.ManualMigration
net.fwbrasil.activate.migration.Migration$StorageVersionMigration$1

-- 
Ryan Proud
Sent with Airmail

Ryan Proud

unread,
Jan 14, 2015, 3:30:23 PM1/14/15
to Flavio W. Brasil, activate-p...@googlegroups.com
To add a little more context this is the Migration

package com.example.foo

import com.example.foo.activate.Entities._
import com.example.foo.activate.activateExampleContext._
import net.fwbrasil.activate.migration.Migration
import org.joda.time.DateTime

class CreateSchemaMigration extends Migration {

  def timestamp = 201225081211l

  def up {

    table[A]
      .createTable(
        _.column[String]("string"),
        _.column[DateTime]("date"))

    table[B]
      .createTable(
        _.column[BigDecimal]("bigDecimal1"),
        _.column[BigDecimal]("bigDecimal2"),
        _.column[String]("string1"),
        _.column[String]("string2"),
        _.column[String]("string3"),
        _.column[String]("a"))

    table[B]
      .addReference("a", table[Journal], "a_b_fk").ifNotExists

  }

}

-- 
Ryan Proud
Sent with Airmail

Ryan Proud

unread,
Jan 14, 2015, 3:35:30 PM1/14/15
to Flavio W. Brasil, activate-p...@googlegroups.com
I think I just found the cause.  Not sure if it’s a bug or something I wasn’t understanding properly.  Once I changed the Migration package to com.example.foo.activate it started to get picked up.

-- 
Ryan Proud
Sent with Airmail

Flavio W. Brasil

unread,
Jan 14, 2015, 3:42:00 PM1/14/15
to Ryan Proud, activate-p...@googlegroups.com
That explains, the migrations and entities should be under a sub package of the persistence context’s package.


Regards,

-- 
Flavio W. Brasil

Reply all
Reply to author
Forward
0 new messages