mirror of
https://github.com/dataease/dataease.git
synced 2026-06-16 11:21:44 +08:00
fix: 禁用flyway
This commit is contained in:
@@ -0,0 +1,77 @@
|
||||
package io.dataease.datasource.dao.auto.entity;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.ColumnDefault;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "core_datasource")
|
||||
public class CoreDatasource {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "id", nullable = false)
|
||||
private Long id;
|
||||
|
||||
@Size(max = 255)
|
||||
@NotNull
|
||||
@Column(name = "name", nullable = false)
|
||||
private String name;
|
||||
|
||||
@Size(max = 255)
|
||||
@Column(name = "description")
|
||||
private String description;
|
||||
|
||||
@Size(max = 50)
|
||||
@NotNull
|
||||
@Column(name = "type", nullable = false, length = 50)
|
||||
private String type;
|
||||
|
||||
@Column(name = "pid")
|
||||
private Long pid;
|
||||
|
||||
@Size(max = 50)
|
||||
@Column(name = "edit_type", length = 50)
|
||||
private String editType;
|
||||
|
||||
@NotNull
|
||||
@Lob
|
||||
@Column(name = "configuration", length = 16777216, nullable = false)
|
||||
private String configuration;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "create_time", nullable = false)
|
||||
private Long createTime;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "update_time", nullable = false)
|
||||
private Long updateTime;
|
||||
|
||||
@Column(name = "update_by")
|
||||
private Long updateBy;
|
||||
|
||||
@Size(max = 50)
|
||||
@Column(name = "create_by", length = 50)
|
||||
private String createBy;
|
||||
|
||||
@Lob
|
||||
@Column(name = "status", length = 16777216)
|
||||
private String status;
|
||||
|
||||
@Lob
|
||||
@Column(name = "qrtz_instance")
|
||||
private String qrtzInstance;
|
||||
|
||||
@Size(max = 50)
|
||||
@Column(name = "task_status", length = 50)
|
||||
private String taskStatus;
|
||||
|
||||
@ColumnDefault("0")
|
||||
@Column(name = "enable_data_fill")
|
||||
private Byte enableDataFill;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package io.dataease.datasource.dao.auto.entity;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Table;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.ColumnDefault;
|
||||
|
||||
import java.time.Instant;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "de_standalone_version")
|
||||
public class DeStandaloneVersion {
|
||||
@Id
|
||||
@Column(name = "installed_rank", nullable = false)
|
||||
private Integer id;
|
||||
|
||||
@Size(max = 50)
|
||||
@Column(name = "version", length = 50)
|
||||
private String version;
|
||||
|
||||
@Size(max = 200)
|
||||
@NotNull
|
||||
@Column(name = "description", nullable = false, length = 200)
|
||||
private String description;
|
||||
|
||||
@Size(max = 20)
|
||||
@NotNull
|
||||
@Column(name = "type", nullable = false, length = 20)
|
||||
private String type;
|
||||
|
||||
@Size(max = 1000)
|
||||
@NotNull
|
||||
@Column(name = "script", nullable = false, length = 1000)
|
||||
private String script;
|
||||
|
||||
@Column(name = "checksum")
|
||||
private Integer checksum;
|
||||
|
||||
@Size(max = 100)
|
||||
@NotNull
|
||||
@Column(name = "installed_by", nullable = false, length = 100)
|
||||
private String installedBy;
|
||||
|
||||
@NotNull
|
||||
@ColumnDefault("CURRENT_TIMESTAMP")
|
||||
@Column(name = "installed_on", nullable = false)
|
||||
private Instant installedOn;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "execution_time", nullable = false)
|
||||
private Integer executionTime;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "success", nullable = false)
|
||||
private Boolean success = false;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package io.dataease.datasource.dao.auto.repository;
|
||||
|
||||
import io.dataease.datasource.dao.auto.entity.CoreDatasource;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
import org.springframework.data.jpa.repository.Modifying;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface CoreDatasourceRepository extends JpaRepository<CoreDatasource, Long>, JpaSpecificationExecutor<CoreDatasource> {
|
||||
|
||||
@Query("SELECT p FROM CoreDatasource p WHERE p.id IN :ids")
|
||||
List<CoreDatasource> findInIds(@Param("ids") List<Long> ids);
|
||||
|
||||
@Query("SELECT p FROM CoreDatasource p WHERE p.type IN :types")
|
||||
List<CoreDatasource> findInTypes(@Param("types") List<String> types);
|
||||
|
||||
|
||||
@Query("SELECT c FROM CoreDatasource c WHERE c.pid = :pid")
|
||||
List<CoreDatasource> findByPid(Long pid);
|
||||
|
||||
@Query("SELECT c FROM CoreDatasource c WHERE c.createBy = :createBy")
|
||||
List<CoreDatasource> findCoreDatasourcesByCreateBy(Long createBy, Pageable pageable);
|
||||
|
||||
@Query("SELECT c FROM CoreDatasource c WHERE c.type NOT IN :types")
|
||||
List<CoreDatasource> findTypeNotIn(List<String> types);
|
||||
|
||||
List<CoreDatasource> findByTaskStatus(String taskStatus);
|
||||
|
||||
@Modifying
|
||||
@Transactional
|
||||
@Query("UPDATE CoreDatasource c SET c.taskStatus = :taskStatus WHERE c.id IN :ids")
|
||||
int updateTaskStatusByIds(List<Long> ids, String taskStatus);
|
||||
|
||||
@Modifying
|
||||
@Transactional
|
||||
@Query("UPDATE CoreDatasource c SET c.taskStatus = :taskStatus WHERE c.id = :id AND c.taskStatus = :taskStatus")
|
||||
int updateTaskStatusByIds(Long id, String taskStatus);
|
||||
|
||||
@Modifying
|
||||
@Transactional
|
||||
@Query("UPDATE CoreDatasource c SET c.status = :status WHERE c.id = :id")
|
||||
int updateStatusById(String status, Long id);
|
||||
|
||||
@Modifying
|
||||
@Transactional
|
||||
@Query("UPDATE CoreDatasource c SET c.qrtzInstance = :qrtzInstance WHERE c.id = :id")
|
||||
int updateQrtzInstanceById(String qrtzInstance, Long id);
|
||||
|
||||
@Modifying
|
||||
@Transactional
|
||||
@Query("UPDATE CoreDatasource c SET c.updateTime = :updateTime, c.pid = :pid, c.name = :name, c.updateBy = :updateBy WHERE c.id = :id")
|
||||
int move(Long id, Long updateTime, Long pid, String name, Long updateBy);
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package io.dataease.datasource.dao.auto.repository;
|
||||
|
||||
import io.dataease.datasource.dao.auto.entity.DeStandaloneVersion;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public interface DeStandaloneVersionRepository extends JpaRepository<DeStandaloneVersion, Long>, JpaSpecificationExecutor<DeStandaloneVersion> {
|
||||
@Query("SELECT d FROM DeStandaloneVersion d ORDER BY d.id DESC")
|
||||
List<DeStandaloneVersion> findRecords();
|
||||
}
|
||||
@@ -14,7 +14,7 @@ spring:
|
||||
messages:
|
||||
basename: i18n/core
|
||||
flyway:
|
||||
enabled: true
|
||||
enabled: false
|
||||
table: de_desktop_version
|
||||
validate-on-migrate: false
|
||||
locations: classpath:db/desktop
|
||||
|
||||
@@ -6,6 +6,9 @@ spring:
|
||||
messages:
|
||||
basename: i18n/lic,i18n/core,i18n/permissions,i18n/xpack,i18n/sync
|
||||
|
||||
flyway:
|
||||
enabled: false
|
||||
|
||||
jpa:
|
||||
properties:
|
||||
hibernate:
|
||||
|
||||
Reference in New Issue
Block a user