add: flyway

This commit is contained in:
2024-06-06 17:17:41 +08:00
parent 009f331c6d
commit aa91a1ba00
4 changed files with 4673 additions and 0 deletions

View File

@@ -32,6 +32,12 @@
</properties>
<dependencies>
<!--flywaydb-->
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
</dependency>
<dependency>
<groupId>org.dromara.dynamictp</groupId>
<artifactId>dynamic-tp-spring-boot-starter-adapter-webserver</artifactId>

View File

@@ -73,6 +73,19 @@ spring:
username: ${DB_USER:${nl.config.sqlserver.username}}
password: ${DB_PWD:${nl.config.sqlserver.password}}
type: com.alibaba.druid.pool.DruidDataSource
flyway:
#开启
enabled: true
#当迁移时发现目标schema非空而且带有没有元数据的表时是否自动执行基准迁移默认false.
baseline-on-migrate: true
# 检测迁移脚本的路径是否存在,如不存在,则抛出异常
check-location: true
#sql脚本位置
locations: classpath:db/migration
#是否允许无序的迁移默认false
out-of-order: false
#编码
encoding: UTF-8
freemarker:
check-template-location: false
jackson:

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,43 @@
/*
Navicat Premium Data Transfer
Source Server : mysql
Source Server Type : MySQL
Source Server Version : 80030
Source Host : localhost:3306
Source Schema : storm-dev
Target Server Type : MySQL
Target Server Version : 80030
File Encoding : 65001
Date: 06/06/2024 17:11:56
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for system_tenant
-- ----------------------------
DROP TABLE IF EXISTS `system_tenant`;
CREATE TABLE `system_tenant` (
`id` bigint(0) NOT NULL AUTO_INCREMENT COMMENT '租户编号',
`name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '租户名',
`contact_user_id` bigint(0) NULL DEFAULT NULL COMMENT '联系人的用户编号',
`contact_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '联系人',
`contact_mobile` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '联系手机',
`status` tinyint(0) NOT NULL DEFAULT 0 COMMENT '租户状态0正常 1停用',
`website` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '绑定域名',
`package_id` bigint(0) NOT NULL COMMENT '租户套餐编号',
`expire_time` datetime(0) NOT NULL COMMENT '过期时间',
`account_count` int(0) NOT NULL COMMENT '账号数量',
`creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '创建者',
`create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
`updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者',
`update_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '更新时间',
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 162 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '租户表' ROW_FORMAT = Dynamic;
SET FOREIGN_KEY_CHECKS = 1;