From d821750392cd1e770d97f8dab127594f95ca4177 Mon Sep 17 00:00:00 2001 From: Stormeye Wu Date: Sun, 28 Apr 2019 13:43:51 +0800 Subject: [PATCH] =?UTF-8?q?[migration][=E6=96=B0=E5=A2=9E]:flyway=20java?= =?UTF-8?q?=20migration=20=E5=88=A0=E9=99=A4,=20=E5=BD=93=E5=89=8Dflyway?= =?UTF-8?q?=E6=9C=89bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../V201904271650__Update_User_Role.java | 50 ------------------- 1 file changed, 50 deletions(-) delete mode 100644 mallinkAdmin/src/main/java/com/iformall/migration/V201904271650__Update_User_Role.java diff --git a/mallinkAdmin/src/main/java/com/iformall/migration/V201904271650__Update_User_Role.java b/mallinkAdmin/src/main/java/com/iformall/migration/V201904271650__Update_User_Role.java deleted file mode 100644 index ecbb7dbd3..000000000 --- a/mallinkAdmin/src/main/java/com/iformall/migration/V201904271650__Update_User_Role.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.iformall.migration; - -import org.flywaydb.core.api.migration.BaseJavaMigration; -import org.flywaydb.core.api.migration.Context; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.sql.ResultSet; -import java.sql.Statement; -import java.util.ArrayList; -import java.util.List; - -public class V201904271650__Update_User_Role extends BaseJavaMigration { - - private final Logger logger = LoggerFactory.getLogger(this.getClass()); - - private final String getTenantIdList = "SELECT tenant_id FROM wx_mall WHERE tenant_id like '%100%'"; - - public void migrate(Context context) throws Exception { - // 获取 tenantId list - // 获取 现有的 mall_user_role - // 删除已有的用户role - // 添加所有的权限到数据库 - /* - try (Statement select = context.getConnection().createStatement()) { - try (ResultSet rows = select.executeQuery(getTenantIdList)) { - while (rows.next()) { - int id = rows.getInt(1); - String anonymizedName = "Anonymous" + id; - try (Statement update = context.getConnection().createStatement()) { - update.execute("UPDATE person SET name='" + anonymizedName + "' WHERE id=" + id); - } - } - } - } - */ - } - - private List getTenantList(Context context) throws Exception { - List tlist = new ArrayList(); - try (Statement select = context.getConnection().createStatement()) { - try (ResultSet rows = select.executeQuery(getTenantIdList)) { - while (rows.next()) { - tlist.add(rows.getString(0)); - } - } - } - return tlist; - } -}