yesodweb / yesodweb/persistent

Postgres schemas and migrations

Open
#661 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Newcomer
Dominant language
Haskell
Stars
486
Forks
306
PR merge metrics
No merged PRs in 30d

Description

Not possible to migrate if there is a table with the same name in other schema.
Example:
There is an existing "stat"."user" table
and the migration is for "public"."user" (default schema)
Extra: models

User
    username Text sqltype=varchar(17)
      ....

Result:
persistent is not creating the table "user" in "public" because of the one in "stat", after it I get:

*** Exception: SqlError {sqlState = "42P01", sqlExecStatus = FatalError, sqlErrorMsg = "relation \"user\" does not exist", sqlErrorDetail =
 "", sqlErrorHint = ""}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files or tests. Start by reproducing the migration with an existing stat.user table and a target public.user table, then inspect the PostgreSQL migration path that handles schema-qualified relations. Done means the public.user table is created and the migration completes without the reported relation error.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell, postgresql
Domain
backend, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.