0

I created a pg_dump on one computer and load it into a separate database on another computer.

I try to run my yesod executable but it fails on migration.

Migrating:

CREATE TABLE "email"("id" SERIAL PRIMARY KEY UNIQUE,"email" VARCHAR NOT NULL,"user" INT8 NULL,"verkey" VARCHAR NULL)
NOTICE:  CREATE TABLE will create implicit sequence "email_id_seq1" for serial column "email.id"
ff: SqlError {sqlState = "42P07", sqlExecStatus = FatalError, sqlErrorMsg = "relation \"email\" already exists", sqlErrorDetail = "", sqlErrorHint = ""}

The pg_dump has already created an "email" table, but yesod wants to create a new email table, how can I make yesod recognize the dump reloaded email table?

I think the dump is making the database slightly different than the yesod persistent expects the tables. but I don't know for sure, and I just need a way to copy a persistent database from one server to another.

Craig Ringer
  • 307,061
  • 76
  • 688
  • 778
MetaMemoryT
  • 174
  • 1
  • 11
  • It should be querying the database to find the definition of the "email" table so it can figure out the migration required. Turn statement logging on in PostgreSQL and we'll be able to see what it's doing. I think you're right and it can't see the table definition for some reason. – Richard Huxton Sep 02 '13 at 10:05

1 Answers1

0

It sounds to me like you are trying to initialize a new database. Can't you just point Yesod to your new database via a configuration option and run off your copy?

Chris Travers
  • 25,424
  • 6
  • 65
  • 182