{"id":15374178,"url":"https://github.com/stil/efmig","last_synced_at":"2025-04-15T11:32:23.610Z","repository":{"id":146061315,"uuid":"609360117","full_name":"stil/efmig","owner":"stil","description":"GUI for Entity Framework Core migrations.","archived":false,"fork":false,"pushed_at":"2024-10-24T00:28:56.000Z","size":4005,"stargazers_count":22,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-01T10:42:38.662Z","etag":null,"topics":["avalonia","csharp","database","database-migrations","dotnet","dotnet-core","efcore","entityframework","gui","migrations"],"latest_commit_sha":null,"homepage":"","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/stil.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-04T00:23:38.000Z","updated_at":"2024-10-31T09:33:02.000Z","dependencies_parsed_at":"2023-12-02T16:27:21.613Z","dependency_job_id":"ce5da2c0-71d9-4c61-932c-808820ea59da","html_url":"https://github.com/stil/efmig","commit_stats":{"total_commits":57,"total_committers":2,"mean_commits":28.5,"dds":"0.22807017543859653","last_synced_commit":"da64a9f90369e981574b04396100138f0f4dd667"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stil%2Fefmig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stil%2Fefmig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stil%2Fefmig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stil%2Fefmig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stil","download_url":"https://codeload.github.com/stil/efmig/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223673048,"owners_count":17183618,"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":["avalonia","csharp","database","database-migrations","dotnet","dotnet-core","efcore","entityframework","gui","migrations"],"created_at":"2024-10-01T13:57:32.934Z","updated_at":"2024-11-08T11:01:59.422Z","avatar_url":"https://github.com/stil.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# efmig\r\n\r\nThis is a multi-platform (Windows, macOS, Linux) GUI application that makes working with Entity Framework Core migrations easier.\r\n\r\n[![build](https://github.com/stil/efmig/actions/workflows/build.yml/badge.svg)](https://github.com/stil/efmig/actions/workflows/build.yml)\r\n\r\n![alt text](images/main.png)\r\n\r\n\r\nWhy you should use it:\r\n* You'll no longer need to remember `dotnet ef` commands syntax for creating, removing and generating migration scripts.\r\n* Dependency on `Microsoft.EntityFrameworkCore.Design` can be dropped inside your project.\r\n* You can remove `IDesignTimeDbContextFactory\u003cTDbContext\u003e` implementations from your project.\r\n\r\n**Important**: This tool **does not** apply migrations on your database. It's designed to be non-destructive and you're expected to generate migration script, review it and run it manually in database client of your choice.\r\n\r\n## Configuration\r\n\r\n1. Download binaries for your platform from Releases page and launch the `efmig` executable.\r\n2. Click `[+]` button to create a new configuration profile.\r\n3. Fill configuration values\r\n   - Profile name: this is a label of your choice for configuration profile.\r\n   - dotnet-ef version: See [NuGet page](https://www.nuget.org/packages/dotnet-ef/#versions-body-tab) for available versions. Enter version matching your project.\r\n   - Microsoft.EntityFrameworkCore.Design version: See [NuGet page](https://www.nuget.org/packages/Microsoft.EntityFrameworkCore.Design/#versions-body-tab) for available versions.\r\n   - Target framework version: See [this reference table](https://learn.microsoft.com/en-us/dotnet/standard/frameworks#supported-target-frameworks) for available versions.\r\n   - Migrations directory. Enter a path relative to location of C# project where DbContext exists. Default value is `Migrations`.\r\n   - DbContext .csproj path: pick the path of C# project that holds your DbContext class.\r\n   - DbContext fully qualified name: this is a full class name of DbContext, for example `MyApp.MyDbContext`.\r\n   - DbContext configuration code: here you need to configure connection string for `dotnet-ef` to work. See [explanation below](#dbcontext-configuration-code). \r\n4. Save profile.\r\n\r\n### DbContext configuration code\r\n\r\n`optionsBuilder` variable of type `DbContextBuilder\u003cTYourDbContext\u003e` is defined and you are expected to configure connection string using C# syntax.\r\n\r\nPostgres example\r\n```csharp\r\nvar connectionString = \"Host=myserver;Username=mylogin;Password=mypass;Database=mydatabase\";\r\noptionsBuilder.UseNpgsql(connectionString);\r\n```\r\n\r\nMySQL example\r\n```csharp\r\nvar connectionString = \"server=localhost;user=myuser;password=mypassword;database=mydb;\";\r\nvar serverVersion = ServerVersion.AutoDetect(connectionString);\r\noptionsBuilder.UseMySql(connectionString, serverVersion);\r\n```\r\n\r\n## Usage\r\nYou can invoke one of the following actions:\r\n- Create a new migration. Specify its name beforehand and click `[+]` button on the right.\r\n- General actions:\r\n  - List migrations. This action does nothing but lists already existing migrations.\r\n  - Generate migration script. This action opens default text editor with SQL code of all migrations for you to review.\r\n  - Generate optimized model.\r\n- Last migration actions:\r\n  - Remove from code. This action removes most recent migration from **the code**. Nothing will happen on the actual database. Will fail if the migration is already applied on database - in that case, use \"Generate rollback script\" action first.\r\n  - Generate apply script. This actions generates SQL script of last migration for you to review and manually apply.\r\n  - Generate rollback script. This action generates SQL script that rolls back last migration for you to review and manually apply.\r\n\r\n\r\n## Other screenshots\r\n\r\n#### Profile configuration\r\n![alt text](images/profile-settings.png)\r\n\r\n#### Migration script output\r\n![alt text](images/migration-script.png)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstil%2Fefmig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstil%2Fefmig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstil%2Fefmig/lists"}