loopbackio / loopbackio/loopback-next
npm run migrate : cannot migrate models not attached to this datasource, while having model sequencing in migrate.ts
まだ誰も着手していません。
- 主要言語
- TypeScript
- スター
- 5.1k
- フォーク
- 1.1k
- 平均マージ
- 2日 21時間
- マージ済み PR(30日)
- 27
説明
- Visited https://loopback.io/doc/en/lb4/todo-list-tutorial-sqldb.html - #link1
-Visited https://loopback.io/doc/en/lb4/MySQL-connector.html - #link2
Steps to reproduce
-
Intstall @loopback/authentication @loopback/authentication-jwt extensions
-
Suppose you are using Relational database, using the constraints as foreign keys, so you to sequence the model in migrate.ts as guided on #link1 above like
models:[...model, ...relatedmodel]
**Note if you dont have key constraints and this model sequencing, it work fine. no error -
Then bind the authentication-jwt datasource in to your application.ts
this.datasource(YourDbDatasource, UserServiceBindings.DATASOURCE_NAME) -
when you run migrate.
`
npm run clean
npm run build
npm run migrate
`
Error Come in action
Cannot migrate database schema Error: Cannot migrate models not attached to this datasource:
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず migrate.ts と application.ts から始め、authentication-jwt datasource をバインドした後、npm run clean、npm run build、npm run migrate を実行して報告された失敗を再現します。シーケンス化されたモデルが未アタッチとして報告される理由を追跡し、文書化された relational-model のセットアップがそのエラーなしにマイグレーションできた時点で issue は完了とします。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- nodejs, typescript
- 領域
- backend, databases
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 35/100