feat(db): own a dedicated Postgres schema and ship SQL migrations with migrate and export commands

Open
#374 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
postgresql, sql, typescript
Domain
databases

Research direction

Start by reading the existing sequelize-cli migration chain and the schema setup around assertSchemaCurrent; the issue does not name specific files or tests. The work spans configurable schema ownership, SQL migration conversion and upgrade compatibility, migration execution and export formats, plus documentation. Done means these paths work together for existing and new deployments and the listed ORM integrations are documented.

Written by the indexing model from the issue text.

Description

enhancement P4 safe v1.0

Part of fells-code/seamless-auth-api#371.

Problem

The API's tables live in the default schema, alongside whatever the adopter's app owns. Adopters sharing a database with their app hit ORM drift detection (prisma migrate dev sees unknown tables and offers a reset; drizzle-kit needs a schemaFilter). Migrations are sequelize-cli .cjs files that only this repo's tooling can run.

Proposal

  • Tables in a configurable schema (default seamless_auth) via search_path, with the migrations table inside it
  • Plain numbered SQL as the migration source of truth, converted from the existing sequelize-cli chain, with an upgrade path for existing deployments
  • Run on boot or through a migrate command for teams that do not run DDL at boot; assertSchemaCurrent keeps its role
  • migrations export --format prisma|drizzle|knex|flyway|raw for organisations that review every DDL change
  • Docs: one-line ORM config to ignore the schema, and referencing users by ID
Dominant language
TypeScript
Stars
2
Forks
2
Avg merge
11h 40m
Merged PRs (30d)
104

Getting set up

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.

More from fells-code/seamless-auth-api

All issues in fells-code/seamless-auth-api

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.