Neurelo Build Docs
Neurelo Build Docs
  • Introduction
    • Core Concepts
    • Key Features
  • Getting Started
    • Sign-in/Sign-up
    • Dashboard
      • Collapsible Sidebar
      • Light/Dark Mode
      • Account Settings
      • Audit Events
      • User Management
        • Permissions (Member v/s Admin)
      • Org Settings
    • Starting your Neurelo Project
      • Quick Start Guide
      • Step 1 - Add a Data Source
      • Step 2 - Build Definitions
      • Step 3 - Create an Environment
      • Step 4 - Create an API Key
      • Step 5 - Start Runners
      • Try your Neurelo APIs
  • "How to" Videos
    • Product Overview
    • Neurelo APIs & SDKs
    • Project Setup
    • Definitions
    • Environments
    • Data Sources
    • Organization Management
    • Creating and Using Custom Queries
    • Using the Schema Builder to build Relationships
    • Mock Data Generation
  • Definitions
    • Neurelo Schema Editor
      • Schema Builder
      • JSON/YAML Editor
      • Schema Visualization: Entity-Relationship Diagram (ERD)
    • Custom APIs for Complex Queries
      • Write and Commit Custom Queries
      • AI-Assisted Query Generation
      • Deploying Custom API Endpoints
      • Using Variables in your Custom Query
    • Branches and Commits
    • API Docs
  • Environments
    • Creating a new Environment
    • API Playground
    • Observability
    • Migrations
    • API Keys
  • Data Sources
    • PostgreSQL
    • MySQL
    • MongoDB
  • Guides
    • Provisioning Cloud Databases for using with Neurelo
      • PostgreSQL
        • AWS RDS (PostgreSQL)
      • MySQL
        • AWS RDS (MySQL)
      • MongoDB Atlas
    • Mock Data Generation
    • Wipe Data Source
    • Remote Git Repository for Definitions
      • Connecting a Remote Git Repo
      • Creating Commits from Neurelo
      • Syncing Branches
    • Data Viewer
    • Environment/Data Source Tags
    • How to work with Embedded documents and References in MongoDB
    • How to download and use the Postman Collection for your Project
    • Building Python applications with Postgres and FastAPI
    • CI Integration using Neurelo CLI
    • Schema Migrations
    • Schema AI Assist
    • Auto-Introspection
    • Access Policies
    • User Auth
      • Google
      • GitHub
      • GitLab
    • MongoDB Atlas - Migrate GraphQL to Neurelo
    • MongoDB Atlas - Migrate REST Data APIs to Neurelo
  • MongoDB Atlas - Migrate REST Data APIs to Neurelo
  • MongoDB Atlas - Migrate GraphQL APIs to Neurelo
  • Neurelo Schema Language (NSL)
    • Example 1 - DVD Rentals
    • Example 2 - Simple "Posts" App
    • Example 3 - Bookstore
  • Neurelo API Reference (REST)
    • Examples of Neurelo Auto-Generated REST API endpoints
      • Example 1 - Simple “Posts” application
      • Example 2 - "DVD Rentals" application
      • Example 3 - "Bookstore” application
      • cURL API Examples
  • Neurelo API Reference (GraphQL)
  • SDKs
    • TypeScript / JavaScript SDK
    • Go SDK
    • Python SDK
      • Python SDK Tutorial -- News Application
        • News Application using Neurelo’s Python SDKs
  • CLI (Preview Version)
  • Self-Hosted Neurelo Gateways
  • Tutorials
    • Building a Real Time Chat Application with Neurelo and MongoDB using Python
    • Building A Financial Terminal with Neurelo and MongoDB in Rust
    • Building a Restaurant Management System with Neurelo and MongoDB using GraphQL in just a few minutes
    • Bringing Neurelo’s Data APIs to Life Instantly with MySQL
  • Project Examples
  • References
    • Supported Databases
    • Supported OS and Browsers
  • Support
Powered by GitBook
On this page
  • Overview
  • Using Migrations
  • How to access Migrations for an envrionment
  1. Environments

Migrations

PreviousObservabilityNextAPI Keys

Last updated 1 year ago

Overview

Neurelo's schema migration feature enables you to apply the changes to the database for the changes in the schema in your definitions. This feature allows users to modify, update, or enhance their database schema such as adding or modifying tables (or collection) and fields and instantiate those changes in the database. The goal is to keep your database in sync with any changes your application might need over time, providing flexibility and maintaining a well-organized data model. This is crucial for evolving your database along with your application requirements

Using Migrations

Neurelo Schema Migrations is an optional feature that needs to enabled at the Project level. This feature is only supported for Relational Databases such as PostgreSQL and MySQL.

This feature is currently in preview and not intended for production use. Use with caution and provide feedback to help us improve.

Note - this feature can only be enabled during Project Creation. It cannot be re-enabled if this was disabled during project creation or subsequently

Once enabled at the Project level, this feature has two capabilities.

  • Generating Migrations for every commit of the definition with schema changes. This is always enabled for every environment, once it has been enabled at the project level

  • Applying Migrations directly from Neurelo to your data source. This setting needs to be enabled at the Environment level. You can do this while creating a new environment for a project or later from Environment settings page for an existing environment.

Neurelo's definitions capability keeps a record of data model changes using its version control capabilities. This enables Neurelo to automatically generate all the required database migrations in the specific order they were made.

How to access Migrations for an envrionment

  • For a project, access the environment page by clicking "Environments" option from the left sidebar panel. This will load the page with the list of environments deployed for that project.

  • Click on any specific environment and open the detailed environment page. From here, click on "Migrations" tab on this page. This will load the detailed migration page for this environment

This page will show the current schema in the data source (the "Source Schema") and the schema that will need to be migrated to based on the selected commit for the environment (the "Target Schema") and it will list all the commits between the source schema and the target schema. Each commit with a schema change will have one more migrations associated with it. If a commit does not have a schema change (e.g. only has changes for custom query endpoints), then it will not have a migration associated with it.

Each commit can be selected or unselected from the Migrations process.

It is recommended to select all migrations. Please be very careful when unselecting a specific migration, as generally all migrations need to be applied in the sequence they were generated in

Users can -

  • Validate Migrations - This will validate migrations between the source and target schema to see if they can be applied cleanly without possible data loss.

  • Download Migrations - This allows users to download all the migrations across the commits in SQL format. They can then edit these migrations as needed and then apply them directly to the database using a schema migrations tool

  • Mark as Applied - If users want to download migrations and apply them outside of Neurelo, or if Automatic migrations have been disabled for the environment users can use this option to indicate to Neurelo that the migrations have been applied

  • Apply Migrations - If Automatic migrations have been enabled, users can apply migrations directly from Neurelo to the data source

When the user applies a specific commit to the environment (can only be done with the runners stopped), it is recommended to do the following -

  1. Check in the Migrations tab of the environment, if any migrations are needed after the commit has been changed

  2. If Migrations show as pending, then validate the migrations and apply them (manually or through Neurelo, depending on your preference and configuration)

  3. If Migrations have been applied manually, mark them as Applied in Neurelo

  4. Start the Runners