database migration

使用phinx做database migration

安装 使用compose安装, 命令 php composer.phar require robmorgan/phinx 项目根目录创建db/migrations文件夹,然后执行如下命令(windows系统) λ vendor\bin\phinx init 此时根目录生成了phinx.yml文件。打开修改数据库连接信息,此处我们只设置development数据库连接 paths: migrations: '%%PHINX_CONFIG_DIR%%/db/migrations' seeds: '%%PHINX_CONFIG_DIR%%/db/seeds' environments: default_migration_table: phinxlog default_database: development production: adapter: mysql host: localhost name: production_db user: root pass: '' port: 3306 charset: utf8 development: adapter: mysql table...
执行时间: 29.486894607544 毫秒