{"id":20272953,"url":"https://github.com/cyilcode/efcoreautomigrator","last_synced_at":"2025-04-11T04:42:37.430Z","repository":{"id":55619395,"uuid":"168304345","full_name":"cyilcode/EFCoreAutoMigrator","owner":"cyilcode","description":"An aggresive auto migrator tool for EF core 2.1 and above","archived":false,"fork":false,"pushed_at":"2022-10-18T15:36:40.000Z","size":25,"stargazers_count":23,"open_issues_count":3,"forks_count":5,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-11T04:42:32.412Z","etag":null,"topics":["auto-migartion","dotnet","dotnet-core","efcore2","entity-framework-core"],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cyilcode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-30T08:10:11.000Z","updated_at":"2023-03-30T01:15:01.000Z","dependencies_parsed_at":"2023-01-20T08:15:52.962Z","dependency_job_id":null,"html_url":"https://github.com/cyilcode/EFCoreAutoMigrator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyilcode%2FEFCoreAutoMigrator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyilcode%2FEFCoreAutoMigrator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyilcode%2FEFCoreAutoMigrator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyilcode%2FEFCoreAutoMigrator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cyilcode","download_url":"https://codeload.github.com/cyilcode/EFCoreAutoMigrator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248345281,"owners_count":21088242,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["auto-migartion","dotnet","dotnet-core","efcore2","entity-framework-core"],"created_at":"2024-11-14T12:47:34.766Z","updated_at":"2025-04-11T04:42:37.411Z","avatar_url":"https://github.com/cyilcode.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![NuGet](https://img.shields.io/nuget/dt/EFCoreAutoMigrator.svg)](https://www.nuget.org/packages/EFCoreAutoMigrator/)\n[![DynamicQueryBuilder](https://img.shields.io/nuget/v/EFCoreAutoMigrator.svg)](https://www.nuget.org/packages/EFCoreAutoMigrator/)\n[![License](https://img.shields.io/badge/License-MIT-green.svg)](https://github.com/oplog/EFCoreAutoMigrator/blob/master/LICENSE)\n\n# What ?\n\nEFCoreAutoMigrator is an aggressive automatic migration tool that works with [Entity Framework Core 2.1](https://github.com/aspnet/EntityFrameworkCore) and above. It basically recreates your database tables whenever it detects a change in your database schema.\n\n# Why ?\n\nEFCoreAutoMigrator was built for speeding up the development stages of your applications. Since you don't need to deal with database migrations after you install this tool;\n\n* No migration files generated.\n* No more conflicts with your branch and your teammates.\n* Fixing database schema errors is a lot easier.\n\n# How ?\n\nEFCoreAutoMigrator creates and stores a hash in your FileSystem or Database to check if you have any changes on your current schema by utilizing [GenerateCreateScript ](https://docs.microsoft.com/en-us/dotnet/api/microsoft.entityframeworkcore.relationaldatabasefacadeextensions.generatecreatescript?view=efcore-2.1) function of EFCore 2.1+.\n\n#### Installation\nIt is quite simple to install.\n\nYou can install EFCoreAutoMigrator from NuGet with the command below:\n\n`Install-Package EFCoreAutoMigrator`\n\n### On ASP.NET Core Project\n\n**Program.cs**\n```csharp\npublic static class Program\n    {\n        public static void Main(string[] args)\n        {\n            IWebHost server = BuildWebHost(args);\n            var env = server.Services.GetService(typeof(IHostingEnvironment)) as IHostingEnvironment;\n\n            // I would highly suggest you to not to use this tool in your production environment.\n            // Since it will vaporize your whole database which you probably don't want :)\n            if (!env.IsProduction())\n            {\n                using (IServiceScope serviceScope = server.Services.GetService\u003cIServiceScopeFactory\u003e().CreateScope())\n                {\n                    // Make sure that your DbContext is registered in your DI container.\n                    MyDbContext myDbContext = serviceScope.ServiceProvider.GetService\u003cMyDbContext\u003e();\n                    // Always protect your production/secure databases.\n                    var secureDataSources = new SecureDataSource[] \n                    {\n                        new SecureDataSource \n                        {\n                            ServerAddress = \"mysecure.database.net\",\n                            DatabaseName = \"my-production-database\"\n                        }\n                    };\n                    \n                    new AutoMigrator(myDbContext, secureDataSources).EnableAutoMigration(\n                        false, MigrationModelHashStorageMode.Database, () =\u003e\n                    {\n                        // Seed function here if you need\n                    });\n                }\n            }\n\n            server.Run();\n        }\n\n        public static IWebHost BuildWebHost(string[] args) =\u003e\n            WebHost.CreateDefaultBuilder(args)\n                .UseStartup\u003cStartup\u003e()\n                .Build();\n    }\n```\n#### TODO: \n    * Tests\n    * Further documentation\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyilcode%2Fefcoreautomigrator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcyilcode%2Fefcoreautomigrator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyilcode%2Fefcoreautomigrator/lists"}