From dbb5e791f0c228369605d126dd590962ebe1eddc Mon Sep 17 00:00:00 2001 From: Bertrand Yuan Date: Mon, 27 Apr 2026 20:52:54 +0800 Subject: docs: add comprehensive documentation for operations This commit introduces a complete set of documentation files covering various aspects of the project, including environment setup, quality checks, command references, and architecture. The documentation is structured to assist developers and contributors in understanding the project's configuration, workflow, and best practices. Additionally, translations for Simplified and Traditional Chinese have been added to ensure accessibility for a wider audience. This enhances the overall usability and maintainability of the project. Signed-off-by: Bertrand Yuan --- Documentation/source/operations/database.rst | 59 ++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 Documentation/source/operations/database.rst (limited to 'Documentation/source/operations/database.rst') diff --git a/Documentation/source/operations/database.rst b/Documentation/source/operations/database.rst new file mode 100644 index 0000000..37c0cba --- /dev/null +++ b/Documentation/source/operations/database.rst @@ -0,0 +1,59 @@ +Database +======== + +Local Bootstrap +--------------- + +Use the included helper when developing locally: + +.. code-block:: bash + + ./start-database.sh + +The script is designed for local development and should not be used as a +production database management tool. + +Schema Areas +------------ + +.. list-table:: + :header-rows: 1 + :widths: 24 50 + + * - Area + - Ownership + * - Payload schema + - CMS collections, admin content, media metadata, and Payload-managed + structures. + * - Drizzle ``blog_*`` tables + - better-auth users, sessions, accounts, verifications, comments, rates, + and roles. + +Migration Workflow +------------------ + +For Payload collection changes: + +.. code-block:: bash + + pnpm payload:migrate:create + pnpm payload:migrate + pnpm payload:generate + +For application schema changes: + +.. code-block:: bash + + pnpm db:generate + pnpm db:migrate + +During local iteration, ``pnpm db:push`` can be useful, but committed schema +changes should still have a deliberate migration story. + +Operational Cautions +-------------------- + +* Keep Payload and application-owned tables conceptually separate. +* Regenerate Payload types after collection changes. +* Keep ``drizzle.config.ts`` filters aligned with application-owned tables. +* Do not commit local database data directories or generated build artifacts. -- cgit v1.2.3