如何解决如何在 Phinx 迁移中为 MySQL 浮点列设置比例和精度
我在当前 MySQL 表中有一个定义为 root@8807902e27b4:/# mkdir parent
root@8807902e27b4:/# cd parent
root@8807902e27b4:/parent# mkdir example
root@8807902e27b4:/parent# chmod 000 example
root@8807902e27b4:/parent# ls -la
total 12
drwxr-xr-x 3 root root 4096 Apr 28 19:33 .
drwxr-xr-x 1 root root 4096 Apr 28 19:32 ..
d--------- 2 root root 4096 Apr 28 19:33 example
root@8807902e27b4:/parent# cd example
root@8807902e27b4:/parent/example# echo "test" > test.txt
root@8807902e27b4:/parent/example# chmod 100 test.txt
root@8807902e27b4:/parent/example# cat test.txt
test
root@8807902e27b4:/parent/example# ls -la
total 12
d--------- 2 root root 4096 Apr 28 19:33 .
drwxr-xr-x 3 root root 4096 Apr 28 19:33 ..
---x------ 1 root root 5 Apr 28 19:33 test.txt
的列,我需要将其扩展为 cd example
。如何使用 Phinx (CakePHP) 迁移列规范执行此操作?
解决方法
以下似乎有效,但在 Phinx 和 CakePHP 文档中都没有记录。使用风险自负,并测试生成的结果是否正确。键是 cat test.txt
代表小数点右边的数字,beaushinkle@Beaus-MBP ~/p/example-docker> mkdir parent
beaushinkle@Beaus-MBP ~/p/example-docker> cd parent
beaushinkle@Beaus-MBP ~/p/e/parent> mkdir example
beaushinkle@Beaus-MBP ~/p/e/parent> chmod 000 example
beaushinkle@Beaus-MBP ~/p/e/parent> cd example
cd: Permission denied: 'example'
beaushinkle@Beaus-MBP ~/p/e/parent [1]> chmod 777 example
beaushinkle@Beaus-MBP ~/p/e/parent> cd example
beaushinkle@Beaus-MBP ~/p/e/p/example> echo "test" > test.txt
beaushinkle@Beaus-MBP ~/p/e/p/example> chmod 100 test.txt
beaushinkle@Beaus-MBP ~/p/e/p/example> cat test.txt
cat: test.txt: Permission denied
代表最大数字(宽度)。
float(3,2)
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。