Coding
PromptBeginner5 minmarkdown
Markdown Converter
Agent skill for markdown-converter
21
> Parent rules: [`/workspace/backend/agents.md`](../agents.md)
Sign in to like and favorite skills
Parent rules:
/workspace/backend/agents.md
make migrate-new (or alembic revision --autogenerate -m "description").upgrade() and downgrade() functions."add widget config_overrides column", not "update".When adding a new SQLAlchemy model:
app/models/.alembic/env.py so autogenerate detects it.make migrate-new to generate the migration.make migrate-up.users, workflows, dashboards, api_keys) MUST have a tenant_id UUID NOT NULL column.tenant_id column MUST have an index (for query performance on filtered reads).(tenant_id, id) or (tenant_id, created_at) for common query patterns.tenant_id to existing tables, the migration must provide a default value for existing rows or use a data migration to backfill.widgets via dashboards, dashboard_filters via dashboards) do NOT get their own tenant_id column.CREATE POLICY tenant_isolation ON <table> USING (tenant_id = current_setting('app.current_tenant')::uuid). These are safety nets — the application layer is the primary enforcement mechanism.