我需要更改一个表以向其中添加一个列。我需要在 cakephp 3 中执行此操作。 我已经尝试过以下来自 Schema System Cakephp-3 的代码
$result = new Table('dummys');
$result->addColumn('my_field', ['type' => 'binary']);
这段代码应该创建一个带有字段'my_field'
的新表,但它没有这样做。
我也尝试过使用已经创建的表,但仍然没有成功。
请帮助我,因为我只需要从 Cakephp 创建表中的字段。
最佳答案
This code should create a new Table with the field 'my_field' but its not doing that.
不,不应该。
你想要migrations ,而不是架构。
关于php - 将列字段添加到表中 - cakephp 3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33255353/