Closed zlseqx closed 4 years ago
Devtools using version v1.x
meanwhile you are trying to use v2.x
command. There are plans to upgrade migrations inside devtools in future version.
If you want to use migrations as separate package, include it inside composer.json
.
Devtools using version
v1.x
meanwhile you are trying to usev2.x
command. There are plans to upgrade migrations inside devtools in future version.If you want to use migrations as separate package, include it inside
composer.json
.
oh,I can't understand are you say,the composer uesd install Devtool and add phalcon/devTool and phalcon/migrates composer package to in the unbuntu PATH,I try test for Official tutorial,it's failed.that is my way in use devtool
Change "phalcon/devtools": "^4.0"
to "phalcon/migrations": "^2"
Change
"phalcon/devtools": "^4.0"
to"phalcon/migrations": "^2"
the reason is migrations packages Phalcon\Migrations\Mvc\Model::class of generateAll and generate method apply too much RAM,the system seem not allow used so much RAM .
I use migrates version ^2
Can you describe what database do you have?
Can you describe what database do you have?
- Total number of tables
- Total disk usage
- Probably some examples of big tables that you have
only Seven tables,no data,if print table description on console in Phalcon\Migrations\Mvc\Model::class of generate method ,it's well,for example
/* Navicat Premium Data Transfer
Source Server : localhost_3306 Source Server Type : MySQL Source Server Version : 50729 Source Host : localhost:3357 Source Schema : pcms
Target Server Type : MySQL Target Server Version : 50729 File Encoding : 65001
Date: 09/04/2020 10:14:17 */
SET NAMES utf8mb4; SET FOREIGN_KEY_CHECKS = 0;
-- Table structure for ad
DROP TABLE IF EXISTS ad
;
CREATE TABLE ad
(
id
int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'ID',
username
varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '用户名',
nickname
varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '昵称',
password
varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '密码',
mobile
varchar(24) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '',
salt
varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '密码盐',
avatar
varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '头像',
email
varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '电子邮箱',
loginfailure
tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '失败次数',
logintime
int(10) NULL DEFAULT NULL COMMENT '登录时间',
loginip
varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '登录IP',
createtime
int(10) NULL DEFAULT NULL COMMENT '创建时间',
updatetime
int(10) NULL DEFAULT NULL COMMENT '更新时间',
token
varchar(59) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT 'Session标识',
status
varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'normal' COMMENT '状态',
PRIMARY KEY (id
) USING BTREE,
UNIQUE INDEX username
(username
) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '管理员表' ROW_FORMAT = Compact;
-- Table structure for ad_auth_grp
DROP TABLE IF EXISTS ad_auth_grp
;
CREATE TABLE ad_auth_grp
(
id
int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
pid
int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '父组别',
name
varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '组名',
rules
text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '规则ID',
createtime
int(10) NULL DEFAULT NULL COMMENT '创建时间',
updatetime
int(10) NULL DEFAULT NULL COMMENT '更新时间',
status
varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '状态',
PRIMARY KEY (id
) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '分组表' ROW_FORMAT = Compact;
-- Table structure for ad_auth_grp_acc
DROP TABLE IF EXISTS ad_auth_grp_acc
;
CREATE TABLE ad_auth_grp_acc
(
uid
int(10) UNSIGNED NOT NULL COMMENT '会员ID',
group_id
int(10) UNSIGNED NOT NULL COMMENT '级别ID',
UNIQUE INDEX uid_group_id
(uid
, group_id
) USING BTREE,
INDEX uid
(uid
) USING BTREE,
INDEX group_id
(group_id
) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '权限分组表' ROW_FORMAT = Compact;
-- Table structure for ad_auth_rule
DROP TABLE IF EXISTS ad_auth_rule
;
CREATE TABLE ad_auth_rule
(
id
int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
type
enum('menu','file') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'file' COMMENT 'menu为菜单,file为权限节点',
pid
int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '父ID',
name
varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '规则名称',
title
varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '规则名称',
icon
varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '图标',
condition
varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '条件',
remark
varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '备注',
ismenu
tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否为菜单',
createtime
int(10) NULL DEFAULT NULL COMMENT '创建时间',
updatetime
int(10) NULL DEFAULT NULL COMMENT '更新时间',
weigh
int(10) NOT NULL DEFAULT 0 COMMENT '权重',
status
varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '状态',
PRIMARY KEY (id
) USING BTREE,
UNIQUE INDEX name
(name
) USING BTREE,
INDEX pid
(pid
) USING BTREE,
INDEX weigh
(weigh
) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '节点表' ROW_FORMAT = Compact;
-- Table structure for ad_log
DROP TABLE IF EXISTS ad_log
;
CREATE TABLE ad_log
(
id
int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'ID',
admin_id
int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '管理员ID',
username
varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '管理员名字',
url
varchar(1500) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '操作页面',
title
varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '日志标题',
content
text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '内容',
ip
varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT 'IP',
useragent
varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT 'User-Agent',
createtime
int(10) NULL DEFAULT NULL COMMENT '操作时间',
PRIMARY KEY (id
) USING BTREE,
INDEX name
(username
) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '管理员日志表' ROW_FORMAT = Compact;
-- Table structure for user
DROP TABLE IF EXISTS user
;
CREATE TABLE user
(
id
int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'ID',
group_id
int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '组别ID',
username
varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '用户名',
share_code
varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '分享码',
invite_code
varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '邀请码',
total_money
double(20, 2) NOT NULL DEFAULT 0.00 COMMENT '账户历史金额',
money
decimal(20, 2) UNSIGNED NOT NULL DEFAULT 0.00 COMMENT '余额',
day_income
float(11, 2) NOT NULL DEFAULT 0.00 COMMENT '今日收益',
cash_total_money
float(20, 2) NOT NULL DEFAULT 0.00 COMMENT '累计提现金额',
nickname
varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '昵称',
password
varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '密码',
salt
varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '密码盐',
email
varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '电子邮箱',
mobile
varchar(11) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '手机号',
avatar
varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '/assets/img/avatar.jpg' COMMENT '头像',
level
tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '等级',
gender
tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '性别',
birthday
date NULL DEFAULT NULL COMMENT '生日',
bio
varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '格言',
score
int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '积分',
successions
int(10) UNSIGNED NOT NULL DEFAULT 1 COMMENT '连续登录天数',
maxsuccessions
int(10) UNSIGNED NOT NULL DEFAULT 1 COMMENT '最大连续登录天数',
prevtime
int(10) NULL DEFAULT NULL COMMENT '上次登录时间',
logintime
int(10) NULL DEFAULT NULL COMMENT '登录时间',
loginip
varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '登录IP',
loginfailure
tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '失败次数',
joinip
varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '加入IP',
jointime
int(10) NULL DEFAULT NULL COMMENT '加入时间',
createtime
int(10) NULL DEFAULT NULL COMMENT '创建时间',
updatetime
int(10) NULL DEFAULT NULL COMMENT '更新时间',
token
varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT 'Token',
status
varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '状态',
verification
varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '验证',
PRIMARY KEY (id
) USING BTREE,
UNIQUE INDEX share_code
(share_code
) USING BTREE,
UNIQUE INDEX id
(id
) USING BTREE,
INDEX username
(username
) USING BTREE,
INDEX email
(email
) USING BTREE,
INDEX mobile
(mobile
) USING BTREE,
INDEX invite_code
(invite_code
) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '会员表' ROW_FORMAT = Compact;
SET FOREIGN_KEY_CHECKS = 1;
this is my tables.
With latest version of phalcon migrations, I couldn't catch your error
What do you have inside config.php
?
oh,last day,I finally wanted to understand the problems he might have,It may be the problem caused by other php extensions. Then I disabled xdebug. I tested this morning and he seems to work very well. I have concluded that there is an incompatibility between xdebug and Phalcon.
Make sense, because old versions of xdebug are incompatible with Phalcon v4.
You need xdebug version v2.8.0
or above.
phalcon devtool version 4.0.1
use phalcon migration generate command it's get me a error: that say
this is bug ??
and I want migrate all tables ,the help ask me no need use any options,the same bad,only use --table option it's well.
![2020-04-07 16-52-43 的屏幕截图](https://user-images.githubusercontent.com/26402118/78650230-34697780-78f1-11ea-8073-a92b0600b004.png)