230 questions
0
votes
0
answers
49
views
Different tool to generate codefirst migration. Time to clean up and refactor
I've inherited a non-complete clean solution from the point of view of CodeFist on a .NET 7 project.
The scenario is the following:
I had an old part of the Codebase that used EF Code first migration
...
0
votes
0
answers
41
views
Fluentmigrator how test if a user defined function (UDF) exists?
Is it possible, using FluentMigrator, to verify if a user defined function (UDF) exists before creating it?
I'm using version 3.2.9 and SQL Server
1
vote
0
answers
177
views
FluentMigrator issue with net8 AOT on MAUI for iOS
We've been using FluentMigrator with Xamarin but now with net8-ios and with the new AOT compiler, seems like inclusion of all the runners in FluentRunner.Runner nuget package is causing AOT step to ...
-1
votes
1
answer
300
views
Autofac Unable to resolve service for type 'log4net.ILog'
I have ASP.NET MVC app which was working fine but once I upgraded Autofac and did the change for Log4Net middleware example it keeps failling if I try to Resolve ILog.
We use FluentMigrator and I am ...
0
votes
1
answer
177
views
Fluent Migrator - Method is not supported by the connectionless processor
Never seen this error before and not sure what it's referring to. We just changed the instance of Oracle we are using and our existing code which was working for years and looks like this:
[...
0
votes
1
answer
289
views
The FluentMigrator throws when want to migrate due to wrong assembly binding
I use FluentMigrator in NET7 and wanted to migrate my migrations. I use the:
dotnet tool install -g FluentMigrator.DotNet.Cli
And I have ran command:
dotnet fm migrate -a Conversations.API.dll -p ...
2
votes
1
answer
176
views
EF Core IEntityTypeConfigurations: Related object is null after drawing data from DB
I am using IEntityTypeConfigurations and FluentMigrator migrations for my data access setup. Generally I thought I had a basic understanding of configuring entities and tables for relations to work ...
0
votes
2
answers
640
views
Run FluentMigrator for one specific migration only
We are using FluentMigrator with C# to run our database changes and we don't use any tag as we have simple solution, so all our migrations are without any tags.
I know it seems not common, but I hope ...
2
votes
1
answer
631
views
How to determine current version from VersionInfo for Fluent Migrator?
I am using Fluent Migrator in .NET 6.
I know that Fluent Migrator looks at VersionInfo table to determine which migrations need to be applied when we migrate down or up.
For example, we can do runner....
0
votes
1
answer
190
views
How to auto-generate unique_rowId with Fluent Migrator in CockroachDB?
I'm using Fluent Migrator in NET 6.
I'm trying to set an unique_rowId to an int64 column. On cockroach DB, I would use
Create table x (version INT NOT NULL DEFAULT unique_rowid())
With fluent ...
2
votes
1
answer
443
views
Add computed column with fluent migrator
I've got a table that has a JSON content property. I wish to extract with a computed column a value I'm sure it's inside that field. I've used it in the past json_value. How can I define a computed ...
1
vote
2
answers
564
views
How to create a PostgreSQL table with column of type array using Fluentmigrator in C#
I might be overlooking something simple, I'm pretty novice with Fluentmigrator, but is it possible to create a table, using Fluentmigrator in C# code, that has a column of type array such as TEXT []?
...
0
votes
1
answer
716
views
Fluent migrator throws timout exception
I using Fluent migrator 3.3.2, which throws error on one of databases:
The error was Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not ...
0
votes
0
answers
722
views
What is the best way to write a stored procedure with FluentMigrator
[Migration(1)]
public class TestCreateUserTable : Migration
{
public override void Up()
{
Execute.Script("myscriptUP.sql");
Execute.EmbeddedScript("myscriptUP....
0
votes
0
answers
67
views
Table attribute with FluentMigrator C#
I am trying to create a table that contains a VARBINARY(MAX) column with the FILESTREAM attribute. I don't know how to achieve that. Can you please help.
Documentation Pages You've Read So Far
...
0
votes
0
answers
127
views
NHibernate session.saveOrUpdate takes a long time
I have the below mapping of data, everything is mapped correctly for each mode
public DataMap()
{
Id(x => x.Id).GeneratedBy.Identity().UnsavedValue(0);
Map(x => x.Name).Not....
2
votes
1
answer
966
views
How to create Postgres table with Identity as GENERATED ALWAYS using Fluent Migrator?
My Fluent migrator code :
Create.Table("Players")
.WithColumn("Id" ).AsInt32().NotNullable().PrimaryKey().Identity()
.WithColumn("FirstName").AsString();
...
2
votes
1
answer
380
views
FluentMigrator: How to support fluent migrator for multiple database with same schema
We have a multi-tenant architecture design with multiple databases with the same schema and We are using .net core 3.1 for the migration project.
I'd like to run fluent migration on all the databases. ...
1
vote
0
answers
280
views
Insert dependent Values with Fluent Migrator and EF Core HiLo
I have the following table:
public class Category
{
public int Id{ get; set; }
public string Name { get; set; }
public int? ParentId { get; set; }
public Category Parent { get; set; ...
1
vote
1
answer
2k
views
Fluentmigrator in database schema
I use Fluentmigrator in my Visual Studio project to version and migrate a single MS SQL Server database.
Within that db, there are multiple customer dedicated database schemas,
and wish to migrate ...
0
votes
1
answer
1k
views
FluentMigrator - Check if column exists cross database
I'm using FluentMigrator to migrate multiple databases to different schemas.
How can I check if a column exists in a table in another database?
public override void Up()
{
//this line by default ...
0
votes
0
answers
72
views
FluentMigrator updated 1.2.1 to 3.3.1
I have this TableExtensions static class that I am using fine with FluentMigrator 1.2.1 now I updated the package to 3.3.1 and getting this error. I dont know that this error means a requires a ...
0
votes
1
answer
1k
views
FluentMigrator with EF Core and Azure Managed Identity
On my current project (.NET 5, ASP.NET Core), we're using FluentMigrator for running EF Core migrations which works flawlessly. We're in the process of setting up our infrastructure in Azure to ...
1
vote
0
answers
176
views
Database Migration Library which supports multiple database types
I am trying to enable support for multiple database types in our application developed in ASP.NET Core.
For the ORM layer, we are using EF Core.
Hence using EF Core Migrations seems to be a natural ...
0
votes
0
answers
1k
views
Migration exception - could not create unique index
I have a schema for customer is as following:
CREATE TABLE dbo.customer
(
id uuid NOT NULL,
id_number integer NOT NULL,
name character varying(128),
cust_group uuid NOT NULL,
...
0
votes
1
answer
469
views
Deploy DB with FluentMigrator
How to create first deployment DB with FluentMigrator to my local SQL2014? I have project in .NET 4.6.1.
I expect command like Update-Database, but no. What is the right way?
1
vote
2
answers
710
views
While altering column with type time to timestamp using FluentMigrator I faced error
I want to alter a column with type time to timestamp using FluentMigrator
here is my code
this.Alter.Table(Tables.Events.Name)
.InSchema(Tables.DefaultSchemaName)
.AlterColumn(Tables.Events....
2
votes
2
answers
2k
views
FluentMigrator - how does it know which migration to execute
How does FluentMigrator know what migrations to execute / migrate when you start up the application?
Example: I got two migrations already performed (1 and 2). Now I create a third migration and give ...
1
vote
1
answer
1k
views
How to get last inserted id in FluentMigrator
I'm using FluentMigrator with MySql and C#.
[Migration(3)]
public class _0003_TestMigrationTI : Migration
{
public override void Up()
{
Insert.IntoTable("cmn_file_types").Row(...
0
votes
1
answer
476
views
FluentMigrator - add column to every table in loop
I'm trying to create code that adds column 'ExternalId' to almost every table in foreach loop with some exceptions. If table schema name equals "Scheduler" or table name starts with "...
2
votes
1
answer
1k
views
How do I direct log output to a file, using a FluentMigrator v3.2.15 In-Process runner?
I have a .NET 4.5.2 migration runner built using FluentMigrator 2.0.7 that "m trying to move to .NET 5.0 and FluentMigrator 3.2.15.
My current difficulty is writing the output to a text file.
var ...
5
votes
1
answer
3k
views
Convert SQL expression to create index using Fluentmigrator
I have an application in .Net Core 3.1 using a SQL Server DB, where I have this SQL expression that I want to "convert" to a fluent migrator expression, but I'm not sure about how to do it.
...
0
votes
1
answer
883
views
Fluent Migrator created table Version Info in wrong DB
When I connected to SQL Server, Fluent Migrator creates a Version Info table in the master database, but I create the database myself with a SQL script, then the app drops because it can't find the ...
1
vote
1
answer
416
views
How to build, deploy and execute dotnet library on Heroku
I have .net core 2.1 project library which executes db migrations (using the fluentmigrator). What is the simplest method to to execute this library once I push my code changes (migrations) to github ...
0
votes
1
answer
1k
views
Get content of pending migrations using FluentMigrator
I have console app that uses FluentMigrator migrations, but now I need to implement user confirmation before actual migration process. I got into repo sources, found out about version loader and how ...
1
vote
0
answers
786
views
FluentMigrator update columns where value is not null
I want to update columns where values are not null. I can find values that are null in my database like that:
Update.Table("someTable").InSchema("schema")
.Set(new {...
0
votes
1
answer
1k
views
Delete a column using FluentMigrator
I want to delete a column from a table using FluenMigrator ver.3.2.6.0. I saw that this question is already asked here some years ago but the solution doesn't fit for me because looks like the method ...
1
vote
2
answers
182
views
Create expression dynamically
Using FluentMigrator when i want to insert data into table i must use syntax like that:
Insert.IntoTable(table).InSchema(shcema).Row().Row(obj1).Row(obj2).Row(obj3)... // and so on
My question is, ...
2
votes
1
answer
1k
views
NotMapped and AsNoTracking equivalent in FluentMigrator
What's the equivalent of NotMapped attribute and AsNoTracking method in Fluent Migrator .Net ORM. I'm migrating one of my project which used EF6 as ORM to Fluent Migrator. I google a lot regarding ...
0
votes
1
answer
216
views
Fluent NHibernate Mapping Doesn't Work For Some Tables
I'm using Fluent Migrator and Fluent NHibernate in the same project but when I launch queries using Database.Session.Query<ENTITY>().** some return data and some don't. I can't tell where I'm ...
3
votes
1
answer
2k
views
FluentMigrator: How to set default schema for MigrationRunner
I have a multi-tenanted database. The tenant-specific data is stored inside it's own (PostgreSQL) schema.
I'd like to be able to use FluentMigrator to deploy new tenants as required. I've set up an ...
3
votes
2
answers
2k
views
How to update value to null using FluentMigrator
How can I update all rows to null using FluentMigrator fluent syntax? You cannot assign null to anonymous type property.
Update.Table("mytable").Set(new { supplierid = null }).AllRows();
2
votes
1
answer
880
views
Turn postgres db into migrations
I have a database that I have inherited and would like to turn the database itself into migrations that I can use in an ASP.NET Core 3 API. I would like to, if I can, to not have to write the ...
1
vote
1
answer
2k
views
How do build an Azure Devops Pipeline with Fluent Migrator task?
I have been using Fluent Migrator (version 3.2.1) for some time and in my Visual Studio environment I use dotnet-fm to migrate or rollback my migrations. This is all great but now I want to automate ...
1
vote
0
answers
322
views
Getting "Could not load file or assembly 'FSharp.Core, Version=4.7.0.0" for pubished application
I created a F# console application with DB migrations.
When I run the command:
dotnet fm migrate -c "Server=(localdb)\MsSQLLocalDB;Database=Foo;Trusted_Connection=True" -a .\DbMigrations.dll -p ...
0
votes
0
answers
247
views
Insert data into versionInfo
i have added fluentmigration to execute migration with my sql script :
services.AddFluentMigratorCore()
.ConfigureRunner(
builder => builder
...
3
votes
0
answers
503
views
EF Core create database without tables
Is there a ways for EF Core to create the database but not the tables, as all I need is the database to be made, and then run fluent migrator to do the actual migrations?
Many thanks in advance
4
votes
1
answer
2k
views
C# FluentMigrator.Runner console app set transaction per session
I am using FlunetMigrator.Runner.3.2.1 and see that this version no longer defaults to rolling back all migrations is one of them fails. It says they are per migration file! which doesn't add value. ...
1
vote
0
answers
198
views
Does Fluent Migration work with .net core web api's?
I have worked with fluent migrations in the .net framework (with the class library). Can I use fluent migration with .net core as well, especially with '.Net Core Web API's'?
2
votes
1
answer
2k
views
How to force FluentMigrator to run migration even if DB version matches
I use FluentMigrator 3.2.1 & dotnet-fm too to run migrations.
Imagine that I have database versions 1,2,3,4 and so on, classes are marked with
[FluentMigrator.Migration(1, "1")]
[FluentMigrator....