Coder Social home page Coder Social logo

can't use the migration about migrations HOT 9 CLOSED

phalcon avatar phalcon commented on May 30, 2024
can't use the migration

from migrations.

Comments (9)

Jeckerson avatar Jeckerson commented on May 30, 2024

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.

from migrations.

zlseqx avatar zlseqx commented on May 30, 2024

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.

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
2020-04-07 18-15-36 的屏幕截图

from migrations.

Jeckerson avatar Jeckerson commented on May 30, 2024

Change "phalcon/devtools": "^4.0" to "phalcon/migrations": "^2"

from migrations.

zlseqx avatar zlseqx commented on May 30, 2024

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 .
2020-04-08 10-34-42 的屏幕截图
I use migrates version ^2
2020-04-08 10-36-38 的屏幕截图

from migrations.

Jeckerson avatar Jeckerson commented on May 30, 2024

Can you describe what database do you have?

  • Total number of tables
  • Total disk usage
  • Probably some examples of big tables that you have

from migrations.

zlseqx avatar zlseqx commented on May 30, 2024

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
2020-04-09 10-23-19 的屏幕截图

/*
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.

from migrations.

Jeckerson avatar Jeckerson commented on May 30, 2024

With latest version of phalcon migrations, I couldn't catch your error

image

What do you have inside config.php?

from migrations.

zlseqx avatar zlseqx commented on May 30, 2024

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.

from migrations.

Jeckerson avatar Jeckerson commented on May 30, 2024

Make sense, because old versions of xdebug are incompatible with Phalcon v4.

You need xdebug version v2.8.0 or above.

https://xdebug.org/updates#x_2_8_0
image

from migrations.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.