Skip to content

moooon

Motir

Vibe your whole project. Bring an idea — Motir's three AI layers plan it, track it, and ship it, end to end. You're looking at Motir, built in Motir.

  • Vibe Project
  • Open Source
  • AI Agent
  • AI Loop
1
requests
0
upvotes
145
planned
1,361
shipped

Motir · Work items

MOTIR-193Done

3.7.2 Schema — default-board flag + switcher ordering (N boards per project; migration-aware)

Estimate: 16m · Depends on: 3.1.1

Make the board table first-class multi-per-project. The per-project index is already non-unique (3.1.1), so add: a board.isDefault Boolean @default(false) (exactly one default per project — enforced in the service + a partial unique index (projectId) WHERE is_default), and a board.position (fractional-index string) for stable switcher ordering. ONE migration; the existing auto-seeded board per project backfills to isDefault = true + an initial position, so no project is left without a default. No RLS change (the board table is already workspace-RLS-forced from 3.1.1).

Out of scope: the CRUD service/routes (3.7.3); UI (3.7.4); the read wiring (3.7.5).

Acceptance criteria

  • board.isDefault @default(false) + board.position added in ONE migration; a partial unique index guarantees ≤1 default per project; migrate dev applies cleanly + idempotently.
  • Existing boards backfill to isDefault = true + an initial position (every project keeps exactly one default); prisma generate types the fields.
  • A vitest (real Postgres) asserts the one-default invariant (a second isDefault=true for the same project is rejected) and the backfill.

Context refs

  • prisma/schema.prisma Board (3.1.1 — the non-unique @@index([projectId]) + RLS) ; the fractional-index position convention used on work_item / board_column
  • motir-core/CLAUDE.md — one migration, application-seeded data, partial indexes