【发布时间】:2018-07-03 06:33:37
【问题描述】:
我正在尝试使用命令“aqueduct db generate”从模型生成迁移。
这是 lib > 模型下的模型“request.dart”(我还有其他模型,它们已经迁移没有任何问题):
导入'package:dbapi/dbapi.dart';
类 Request 扩展 ManagedObject<_request> 实现 _Request {}
类_请求{
@managedPrimaryKey
整数索引;
字符串描述;
}
然而,它正在创建一个空迁移,因为它无法识别新模型-“请求”。下面是“aqueduct db generate”的输出
-- Aqueduct CLI Version: 2.5.0+1
-- Aqueduct project version: 2.5.0+1
-- Replaying migration files...
Replaying version 1
Replaying version 2
Replaying version 3
-- The following ManagedObject<T> subclasses were found:
Question
UserProfile
* If you were expecting more declarations, ensure the files are visible in the application library file.
-- Created new migration file (version 4).
注意:新模型“request.dart”与我可以迁移的以前模型具有相同的文件权限。
还有其他人遇到过同样的问题吗?感谢帮助!
【问题讨论】: