All Projects → pekspro → EF-Migrations-Script-Generator-Task

pekspro / EF-Migrations-Script-Generator-Task

Licence: other
No description or website provided.

Programming Languages

C#
18002 projects
HTML
75241 projects
typescript
32286 projects
CSS
56736 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to EF-Migrations-Script-Generator-Task

html-pipeline
HTML processing filters and utilities in Go version
Stars: ✭ 18 (-10%)
Mutual labels:  pipeline
nanoflow
🔬 De novo assembly of nanopore reads using nextflow
Stars: ✭ 20 (+0%)
Mutual labels:  pipeline
predict-fraud-using-auto-ai
Use AutoAI to detect fraud
Stars: ✭ 27 (+35%)
Mutual labels:  pipeline
SalmonTE
SalmonTE is an ultra-Fast and Scalable Quantification Pipeline of Transpose Element (TE) Abundances
Stars: ✭ 63 (+215%)
Mutual labels:  pipeline
lightflow
A lightweight, distributed workflow system
Stars: ✭ 67 (+235%)
Mutual labels:  pipeline
TDAstats
R pipeline for computing persistent homology in topological data analysis. See https://doi.org/10.21105/joss.00860 for more details.
Stars: ✭ 26 (+30%)
Mutual labels:  pipeline
jenkins-terraform-pipeline
create a jenkins pipeline which uses terraform to manage AWS resources
Stars: ✭ 17 (-15%)
Mutual labels:  pipeline
howtheydevops
A curated collection of publicly available resources on how companies around the world practice DevOps
Stars: ✭ 318 (+1490%)
Mutual labels:  pipeline
Ramses
The Rx Asset Management System for motion picture production
Stars: ✭ 48 (+140%)
Mutual labels:  pipeline
TOGGLE
Toolbox for generic NGS analyses - A framework to quickly build pipelines and to perform large-scale NGS analysis
Stars: ✭ 18 (-10%)
Mutual labels:  pipeline
LazyEntityGraph
LazyEntityGraph is an open source library for .NET which lets you generate object graphs with circular dependencies, such as those found in ORMs, by lazily generating relationship properties.
Stars: ✭ 23 (+15%)
Mutual labels:  entity-framework
IARC-nf
List of IARC bioinformatics nextflow pipelines
Stars: ✭ 34 (+70%)
Mutual labels:  pipeline
tfa
tfa is a 2fa cli tool that aims to help you to generate 2fa code on CI/CD pipelines.
Stars: ✭ 25 (+25%)
Mutual labels:  pipeline
httpit
A rapid http(s) benchmark tool written in Go
Stars: ✭ 156 (+680%)
Mutual labels:  pipeline
flow-platform-x
Continuous Integration Platform
Stars: ✭ 21 (+5%)
Mutual labels:  pipeline
LabPype
Framework for Creating Pipeline Software
Stars: ✭ 18 (-10%)
Mutual labels:  pipeline
lines
A pure bash clojureish CI pipeline
Stars: ✭ 72 (+260%)
Mutual labels:  pipeline
sagemaker-sparkml-serving-container
This code is used to build & run a Docker container for performing predictions against a Spark ML Pipeline.
Stars: ✭ 44 (+120%)
Mutual labels:  pipeline
classification
Catalyst.Classification
Stars: ✭ 35 (+75%)
Mutual labels:  pipeline
node-express-azure
Node & Express Demo App for Azure DevOps
Stars: ✭ 31 (+55%)
Mutual labels:  pipeline

Entity Framework Core Migrations Script Generator

Entity Framework Core Migrations Script Generator is a very simple extension to make it easy to generate migration script for projects using Entity Framework Core with Code-First. This tool internally calls dotnet ef migrations script.

This tool can be installed from Visual Studio Marketplace.

How to generate migration scripts

With this task it's very easy to generate migration scripts:

  • Add Entity Framework Core Migrations Script Generator task to your build pipeline.
  • Select the project where the database project.
  • Enter the names of the database contexts.
  • If your database context is defined in a library, you also need to select an executable project that is using this library as start-up project.
  • You could also change the directory where the migrations scripts should be stored. By default they are stored in a folder named migrations.
  • If you are using .NET Core 3, you could enable Install dependencies for .NET Core 3 to auto install the global tool dotnet-ef.
  • If you are using .NET Core 2, you may be able to build your application but you get an error when creating migration scripts. If that's the case you're probably using .NET Core 3 SDK which doesn't have built-in support to do this. To solve this, just add Use .NET Core before this task and select version 2.2.207 for instance.

When the build is completed you should have migrations scripts stored in the package. They named {{NameOfTheDatabaseContext}}.sql. Under most circumstances it's safe to run these migrations on every release even if you haven't done any changes.

How to apply migrations to your databases

When you have your migration scripts ready you just need to apply them in a release pipeline. If you have your databases in Azure you could to like this:

  • Add the task Azure SQL Database Deployment to your release pipeline.
  • Enter the details of your database.
  • In the option SQL Script select the migration script from the package.

If you have several databases, add a new task for each database.

Supported versions

Both .NET Core 2 and .NET Core 3 with Entity Framework 2 and 3 and 3.1 is supported. That said, if you are using .NET Core 3.x this tool requires that the global tool dotnet-ef is installed. You could do this easily be enable Install dependencies for .NET Core 3.

If you are using .NET Core 2, you may be able to build your application but you get an error when creating migration scripts. If that's the case you probably are using .NET Core 3 SDK which doesn't have build-in support to do this. To solve this, just add Use .NET Core before this task and select version 2.2.207 for instance.

Notes about the source

In the folder efcore-migration-task the complete source is for this project.

The folder NetCoreTestApplication contains a test project with two database contexts that could be used for generating migration scripts.

How to make changes

Changes are hopefully never needed :-) But if the logic need to be changes index.ts should be modified. If the UI need to be changed task.json should be updated.

How to test changes

There are some commands that are good to know to test the extension locally. These should be executed in the folder efcore-migration-task/efcore-migration-script-generator

This compiles the typescript file index.ts typescript file into index.js:

tsc

These commands setup environment variables for a scenario where the database context is defined in the executable project. These are used for setting input values for the script.

$env:INPUT_PROJECTPATH="C:/Users/msn/Source/Repos/EF-Migrations-Script-Generator-Task/NetCoreTestApplication/NetCoreTestApplication/NetCoreTestApplication.csproj"
$env:INPUT_TARGETFOLDER="c:/temp"
$env:INPUT_DATABASECONTEXTS="FirstDatabaseContext`nSecondDatabaseContext"

These commands setup environment variables for a scenario where the database context is defined in a library instead of the executable project:

$env:INPUT_PROJECTPATH="C:/Users/msn/Source/Repos/EF-Migrations-Script-Generator-Task/NetCoreTestApplication/NetCoreTestLibrary/NetCoreTestLibrary.csproj"
$env:INPUT_STARTUPPROJECTPATH="C:/Users/msn/Source/Repos/EF-Migrations-Script-Generator-Task/NetCoreTestApplication/NetCoreTestApplication/NetCoreTestApplication.csproj"
$env:INPUT_TARGETFOLDER="c:/temp"
$env:INPUT_DATABASECONTEXTS="LibraryDatabaseContext`nInternalLibraryDatabaseContext"

This executes the script.

node index.js

How to create a new release

To create a new release one single command is needed to create a vsix-file. This should be executed in the efcore-migration-task directory:

tfx extension create

Build and test status

Build:

Build status

Test migration Windows .NET Core 2:

Build status

Test migration Windows .NET Core 3.0:

Build status

Test migration Windows .NET Core 3.1:

Build Status

Test migration Windows .NET Core 5:

Build Status

Test migration Windows .NET Core 6:

Build Status

Test migration Linux .NET Core 2:

Build status

Test migration Linux .NET Core 3.0:

Build status

Test migration Linux .NET Core 3.1:

Build Status

Test migration Linux .NET Core 5:

Build Status

Test migration Linux .NET Core 6:

Build Status

References

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].