DBIx迁移无法识别MySQL

DBIx迁移无法识别MySQL,mysql,perl,database-migration,dbix-class,Mysql,Perl,Database Migration,Dbix Class,我尝试使用MySQL完成本教程: 我正在使用附加选项--database MySQL运行它声明的命令 例如: dbic迁移-I lib/-I local/lib/perl5/--S Database::Main--target_dir share/--Database MySQL prepare dbic迁移-I lib/-I local/lib/perl5/--S Database::Main--target_dir share/--Database MySQL安装 但是,在执行instal

我尝试使用MySQL完成本教程:

我正在使用附加选项
--database MySQL
运行它声明的命令

例如:

dbic迁移-I lib/-I local/lib/perl5/--S Database::Main--target_dir share/--Database MySQL prepare

dbic迁移-I lib/-I local/lib/perl5/--S Database::Main--target_dir share/--Database MySQL安装

但是,在执行install命令时,它会提供以下输出:

$ dbic-migration -I lib/ -I local/lib/perl5/ --S Database::Main --target_dir share/ --database MySQL install

Since this database is not versioned, we will assume version 1
Reading configurations from share/fixtures/1/conf
Can't opendir($fh, 'share/migrations/SQLite/deploy/1'): No such file or directory at local/lib/perl5/DBIx/Class/DeploymentHandler/DeployMethod/SQL/Translator.pm line 109
DBIx::Class::Storage::TxnScopeGuard::DESTROY(): A DBIx::Class::Storage::TxnScopeGuard went out of scope without explicit commit or error. Rolling back. at local/lib/perl5/DBIx/Class/DeploymentHandler/DeployMethod/SQL/Translator.pm line 116
我的
共享
目录如下所示:

└── share
    ├── database-main.db
    ├── fixtures
    │   └── 1
    │       └── conf
    │           └── all_tables.json
    └── migrations
        ├── MySQL
        │   └── deploy
        │       └── 1
        │           ├── 001-auto-__VERSION.sql
        │           └── 001-auto.sql
        ├── _common
        │   └── deploy
        │       └── 1
        │           └── 002-demo.pl
        └── _source
            └── deploy
                └── 1
                    ├── 001-auto-__VERSION.yml
                    └── 001-auto.yml
有人知道为什么在我指定MySQL时它仍在继续查找SQLite目录吗?

,我怀疑dbic迁移正在使用这种模式

dbic-migration <generic options> <command> <options for that command>
--数据库MySQL
将被忽略,因为它不是dbic迁移的常规选项

你必须说

dbic-migration prepare --database MySQL
其中,
--database MySQL
被理解为prepare命令的一个选项


不幸的是,它没有警告您它不了解的选项。

我也想问一下;在升级/降级/安装/填充数据库的脚本中使用
dbic migration
命令是否与使用
DBIx::Class::DeploymentHandler
相同?谢谢您的回复,我已经尝试了
dbic迁移-i lib/-i local/lib/perl5/--S Database::Main--target_dir share/install--Database MySQL
,但似乎仍然在寻找SQLite目录。你认为制作脚本来升级/降级/安装数据库是一个好主意吗?@A7O我会尝试在命令后面添加除-I选项以外的所有选项
dbic迁移-I lib/-I local/lib/perl5/prepare…所有选项…
dbic迁移-I lib/-I local/lib/perl5/install..所有选项..
。我正在使用脚本安装和升级架构,只是如何确保我不会弄乱已经存在的数据,即不删除所有内容!;)
dbic-migration prepare --database MySQL