我遇到了一个Phinx迁移的问题,目前我正在处理表关系,我必须使用Phinx创建外键,但当我运行命令phinx migrate时,发生了错误。
Error: Call to undefined method Phinx\Db\Adapter\MysqlAdapter::getCakeConnection() in \cms\vendor\cakephp\migrations\src\Table.php on line 79
我找不到任何线索。
这是详细信息错误:
call C:\path\development\cms\vendor\robmorgan\phinx\bin\phinx.b
我有一个项目与苗条,口才和Phinx,我正在整合PHPunit。
除了我需要在执行测试之前执行信息种子的新测试之外,一切都正常工作。
种子
<?php
use Phinx\Seed\AbstractSeed;
class Permissions extends AbstractSeed
{
/**
* Run Method.
*
* Write your database seeder using this method.
*
* More information on writing seeders is availabl
我使用的是PHPUnit 5.7.23和phinx0.9.1
public function setUp(){
$this->phinx = new PhinxApplication;
$this->phinx->setAutoExit(false);
$this->phinx->run(new StringInput('migrate'), new NullOutput);
$this->phinx->run(new StringInput('seed:run
phinx --configuration选项发生了什么变化吗?我的工作中有一个项目依赖于它。
:如果提供--configuration命令行选项,--configuration将加载指定的文件。否则,..。
然而,当我跑步时:
$ ./vendor/bin/phinx --configuration=my_config.php
The "--configuration" option does not exist.
另外,--version不返回版本号。
Phinx by CakePHP - https://phinx.org.
我有一个docker配置(php,mysql,nginx),我需要运行。
问题是,当我运行命令vendor/bin/phinx migrate -e development时,即使我将phinx.yml配置成这个命令,系统也不会在码头容器上工作!
我有一条错误消息:
PDOException: PDO::__construct(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /var/www/html/.
/vendor/robmorgan/phinx/src/Phinx/Db
我正在使用Phinx在多台服务器上执行跨越1000多个应用程序的迁移。每个应用程序都应该执行相同的迁移。
为了做到这一点,在中央服务器上有一个app实例,它知道执行引导过程所需的所有信任和其他信息(这是基于applicationId的)。
这个中心实例(我们称之为adminapp)通过STDIN执行命令并接收applicationIds,然后执行一个引导应用程序并运行迁移命令的循环。
<?php
namespace Command\Db;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\
我已经创建了一个存根/模板文件,我想用它来创建迁移
<?php
use Phinx\Migration\AbstractMigration;
class DummyTableMigration extends AbstractMigration
{
public function up()
{
// Create the table
$table = $this->table('table_name');
$table->addColumn('column_name',
使用sqlite内存的Phinx迁移在0.9.2中似乎不起作用,我有一个非常简单的应用程序,只有一个表(产品)。运行迁移后,product表不存在:
use Symfony\Component\Yaml\Yaml;
use Phinx\Config\Config;
use Phinx\Migration\Manager;
use Symfony\Component\Console\Input\StringInput;
use Symfony\Component\Console\Output\NullOutput;
$pdo = new PDO('sqlite::memory:'
我们在远程服务器中有一个SVN存储库,我在本地机器中有一个SVN存储库的副本。我们正在使用phinx进行数据库迁移。因此,在本地,我创建一个迁移并运行它,所以我确信表是创建的,而且它确实创建了。存储库跟踪迁移文件。所以我提交它,然后尝试在远程服务器上运行迁移。但迁移似乎没有运行。我得到的只是这条信息然后什么都没有
Phinx by Rob Morgan. version 0.3.4
using config file ./phinx.php
using config parser php
using migration path
/srv/www/subversion/MyProject/
我正在尝试使用phinx库来运行名为“Vokuro”的Phalcon框架示例项目的数据库迁移,并得到了这个错误。文件目录是正确的,所以我不知道为什么会发生这种情况。
Cmd:
C:\xampp\htdocs\vokuro\vendor\bin>phinx.bat status -e development
Phinx by CakePHP - https://phinx.org.
using config file .\phinx.json
using config parser json
using migration paths
- C:\xampp\htdocs\vokuro\
试图找出在phinx包中事务是如何工作的。这是我的迁移代码,它不起作用。我使用mysql,phinx.yml一切都很好。因此,表acme是在表fail失败时创建的,在phinxlog表中找不到任何记录。所以,当我运行phinx migrate时,我出现了错误SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'acme' already exists。那么,我如何使用事务呢?我没有找到任何关于这件事的文档,请帮帮我)
public function up()
{
$this->getAdap
我正在为我的MySQL应用程序运行官方PHP容器。我正在使用Phinx进行迁移。MySQL镜像似乎工作得很好,因为我可以使用MySQL工作台以'dbuser‘(非根用户)的身份连接到它。我也可以连接Docker exec。
当我尝试运行任何Phinx命令时出现问题,例如status。我得到了:
[InvalidArgumentException]
There was a problem connecting to the database: SQLSTATE[HY000][1045] Access denied for user 'dbuser'@'localh
我想用Phinx来管理我的数据库。我已经有了一个带有表设置的数据库,所以我编写了迁移来反映已经存在的内容。从空数据库进行测试一切正常,但在填充的数据库上,我得到了SQLSTATE[42S01]: Base table or view already exists:错误。
是否有命令或配置会告诉Phinx填充phinxlog表,就好像迁移之前已经运行过一样?请注意,prod中的表有数据,所以以任何方式删除表都是无效的。
我使用了phinx迁移,并使用了它的'up‘和'change’函数,但是我没有注意到它们之间有什么不同。下面是我的迁移文件。
<?php
use Phinx\Migration\AbstractMigration;
class MediaManager extends AbstractMigration
{
public function up()
{
if($this->hasTable('uss_dish')){
$dish = $this->table('uss
我是Phinx新手,谁能告诉我如何创建'myindex‘,所以它被定义为
KEY myindex (column1、column2(767))
<?php
use Phinx\Migration\AbstractMigration;
class CreateMyTableTable extends AbstractMigration
{
public function change() {
$this->table('my_table')
->addColumn('column1'
我正在尝试使用phinx添加几个相关的表。我创建了我的迁移:
<?php
use Phinx\Migration\AbstractMigration;
class CreatesCognitiveMappingTables extends AbstractMigration
{
public function up()
{
$this->table("cognitive_mapping")
->changeColumn('id', 'biginteger', ['