Skip to content

Explain schema changes as a deployment step, not a run-time operation #306

Open

Description

@dimitri-yatsenko

The docs describe create_tables=False for production (how-to/deploy-production.md), but don't explain the principle behind it.

Proposal

Add an explanation page, or a section of the production guide, covering:

  • The principle. A schema change (declaring a table, altering or dropping it, changing a Lookup table's contents) is part of deploying new code. It is applied once, in a controlled step, before processes start running the new code.
  • Lookup contents count as schema. They change with the code, not at run time.
  • Why it matters. Run-time declaration is convenient for interactive work, but in a shared database it means whichever process imports new code first changes the schema, unreviewed. A table and the code that fills it should change together, at a known moment.
  • How to set it up. The allow_ddl setting (A single setting to disable all schema changes (DDL) at run time, Lookup contents included datajoint-python#1649), separate database logins for deployment and for run time, and the deployment step that applies the changes.
  • What stays the same for interactive use. The defaults keep today's convenience.

This page should land in the same release as the setting.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions