Flyway — database migration tool for version control of SQL schemas.
1// application.yml2spring:3 flyway:4 enabled: true5 locations: classpath:db/migration6 baseline-on-migrate: true
1-- V1__create_users_table.sql2CREATE TABLE users (3 id BIGINT PRIMARY KEY AUTO_INCREMENT,4 name VARCHAR(255) NOT NULL,5 email VARCHAR(255) UNIQUE NOT NULL,6 created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP7);89-- V2__add_user_status.sql10ALTER TABLE users ADD COLUMN status VARCHAR(20) DEFAULT 'ACTIVE';
Key features: