branch feature/44_several_email_address updated (90f30944 -> afb6df3c)
This is an automated email from the git hooks/post-receive script. New change to branch feature/44_several_email_address in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git from 90f30944 gestion de l'avatar par l'admin new afb6df3c refs #44 correction de la migration pour ajouter les emails des providers The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit afb6df3c9513ff5339c109d66f456aabf7eeee55 Author: Kevin Morin <morin@codelutin.com> Date: Mon Oct 16 11:49:11 2017 +0200 refs #44 correction de la migration pour ajouter les emails des providers Summary of changes: .../common/V3_1_0_5__Extract_email_addresses.java | 24 +++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch feature/44_several_email_address in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git commit afb6df3c9513ff5339c109d66f456aabf7eeee55 Author: Kevin Morin <morin@codelutin.com> Date: Mon Oct 16 11:49:11 2017 +0200 refs #44 correction de la migration pour ajouter les emails des providers --- .../common/V3_1_0_5__Extract_email_addresses.java | 24 +++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/pollen-persistence/src/main/java/db/migration/common/V3_1_0_5__Extract_email_addresses.java b/pollen-persistence/src/main/java/db/migration/common/V3_1_0_5__Extract_email_addresses.java index 677ab47b..bb4f365e 100644 --- a/pollen-persistence/src/main/java/db/migration/common/V3_1_0_5__Extract_email_addresses.java +++ b/pollen-persistence/src/main/java/db/migration/common/V3_1_0_5__Extract_email_addresses.java @@ -12,6 +12,7 @@ import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.Timestamp; +import java.sql.Types; /** * @author Kevin Morin (Code Lutin) @@ -62,9 +63,30 @@ public class V3_1_0_5__Extract_email_addresses implements JdbcMigration { updateStatement.addBatch(); } + resultSet.close(); + + resultSet = connection.createStatement() + .executeQuery("SELECT uc.pollenuser, uc.email FROM usercredential uc"); + + while (resultSet.next()) { + + String userTopiaId = resultSet.getString(1); + String emailAddress = resultSet.getString(2); + String addressTopiaId = shortTopiaIdFactory.newTopiaId(PollenUserEmailAddress.class, (TopiaEntity) null); + + insertStatement.setString(1, addressTopiaId); + insertStatement.setInt(2, 1); + insertStatement.setTimestamp(3, new Timestamp(System.currentTimeMillis())); + insertStatement.setString(4,emailAddress); + insertStatement.setNull(5, Types.VARCHAR); + insertStatement.setString(6, userTopiaId); + insertStatement.addBatch(); + } + + resultSet.close(); + insertStatement.executeBatch(); updateStatement.executeBatch(); - resultSet.close(); connection.commit(); -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm