2026-03-27 15:40:50.026 +00:00 [ERR] Erro ao migrar Base de Dados
System.InvalidOperationException: There is no property mapped to the column 'HandlingUnitTypes.Active' which is used in a data operation. Either add a property mapped to this column, or specify the column types in the data operation.
   at Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.GetPropertyMappings(String[] names, String tableName, String schema, IModel model)
   at Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.GenerateModificationCommands(InsertDataOperation operation, IModel model)+MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Microsoft.EntityFrameworkCore.Migrations.SqlServerMigrationsSqlGenerator.Generate(InsertDataOperation operation, IModel model, MigrationCommandListBuilder builder, Boolean terminate)
   at Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.<>c.<.cctor>b__83_28(MigrationsSqlGenerator g, MigrationOperation o, IModel m, MigrationCommandListBuilder b)
   at Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.Generate(MigrationOperation operation, IModel model, MigrationCommandListBuilder builder)
   at Microsoft.EntityFrameworkCore.Migrations.SqlServerMigrationsSqlGenerator.Generate(MigrationOperation operation, IModel model, MigrationCommandListBuilder builder)
   at Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.Generate(IReadOnlyList`1 operations, IModel model, MigrationsSqlGenerationOptions options)
   at Microsoft.EntityFrameworkCore.Migrations.SqlServerMigrationsSqlGenerator.Generate(IReadOnlyList`1 operations, IModel model, MigrationsSqlGenerationOptions options)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.GenerateUpSql(Migration migration, MigrationsSqlGenerationOptions options)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.<>c__DisplayClass25_2.<GetMigrationCommandLists>b__2()
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.MigrateImplementation(DbContext context, String targetMigration, MigrationExecutionState state, Boolean useTransaction)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.<>c.<Migrate>b__20_1(DbContext c, ValueTuple`4 s)
   at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration)
   at Shared.Data.Services.EfCoreMigrationService.ApplyPendingMigrations() in C:\Users\gilmatoscn\Documents\Projects\.NET\Gestovo\src\Data.Context\Services\EfCoreMigrationService.cs:line 81
   at Server.Program.UpgradeApplication(IServiceProvider serviceProvider, IAppHelperService appHelperService, ILogger logger) in C:\Users\gilmatoscn\Documents\Projects\.NET\Gestovo\src\Server\Program.cs:line 475
2026-03-27 15:42:48.305 +00:00 [ERR] Erro ao migrar Base de Dados
System.InvalidOperationException: There is no property mapped to the column 'HandlingUnitTypes.Active' which is used in a data operation. Either add a property mapped to this column, or specify the column types in the data operation.
   at Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.GetPropertyMappings(String[] names, String tableName, String schema, IModel model)
   at Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.GenerateModificationCommands(InsertDataOperation operation, IModel model)+MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Microsoft.EntityFrameworkCore.Migrations.SqlServerMigrationsSqlGenerator.Generate(InsertDataOperation operation, IModel model, MigrationCommandListBuilder builder, Boolean terminate)
   at Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.<>c.<.cctor>b__83_28(MigrationsSqlGenerator g, MigrationOperation o, IModel m, MigrationCommandListBuilder b)
   at Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.Generate(MigrationOperation operation, IModel model, MigrationCommandListBuilder builder)
   at Microsoft.EntityFrameworkCore.Migrations.SqlServerMigrationsSqlGenerator.Generate(MigrationOperation operation, IModel model, MigrationCommandListBuilder builder)
   at Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.Generate(IReadOnlyList`1 operations, IModel model, MigrationsSqlGenerationOptions options)
   at Microsoft.EntityFrameworkCore.Migrations.SqlServerMigrationsSqlGenerator.Generate(IReadOnlyList`1 operations, IModel model, MigrationsSqlGenerationOptions options)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.GenerateUpSql(Migration migration, MigrationsSqlGenerationOptions options)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.<>c__DisplayClass25_2.<GetMigrationCommandLists>b__2()
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.MigrateImplementation(DbContext context, String targetMigration, MigrationExecutionState state, Boolean useTransaction)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.<>c.<Migrate>b__20_1(DbContext c, ValueTuple`4 s)
   at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration)
   at Shared.Data.Services.EfCoreMigrationService.ApplyPendingMigrations() in C:\Users\gilmatoscn\Documents\Projects\.NET\Gestovo\src\Data.Context\Services\EfCoreMigrationService.cs:line 81
   at Server.Program.UpgradeApplication(IServiceProvider serviceProvider, IAppHelperService appHelperService, ILogger logger) in C:\Users\gilmatoscn\Documents\Projects\.NET\Gestovo\src\Server\Program.cs:line 475
2026-03-27 15:46:36.002 +00:00 [ERR] Erro ao migrar Base de Dados
System.InvalidOperationException: There is no property mapped to the column 'Series.Active' which is used in a data operation. Either add a property mapped to this column, or specify the column types in the data operation.
   at Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.GetPropertyMappings(String[] names, String tableName, String schema, IModel model)
   at Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.GenerateModificationCommands(InsertDataOperation operation, IModel model)+MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Microsoft.EntityFrameworkCore.Migrations.SqlServerMigrationsSqlGenerator.Generate(InsertDataOperation operation, IModel model, MigrationCommandListBuilder builder, Boolean terminate)
   at Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.<>c.<.cctor>b__83_28(MigrationsSqlGenerator g, MigrationOperation o, IModel m, MigrationCommandListBuilder b)
   at Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.Generate(MigrationOperation operation, IModel model, MigrationCommandListBuilder builder)
   at Microsoft.EntityFrameworkCore.Migrations.SqlServerMigrationsSqlGenerator.Generate(MigrationOperation operation, IModel model, MigrationCommandListBuilder builder)
   at Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.Generate(IReadOnlyList`1 operations, IModel model, MigrationsSqlGenerationOptions options)
   at Microsoft.EntityFrameworkCore.Migrations.SqlServerMigrationsSqlGenerator.Generate(IReadOnlyList`1 operations, IModel model, MigrationsSqlGenerationOptions options)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.GenerateUpSql(Migration migration, MigrationsSqlGenerationOptions options)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.<>c__DisplayClass25_2.<GetMigrationCommandLists>b__2()
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.MigrateImplementation(DbContext context, String targetMigration, MigrationExecutionState state, Boolean useTransaction)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.<>c.<Migrate>b__20_1(DbContext c, ValueTuple`4 s)
   at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration)
   at Shared.Data.Services.EfCoreMigrationService.ApplyPendingMigrations() in C:\Users\gilmatoscn\Documents\Projects\.NET\Gestovo\src\Data.Context\Services\EfCoreMigrationService.cs:line 81
   at Server.Program.UpgradeApplication(IServiceProvider serviceProvider, IAppHelperService appHelperService, ILogger logger) in C:\Users\gilmatoscn\Documents\Projects\.NET\Gestovo\src\Server\Program.cs:line 475
2026-03-27 15:48:12.785 +00:00 [ERR] Erro ao migrar Base de Dados
System.InvalidOperationException: There is no property mapped to the column 'Terminals.Active' which is used in a data operation. Either add a property mapped to this column, or specify the column types in the data operation.
   at Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.GetPropertyMappings(String[] names, String tableName, String schema, IModel model)
   at Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.GenerateModificationCommands(InsertDataOperation operation, IModel model)+MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Microsoft.EntityFrameworkCore.Migrations.SqlServerMigrationsSqlGenerator.Generate(InsertDataOperation operation, IModel model, MigrationCommandListBuilder builder, Boolean terminate)
   at Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.<>c.<.cctor>b__83_28(MigrationsSqlGenerator g, MigrationOperation o, IModel m, MigrationCommandListBuilder b)
   at Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.Generate(MigrationOperation operation, IModel model, MigrationCommandListBuilder builder)
   at Microsoft.EntityFrameworkCore.Migrations.SqlServerMigrationsSqlGenerator.Generate(MigrationOperation operation, IModel model, MigrationCommandListBuilder builder)
   at Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.Generate(IReadOnlyList`1 operations, IModel model, MigrationsSqlGenerationOptions options)
   at Microsoft.EntityFrameworkCore.Migrations.SqlServerMigrationsSqlGenerator.Generate(IReadOnlyList`1 operations, IModel model, MigrationsSqlGenerationOptions options)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.GenerateUpSql(Migration migration, MigrationsSqlGenerationOptions options)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.<>c__DisplayClass25_2.<GetMigrationCommandLists>b__2()
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.MigrateImplementation(DbContext context, String targetMigration, MigrationExecutionState state, Boolean useTransaction)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.<>c.<Migrate>b__20_1(DbContext c, ValueTuple`4 s)
   at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration)
   at Shared.Data.Services.EfCoreMigrationService.ApplyPendingMigrations() in C:\Users\gilmatoscn\Documents\Projects\.NET\Gestovo\src\Data.Context\Services\EfCoreMigrationService.cs:line 81
   at Server.Program.UpgradeApplication(IServiceProvider serviceProvider, IAppHelperService appHelperService, ILogger logger) in C:\Users\gilmatoscn\Documents\Projects\.NET\Gestovo\src\Server\Program.cs:line 475
2026-03-27 15:49:25.080 +00:00 [ERR] Erro ao migrar Base de Dados
System.InvalidOperationException: There is no property mapped to the column 'Terminals.LabelPrinter' which is used in a data operation. Either add a property mapped to this column, or specify the column types in the data operation.
   at Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.GetPropertyMappings(String[] names, String tableName, String schema, IModel model)
   at Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.GenerateModificationCommands(InsertDataOperation operation, IModel model)+MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Microsoft.EntityFrameworkCore.Migrations.SqlServerMigrationsSqlGenerator.Generate(InsertDataOperation operation, IModel model, MigrationCommandListBuilder builder, Boolean terminate)
   at Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.<>c.<.cctor>b__83_28(MigrationsSqlGenerator g, MigrationOperation o, IModel m, MigrationCommandListBuilder b)
   at Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.Generate(MigrationOperation operation, IModel model, MigrationCommandListBuilder builder)
   at Microsoft.EntityFrameworkCore.Migrations.SqlServerMigrationsSqlGenerator.Generate(MigrationOperation operation, IModel model, MigrationCommandListBuilder builder)
   at Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.Generate(IReadOnlyList`1 operations, IModel model, MigrationsSqlGenerationOptions options)
   at Microsoft.EntityFrameworkCore.Migrations.SqlServerMigrationsSqlGenerator.Generate(IReadOnlyList`1 operations, IModel model, MigrationsSqlGenerationOptions options)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.GenerateUpSql(Migration migration, MigrationsSqlGenerationOptions options)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.<>c__DisplayClass25_2.<GetMigrationCommandLists>b__2()
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.MigrateImplementation(DbContext context, String targetMigration, MigrationExecutionState state, Boolean useTransaction)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.<>c.<Migrate>b__20_1(DbContext c, ValueTuple`4 s)
   at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration)
   at Shared.Data.Services.EfCoreMigrationService.ApplyPendingMigrations() in C:\Users\gilmatoscn\Documents\Projects\.NET\Gestovo\src\Data.Context\Services\EfCoreMigrationService.cs:line 81
   at Server.Program.UpgradeApplication(IServiceProvider serviceProvider, IAppHelperService appHelperService, ILogger logger) in C:\Users\gilmatoscn\Documents\Projects\.NET\Gestovo\src\Server\Program.cs:line 475
2026-03-27 15:51:02.695 +00:00 [ERR] Erro ao migrar Base de Dados
System.InvalidOperationException: There is no property mapped to the column 'UOM.Active' which is used in a data operation. Either add a property mapped to this column, or specify the column types in the data operation.
   at Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.GetPropertyMappings(String[] names, String tableName, String schema, IModel model)
   at Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.GenerateModificationCommands(InsertDataOperation operation, IModel model)+MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Microsoft.EntityFrameworkCore.Migrations.SqlServerMigrationsSqlGenerator.Generate(InsertDataOperation operation, IModel model, MigrationCommandListBuilder builder, Boolean terminate)
   at Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.<>c.<.cctor>b__83_28(MigrationsSqlGenerator g, MigrationOperation o, IModel m, MigrationCommandListBuilder b)
   at Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.Generate(MigrationOperation operation, IModel model, MigrationCommandListBuilder builder)
   at Microsoft.EntityFrameworkCore.Migrations.SqlServerMigrationsSqlGenerator.Generate(MigrationOperation operation, IModel model, MigrationCommandListBuilder builder)
   at Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.Generate(IReadOnlyList`1 operations, IModel model, MigrationsSqlGenerationOptions options)
   at Microsoft.EntityFrameworkCore.Migrations.SqlServerMigrationsSqlGenerator.Generate(IReadOnlyList`1 operations, IModel model, MigrationsSqlGenerationOptions options)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.GenerateUpSql(Migration migration, MigrationsSqlGenerationOptions options)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.<>c__DisplayClass25_2.<GetMigrationCommandLists>b__2()
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.MigrateImplementation(DbContext context, String targetMigration, MigrationExecutionState state, Boolean useTransaction)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.<>c.<Migrate>b__20_1(DbContext c, ValueTuple`4 s)
   at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration)
   at Shared.Data.Services.EfCoreMigrationService.ApplyPendingMigrations() in C:\Users\gilmatoscn\Documents\Projects\.NET\Gestovo\src\Data.Context\Services\EfCoreMigrationService.cs:line 81
   at Server.Program.UpgradeApplication(IServiceProvider serviceProvider, IAppHelperService appHelperService, ILogger logger) in C:\Users\gilmatoscn\Documents\Projects\.NET\Gestovo\src\Server\Program.cs:line 475
2026-03-27 15:52:14.071 +00:00 [ERR] Erro ao migrar Base de Dados
System.InvalidCastException: Unable to cast object of type 'System.Int32' to type 'System.Boolean'.
   at Microsoft.EntityFrameworkCore.Storage.BoolTypeMapping.GenerateNonNullSqlLiteral(Object value)
   at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerBoolTypeMapping.GenerateNonNullSqlLiteral(Object value)
   at Microsoft.EntityFrameworkCore.Storage.RelationalTypeMapping.GenerateProviderValueSqlLiteral(Object value)
   at Microsoft.EntityFrameworkCore.Update.UpdateSqlGenerator.AppendSqlLiteral(StringBuilder commandStringBuilder, IColumnModification modification, String tableName, String schema)
   at Microsoft.EntityFrameworkCore.Update.UpdateSqlGenerator.<>c.<AppendValues>b__24_0(StringBuilder sb, IColumnModification o, ValueTuple`3 p)
   at System.Text.StringBuilderExtensions.AppendJoin[T,TParam](StringBuilder stringBuilder, IEnumerable`1 values, TParam param, Action`3 joinAction, String separator)
   at Microsoft.EntityFrameworkCore.Update.UpdateSqlGenerator.AppendValues(StringBuilder commandStringBuilder, String name, String schema, IReadOnlyList`1 operations)
   at Microsoft.EntityFrameworkCore.SqlServer.Update.Internal.SqlServerUpdateSqlGenerator.AppendInsertMultipleRows(StringBuilder commandStringBuilder, IReadOnlyList`1 modificationCommands, List`1 writeOperations, Boolean& requiresTransaction)
   at Microsoft.EntityFrameworkCore.SqlServer.Update.Internal.SqlServerUpdateSqlGenerator.AppendBulkInsertOperation(StringBuilder commandStringBuilder, IReadOnlyList`1 modificationCommands, Int32 commandPosition, Boolean& requiresTransaction)
   at Microsoft.EntityFrameworkCore.SqlServer.Update.Internal.SqlServerModificationCommandBatch.ApplyPendingBulkInsertCommands()
   at Microsoft.EntityFrameworkCore.SqlServer.Update.Internal.SqlServerModificationCommandBatch.Complete(Boolean moreBatchesExpected)
   at Microsoft.EntityFrameworkCore.Update.Internal.CommandBatchPreparer.CreateCommandBatches(IEnumerable`1 commandSet, Boolean moreCommandSets, Boolean assertColumnModification, ParameterNameGenerator parameterNameGenerator)+MoveNext()
   at Microsoft.EntityFrameworkCore.Migrations.SqlServerMigrationsSqlGenerator.Generate(InsertDataOperation operation, IModel model, MigrationCommandListBuilder builder, Boolean terminate)
   at Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.<>c.<.cctor>b__83_28(MigrationsSqlGenerator g, MigrationOperation o, IModel m, MigrationCommandListBuilder b)
   at Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.Generate(MigrationOperation operation, IModel model, MigrationCommandListBuilder builder)
   at Microsoft.EntityFrameworkCore.Migrations.SqlServerMigrationsSqlGenerator.Generate(MigrationOperation operation, IModel model, MigrationCommandListBuilder builder)
   at Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.Generate(IReadOnlyList`1 operations, IModel model, MigrationsSqlGenerationOptions options)
   at Microsoft.EntityFrameworkCore.Migrations.SqlServerMigrationsSqlGenerator.Generate(IReadOnlyList`1 operations, IModel model, MigrationsSqlGenerationOptions options)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.GenerateUpSql(Migration migration, MigrationsSqlGenerationOptions options)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.<>c__DisplayClass25_2.<GetMigrationCommandLists>b__2()
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.MigrateImplementation(DbContext context, String targetMigration, MigrationExecutionState state, Boolean useTransaction)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.<>c.<Migrate>b__20_1(DbContext c, ValueTuple`4 s)
   at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration)
   at Shared.Data.Services.EfCoreMigrationService.ApplyPendingMigrations() in C:\Users\gilmatoscn\Documents\Projects\.NET\Gestovo\src\Data.Context\Services\EfCoreMigrationService.cs:line 81
   at Server.Program.UpgradeApplication(IServiceProvider serviceProvider, IAppHelperService appHelperService, ILogger logger) in C:\Users\gilmatoscn\Documents\Projects\.NET\Gestovo\src\Server\Program.cs:line 475
2026-03-27 15:53:53.806 +00:00 [ERR] Failed executing DbCommand (22ms) [Parameters=[], CommandType='"Text"', CommandTimeout='30']
IF EXISTS (SELECT * FROM [sys].[identity_columns] WHERE [name] IN (N'Id', N'Address', N'City', N'CountryId', N'CreatedAt', N'CreatedByUserId', N'GS1Prefix', N'IsDeleted', N'Name', N'Phone', N'PostalCode', N'UpdatedAt', N'UpdatedByUserId', N'VatNumber') AND [object_id] = OBJECT_ID(N'[Company]'))
    SET IDENTITY_INSERT [Company] ON;
INSERT INTO [Company] ([Id], [Address], [City], [CountryId], [CreatedAt], [CreatedByUserId], [GS1Prefix], [IsDeleted], [Name], [Phone], [PostalCode], [UpdatedAt], [UpdatedByUserId], [VatNumber])
VALUES ('00000000-0000-0000-0000-000000000000', N'Morada Empresa', N'Cidade Empresa', '7591267a-93b2-4424-bd20-641e550afdd4', '0001-01-01T00:00:00.0000000', NULL, N'', CAST(0 AS bit), N'Nome Empresa', N'', N'0000-000', '0001-01-01T00:00:00.0000000', NULL, N'000000000');
IF EXISTS (SELECT * FROM [sys].[identity_columns] WHERE [name] IN (N'Id', N'Address', N'City', N'CountryId', N'CreatedAt', N'CreatedByUserId', N'GS1Prefix', N'IsDeleted', N'Name', N'Phone', N'PostalCode', N'UpdatedAt', N'UpdatedByUserId', N'VatNumber') AND [object_id] = OBJECT_ID(N'[Company]'))
    SET IDENTITY_INSERT [Company] OFF;
2026-03-27 15:53:53.915 +00:00 [ERR] Erro ao migrar Base de Dados
Microsoft.Data.SqlClient.SqlException (0x80131904): Cannot insert the value NULL into column 'Gln', table 'GestovoTeste2.dbo.Company'; column does not allow nulls. INSERT fails.
The statement has been terminated.
   at Microsoft.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at Microsoft.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, SqlCommand command, Boolean callerHasConnectionLock, Boolean asyncClose)
   at Microsoft.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at Microsoft.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean isAsync, Int32 timeout, Boolean asyncWrite)
   at Microsoft.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry, String methodName)
   at Microsoft.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQuery(RelationalCommandParameterObject parameterObject)
   at Microsoft.EntityFrameworkCore.Migrations.MigrationCommand.ExecuteNonQuery(IRelationalConnection connection, IReadOnlyDictionary`2 parameterValues)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.Execute(IReadOnlyList`1 migrationCommands, IRelationalConnection connection, MigrationExecutionState executionState, Boolean beginTransaction, Boolean commitTransaction, Nullable`1 isolationLevel)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.<>c.<ExecuteNonQuery>b__3_1(DbContext _, ValueTuple`6 s)
   at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.ExecuteNonQuery(IReadOnlyList`1 migrationCommands, IRelationalConnection connection, MigrationExecutionState executionState, Boolean commitTransaction, Nullable`1 isolationLevel)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.MigrateImplementation(DbContext context, String targetMigration, MigrationExecutionState state, Boolean useTransaction)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.<>c.<Migrate>b__20_1(DbContext c, ValueTuple`4 s)
   at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration)
   at Shared.Data.Services.EfCoreMigrationService.ApplyPendingMigrations() in C:\Users\gilmatoscn\Documents\Projects\.NET\Gestovo\src\Data.Context\Services\EfCoreMigrationService.cs:line 81
   at Server.Program.UpgradeApplication(IServiceProvider serviceProvider, IAppHelperService appHelperService, ILogger logger) in C:\Users\gilmatoscn\Documents\Projects\.NET\Gestovo\src\Server\Program.cs:line 475
ClientConnectionId:18991c51-0904-48ed-b5ac-ee0b20b9a59a
Error Number:515,State:2,Class:16
2026-03-27 15:55:51.897 +00:00 [ERR] Failed executing DbCommand (13ms) [Parameters=[], CommandType='"Text"', CommandTimeout='30']
IF EXISTS (SELECT * FROM [sys].[identity_columns] WHERE [name] IN (N'Id', N'Address', N'City', N'CountryId', N'CreatedAt', N'CreatedByUserId', N'GS1Prefix', N'IsDeleted', N'Name', N'Phone', N'PostalCode', N'UpdatedAt', N'UpdatedByUserId', N'VatNumber') AND [object_id] = OBJECT_ID(N'[Company]'))
    SET IDENTITY_INSERT [Company] ON;
INSERT INTO [Company] ([Id], [Address], [City], [CountryId], [CreatedAt], [CreatedByUserId], [GS1Prefix], [IsDeleted], [Name], [Phone], [PostalCode], [UpdatedAt], [UpdatedByUserId], [VatNumber])
VALUES ('00000000-0000-0000-0000-000000000000', N'Morada Empresa', N'Cidade Empresa', '7591267a-93b2-4424-bd20-641e550afdd4', '0001-01-01T00:00:00.0000000', NULL, N'', CAST(0 AS bit), N'Nome Empresa', N'', N'0000-000', '0001-01-01T00:00:00.0000000', NULL, N'000000000');
IF EXISTS (SELECT * FROM [sys].[identity_columns] WHERE [name] IN (N'Id', N'Address', N'City', N'CountryId', N'CreatedAt', N'CreatedByUserId', N'GS1Prefix', N'IsDeleted', N'Name', N'Phone', N'PostalCode', N'UpdatedAt', N'UpdatedByUserId', N'VatNumber') AND [object_id] = OBJECT_ID(N'[Company]'))
    SET IDENTITY_INSERT [Company] OFF;
2026-03-27 15:55:51.996 +00:00 [ERR] Erro ao migrar Base de Dados
Microsoft.Data.SqlClient.SqlException (0x80131904): Cannot insert the value NULL into column 'Gln', table 'GestovoTeste2.dbo.Company'; column does not allow nulls. INSERT fails.
The statement has been terminated.
   at Microsoft.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at Microsoft.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, SqlCommand command, Boolean callerHasConnectionLock, Boolean asyncClose)
   at Microsoft.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at Microsoft.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean isAsync, Int32 timeout, Boolean asyncWrite)
   at Microsoft.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry, String methodName)
   at Microsoft.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQuery(RelationalCommandParameterObject parameterObject)
   at Microsoft.EntityFrameworkCore.Migrations.MigrationCommand.ExecuteNonQuery(IRelationalConnection connection, IReadOnlyDictionary`2 parameterValues)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.Execute(IReadOnlyList`1 migrationCommands, IRelationalConnection connection, MigrationExecutionState executionState, Boolean beginTransaction, Boolean commitTransaction, Nullable`1 isolationLevel)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.<>c.<ExecuteNonQuery>b__3_1(DbContext _, ValueTuple`6 s)
   at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.ExecuteNonQuery(IReadOnlyList`1 migrationCommands, IRelationalConnection connection, MigrationExecutionState executionState, Boolean commitTransaction, Nullable`1 isolationLevel)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.MigrateImplementation(DbContext context, String targetMigration, MigrationExecutionState state, Boolean useTransaction)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.<>c.<Migrate>b__20_1(DbContext c, ValueTuple`4 s)
   at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration)
   at Shared.Data.Services.EfCoreMigrationService.ApplyPendingMigrations() in C:\Users\gilmatoscn\Documents\Projects\.NET\Gestovo\src\Data.Context\Services\EfCoreMigrationService.cs:line 81
   at Server.Program.UpgradeApplication(IServiceProvider serviceProvider, IAppHelperService appHelperService, ILogger logger) in C:\Users\gilmatoscn\Documents\Projects\.NET\Gestovo\src\Server\Program.cs:line 475
ClientConnectionId:031cea57-1c14-4517-b88e-6371dbb65398
Error Number:515,State:2,Class:16
2026-03-27 15:57:20.580 +00:00 [ERR] Failed executing DbCommand (14ms) [Parameters=[], CommandType='"Text"', CommandTimeout='30']
IF EXISTS (SELECT * FROM [sys].[identity_columns] WHERE [name] IN (N'Id', N'IsActive', N'Code', N'CreatedAt', N'CreatedByUserId', N'IsDeleted', N'LocationId', N'Name', N'SeriesId', N'TerminalTemplateId', N'UpdatedAt', N'UpdatedByUserId', N'TerminalTypeId') AND [object_id] = OBJECT_ID(N'[Terminals]'))
    SET IDENTITY_INSERT [Terminals] ON;
INSERT INTO [Terminals] ([Id], [IsActive], [Code], [CreatedAt], [CreatedByUserId], [IsDeleted], [LocationId], [Name], [SeriesId], [TerminalTemplateId], [UpdatedAt], [UpdatedByUserId], [TerminalTypeId])
VALUES ('721f81cb-efae-4a59-b39b-936e64fb2274', CAST(1 AS bit), N'BO1', '0001-01-01T00:00:00.0000000', NULL, CAST(0 AS bit), '36b28def-b4d0-4baa-bb81-fa06aa11f446', N'Backoffice 1', 'ebcc79d4-342f-45c1-8efe-499f5f59c272', 'bb54c22f-d8c3-48cd-88c1-5c86bab851f5', '0001-01-01T00:00:00.0000000', NULL, '310d05b5-0217-45f5-be41-1ad235537ea1');
IF EXISTS (SELECT * FROM [sys].[identity_columns] WHERE [name] IN (N'Id', N'IsActive', N'Code', N'CreatedAt', N'CreatedByUserId', N'IsDeleted', N'LocationId', N'Name', N'SeriesId', N'TerminalTemplateId', N'UpdatedAt', N'UpdatedByUserId', N'TerminalTypeId') AND [object_id] = OBJECT_ID(N'[Terminals]'))
    SET IDENTITY_INSERT [Terminals] OFF;
2026-03-27 15:57:20.684 +00:00 [ERR] Erro ao migrar Base de Dados
Microsoft.Data.SqlClient.SqlException (0x80131904): Cannot insert the value NULL into column 'DocumentPrinter', table 'GestovoTeste2.dbo.Terminals'; column does not allow nulls. INSERT fails.
The statement has been terminated.
   at Microsoft.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at Microsoft.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, SqlCommand command, Boolean callerHasConnectionLock, Boolean asyncClose)
   at Microsoft.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at Microsoft.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean isAsync, Int32 timeout, Boolean asyncWrite)
   at Microsoft.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry, String methodName)
   at Microsoft.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQuery(RelationalCommandParameterObject parameterObject)
   at Microsoft.EntityFrameworkCore.Migrations.MigrationCommand.ExecuteNonQuery(IRelationalConnection connection, IReadOnlyDictionary`2 parameterValues)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.Execute(IReadOnlyList`1 migrationCommands, IRelationalConnection connection, MigrationExecutionState executionState, Boolean beginTransaction, Boolean commitTransaction, Nullable`1 isolationLevel)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.<>c.<ExecuteNonQuery>b__3_1(DbContext _, ValueTuple`6 s)
   at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.ExecuteNonQuery(IReadOnlyList`1 migrationCommands, IRelationalConnection connection, MigrationExecutionState executionState, Boolean commitTransaction, Nullable`1 isolationLevel)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.MigrateImplementation(DbContext context, String targetMigration, MigrationExecutionState state, Boolean useTransaction)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.<>c.<Migrate>b__20_1(DbContext c, ValueTuple`4 s)
   at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration)
   at Shared.Data.Services.EfCoreMigrationService.ApplyPendingMigrations() in C:\Users\gilmatoscn\Documents\Projects\.NET\Gestovo\src\Data.Context\Services\EfCoreMigrationService.cs:line 81
   at Server.Program.UpgradeApplication(IServiceProvider serviceProvider, IAppHelperService appHelperService, ILogger logger) in C:\Users\gilmatoscn\Documents\Projects\.NET\Gestovo\src\Server\Program.cs:line 475
ClientConnectionId:ef6c95f4-8e64-435a-a5c9-d00023b3ce6f
Error Number:515,State:2,Class:16
2026-03-27 16:01:24.204 +00:00 [ERR] Failed executing DbCommand (15ms) [Parameters=[], CommandType='"Text"', CommandTimeout='30']
IF EXISTS (SELECT * FROM [sys].[identity_columns] WHERE [name] IN (N'Id', N'IsActive', N'Code', N'CreatedAt', N'CreatedByUserId', N'IsDeleted', N'LocationId', N'Name', N'SeriesId', N'TerminalTemplateId', N'UpdatedAt', N'UpdatedByUserId', N'TerminalTypeId', N'PalletLabelPrinter', N'PalletLabelReport', N'DocumentPrinter', N'DocumentReport', N'PackagingLabelPrinter', N'PackagingLabelReport', N'ExpPalletLabelPrinter', N'ExpPalletLabelReport') AND [object_id] = OBJECT_ID(N'[Terminals]'))
    SET IDENTITY_INSERT [Terminals] ON;
INSERT INTO [Terminals] ([Id], [IsActive], [Code], [CreatedAt], [CreatedByUserId], [IsDeleted], [LocationId], [Name], [SeriesId], [TerminalTemplateId], [UpdatedAt], [UpdatedByUserId], [TerminalTypeId], [PalletLabelPrinter], [PalletLabelReport], [DocumentPrinter], [DocumentReport], [PackagingLabelPrinter], [PackagingLabelReport], [ExpPalletLabelPrinter], [ExpPalletLabelReport])
VALUES ('721f81cb-efae-4a59-b39b-936e64fb2274', CAST(1 AS bit), N'BO1', '0001-01-01T00:00:00.0000000', NULL, CAST(0 AS bit), '36b28def-b4d0-4baa-bb81-fa06aa11f446', N'Backoffice 1', 'ebcc79d4-342f-45c1-8efe-499f5f59c272', 'bb54c22f-d8c3-48cd-88c1-5c86bab851f5', '0001-01-01T00:00:00.0000000', NULL, '310d05b5-0217-45f5-be41-1ad235537ea1', N'', N'', N'', N'', N'', N'', N'', N'');
IF EXISTS (SELECT * FROM [sys].[identity_columns] WHERE [name] IN (N'Id', N'IsActive', N'Code', N'CreatedAt', N'CreatedByUserId', N'IsDeleted', N'LocationId', N'Name', N'SeriesId', N'TerminalTemplateId', N'UpdatedAt', N'UpdatedByUserId', N'TerminalTypeId', N'PalletLabelPrinter', N'PalletLabelReport', N'DocumentPrinter', N'DocumentReport', N'PackagingLabelPrinter', N'PackagingLabelReport', N'ExpPalletLabelPrinter', N'ExpPalletLabelReport') AND [object_id] = OBJECT_ID(N'[Terminals]'))
    SET IDENTITY_INSERT [Terminals] OFF;
2026-03-27 16:01:24.303 +00:00 [ERR] Erro ao migrar Base de Dados
Microsoft.Data.SqlClient.SqlException (0x80131904): Cannot insert the value NULL into column 'DocumentNumCopies', table 'GestovoTeste2.dbo.Terminals'; column does not allow nulls. INSERT fails.
The statement has been terminated.
   at Microsoft.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at Microsoft.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, SqlCommand command, Boolean callerHasConnectionLock, Boolean asyncClose)
   at Microsoft.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at Microsoft.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean isAsync, Int32 timeout, Boolean asyncWrite)
   at Microsoft.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry, String methodName)
   at Microsoft.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQuery(RelationalCommandParameterObject parameterObject)
   at Microsoft.EntityFrameworkCore.Migrations.MigrationCommand.ExecuteNonQuery(IRelationalConnection connection, IReadOnlyDictionary`2 parameterValues)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.Execute(IReadOnlyList`1 migrationCommands, IRelationalConnection connection, MigrationExecutionState executionState, Boolean beginTransaction, Boolean commitTransaction, Nullable`1 isolationLevel)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.<>c.<ExecuteNonQuery>b__3_1(DbContext _, ValueTuple`6 s)
   at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.ExecuteNonQuery(IReadOnlyList`1 migrationCommands, IRelationalConnection connection, MigrationExecutionState executionState, Boolean commitTransaction, Nullable`1 isolationLevel)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.MigrateImplementation(DbContext context, String targetMigration, MigrationExecutionState state, Boolean useTransaction)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.<>c.<Migrate>b__20_1(DbContext c, ValueTuple`4 s)
   at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration)
   at Shared.Data.Services.EfCoreMigrationService.ApplyPendingMigrations() in C:\Users\gilmatoscn\Documents\Projects\.NET\Gestovo\src\Data.Context\Services\EfCoreMigrationService.cs:line 81
   at Server.Program.UpgradeApplication(IServiceProvider serviceProvider, IAppHelperService appHelperService, ILogger logger) in C:\Users\gilmatoscn\Documents\Projects\.NET\Gestovo\src\Server\Program.cs:line 475
ClientConnectionId:dc3a5ac9-3dcb-4be1-aa5a-845f8c270865
Error Number:515,State:2,Class:16
2026-03-27 16:17:52.000 +00:00 [ERR] Erro ao migrar Base de Dados
System.InvalidOperationException: The number of values (26) doesn't match the number of columns (25) for the data insertion operation on 'Terminals'. Provide the same number of values and columns.
   at Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.GenerateModificationCommands(InsertDataOperation operation, IModel model)+MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Microsoft.EntityFrameworkCore.Migrations.SqlServerMigrationsSqlGenerator.Generate(InsertDataOperation operation, IModel model, MigrationCommandListBuilder builder, Boolean terminate)
   at Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.<>c.<.cctor>b__83_28(MigrationsSqlGenerator g, MigrationOperation o, IModel m, MigrationCommandListBuilder b)
   at Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.Generate(MigrationOperation operation, IModel model, MigrationCommandListBuilder builder)
   at Microsoft.EntityFrameworkCore.Migrations.SqlServerMigrationsSqlGenerator.Generate(MigrationOperation operation, IModel model, MigrationCommandListBuilder builder)
   at Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.Generate(IReadOnlyList`1 operations, IModel model, MigrationsSqlGenerationOptions options)
   at Microsoft.EntityFrameworkCore.Migrations.SqlServerMigrationsSqlGenerator.Generate(IReadOnlyList`1 operations, IModel model, MigrationsSqlGenerationOptions options)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.GenerateUpSql(Migration migration, MigrationsSqlGenerationOptions options)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.<>c__DisplayClass25_2.<GetMigrationCommandLists>b__2()
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.MigrateImplementation(DbContext context, String targetMigration, MigrationExecutionState state, Boolean useTransaction)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.<>c.<Migrate>b__20_1(DbContext c, ValueTuple`4 s)
   at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration)
   at Shared.Data.Services.EfCoreMigrationService.ApplyPendingMigrations() in C:\Users\gilmatoscn\Documents\Projects\.NET\Gestovo\src\Data.Context\Services\EfCoreMigrationService.cs:line 81
   at Server.Program.UpgradeApplication(IServiceProvider serviceProvider, IAppHelperService appHelperService, ILogger logger) in C:\Users\gilmatoscn\Documents\Projects\.NET\Gestovo\src\Server\Program.cs:line 475
2026-03-27 16:20:13.871 +00:00 [ERR] Failed executing DbCommand (23ms) [Parameters=[], CommandType='"Text"', CommandTimeout='30']
IF EXISTS (SELECT * FROM [sys].[identity_columns] WHERE [name] IN (N'Id', N'IsActive', N'Code', N'CreatedAt', N'CreatedByUserId', N'IsDeleted', N'LocationId', N'Name', N'SeriesId', N'TerminalTemplateId', N'UpdatedAt', N'UpdatedByUserId', N'TerminalTypeId', N'PalletLabelPrinter', N'PalletLabelReport', N'DocumentPrinter', N'DocumentReport', N'PackagingLabelPrinter', N'PackagingLabelReport', N'ExpPalletLabelPrinter', N'ExpPalletLabelReport', N'DocumentNumCopies', N'PalletLabelNumCopies', N'PackagingLabelNumCopies', N'ExpPalletLabelNumCopies') AND [object_id] = OBJECT_ID(N'[Terminals]'))
    SET IDENTITY_INSERT [Terminals] ON;
INSERT INTO [Terminals] ([Id], [IsActive], [Code], [CreatedAt], [CreatedByUserId], [IsDeleted], [LocationId], [Name], [SeriesId], [TerminalTemplateId], [UpdatedAt], [UpdatedByUserId], [TerminalTypeId], [PalletLabelPrinter], [PalletLabelReport], [DocumentPrinter], [DocumentReport], [PackagingLabelPrinter], [PackagingLabelReport], [ExpPalletLabelPrinter], [ExpPalletLabelReport], [DocumentNumCopies], [PalletLabelNumCopies], [PackagingLabelNumCopies], [ExpPalletLabelNumCopies])
VALUES ('721f81cb-efae-4a59-b39b-936e64fb2274', CAST(1 AS bit), N'BO1', '0001-01-01T00:00:00.0000000', NULL, CAST(0 AS bit), '36b28def-b4d0-4baa-bb81-fa06aa11f446', N'Backoffice 1', 'ebcc79d4-342f-45c1-8efe-499f5f59c272', 'bb54c22f-d8c3-48cd-88c1-5c86bab851f5', '0001-01-01T00:00:00.0000000', NULL, '310d05b5-0217-45f5-be41-1ad235537ea1', N'', N'', N'', N'', N'', N'', N'', N'', 1, 1, 1, 1);
IF EXISTS (SELECT * FROM [sys].[identity_columns] WHERE [name] IN (N'Id', N'IsActive', N'Code', N'CreatedAt', N'CreatedByUserId', N'IsDeleted', N'LocationId', N'Name', N'SeriesId', N'TerminalTemplateId', N'UpdatedAt', N'UpdatedByUserId', N'TerminalTypeId', N'PalletLabelPrinter', N'PalletLabelReport', N'DocumentPrinter', N'DocumentReport', N'PackagingLabelPrinter', N'PackagingLabelReport', N'ExpPalletLabelPrinter', N'ExpPalletLabelReport', N'DocumentNumCopies', N'PalletLabelNumCopies', N'PackagingLabelNumCopies', N'ExpPalletLabelNumCopies') AND [object_id] = OBJECT_ID(N'[Terminals]'))
    SET IDENTITY_INSERT [Terminals] OFF;
2026-03-27 16:20:13.976 +00:00 [ERR] Erro ao migrar Base de Dados
Microsoft.Data.SqlClient.SqlException (0x80131904): The INSERT statement conflicted with the FOREIGN KEY constraint "FK_Terminals_Locations_LocationId". The conflict occurred in database "GestovoTeste2", table "dbo.Locations", column 'Id'.
The statement has been terminated.
   at Microsoft.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at Microsoft.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, SqlCommand command, Boolean callerHasConnectionLock, Boolean asyncClose)
   at Microsoft.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at Microsoft.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean isAsync, Int32 timeout, Boolean asyncWrite)
   at Microsoft.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry, String methodName)
   at Microsoft.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQuery(RelationalCommandParameterObject parameterObject)
   at Microsoft.EntityFrameworkCore.Migrations.MigrationCommand.ExecuteNonQuery(IRelationalConnection connection, IReadOnlyDictionary`2 parameterValues)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.Execute(IReadOnlyList`1 migrationCommands, IRelationalConnection connection, MigrationExecutionState executionState, Boolean beginTransaction, Boolean commitTransaction, Nullable`1 isolationLevel)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.<>c.<ExecuteNonQuery>b__3_1(DbContext _, ValueTuple`6 s)
   at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.ExecuteNonQuery(IReadOnlyList`1 migrationCommands, IRelationalConnection connection, MigrationExecutionState executionState, Boolean commitTransaction, Nullable`1 isolationLevel)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.MigrateImplementation(DbContext context, String targetMigration, MigrationExecutionState state, Boolean useTransaction)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.<>c.<Migrate>b__20_1(DbContext c, ValueTuple`4 s)
   at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration)
   at Shared.Data.Services.EfCoreMigrationService.ApplyPendingMigrations() in C:\Users\gilmatoscn\Documents\Projects\.NET\Gestovo\src\Data.Context\Services\EfCoreMigrationService.cs:line 81
   at Server.Program.UpgradeApplication(IServiceProvider serviceProvider, IAppHelperService appHelperService, ILogger logger) in C:\Users\gilmatoscn\Documents\Projects\.NET\Gestovo\src\Server\Program.cs:line 475
ClientConnectionId:0bc89020-3188-4a4e-99ab-2abdd5169dbd
Error Number:547,State:0,Class:16
2026-03-27 16:24:21.802 +00:00 [ERR] Erro ao migrar Base de Dados
System.InvalidOperationException: There is no property mapped to the column 'Locations.Active' which is used in a data operation. Either add a property mapped to this column, or specify the column types in the data operation.
   at Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.GetPropertyMappings(String[] names, String tableName, String schema, IModel model)
   at Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.GenerateModificationCommands(InsertDataOperation operation, IModel model)+MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Microsoft.EntityFrameworkCore.Migrations.SqlServerMigrationsSqlGenerator.Generate(InsertDataOperation operation, IModel model, MigrationCommandListBuilder builder, Boolean terminate)
   at Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.<>c.<.cctor>b__83_28(MigrationsSqlGenerator g, MigrationOperation o, IModel m, MigrationCommandListBuilder b)
   at Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.Generate(MigrationOperation operation, IModel model, MigrationCommandListBuilder builder)
   at Microsoft.EntityFrameworkCore.Migrations.SqlServerMigrationsSqlGenerator.Generate(MigrationOperation operation, IModel model, MigrationCommandListBuilder builder)
   at Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.Generate(IReadOnlyList`1 operations, IModel model, MigrationsSqlGenerationOptions options)
   at Microsoft.EntityFrameworkCore.Migrations.SqlServerMigrationsSqlGenerator.Generate(IReadOnlyList`1 operations, IModel model, MigrationsSqlGenerationOptions options)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.GenerateUpSql(Migration migration, MigrationsSqlGenerationOptions options)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.<>c__DisplayClass25_2.<GetMigrationCommandLists>b__2()
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.MigrateImplementation(DbContext context, String targetMigration, MigrationExecutionState state, Boolean useTransaction)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.<>c.<Migrate>b__20_1(DbContext c, ValueTuple`4 s)
   at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration)
   at Shared.Data.Services.EfCoreMigrationService.ApplyPendingMigrations() in C:\Users\gilmatoscn\Documents\Projects\.NET\Gestovo\src\Data.Context\Services\EfCoreMigrationService.cs:line 81
   at Server.Program.UpgradeApplication(IServiceProvider serviceProvider, IAppHelperService appHelperService, ILogger logger) in C:\Users\gilmatoscn\Documents\Projects\.NET\Gestovo\src\Server\Program.cs:line 475
2026-03-27 16:25:27.982 +00:00 [ERR] Failed executing DbCommand (15ms) [Parameters=[], CommandType='"Text"', CommandTimeout='30']
IF EXISTS (SELECT * FROM [sys].[identity_columns] WHERE [name] IN (N'Id', N'IsActive', N'Address', N'City', N'Code', N'CountryId', N'CreatedAt', N'CreatedByUserId', N'EggProducerCode', N'IsDeleted', N'Name', N'ParentId', N'PostalCode', N'TypeId', N'UpdatedAt', N'UpdatedByUserId') AND [object_id] = OBJECT_ID(N'[Locations]'))
    SET IDENTITY_INSERT [Locations] ON;
INSERT INTO [Locations] ([Id], [IsActive], [Address], [City], [Code], [CountryId], [CreatedAt], [CreatedByUserId], [EggProducerCode], [IsDeleted], [Name], [ParentId], [PostalCode], [TypeId], [UpdatedAt], [UpdatedByUserId])
VALUES ('36b28def-b4d0-4baa-bb81-fa06aa11f446', CAST(1 AS bit), N'Morada Centro 1', N'Cidade Centro 1', N'', '7591267a-93b2-4424-bd20-641e550afdd4', '0001-01-01T00:00:00.0000000', NULL, N'', CAST(0 AS bit), N'Centro 1', NULL, N'1111-111', '71b83636-68db-4c7f-ad31-975a4858c9f7', '0001-01-01T00:00:00.0000000', NULL),
('eee61f40-3815-4692-8b39-839617a5a2e7', CAST(1 AS bit), N'Morada Recolha 1', N'Cidade Recolha 1', N'', '7591267a-93b2-4424-bd20-641e550afdd4', '0001-01-01T00:00:00.0000000', NULL, N'', CAST(0 AS bit), N'Casa Recolha 1', NULL, N'9999-999', '71b83636-68db-4c7f-ad31-975a4858c9f7', '0001-01-01T00:00:00.0000000', NULL);
IF EXISTS (SELECT * FROM [sys].[identity_columns] WHERE [name] IN (N'Id', N'IsActive', N'Address', N'City', N'Code', N'CountryId', N'CreatedAt', N'CreatedByUserId', N'EggProducerCode', N'IsDeleted', N'Name', N'ParentId', N'PostalCode', N'TypeId', N'UpdatedAt', N'UpdatedByUserId') AND [object_id] = OBJECT_ID(N'[Locations]'))
    SET IDENTITY_INSERT [Locations] OFF;
2026-03-27 16:25:28.077 +00:00 [ERR] Erro ao migrar Base de Dados
Microsoft.Data.SqlClient.SqlException (0x80131904): Cannot insert the value NULL into column 'CanReceiveEggs', table 'GestovoTeste2.dbo.Locations'; column does not allow nulls. INSERT fails.
The statement has been terminated.
   at Microsoft.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at Microsoft.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, SqlCommand command, Boolean callerHasConnectionLock, Boolean asyncClose)
   at Microsoft.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at Microsoft.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean isAsync, Int32 timeout, Boolean asyncWrite)
   at Microsoft.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry, String methodName)
   at Microsoft.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQuery(RelationalCommandParameterObject parameterObject)
   at Microsoft.EntityFrameworkCore.Migrations.MigrationCommand.ExecuteNonQuery(IRelationalConnection connection, IReadOnlyDictionary`2 parameterValues)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.Execute(IReadOnlyList`1 migrationCommands, IRelationalConnection connection, MigrationExecutionState executionState, Boolean beginTransaction, Boolean commitTransaction, Nullable`1 isolationLevel)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.<>c.<ExecuteNonQuery>b__3_1(DbContext _, ValueTuple`6 s)
   at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.ExecuteNonQuery(IReadOnlyList`1 migrationCommands, IRelationalConnection connection, MigrationExecutionState executionState, Boolean commitTransaction, Nullable`1 isolationLevel)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.MigrateImplementation(DbContext context, String targetMigration, MigrationExecutionState state, Boolean useTransaction)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.<>c.<Migrate>b__20_1(DbContext c, ValueTuple`4 s)
   at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration)
   at Shared.Data.Services.EfCoreMigrationService.ApplyPendingMigrations() in C:\Users\gilmatoscn\Documents\Projects\.NET\Gestovo\src\Data.Context\Services\EfCoreMigrationService.cs:line 81
   at Server.Program.UpgradeApplication(IServiceProvider serviceProvider, IAppHelperService appHelperService, ILogger logger) in C:\Users\gilmatoscn\Documents\Projects\.NET\Gestovo\src\Server\Program.cs:line 475
ClientConnectionId:771717d1-5d12-41c4-8d04-d1e1745fae1b
Error Number:515,State:2,Class:16
2026-03-27 16:31:34.171 +00:00 [ERR] Failed executing DbCommand (12ms) [Parameters=[], CommandType='"Text"', CommandTimeout='30']
IF EXISTS (SELECT * FROM [sys].[identity_columns] WHERE [name] IN (N'TypeId', N'UpdatedAt', N'UpdatedByUserId') AND [object_id] = OBJECT_ID(N'[Locations]'))
    SET IDENTITY_INSERT [Locations] ON;
INSERT INTO [Locations] ([TypeId], [UpdatedAt], [UpdatedByUserId])
VALUES ('71b83636-68db-4c7f-ad31-975a4858c9f7', '0001-01-01T00:00:00.0000000', NULL);
IF EXISTS (SELECT * FROM [sys].[identity_columns] WHERE [name] IN (N'TypeId', N'UpdatedAt', N'UpdatedByUserId') AND [object_id] = OBJECT_ID(N'[Locations]'))
    SET IDENTITY_INSERT [Locations] OFF;
2026-03-27 16:31:34.294 +00:00 [ERR] Erro ao migrar Base de Dados
Microsoft.Data.SqlClient.SqlException (0x80131904): Cannot insert the value NULL into column 'IsDeleted', table 'GestovoTeste2.dbo.Locations'; column does not allow nulls. INSERT fails.
The statement has been terminated.
   at Microsoft.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at Microsoft.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, SqlCommand command, Boolean callerHasConnectionLock, Boolean asyncClose)
   at Microsoft.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at Microsoft.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean isAsync, Int32 timeout, Boolean asyncWrite)
   at Microsoft.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry, String methodName)
   at Microsoft.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQuery(RelationalCommandParameterObject parameterObject)
   at Microsoft.EntityFrameworkCore.Migrations.MigrationCommand.ExecuteNonQuery(IRelationalConnection connection, IReadOnlyDictionary`2 parameterValues)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.Execute(IReadOnlyList`1 migrationCommands, IRelationalConnection connection, MigrationExecutionState executionState, Boolean beginTransaction, Boolean commitTransaction, Nullable`1 isolationLevel)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.<>c.<ExecuteNonQuery>b__3_1(DbContext _, ValueTuple`6 s)
   at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.ExecuteNonQuery(IReadOnlyList`1 migrationCommands, IRelationalConnection connection, MigrationExecutionState executionState, Boolean commitTransaction, Nullable`1 isolationLevel)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.MigrateImplementation(DbContext context, String targetMigration, MigrationExecutionState state, Boolean useTransaction)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.<>c.<Migrate>b__20_1(DbContext c, ValueTuple`4 s)
   at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration)
   at Shared.Data.Services.EfCoreMigrationService.ApplyPendingMigrations() in C:\Users\gilmatoscn\Documents\Projects\.NET\Gestovo\src\Data.Context\Services\EfCoreMigrationService.cs:line 81
   at Server.Program.UpgradeApplication(IServiceProvider serviceProvider, IAppHelperService appHelperService, ILogger logger) in C:\Users\gilmatoscn\Documents\Projects\.NET\Gestovo\src\Server\Program.cs:line 475
ClientConnectionId:91de96ce-4ae2-4598-9a77-86c8e939d389
Error Number:515,State:2,Class:16
2026-03-27 16:34:59.095 +00:00 [ERR] Failed executing DbCommand (15ms) [Parameters=[], CommandType='"Text"', CommandTimeout='30']
IF EXISTS (SELECT * FROM [sys].[identity_columns] WHERE [name] IN (N'Id', N'Abbreviation', N'IsActive', N'CategoryId', N'CreatedAt', N'CreatedByUserId', N'Factor', N'IsDeleted', N'IsReferenceUnit', N'Name', N'UpdatedAt', N'UpdatedByUserId', N'IsSystemBaseUnit') AND [object_id] = OBJECT_ID(N'[UOM]'))
    SET IDENTITY_INSERT [UOM] ON;
INSERT INTO [UOM] ([Id], [Abbreviation], [IsActive], [CategoryId], [CreatedAt], [CreatedByUserId], [Factor], [IsDeleted], [IsReferenceUnit], [Name], [UpdatedAt], [UpdatedByUserId], [IsSystemBaseUnit])
VALUES ('4f36f3fe-f2b6-4e92-8e3f-cce7c21c05d1', N'un', CAST(1 AS bit), '56151cc1-17d6-4ff6-8479-11dc57729551', '0001-01-01T00:00:00.0000000', NULL, 1.0, CAST(0 AS bit), CAST(1 AS bit), N'Unidade', '0001-01-01T00:00:00.0000000', NULL, CAST(1 AS bit)),
('671e777c-2576-4667-97ce-a6e16af0f923', N'dz', CAST(1 AS bit), '56151cc1-17d6-4ff6-8479-11dc57729551', '0001-01-01T00:00:00.0000000', NULL, 12.0, CAST(0 AS bit), CAST(0 AS bit), N'Dúzia', '0001-01-01T00:00:00.0000000', NULL, CAST(0 AS bit));
IF EXISTS (SELECT * FROM [sys].[identity_columns] WHERE [name] IN (N'Id', N'Abbreviation', N'IsActive', N'CategoryId', N'CreatedAt', N'CreatedByUserId', N'Factor', N'IsDeleted', N'IsReferenceUnit', N'Name', N'UpdatedAt', N'UpdatedByUserId', N'IsSystemBaseUnit') AND [object_id] = OBJECT_ID(N'[UOM]'))
    SET IDENTITY_INSERT [UOM] OFF;
2026-03-27 16:34:59.194 +00:00 [ERR] Erro ao migrar Base de Dados
Microsoft.Data.SqlClient.SqlException (0x80131904): Cannot insert the value NULL into column 'UomType', table 'GestovoTeste2.dbo.UOM'; column does not allow nulls. INSERT fails.
The statement has been terminated.
   at Microsoft.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at Microsoft.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, SqlCommand command, Boolean callerHasConnectionLock, Boolean asyncClose)
   at Microsoft.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at Microsoft.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean isAsync, Int32 timeout, Boolean asyncWrite)
   at Microsoft.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry, String methodName)
   at Microsoft.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQuery(RelationalCommandParameterObject parameterObject)
   at Microsoft.EntityFrameworkCore.Migrations.MigrationCommand.ExecuteNonQuery(IRelationalConnection connection, IReadOnlyDictionary`2 parameterValues)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.Execute(IReadOnlyList`1 migrationCommands, IRelationalConnection connection, MigrationExecutionState executionState, Boolean beginTransaction, Boolean commitTransaction, Nullable`1 isolationLevel)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.<>c.<ExecuteNonQuery>b__3_1(DbContext _, ValueTuple`6 s)
   at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.ExecuteNonQuery(IReadOnlyList`1 migrationCommands, IRelationalConnection connection, MigrationExecutionState executionState, Boolean commitTransaction, Nullable`1 isolationLevel)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.MigrateImplementation(DbContext context, String targetMigration, MigrationExecutionState state, Boolean useTransaction)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.<>c.<Migrate>b__20_1(DbContext c, ValueTuple`4 s)
   at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration)
   at Shared.Data.Services.EfCoreMigrationService.ApplyPendingMigrations() in C:\Users\gilmatoscn\Documents\Projects\.NET\Gestovo\src\Data.Context\Services\EfCoreMigrationService.cs:line 81
   at Server.Program.UpgradeApplication(IServiceProvider serviceProvider, IAppHelperService appHelperService, ILogger logger) in C:\Users\gilmatoscn\Documents\Projects\.NET\Gestovo\src\Server\Program.cs:line 475
ClientConnectionId:561e8933-a4e9-45ca-88d0-99bef544c8de
Error Number:515,State:2,Class:16
2026-03-27 16:37:29.429 +00:00 [ERR] Erro ao migrar Base de Dados
System.InvalidCastException: Unable to cast object of type 'Data.Entities.Enums.UomType' to type 'System.String'.
   at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerStringTypeMapping.GenerateNonNullSqlLiteral(Object value)
   at Microsoft.EntityFrameworkCore.Storage.RelationalTypeMapping.GenerateProviderValueSqlLiteral(Object value)
   at Microsoft.EntityFrameworkCore.Update.UpdateSqlGenerator.AppendSqlLiteral(StringBuilder commandStringBuilder, IColumnModification modification, String tableName, String schema)
   at Microsoft.EntityFrameworkCore.Update.UpdateSqlGenerator.<>c.<AppendValues>b__24_0(StringBuilder sb, IColumnModification o, ValueTuple`3 p)
   at System.Text.StringBuilderExtensions.AppendJoin[T,TParam](StringBuilder stringBuilder, IEnumerable`1 values, TParam param, Action`3 joinAction, String separator)
   at Microsoft.EntityFrameworkCore.Update.UpdateSqlGenerator.AppendValues(StringBuilder commandStringBuilder, String name, String schema, IReadOnlyList`1 operations)
   at Microsoft.EntityFrameworkCore.SqlServer.Update.Internal.SqlServerUpdateSqlGenerator.AppendInsertMultipleRows(StringBuilder commandStringBuilder, IReadOnlyList`1 modificationCommands, List`1 writeOperations, Boolean& requiresTransaction)
   at Microsoft.EntityFrameworkCore.SqlServer.Update.Internal.SqlServerUpdateSqlGenerator.AppendBulkInsertOperation(StringBuilder commandStringBuilder, IReadOnlyList`1 modificationCommands, Int32 commandPosition, Boolean& requiresTransaction)
   at Microsoft.EntityFrameworkCore.SqlServer.Update.Internal.SqlServerModificationCommandBatch.ApplyPendingBulkInsertCommands()
   at Microsoft.EntityFrameworkCore.SqlServer.Update.Internal.SqlServerModificationCommandBatch.Complete(Boolean moreBatchesExpected)
   at Microsoft.EntityFrameworkCore.Update.Internal.CommandBatchPreparer.CreateCommandBatches(IEnumerable`1 commandSet, Boolean moreCommandSets, Boolean assertColumnModification, ParameterNameGenerator parameterNameGenerator)+MoveNext()
   at Microsoft.EntityFrameworkCore.Migrations.SqlServerMigrationsSqlGenerator.Generate(InsertDataOperation operation, IModel model, MigrationCommandListBuilder builder, Boolean terminate)
   at Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.<>c.<.cctor>b__83_28(MigrationsSqlGenerator g, MigrationOperation o, IModel m, MigrationCommandListBuilder b)
   at Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.Generate(MigrationOperation operation, IModel model, MigrationCommandListBuilder builder)
   at Microsoft.EntityFrameworkCore.Migrations.SqlServerMigrationsSqlGenerator.Generate(MigrationOperation operation, IModel model, MigrationCommandListBuilder builder)
   at Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.Generate(IReadOnlyList`1 operations, IModel model, MigrationsSqlGenerationOptions options)
   at Microsoft.EntityFrameworkCore.Migrations.SqlServerMigrationsSqlGenerator.Generate(IReadOnlyList`1 operations, IModel model, MigrationsSqlGenerationOptions options)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.GenerateUpSql(Migration migration, MigrationsSqlGenerationOptions options)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.<>c__DisplayClass25_2.<GetMigrationCommandLists>b__2()
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.MigrateImplementation(DbContext context, String targetMigration, MigrationExecutionState state, Boolean useTransaction)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.<>c.<Migrate>b__20_1(DbContext c, ValueTuple`4 s)
   at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration)
   at Shared.Data.Services.EfCoreMigrationService.ApplyPendingMigrations() in C:\Users\gilmatoscn\Documents\Projects\.NET\Gestovo\src\Data.Context\Services\EfCoreMigrationService.cs:line 81
   at Server.Program.UpgradeApplication(IServiceProvider serviceProvider, IAppHelperService appHelperService, ILogger logger) in C:\Users\gilmatoscn\Documents\Projects\.NET\Gestovo\src\Server\Program.cs:line 475
2026-03-27 16:39:49.619 +00:00 [ERR] Failed executing DbCommand (16ms) [Parameters=[], CommandType='"Text"', CommandTimeout='30']
IF EXISTS (SELECT * FROM [sys].[identity_columns] WHERE [name] IN (N'Id', N'Abbreviation', N'IsActive', N'CategoryId', N'CreatedAt', N'CreatedByUserId', N'Factor', N'IsDeleted', N'IsReferenceUnit', N'Name', N'UpdatedAt', N'UpdatedByUserId', N'IsSystemBaseUnit', N'UomType') AND [object_id] = OBJECT_ID(N'[UOM]'))
    SET IDENTITY_INSERT [UOM] ON;
INSERT INTO [UOM] ([Id], [Abbreviation], [IsActive], [CategoryId], [CreatedAt], [CreatedByUserId], [Factor], [IsDeleted], [IsReferenceUnit], [Name], [UpdatedAt], [UpdatedByUserId], [IsSystemBaseUnit], [UomType])
VALUES ('4f36f3fe-f2b6-4e92-8e3f-cce7c21c05d1', N'un', CAST(1 AS bit), '56151cc1-17d6-4ff6-8479-11dc57729551', '0001-01-01T00:00:00.0000000', NULL, 1.0, CAST(0 AS bit), CAST(1 AS bit), N'Unidade', '0001-01-01T00:00:00.0000000', NULL, CAST(1 AS bit), N'global'),
('671e777c-2576-4667-97ce-a6e16af0f923', N'dz', CAST(1 AS bit), '56151cc1-17d6-4ff6-8479-11dc57729551', '0001-01-01T00:00:00.0000000', NULL, 12.0, CAST(0 AS bit), CAST(0 AS bit), N'Dúzia', '0001-01-01T00:00:00.0000000', NULL, CAST(0 AS bit), N'global');
IF EXISTS (SELECT * FROM [sys].[identity_columns] WHERE [name] IN (N'Id', N'Abbreviation', N'IsActive', N'CategoryId', N'CreatedAt', N'CreatedByUserId', N'Factor', N'IsDeleted', N'IsReferenceUnit', N'Name', N'UpdatedAt', N'UpdatedByUserId', N'IsSystemBaseUnit', N'UomType') AND [object_id] = OBJECT_ID(N'[UOM]'))
    SET IDENTITY_INSERT [UOM] OFF;
2026-03-27 16:39:49.719 +00:00 [ERR] Erro ao migrar Base de Dados
Microsoft.Data.SqlClient.SqlException (0x80131904): The INSERT statement conflicted with the FOREIGN KEY constraint "FK_UOM_UOMCategory_CategoryId". The conflict occurred in database "GestovoTeste2", table "dbo.UOMCategory", column 'Id'.
The statement has been terminated.
   at Microsoft.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at Microsoft.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, SqlCommand command, Boolean callerHasConnectionLock, Boolean asyncClose)
   at Microsoft.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at Microsoft.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean isAsync, Int32 timeout, Boolean asyncWrite)
   at Microsoft.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry, String methodName)
   at Microsoft.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQuery(RelationalCommandParameterObject parameterObject)
   at Microsoft.EntityFrameworkCore.Migrations.MigrationCommand.ExecuteNonQuery(IRelationalConnection connection, IReadOnlyDictionary`2 parameterValues)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.Execute(IReadOnlyList`1 migrationCommands, IRelationalConnection connection, MigrationExecutionState executionState, Boolean beginTransaction, Boolean commitTransaction, Nullable`1 isolationLevel)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.<>c.<ExecuteNonQuery>b__3_1(DbContext _, ValueTuple`6 s)
   at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.ExecuteNonQuery(IReadOnlyList`1 migrationCommands, IRelationalConnection connection, MigrationExecutionState executionState, Boolean commitTransaction, Nullable`1 isolationLevel)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.MigrateImplementation(DbContext context, String targetMigration, MigrationExecutionState state, Boolean useTransaction)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.<>c.<Migrate>b__20_1(DbContext c, ValueTuple`4 s)
   at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration)
   at Shared.Data.Services.EfCoreMigrationService.ApplyPendingMigrations() in C:\Users\gilmatoscn\Documents\Projects\.NET\Gestovo\src\Data.Context\Services\EfCoreMigrationService.cs:line 81
   at Server.Program.UpgradeApplication(IServiceProvider serviceProvider, IAppHelperService appHelperService, ILogger logger) in C:\Users\gilmatoscn\Documents\Projects\.NET\Gestovo\src\Server\Program.cs:line 475
ClientConnectionId:93e99134-eeeb-4bdd-b864-b55bc97b686c
Error Number:547,State:0,Class:16
