我需要将sfGuard迁移到FOSUserBundle。我有数据库结构的问题。我的旧用户表创建查询:
CREATE TABLE `sf_guard_user` (
`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
`first_name` VARCHAR(255) NULL DEFAULT NULL COLLATE 'utf8_unicode_ci',
`last_name` VARCHAR(255) NULL DEFAULT NULL COLLATE 'utf8_unicode_ci',
`email_address` VARCHAR(255) NOT NULL COLLATE 'utf8_unicode_ci',
`username` VARCHAR(128) NOT NULL COLLATE 'utf8_unicode_ci',
`algorithm` VARCHAR(128) NOT NULL COLLATE 'utf8_unicode_ci',
`salt` VARCHAR(128) NULL DEFAULT NULL COLLATE 'utf8_unicode_ci',
`password` VARCHAR(128) NULL DEFAULT NULL COLLATE 'utf8_unicode_ci',
`is_active` TINYINT(1) NULL DEFAULT NULL,
`is_super_admin` TINYINT(1) NULL DEFAULT NULL,
`last_login` DATETIME NULL DEFAULT NULL,
`created_at` DATETIME NOT NULL,
`updated_at` DATETIME NOT NULL,
PRIMARY KEY (`id`),
UNIQUE INDEX `email_address` (`email_address`),
UNIQUE INDEX `username` (`username`),
INDEX `is_active_idx_idx` (`is_active`)
)
COLLATE='utf8_unicode_ci'
ENGINE=InnoDB
我浏览了这个教程https://www.youtube.com/watch?v=ZvLUvOaW_XY,我有工作登录系统,但它使用此表:
CREATE TABLE `fos_user` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`username` VARCHAR(255) NOT NULL COLLATE 'utf8_unicode_ci',
`username_canonical` VARCHAR(255) NOT NULL COLLATE 'utf8_unicode_ci',
`email` VARCHAR(255) NOT NULL COLLATE 'utf8_unicode_ci',
`email_canonical` VARCHAR(255) NOT NULL COLLATE 'utf8_unicode_ci',
`enabled` TINYINT(1) NOT NULL,
`salt` VARCHAR(255) NOT NULL COLLATE 'utf8_unicode_ci',
`password` VARCHAR(255) NOT NULL COLLATE 'utf8_unicode_ci',
`last_login` DATETIME NULL DEFAULT NULL,
`locked` TINYINT(1) NOT NULL,
`expired` TINYINT(1) NOT NULL,
`expires_at` DATETIME NULL DEFAULT NULL,
`confirmation_token` VARCHAR(255) NULL DEFAULT NULL COLLATE 'utf8_unicode_ci',
`password_requested_at` DATETIME NULL DEFAULT NULL,
`roles` LONGTEXT NOT NULL COMMENT '(DC2Type:array)' COLLATE 'utf8_unicode_ci',
`credentials_expired` TINYINT(1) NOT NULL,
`credentials_expire_at` DATETIME NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE INDEX `UNIQ_957A647992FC23A8` (`username_canonical`),
UNIQUE INDEX `UNIQ_957A6479A0D96FBF` (`email_canonical`)
)
COLLATE='utf8_unicode_ci'
ENGINE=InnoDB
现在我必须更改FOSUserBundle以使用我的旧表sf_guard_user。我必须从哪里开始?有什么想法吗?