Caused by: org.flywaydb.core.internal.sqlscript.FlywaySqlScriptException: Migration V6__migrate_create_contents_table.sql failed
SQL State : 23000
Error Code : 1062
Message : Duplicate entry '2' for key 'PRIMARY'
Location : migration/V6migrate_create_contents_table.sql (/file:/halo.jar!/BOOT-INF/classes!/migration/V6migrate_create_contents_table.sql)
Line : 2
Statement : -- Migrate post content to contents table
INSERT INTO contents(post_id, status, patch_log_id, head_patch_log_id, content, original_content, create_time,
update_time)
SELECT id,
status,
id,
id,
format_content,
original_content,
create_time,
update_time
FROM posts
2022-05-11 00:45:24.261 ERROR 1 --- [ main] o.f.core.internal.command.DbMigrate : Migration of schema halo
to version "6 - migrate create contents table" failed! Please restore backups and roll back database and code!
2022-05-11 00:45:24.276 INFO 1 --- [ main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2022-05-11 00:45:24.322 ERROR 1 --- [ main] o.s.boot.SpringApplication : Application run failed
org.flywaydb.core.internal.command.DbMigrate$FlywayMigrateException: Migration V6__migrate_create_contents_table.sql failed
SQL State : 23000
Error Code : 1062
Message : Duplicate entry '2' for key 'PRIMARY'
Location : migration/V6migrate_create_contents_table.sql (/file:/halo.jar!/BOOT-INF/classes!/migration/V6migrate_create_contents_table.sql)
Line : 2
Statement : -- Migrate post content to contents table
INSERT INTO contents(post_id, status, patch_log_id, head_patch_log_id, content, original_content, create_time,
update_time)
SELECT id,
status,
id,
id,
format_content,
original_content,
create_time,
update_time
FROM posts