 Twilio SMS Service initialized with number: +12202651139
2025-10-21T14:02:23.083+01:00  WARN 25926 --- [saas-multitenant-api] [           main] JpaBaseConfiguration$JpaWebConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
2025-10-21T14:02:23.097+01:00  INFO 25926 --- [saas-multitenant-api] [           main] com.saas.voip.config.WebSocketConfig     : Registering WebSocket handler at /media-stream
2025-10-21T14:02:23.158+01:00  WARN 25926 --- [saas-multitenant-api] [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Multiple @RequestMapping annotations found on public java.lang.String com.saas.voip.controller.TelnyxTeXMLController.handleTeXMLRequest(jakarta.servlet.http.HttpServletRequest,java.lang.String,java.lang.String,java.lang.String,java.lang.String), but only the first will be used: [@org.springframework.web.bind.annotation.PostMapping(consumes={}, headers={}, name="", params={}, path={"/texml-response"}, produces={"application/xml"}, value={"/texml-response"}), @org.springframework.web.bind.annotation.GetMapping(consumes={}, headers={}, name="", params={}, path={"/texml-response"}, produces={"application/xml"}, value={"/texml-response"})]
2025-10-21T14:02:23.268+01:00  INFO 25926 --- [saas-multitenant-api] [           main] o.s.b.a.e.web.EndpointLinksResolver      : Exposing 3 endpoints beneath base path '/actuator'
2025-10-21T14:02:23.344+01:00 DEBUG 25926 --- [saas-multitenant-api] [           main] o.s.s.web.DefaultSecurityFilterChain     : Will secure any request with filters: DisableEncodeUrlFilter, WebAsyncManagerIntegrationFilter, SecurityContextHolderFilter, HeaderWriterFilter, LogoutFilter, JwtAuthenticationFilter, TenantIdentifierFilter, RequestCacheAwareFilter, SecurityContextHolderAwareRequestFilter, AnonymousAuthenticationFilter, SessionManagementFilter, ExceptionTranslationFilter, AuthorizationFilter
2025-10-21T14:02:23.568+01:00  INFO 25926 --- [saas-multitenant-api] [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port 7001 (http) with context path '/'
2025-10-21T14:02:23.577+01:00  INFO 25926 --- [saas-multitenant-api] [           main] com.saas.SaasApplication                 : Started SaasApplication in 3.535 seconds (process running for 3.798)
2025-10-21T14:02:23.580+01:00  INFO 25926 --- [saas-multitenant-api] [           main] c.s.shared.config.TenantMigrationRunner  : 🚀 [TenantMigrationRunner] Application started - initiating tenant schema migrations...
2025-10-21T14:02:23.580+01:00  INFO 25926 --- [saas-multitenant-api] [           main] c.s.shared.config.TenantMigrationRunner  : ⚠️ [TenantMigrationRunner] Migrations will run SYNCHRONOUSLY to ensure schemas are ready before serving traffic
2025-10-21T14:02:23.580+01:00  INFO 25926 --- [saas-multitenant-api] [           main] c.s.s.c.FlywayTenantMigrationService     : ╔═══════════════════════════════════════════════════════╗
2025-10-21T14:02:23.580+01:00  INFO 25926 --- [saas-multitenant-api] [           main] c.s.s.c.FlywayTenantMigrationService     : ║     FLYWAY TENANT MIGRATION - ALL SCHEMAS           ║
2025-10-21T14:02:23.580+01:00  INFO 25926 --- [saas-multitenant-api] [           main] c.s.s.c.FlywayTenantMigrationService     : ╚═══════════════════════════════════════════════════════╝
2025-10-21T14:02:23.580+01:00  INFO 25926 --- [saas-multitenant-api] [           main] c.s.s.c.FlywayTenantMigrationService     : 🔄 [FlywayTenantMigration] Starting Flyway migration for all tenant schemas...
2025-10-21T14:02:23.582+01:00  INFO 25926 --- [saas-multitenant-api] [           main] c.s.s.core.TenantIdentifierResolverImpl  : 🔍 resolveCurrentTenantIdentifier() CALLED - returning: saas_db
2025-10-21T14:02:23.583+01:00  INFO 25926 --- [saas-multitenant-api] [           main] .s.c.SchemaMultiTenantConnectionProvider : 🔥 getConnection() CALLED with tenantIdentifier: saas_db
2025-10-21T14:02:23.583+01:00  INFO 25926 --- [saas-multitenant-api] [           main] .s.c.SchemaMultiTenantConnectionProvider : ⚡ Executing: USE saas_db
2025-10-21T14:02:23.583+01:00  INFO 25926 --- [saas-multitenant-api] [           main] .s.c.SchemaMultiTenantConnectionProvider : ✅ Successfully switched to database: saas_db
Hibernate: 
    select
        t1_0.id,
        t1_0.created_at,
        t1_0.schema_name,
        t1_0.status,
        t1_0.tenant_id,
        t1_0.tenant_name,
        t1_0.updated_at 
    from
        tenants t1_0
2025-10-21T14:02:23.616+01:00  INFO 25926 --- [saas-multitenant-api] [           main] c.s.s.c.FlywayTenantMigrationService     : 📊 [FlywayTenantMigration] Found 1 tenant(s) to migrate
2025-10-21T14:02:23.616+01:00  INFO 25926 --- [saas-multitenant-api] [           main] c.s.s.c.FlywayTenantMigrationService     : ═══════════════════════════════════════════════════════
2025-10-21T14:02:23.616+01:00  INFO 25926 --- [saas-multitenant-api] [           main] c.s.s.c.FlywayTenantMigrationService     : 🔧 [FlywayTenantMigration] Migrating tenant schema: tenant_clinique_la_rive1_bleue1
2025-10-21T14:02:23.616+01:00  INFO 25926 --- [saas-multitenant-api] [           main] c.s.s.c.FlywayTenantMigrationService     :    ├─ Tenant ID: e7f7179a-5393-4711-adae-083a22cf9e68
2025-10-21T14:02:23.616+01:00  INFO 25926 --- [saas-multitenant-api] [           main] c.s.s.c.FlywayTenantMigrationService     :    ├─ Tenant Name: Clinique La Rive1 Bleue1
2025-10-21T14:02:23.616+01:00  INFO 25926 --- [saas-multitenant-api] [           main] c.s.s.c.FlywayTenantMigrationService     :    └─ Schema Name: tenant_clinique_la_rive1_bleue1
2025-10-21T14:02:23.616+01:00  INFO 25926 --- [saas-multitenant-api] [           main] c.s.s.c.FlywayTenantMigrationService     : 🚀 [FlywayTenantMigration] Starting Flyway migration for schema: tenant_clinique_la_rive1_bleue1
2025-10-21T14:02:23.616+01:00  INFO 25926 --- [saas-multitenant-api] [           main] c.s.s.c.FlywayTenantMigrationService     : ⚙️ [FlywayTenantMigration] Configuring Flyway...
2025-10-21T14:02:23.616+01:00  INFO 25926 --- [saas-multitenant-api] [           main] c.s.s.c.FlywayTenantMigrationService     :    ├─ Target Schema: tenant_clinique_la_rive1_bleue1
2025-10-21T14:02:23.616+01:00  INFO 25926 --- [saas-multitenant-api] [           main] c.s.s.c.FlywayTenantMigrationService     :    ├─ Migration Location: classpath:db/migration/tenant
2025-10-21T14:02:23.616+01:00  INFO 25926 --- [saas-multitenant-api] [           main] c.s.s.c.FlywayTenantMigrationService     :    ├─ History Table: flyway_schema_history
2025-10-21T14:02:23.616+01:00  INFO 25926 --- [saas-multitenant-api] [           main] c.s.s.c.FlywayTenantMigrationService     :    └─ Baseline on Migrate: true
2025-10-21T14:02:23.620+01:00  INFO 25926 --- [saas-multitenant-api] [           main] c.s.s.c.FlywayTenantMigrationService     : 🔧 [FlywayTenantMigration] Running Flyway.repair() to clean failed migrations...
2025-10-21T14:02:23.623+01:00  INFO 25926 --- [saas-multitenant-api] [           main] org.flywaydb.core.FlywayExecutor         : Database: jdbc:mysql://localhost:3306/saas_db?createDatabaseIfNotExist=true&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=UTC (MySQL 8.4)
2025-10-21T14:02:23.626+01:00  WARN 25926 --- [saas-multitenant-api] [           main] o.f.c.internal.database.base.Database    : Flyway upgrade recommended: MySQL 8.4 is newer than this version of Flyway and support has not been tested. The latest supported version of MySQL is 8.1.
2025-10-21T14:02:23.637+01:00  INFO 25926 --- [saas-multitenant-api] [           main] o.f.core.internal.command.DbRepair       : Successfully repaired schema history table `tenant_clinique_la_rive1_bleue1`.`flyway_schema_history` (execution time 00:00.009s).
2025-10-21T14:02:23.637+01:00  INFO 25926 --- [saas-multitenant-api] [           main] o.f.core.internal.command.DbRepair       : Manual cleanup of the remaining effects of the failed migration may still be required.
2025-10-21T14:02:23.638+01:00  INFO 25926 --- [saas-multitenant-api] [           main] c.s.s.c.FlywayTenantMigrationService     : ✅ [FlywayTenantMigration] Flyway repair completed successfully
2025-10-21T14:02:23.638+01:00  INFO 25926 --- [saas-multitenant-api] [           main] c.s.s.c.FlywayTenantMigrationService     : 🔍 [FlywayTenantMigration] Executing Flyway.migrate()...
2025-10-21T14:02:23.642+01:00  WARN 25926 --- [saas-multitenant-api] [           main] o.f.c.internal.database.base.Database    : Flyway upgrade recommended: MySQL 8.4 is newer than this version of Flyway and support has not been tested. The latest supported version of MySQL is 8.1.
2025-10-21T14:02:23.645+01:00  INFO 25926 --- [saas-multitenant-api] [           main] o.f.core.internal.command.DbValidate     : Successfully validated 2 migrations (execution time 00:00.002s)
2025-10-21T14:02:23.650+01:00  INFO 25926 --- [saas-multitenant-api] [           main] o.f.core.internal.command.DbMigrate      : Current version of schema `tenant_clinique_la_rive1_bleue1`: 1
2025-10-21T14:02:23.655+01:00  INFO 25926 --- [saas-multitenant-api] [           main] o.f.core.internal.command.DbMigrate      : Migrating schema `tenant_clinique_la_rive1_bleue1` to version "2 - add provider to inbound call data"
2025-10-21T14:02:23.661+01:00 ERROR 25926 --- [saas-multitenant-api] [           main] o.f.core.internal.command.DbMigrate      : Migration of schema `tenant_clinique_la_rive1_bleue1` to version "2 - add provider to inbound call data" failed! Please restore backups and roll back database and code!
2025-10-21T14:02:23.669+01:00 ERROR 25926 --- [saas-multitenant-api] [           main] c.s.s.c.FlywayTenantMigrationService     : ╔═══════════════════════════════════════════════════════╗
2025-10-21T14:02:23.669+01:00 ERROR 25926 --- [saas-multitenant-api] [           main] c.s.s.c.FlywayTenantMigrationService     : ║     FLYWAY MIGRATION FAILED                          ║
2025-10-21T14:02:23.669+01:00 ERROR 25926 --- [saas-multitenant-api] [           main] c.s.s.c.FlywayTenantMigrationService     : ╚═══════════════════════════════════════════════════════╝
2025-10-21T14:02:23.669+01:00 ERROR 25926 --- [saas-multitenant-api] [           main] c.s.s.c.FlywayTenantMigrationService     : ❌ [FlywayTenantMigration] Flyway migration FAILED for schema: tenant_clinique_la_rive1_bleue1
2025-10-21T14:02:23.669+01:00 ERROR 25926 --- [saas-multitenant-api] [           main] c.s.s.c.FlywayTenantMigrationService     : ❌ [FlywayTenantMigration] Exception type: org.flywaydb.core.internal.exception.FlywayMigrateException
2025-10-21T14:02:23.669+01:00 ERROR 25926 --- [saas-multitenant-api] [           main] c.s.s.c.FlywayTenantMigrationService     : ❌ [FlywayTenantMigration] Exception message: Script V2__add_provider_to_inbound_call_data.sql failed
-------------------------------------------------------
SQL State  : 42S21
Error Code : 1060
Message    : Duplicate column name 'provider'
Location   : db/migration/tenant/V2__add_provider_to_inbound_call_data.sql (/Users/withanouar/Downloads/SaaSForge-5/target/classes/db/migration/tenant/V2__add_provider_to_inbound_call_data.sql)
Line       : 10
Statement  : Run Flyway with -X option to see the actual statement causing the problem

2025-10-21T14:02:23.669+01:00 ERROR 25926 --- [saas-multitenant-api] [           main] c.s.s.c.FlywayTenantMigrationService     : ❌ [FlywayTenantMigration] Stack trace:

org.flywaydb.core.internal.exception.FlywayMigrateException: Script V2__add_provider_to_inbound_call_data.sql failed
-------------------------------------------------------
SQL State  : 42S21
Error Code : 1060
Message    : Duplicate column name 'provider'
Location   : db/migration/tenant/V2__add_provider_to_inbound_call_data.sql (/Users/withanouar/Downloads/SaaSForge-5/target/classes/db/migration/tenant/V2__add_provider_to_inbound_call_data.sql)
Line       : 10
Statement  : Run Flyway with -X option to see the actual statement causing the problem

	at org.flywaydb.core.internal.command.DbMigrate.doMigrateGroup(DbMigrate.java:399)
	at org.flywaydb.core.internal.command.DbMigrate.lambda$applyMigrations$1(DbMigrate.java:283)
	at org.flywaydb.core.internal.jdbc.TransactionalExecutionTemplate.execute(TransactionalExecutionTemplate.java:59)
	at org.flywaydb.core.internal.command.DbMigrate.applyMigrations(DbMigrate.java:282)
	at org.flywaydb.core.internal.command.DbMigrate.migrateGroup(DbMigrate.java:255)
	at org.flywaydb.core.internal.command.DbMigrate.lambda$migrateAll$0(DbMigrate.java:153)
	at org.flywaydb.database.mysql.MySQLNamedLockTemplate.execute(MySQLNamedLockTemplate.java:62)
	at org.flywaydb.database.mysql.MySQLConnection.lock(MySQLConnection.java:159)
	at org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory.lock(JdbcTableSchemaHistory.java:164)
	at org.flywaydb.core.internal.command.DbMigrate.migrateAll(DbMigrate.java:153)
	at org.flywaydb.core.internal.command.DbMigrate.migrate(DbMigrate.java:104)
	at org.flywaydb.core.Flyway.lambda$migrate$1(Flyway.java:247)
	at org.flywaydb.core.FlywayExecutor.execute(FlywayExecutor.java:210)
	at org.flywaydb.core.Flyway.migrate(Flyway.java:188)
	at com.saas.shared.config.FlywayTenantMigrationService.migrateTenant(FlywayTenantMigrationService.java:104)
	at com.saas.shared.config.FlywayTenantMigrationService.migrateAllTenants(FlywayTenantMigrationService.java:47)
	at com.saas.shared.config.TenantMigrationRunner.run(TenantMigrationRunner.java:23)
	at org.springframework.boot.SpringApplication.lambda$callRunner$4(SpringApplication.java:784)
	at org.springframework.util.function.ThrowingConsumer$1.acceptWithException(ThrowingConsumer.java:82)
	at org.springframework.util.function.ThrowingConsumer.accept(ThrowingConsumer.java:60)
	at org.springframework.util.function.ThrowingConsumer$1.accept(ThrowingConsumer.java:86)
	at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:796)
	at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:784)
	at org.springframework.boot.SpringApplication.lambda$callRunners$3(SpringApplication.java:772)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:186)
	at java.base/java.util.stream.SortedOps$SizedRefSortingSink.end(SortedOps.java:357)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:571)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:560)
	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:153)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:176)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:265)
	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:632)
	at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:772)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:325)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1361)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1350)
	at com.saas.SaasApplication.main(SaasApplication.java:13)
Caused by: org.flywaydb.core.internal.sqlscript.FlywaySqlScriptException: Script V2__add_provider_to_inbound_call_data.sql failed
-------------------------------------------------------
SQL State  : 42S21
Error Code : 1060
Message    : Duplicate column name 'provider'
Location   : db/migration/tenant/V2__add_provider_to_inbound_call_data.sql (/Users/withanouar/Downloads/SaaSForge-5/target/classes/db/migration/tenant/V2__add_provider_to_inbound_call_data.sql)
Line       : 10
Statement  : Run Flyway with -X option to see the actual statement causing the problem

	at org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor.handleException(DefaultSqlScriptExecutor.java:256)
	at org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor.executeStatement(DefaultSqlScriptExecutor.java:217)
	at org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor.execute(DefaultSqlScriptExecutor.java:137)
	at org.flywaydb.core.internal.resolver.sql.SqlMigrationExecutor.executeOnce(SqlMigrationExecutor.java:75)
	at org.flywaydb.core.internal.resolver.sql.SqlMigrationExecutor.lambda$execute$0(SqlMigrationExecutor.java:66)
	at org.flywaydb.core.internal.database.DefaultExecutionStrategy.execute(DefaultExecutionStrategy.java:31)
	at org.flywaydb.core.internal.resolver.sql.SqlMigrationExecutor.execute(SqlMigrationExecutor.java:65)
	at org.flywaydb.core.internal.command.DbMigrate.doMigrateGroup(DbMigrate.java:391)
	... 36 common frames omitted
Caused by: java.sql.SQLSyntaxErrorException: Duplicate column name 'provider'
	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:112)
	at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:114)
	at com.mysql.cj.jdbc.StatementImpl.executeInternal(StatementImpl.java:837)
	at com.mysql.cj.jdbc.StatementImpl.execute(StatementImpl.java:685)
	at com.zaxxer.hikari.pool.ProxyStatement.execute(ProxyStatement.java:95)
	at com.zaxxer.hikari.pool.HikariProxyStatement.execute(HikariProxyStatement.java)
	at org.flywaydb.core.internal.jdbc.JdbcTemplate.executeStatement(JdbcTemplate.java:215)
	at org.flywaydb.core.internal.sqlscript.ParsedSqlStatement.execute(ParsedSqlStatement.java:88)
	at org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor.executeStatement(DefaultSqlScriptExecutor.java:212)
	... 42 common frames omitted

2025-10-21T14:02:23.670+01:00 ERROR 25926 --- [saas-multitenant-api] [           main] c.s.s.c.FlywayTenantMigrationService     : ❌ [FlywayTenantMigration] FAILED to migrate schema: tenant_clinique_la_rive1_bleue1

java.lang.RuntimeException: Failed to migrate tenant schema: tenant_clinique_la_rive1_bleue1
	at com.saas.shared.config.FlywayTenantMigrationService.migrateTenant(FlywayTenantMigrationService.java:122)
	at com.saas.shared.config.FlywayTenantMigrationService.migrateAllTenants(FlywayTenantMigrationService.java:47)
	at com.saas.shared.config.TenantMigrationRunner.run(TenantMigrationRunner.java:23)
	at org.springframework.boot.SpringApplication.lambda$callRunner$4(SpringApplication.java:784)
	at org.springframework.util.function.ThrowingConsumer$1.acceptWithException(ThrowingConsumer.java:82)
	at org.springframework.util.function.ThrowingConsumer.accept(ThrowingConsumer.java:60)
	at org.springframework.util.function.ThrowingConsumer$1.accept(ThrowingConsumer.java:86)
	at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:796)
	at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:784)
	at org.springframework.boot.SpringApplication.lambda$callRunners$3(SpringApplication.java:772)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:186)
	at java.base/java.util.stream.SortedOps$SizedRefSortingSink.end(SortedOps.java:357)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:571)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:560)
	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:153)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:176)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:265)
	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:632)
	at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:772)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:325)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1361)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1350)
	at com.saas.SaasApplication.main(SaasApplication.java:13)
Caused by: org.flywaydb.core.internal.exception.FlywayMigrateException: Script V2__add_provider_to_inbound_call_data.sql failed
-------------------------------------------------------
SQL State  : 42S21
Error Code : 1060
Message    : Duplicate column name 'provider'
Location   : db/migration/tenant/V2__add_provider_to_inbound_call_data.sql (/Users/withanouar/Downloads/SaaSForge-5/target/classes/db/migration/tenant/V2__add_provider_to_inbound_call_data.sql)
Line       : 10
Statement  : Run Flyway with -X option to see the actual statement causing the problem

	at org.flywaydb.core.internal.command.DbMigrate.doMigrateGroup(DbMigrate.java:399)
	at org.flywaydb.core.internal.command.DbMigrate.lambda$applyMigrations$1(DbMigrate.java:283)
	at org.flywaydb.core.internal.jdbc.TransactionalExecutionTemplate.execute(TransactionalExecutionTemplate.java:59)
	at org.flywaydb.core.internal.command.DbMigrate.applyMigrations(DbMigrate.java:282)
	at org.flywaydb.core.internal.command.DbMigrate.migrateGroup(DbMigrate.java:255)
	at org.flywaydb.core.internal.command.DbMigrate.lambda$migrateAll$0(DbMigrate.java:153)
	at org.flywaydb.database.mysql.MySQLNamedLockTemplate.execute(MySQLNamedLockTemplate.java:62)
	at org.flywaydb.database.mysql.MySQLConnection.lock(MySQLConnection.java:159)
	at org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory.lock(JdbcTableSchemaHistory.java:164)
	at org.flywaydb.core.internal.command.DbMigrate.migrateAll(DbMigrate.java:153)
	at org.flywaydb.core.internal.command.DbMigrate.migrate(DbMigrate.java:104)
	at org.flywaydb.core.Flyway.lambda$migrate$1(Flyway.java:247)
	at org.flywaydb.core.FlywayExecutor.execute(FlywayExecutor.java:210)
	at org.flywaydb.core.Flyway.migrate(Flyway.java:188)
	at com.saas.shared.config.FlywayTenantMigrationService.migrateTenant(FlywayTenantMigrationService.java:104)
	... 22 common frames omitted
Caused by: org.flywaydb.core.internal.sqlscript.FlywaySqlScriptException: Script V2__add_provider_to_inbound_call_data.sql failed
-------------------------------------------------------
SQL State  : 42S21
Error Code : 1060
Message    : Duplicate column name 'provider'
Location   : db/migration/tenant/V2__add_provider_to_inbound_call_data.sql (/Users/withanouar/Downloads/SaaSForge-5/target/classes/db/migration/tenant/V2__add_provider_to_inbound_call_data.sql)
Line       : 10
Statement  : Run Flyway with -X option to see the actual statement causing the problem

	at org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor.handleException(DefaultSqlScriptExecutor.java:256)
	at org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor.executeStatement(DefaultSqlScriptExecutor.java:217)
	at org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor.execute(DefaultSqlScriptExecutor.java:137)
	at org.flywaydb.core.internal.resolver.sql.SqlMigrationExecutor.executeOnce(SqlMigrationExecutor.java:75)
	at org.flywaydb.core.internal.resolver.sql.SqlMigrationExecutor.lambda$execute$0(SqlMigrationExecutor.java:66)
	at org.flywaydb.core.internal.database.DefaultExecutionStrategy.execute(DefaultExecutionStrategy.java:31)
	at org.flywaydb.core.internal.resolver.sql.SqlMigrationExecutor.execute(SqlMigrationExecutor.java:65)
	at org.flywaydb.core.internal.command.DbMigrate.doMigrateGroup(DbMigrate.java:391)
	... 36 common frames omitted
Caused by: java.sql.SQLSyntaxErrorException: Duplicate column name 'provider'
	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:112)
	at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:114)
	at com.mysql.cj.jdbc.StatementImpl.executeInternal(StatementImpl.java:837)
	at com.mysql.cj.jdbc.StatementImpl.execute(StatementImpl.java:685)
	at com.zaxxer.hikari.pool.ProxyStatement.execute(ProxyStatement.java:95)
	at com.zaxxer.hikari.pool.HikariProxyStatement.execute(HikariProxyStatement.java)
	at org.flywaydb.core.internal.jdbc.JdbcTemplate.executeStatement(JdbcTemplate.java:215)
	at org.flywaydb.core.internal.sqlscript.ParsedSqlStatement.execute(ParsedSqlStatement.java:88)
	at org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor.executeStatement(DefaultSqlScriptExecutor.java:212)
	... 42 common frames omitted

2025-10-21T14:02:23.670+01:00 ERROR 25926 --- [saas-multitenant-api] [           main] c.s.s.c.FlywayTenantMigrationService     : ❌ [FlywayTenantMigration] Exception type: java.lang.RuntimeException
2025-10-21T14:02:23.670+01:00 ERROR 25926 --- [saas-multitenant-api] [           main] c.s.s.c.FlywayTenantMigrationService     : ❌ [FlywayTenantMigration] Exception message: Failed to migrate tenant schema: tenant_clinique_la_rive1_bleue1
2025-10-21T14:02:23.670+01:00  INFO 25926 --- [saas-multitenant-api] [           main] c.s.s.c.FlywayTenantMigrationService     : ╔═══════════════════════════════════════════════════════╗
2025-10-21T14:02:23.670+01:00  INFO 25926 --- [saas-multitenant-api] [           main] c.s.s.c.FlywayTenantMigrationService     : ║     FLYWAY MIGRATION COMPLETE                        ║
2025-10-21T14:02:23.670+01:00  INFO 25926 --- [saas-multitenant-api] [           main] c.s.s.c.FlywayTenantMigrationService     : ╚═══════════════════════════════════════════════════════╝
2025-10-21T14:02:23.670+01:00  INFO 25926 --- [saas-multitenant-api] [           main] c.s.s.c.FlywayTenantMigrationService     : 🏁 [FlywayTenantMigration] Success: 0 / 1
2025-10-21T14:02:23.670+01:00  INFO 25926 --- [saas-multitenant-api] [           main] c.s.s.c.FlywayTenantMigrationService     : 🏁 [FlywayTenantMigration] Failures: 1
2025-10-21T14:02:23.670+01:00 ERROR 25926 --- [saas-multitenant-api] [           main] c.s.shared.config.TenantMigrationRunner  : ❌ [TenantMigrationRunner] CRITICAL: Failed to run tenant migrations on startup

java.lang.RuntimeException: Tenant migration failed for 1 schemas (out of 1 total)
	at com.saas.shared.config.FlywayTenantMigrationService.migrateAllTenants(FlywayTenantMigrationService.java:67)
	at com.saas.shared.config.TenantMigrationRunner.run(TenantMigrationRunner.java:23)
	at org.springframework.boot.SpringApplication.lambda$callRunner$4(SpringApplication.java:784)
	at org.springframework.util.function.ThrowingConsumer$1.acceptWithException(ThrowingConsumer.java:82)
	at org.springframework.util.function.ThrowingConsumer.accept(ThrowingConsumer.java:60)
	at org.springframework.util.function.ThrowingConsumer$1.accept(ThrowingConsumer.java:86)
	at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:796)
	at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:784)
	at org.springframework.boot.SpringApplication.lambda$callRunners$3(SpringApplication.java:772)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:186)
	at java.base/java.util.stream.SortedOps$SizedRefSortingSink.end(SortedOps.java:357)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:571)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:560)
	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:153)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:176)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:265)
	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:632)
	at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:772)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:325)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1361)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1350)
	at com.saas.SaasApplication.main(SaasApplication.java:13)

2025-10-21T14:02:23.670+01:00 ERROR 25926 --- [saas-multitenant-api] [           main] c.s.shared.config.TenantMigrationRunner  : ❌ [TenantMigrationRunner] Application may not function correctly until migrations are applied!
2025-10-21T14:02:23.671+01:00  INFO 25926 --- [saas-multitenant-api] [           main] .s.b.a.l.ConditionEvaluationReportLogger : 

Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.
2025-10-21T14:02:23.676+01:00 ERROR 25926 --- [saas-multitenant-api] [           main] o.s.boot.SpringApplication               : Application run failed

java.lang.RuntimeException: Failed to apply tenant migrations on startup
	at com.saas.shared.config.TenantMigrationRunner.run(TenantMigrationRunner.java:28)
	at org.springframework.boot.SpringApplication.lambda$callRunner$4(SpringApplication.java:784)
	at org.springframework.util.function.ThrowingConsumer$1.acceptWithException(ThrowingConsumer.java:82)
	at org.springframework.util.function.ThrowingConsumer.accept(ThrowingConsumer.java:60)
	at org.springframework.util.function.ThrowingConsumer$1.accept(ThrowingConsumer.java:86)
	at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:796)
	at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:784)
	at org.springframework.boot.SpringApplication.lambda$callRunners$3(SpringApplication.java:772)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:186)
	at java.base/java.util.stream.SortedOps$SizedRefSortingSink.end(SortedOps.java:357)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:571)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:560)
	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:153)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:176)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:265)
	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:632)
	at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:772)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:325)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1361)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1350)
	at com.saas.SaasApplication.main(SaasApplication.java:13)
Caused by: java.lang.RuntimeException: Tenant migration failed for 1 schemas (out of 1 total)
	at com.saas.shared.config.FlywayTenantMigrationService.migrateAllTenants(FlywayTenantMigrationService.java:67)
	at com.saas.shared.config.TenantMigrationRunner.run(TenantMigrationRunner.java:23)
	... 20 common frames omitted

2025-10-21T14:02:23.677+01:00  INFO 25926 --- [saas-multitenant-api] [           main] o.s.b.w.e.tomcat.GracefulShutdown        : Commencing graceful shutdown. Waiting for active requests to complete
2025-10-21T14:02:23.680+01:00  INFO 25926 --- [saas-multitenant-api] [tomcat-shutdown] o.s.b.w.e.tomcat.GracefulShutdown        : Graceful shutdown complete
2025-10-21T14:02:23.686+01:00  INFO 25926 --- [saas-multitenant-api] [           main] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2025-10-21T14:02:23.687+01:00  INFO 25926 --- [saas-multitenant-api] [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown initiated...
2025-10-21T14:02:23.689+01:00  INFO 25926 --- [saas-multitenant-api] [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown completed.
