1 Star 0 Fork 19

wslianbo / db-control-version-server

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
README-en.md 4.77 KB
一键复制 编辑 原始数据 按行查看 历史
noah 提交于 2019-06-02 11:20 . 更改ReadMe文件

DB-CONTROL-VERSION-SERVER

INTRODUCE

Synchronized database structure, version control.
  • Instead of the synchronization function of Navicat structure, it solves the problem that if the source table has fewer columns than the target table, the synchronization function of Navicat structure will cause the data to be deleted.
  • Synchronize the table, column, and index information of two schemas between any two environments, but the original data records of the two environments remain unchanged.
  • In the same development cycle, due to product requirements, the development environment table information changes many times, when the environment changes, the need to manually record changes..
  • Solve the problem of database table structure differences between different environments.
  • With source schema as the benchmark and target schema as the goal, we can freely choose the changes to be synchronized and provide page interaction buttons (as shown below).
  • Provide different results of each synchronization, save them as SQL files, and do version management.
  • Synchronized content items are: database tables, table attributes, column names, column attributes, index names, index attributes.
  • Asynchronous Content Items: Data from Datasheets.
  • Synchronization of foreign keys and table spaces is not currently supported because modern projects generally do not seem to need them.
  • Synchronization of foreign keys and table spaces is not currently supported because modern projects generally do not seem to need them.
  • Currently only Mysql is supported.


avatar

SOFTWARE ARCHITECTURE

  • Used SpringBoot 1.5.9.RELEASE
  • Used Flyway for control version .

INSTALLATION TUTORIAL

 A. CONFIGURE
  1. If you want to configure a single database schema:
    rule:

            database_name:
              source:
                datasource:
                  url: ${source_1_url:jdbc:mysql://test:3306/database_name?characterEncoding=utf-8&useSSL=false}
                  username: ${source_1_username:root}
                  password: ${source_1_password:123456}
                  driver-class-name: com.mysql.jdbc.Driver
              target:
                datasource:
                  url: ${target_1_url:jdbc:mysql://dev:3306/database_name?characterEncoding=utf-8&useSSL=false}
                  username: ${target_1_username:root}
                  password: ${target_1_password:123456}
                  driver-class-name: com.mysql.jdbc.Driver
        #   database_name-mysql:
        #     source:
        #       datasource:
        #         url: ${source_1_url:jdbc:mysql://test:3306/database_name-mysql?characterEncoding=utf-8&useSSL=false}
        #         username: ${source_1_username:root}
        #         password: ${source_1_password:123456}
        #         driver-class-name: com.mysql.jdbc.Driver
        #     target:
        #       datasource:
        #         url: ${target_1_url:jdbc:mysql://dev:3306/database_name-mysql?characterEncoding=utf-8&useSSL=false}
        #         username: ${target_1_username:root}
        #         password: ${target_1_password:123456}
        #         driver-class-name: com.mysql.jdbc.Driver
     
  2. Create directories in Dockerfile or locally

    • Create directories to generate the path of the SQL file to be executed.
      RUN mkdir -p /var/logs/db_locations/dev/
      RUN mkdir -p /var/logs/db_locations/local/
      RUN mkdir -p /var/logs/db_locations/staging/
      RUN mkdir -p /var/logs/db_locations/online/
      RUN mkdir -p /var/logs/db_locations/test/
  3. If you want to configure multiple database schemas, just leave the notes open.

INSTRUCTIONS

  1. Running with IDEA or Eclipse 'src/main/java/com/system/DBVersionControlServerApplication'

  2. Local access http://localhost:8081/
    Login username and password : admin/123456 First: Click 结构同步[Structural synchronization] ,click 开始[start] Pop-up window ,According to their own needs to operate, after completion, Click 迁移【migrate】 New versions are generated and new SQL files are available for download and viewing. 3.
    avatar 4.
    avatar 5.
    avatar 6.
    avatar 7.
    avatar 8.
    avatar 9.
    avatar

NOTE

PROBLEM FEEDBACK

Email : 757761927@qq.com

Java
1
https://gitee.com/lianbo/db-control-version-server.git
git@gitee.com:lianbo/db-control-version-server.git
lianbo
db-control-version-server
db-control-version-server
master

搜索帮助