mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-14 17:02:49 +03:00
parent
bf67e5e246
commit
2e72760852
@ -1,5 +1,5 @@
|
||||
Auto-apply migrations or metadata when server starts
|
||||
====================================================
|
||||
Auto-apply migrations/metadata when server starts
|
||||
=================================================
|
||||
|
||||
.. contents:: Table of contents
|
||||
:backlinks: none
|
||||
@ -23,7 +23,7 @@ Applying migrations
|
||||
|
||||
The ``migrations`` directory created by Hasura CLI (the one next to
|
||||
``config.yaml``) can be mounted at ``/hasura-migrations`` path of this docker
|
||||
container and the container's entrypoint script will apply the migrations before
|
||||
container and the container's entry point script will apply the migrations before
|
||||
starting the server. If no directory is mounted at the designated path, server
|
||||
will start ignoring migrations.
|
||||
|
||||
@ -53,4 +53,4 @@ Applying only metadata
|
||||
|
||||
If you're managing migrations with a different tool and want to use this image to apply only the
|
||||
metadata, mount a directory with just a ``metadata.yaml`` file and the script will
|
||||
apply the meatadata.
|
||||
apply the metadata.
|
@ -114,6 +114,10 @@ Step 3: Initialize the migrations as per your current state
|
||||
|
||||
- Remove ``migrations/<version>_first.down.{sql,yaml}`` migration files if you are not adding down migrations for these
|
||||
|
||||
.. note::
|
||||
|
||||
Migration version cannot be "0". i.e. the files cannot be of the form ``0_<something>.up.sql``
|
||||
|
||||
Step 4: Use the console from the CLI
|
||||
------------------------------------
|
||||
|
||||
@ -135,7 +139,7 @@ in the ``migrations/`` directory in your project.
|
||||
|
||||
.. note::
|
||||
|
||||
Migrations are only created when using the Console through CLI.
|
||||
Migrations are only created when using the console through CLI.
|
||||
|
||||
Step 6: Apply the migrations to another instance of the GraphQL engine
|
||||
----------------------------------------------------------------------
|
||||
|
@ -42,4 +42,4 @@ Advanced
|
||||
For new project <new-project>
|
||||
For existing project <existing-project>
|
||||
With a database with an existing migration system <database-with-migrations>
|
||||
Auto-apply migrations or metadata when server starts <auto-apply-migrations>
|
||||
Auto-apply migrations/metadata when server starts <auto-apply-migrations>
|
||||
|
Loading…
Reference in New Issue
Block a user