From 77b1583f0bf290e270b9d68210d1782df22cc58e Mon Sep 17 00:00:00 2001 From: vran Date: Sat, 19 Feb 2022 23:03:59 +0800 Subject: [PATCH] feat: remove unique name constraint on group (#18) --- .../jooq/main/java/com/databasir/dao/Keys.java | 1 - .../jooq/main/java/com/databasir/dao/tables/Group.java | 7 ------- .../main/resources/db/migration/V1.2__operation_log.sql | 4 +++- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/dao/generated-src/jooq/main/java/com/databasir/dao/Keys.java b/dao/generated-src/jooq/main/java/com/databasir/dao/Keys.java index a4c7dc4..1661bfb 100644 --- a/dao/generated-src/jooq/main/java/com/databasir/dao/Keys.java +++ b/dao/generated-src/jooq/main/java/com/databasir/dao/Keys.java @@ -67,7 +67,6 @@ public class Keys { public static final UniqueKey KEY_DATABASE_DOCUMENT_HISTORY_UK_CONNECTION_ID_VERSION = Internal.createUniqueKey(DatabaseDocumentHistory.DATABASE_DOCUMENT_HISTORY, DSL.name("KEY_database_document_history_uk_connection_id_version"), new TableField[] { DatabaseDocumentHistory.DATABASE_DOCUMENT_HISTORY.DATABASE_DOCUMENT_ID, DatabaseDocumentHistory.DATABASE_DOCUMENT_HISTORY.VERSION }, true); public static final UniqueKey KEY_DOCUMENT_REMARK_PRIMARY = Internal.createUniqueKey(DocumentRemark.DOCUMENT_REMARK, DSL.name("KEY_document_remark_PRIMARY"), new TableField[] { DocumentRemark.DOCUMENT_REMARK.ID }, true); public static final UniqueKey KEY_GROUP_PRIMARY = Internal.createUniqueKey(Group.GROUP, DSL.name("KEY_group_PRIMARY"), new TableField[] { Group.GROUP.ID }, true); - public static final UniqueKey KEY_GROUP_UK_NAME = Internal.createUniqueKey(Group.GROUP, DSL.name("KEY_group_uk_name"), new TableField[] { Group.GROUP.NAME }, true); public static final UniqueKey KEY_LOGIN_PRIMARY = Internal.createUniqueKey(Login.LOGIN, DSL.name("KEY_login_PRIMARY"), new TableField[] { Login.LOGIN.ID }, true); public static final UniqueKey KEY_LOGIN_UK_USER_ID = Internal.createUniqueKey(Login.LOGIN, DSL.name("KEY_login_uk_user_id"), new TableField[] { Login.LOGIN.USER_ID }, true); public static final UniqueKey KEY_OPERATION_LOG_PRIMARY = Internal.createUniqueKey(OperationLog.OPERATION_LOG, DSL.name("KEY_operation_log_PRIMARY"), new TableField[] { OperationLog.OPERATION_LOG.ID }, true); diff --git a/dao/generated-src/jooq/main/java/com/databasir/dao/tables/Group.java b/dao/generated-src/jooq/main/java/com/databasir/dao/tables/Group.java index 6a20f38..525faee 100644 --- a/dao/generated-src/jooq/main/java/com/databasir/dao/tables/Group.java +++ b/dao/generated-src/jooq/main/java/com/databasir/dao/tables/Group.java @@ -9,8 +9,6 @@ import com.databasir.dao.Keys; import com.databasir.dao.tables.records.GroupRecord; import java.time.LocalDateTime; -import java.util.Arrays; -import java.util.List; import org.jooq.Field; import org.jooq.ForeignKey; @@ -127,11 +125,6 @@ public class Group extends TableImpl { return Keys.KEY_GROUP_PRIMARY; } - @Override - public List> getUniqueKeys() { - return Arrays.asList(Keys.KEY_GROUP_UK_NAME); - } - @Override public Group as(String alias) { return new Group(DSL.name(alias), this); diff --git a/dao/src/main/resources/db/migration/V1.2__operation_log.sql b/dao/src/main/resources/db/migration/V1.2__operation_log.sql index 2ae7a05..8d1d693 100644 --- a/dao/src/main/resources/db/migration/V1.2__operation_log.sql +++ b/dao/src/main/resources/db/migration/V1.2__operation_log.sql @@ -1,4 +1,4 @@ -CREATE TABLE operation_log +CREATE TABLE IF NOT EXISTS operation_log ( id BIGINT PRIMARY KEY AUTO_INCREMENT NOT NULL, @@ -16,3 +16,5 @@ CREATE TABLE operation_log create_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ) CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci; + +DROP INDEX uk_name ON `group`; \ No newline at end of file