Skip to content

New loopback-cli command: update/migrate the database #3422

Closed

Description

@bajtos

As a follow-up to the discussion in #3395, we should implement a new loopback-cli command that will allow users to auto-update their databases and more importantly, to print (SQL) scripts needed to perform auto-update, so that users can run these scripts themselves.

Related reading: https://www.martinfowler.com/articles/evodb.html#AllDatabaseChangesAreMigrations

A possible implementation:

$ lb autoupdate db --dry
ALTER TABLE AccessTokens
ADD COLUMN scopes VARCHAR(255);

Activity

  1. shaheero commented on May 28, 2017

    @shaheero

    Another column is needed if you follow the steps in the docs. i.e. if several models are extending the built-in User model.
    "principalType" with type VARCHAR and length 255

  2. bajtos commented on Nov 12, 2019

    @bajtos
    MemberAuthor

    LoopBack version 3 is in LTS, we won't be adding any new features.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions