 ALTER TABLE `vgr_picture` ADD CONSTRAINT `FK_PICTURE_PLAYER` FOREIGN KEY (`idPlayer`) REFERENCES `vgr_player`(`id`) ON DELETE RESTRICT ON UPDATE RESTRICT;
 ALTER TABLE `vgr_picture` ADD CONSTRAINT `FK_PICTURE_GAME` FOREIGN KEY (`idGame`) REFERENCES `vgr_game`(`id`) ON DELETE RESTRICT ON UPDATE RESTRICT;
 
+-- ARTICLE
+ALTER TABLE `article` CHANGE `idArticle` `id` INT(11) NOT NULL AUTO_INCREMENT;
+ALTER TABLE `article` CHANGE `idMembre` `idAuthor` INT(13) NOT NULL;
+
+ALTER TABLE `article` CHANGE `statut` `status` ENUM('EN_CONSTRUCTION','PUBLIE','ANNULE','UNDER CONSTRUCTION','PUBLISHED','CANCELED') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'EN_CONSTRUCTION';
+UPDATE `article` SET status='UNDER CONSTRUCTION' WHERE status = 'EN_CONSTRUCTION';
+UPDATE `article` SET status='PUBLISHED' WHERE status = 'PUBLIE';
+UPDATE `article` SET status='CANCELED' WHERE status = 'ANNULE';
+ALTER TABLE `article` CHANGE `status` `status` ENUM('UNDER CONSTRUCTION','PUBLISHED','CANCELED') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'UNDER CONSTRUCTION';
+ALTER TABLE a`article`DROP FOREIGN KEY article_ibfk_2;
+ALTER TABLE `article` DROP `idTraducteur`;
+ALTER TABLE `article` CHANGE dateCreation created_at DATETIME DEFAULT NULL;
+ALTER TABLE `article` CHANGE dateModification updated_at DATETIME DEFAULT NULL;
+ALTER TABLE `article` CHANGE datePublication published_at DATETIME DEFAULT NULL;
+ALTER TABLE `article` DROP `image`;
+
+
+CREATE TABLE article_translation (id INT AUTO_INCREMENT NOT NULL, translatable_id INT DEFAULT NULL, title VARCHAR(255) NOT NULL, text text  NULL, locale VARCHAR(255) NOT NULL, INDEX IDX_ARTICLE_TRANS_ID (translatable_id), UNIQUE INDEX country_translation_unique_translation (translatable_id, locale), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
+ALTER TABLE article_translation ADD CONSTRAINT FK_ARTICLE_TRANS_ID FOREIGN KEY (translatable_id) REFERENCES article (id) ON DELETE CASCADE;
+TRUNCATE article_translation;
+INSERT INTO article_translation (translatable_id, title, text, locale) SELECT id, libArticle_fr, texte_fr, 'fr' FROM article;
+INSERT INTO article_translation (translatable_id, title, text, locale) SELECT id, libArticle_en, texte_en, 'en' FROM article;
+
+ALTER TABLE `article` DROP `libArticle_fr`;
+ALTER TABLE `article` DROP `libArticle_en`;
+ALTER TABLE `article` DROP `texte_fr`;
+ALTER TABLE `article` DROP `texte_en`;
+ALTER TABLE `article` ADD `link` VARCHAR(255) NULL AFTER `status`;
+ALTER TABLE `article` ADD `slug` VARCHAR(255) NULL AFTER `status`;
+
+DELETE FROM `article` WHERE flag = 'NEWS_VGRJ';
+ALTER TABLE `article` DROP `flag`;
+ALTER TABLE `article` DROP `idJeu`;
+ALTER TABLE `article` DROP `idPlateforme`;

CREATE TABLE member_group (userId INT NOT NULL, groupId INT NOT NULL, INDEX IDX_FE1D13664B64DCC (userId), INDEX IDX_FE1D136ED8188B0 (groupId), PRIMARY KEY(userId, groupId)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE groupRole (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, roles LONGTEXT NOT NULL COMMENT '(DC2Type:array)', UNIQUE INDEX UNIQ_39A2D4D75E237E06 (name), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;

CREATE TABLE member (id INT AUTO_INCREMENT NOT NULL, username VARCHAR(180) NOT NULL, username_canonical VARCHAR(180) NOT NULL, email VARCHAR(180) NOT NULL, email_canonical VARCHAR(180) NOT NULL, enabled TINYINT(1) NOT NULL, salt VARCHAR(255) NOT NULL, password VARCHAR(255) NOT NULL, last_login DATETIME DEFAULT NULL, locked TINYINT(1) NOT NULL, expired TINYINT(1) NOT NULL, expires_at DATETIME DEFAULT NULL, confirmation_token VARCHAR(180) DEFAULT NULL, password_requested_at DATETIME DEFAULT NULL, roles LONGTEXT NOT NULL COMMENT '(DC2Type:array)', credentials_expired TINYINT(1) NOT NULL, credentials_expire_at DATETIME DEFAULT NULL, nbConnexion INT NOT NULL, locale VARCHAR(2) DEFAULT NULL, firstName VARCHAR(255) DEFAULT NULL, lastName VARCHAR(255) DEFAULT NULL, address LONGTEXT DEFAULT NULL, birthDate DATE DEFAULT NULL, gender VARCHAR(1) DEFAULT NULL, timeZone INT DEFAULT NULL, personalWebsite VARCHAR(255) DEFAULT NULL, facebook VARCHAR(255) DEFAULT NULL, twitter VARCHAR(255) DEFAULT NULL, googleplus VARCHAR(255) DEFAULT NULL, youtube VARCHAR(255) DEFAULT NULL, dailymotion VARCHAR(255) DEFAULT NULL, twitch VARCHAR(255) DEFAULT NULL, skype VARCHAR(255) DEFAULT NULL, snapchat VARCHAR(255) DEFAULT NULL, pinterest VARCHAR(255) DEFAULT NULL, trumblr VARCHAR(255) DEFAULT NULL, blogger VARCHAR(255) DEFAULT NULL, reddit VARCHAR(255) DEFAULT NULL, deviantart VARCHAR(255) DEFAULT NULL, created_at DATETIME DEFAULT NULL, updated_at DATETIME DEFAULT NULL, idPays INT DEFAULT NULL, UNIQUE INDEX UNIQ_70E4FA7892FC23A8 (username_canonical), UNIQUE INDEX UNIQ_70E4FA78A0D96FBF (email_canonical), UNIQUE INDEX UNIQ_70E4FA78C05FB297 (confirmation_token), INDEX IDX_70E4FA7847626230 (idPays), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE = InnoDB;
ALTER TABLE member ADD CONSTRAINT FK_70E4FA7847626230 FOREIGN KEY (idPays) REFERENCES country (id);
ALTER TABLE member_group ADD CONSTRAINT FK_FE1D13664B64DCC FOREIGN KEY (userId) REFERENCES member (id);
ALTER TABLE member_group ADD CONSTRAINT FK_FE1D136ED8188B0 FOREIGN KEY (groupId) REFERENCES groupRole (id);

RENAME TABLE vgr_etatrecord TO vgr_player_chart_status;
RENAME TABLE t_pays TO country;
RENAME TABLE t_email TO email;
RENAME TABLE t_article TO article;
RENAME TABLE t_membre TO vgr_player;
RENAME TABLE t_team TO vgr_team;
RENAME TABLE t_team_demande TO vgr_team_request;
