using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Migrations.Operations;

namespace IRaCIS.Core.Test.CodeFirstTest.PGSQL.Migrations
{
    public class NoForeignKeyMigrationsSqlGenerator : MigrationsSqlGenerator
    {
        public NoForeignKeyMigrationsSqlGenerator(
            MigrationsSqlGeneratorDependencies dependencies) : base(dependencies)
        {
        }

        protected override void Generate(Microsoft.EntityFrameworkCore.Migrations.Operations.CreateTableOperation operation, IModel? model, MigrationCommandListBuilder builder, bool terminate = true)
        {
            operation.ForeignKeys.Clear();
            base.Generate(operation, model, builder, terminate);
        }
    }
}
