Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

数据库迁移脚本向不同的连接库迁移问题 #70

Open
zhangyue0503 opened this issue Jun 2, 2022 · 1 comment
Open

数据库迁移脚本向不同的连接库迁移问题 #70

zhangyue0503 opened this issue Jun 2, 2022 · 1 comment

Comments

@zhangyue0503
Copy link

在使用 https://github.com/php-casbin/think-authz/ 的时候发现定义了它的 connection 配置,也无法在指定的连接库中创建表,还是会创建到默认连接的库中

在 topthink/think-migration/src/command/Migrate.php 的 executeMigration() 方法中发现

$migration->setAdapter($this->getAdapter());

这一行的 getAdapter() 方法会直接使用 config 中指定的 default 的连接,即我在迁移脚本中指定了自己想要连接的数据库也无效,要在指定的连接库中创建表只能去改整体的 database.default

@Maplejay
Copy link

最终解决了吗,怎么解决的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants