Skip to content
Back to skills

Flisk Databases

ASecurity

Give a Flisk service a database and migrations - scaffold a backend with `--feature prisma` (adds a `<name>-migrator` resource) or `--feature drizzle`, or run Atlas, Dbmate, TypeORM, MikroORM or another tool as a one-shot migrator job, and connect through the generated `DATABASE_URL`. Use when adding database access, ORM or migration tooling to a service, or when migrations or connections fail. To wipe, seed or snapshot existing data, use flisk-data.

  • 3 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 7, 2026
databasesbashrailsdockergitapidatabasebackend

Works with

  • cli
  • api

Security analysis

A100/100

Scanned November 7, 2026

npx -y skills add flisk-sh/flisk-skills --skill flisk-databases --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Flisk Databases?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Flisk Databases
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/flisk-sh-flisk-databases/badge)](https://www.skillsdirectory.com/skills/flisk-sh-flisk-databases)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: flisk-databases
description: Give a Flisk service a database and migrations - scaffold a backend with `--feature prisma` (adds a `<name>-migrator` resource) or `--feature drizzle`, or run Atlas, Dbmate, TypeORM, MikroORM or another tool as a one-shot migrator job, and connect through the generated `DATABASE_URL`. Use when adding database access, ORM or migration tooling to a service, or when migrations or connections fail. To wipe, seed or snapshot existing data, use flisk-data.
license: MIT
compatibility: Requires the flisk CLI and Docker. Does not deploy.
metadata:
  author: flisk-sh
  version: "1.0"
---

# Databases and migrations

Every Flisk project gets one shared Postgres; you do not add one. Each stack gets its own database, and Compose sets each backend's `DATABASE_URL` to it.

## Workflow

1. Pick the tool when you scaffold the service:
   ```bash
   flisk resource orders-api --type backend --feature prisma --stack shop --yes   # Prisma schema + orders-api-migrator
   flisk resource orders-api --type backend --feature drizzle --stack shop --yes  # Drizzle client in src/db.ts + /health/db, no migrator
   ```
   For an existing service, add `"prisma"` to `featuresEnabled` in its `service.json` once it has a `prisma/schema.prisma`.
2. Run migrations in their own migrator resource, never from the API's start script. Prisma gets one generated. For Drizzle, Atlas, Dbmate, TypeORM, MikroORM or Ptah, copy the matching one-shot job from [examples/byo-jobs](https://github.com/flisk-sh/flisk/tree/main/examples/byo-jobs) and register it with `--type bring-your-own --restart no`.
3. Read the connection string from the environment (`DATABASE_URL`); do not hard-code one.
4. `flisk up <stack>` starts Postgres, then the migrator, then the services that depend on it.
5. If a connection or migration fails, run `flisk doctor` (it checks `DB_PASSWORD` and `DATABASE_URL` in `.env`) and read the migrator's logs with `flisk logs -s <name>-migrator`.

## Guardrails

- A service depends on Postgres through `dependsOn`; list the migrator instead of `postgres` when it creates your tables.
- The Postgres volume keeps the password it was created with; changing `DB_PASSWORD` later does not change it (see flisk-data to reset).
- Do not commit secrets or local data.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.