Most voted "migrations" questions
Migrations allows you, who already work with Codefirst, to generate manageable updates in your database, or if you prefer, let Migrations itself take care of everything automatically, keeping your database always up to date with your classes.
Learn more…102 questions
Sort by count of
-
1
votes1
answer366
viewsError in running update-database Migration
I am trying to run the creation of my database, but I am getting this error below and am not understanding the reason: The type 'Client' cannot be Mapped as defined because it maps inherited…
-
1
votes0
answers186
viewsPython with Django is giving problem when migrating a model
C: Python programs mysite>python Manage.py makemigrations polls Traceback (Most recent call last): File "Manage.py", line 22, in execute_from_command_line(sys.argv) File "C: Python27 lib…
-
1
votes1
answer325
viewsEntity Framework 6 - Migrations - Add c column/ default value and name Constraint
I want to add a column like BIT to an existing table with a default value 1 via Migrations. The challenge is...we have in the company a standard for the name of constraints and it is not legal the…
-
1
votes1
answer237
viewsFK error while running Migrations on C#
I have the following scenario public class branch() { public Branch() { Branchs = new HashSet<Branch>(); } [StringLength(80)] public string Description { get; set; } [Required]…
-
1
votes0
answers246
viewsMigration with multiple banks in Laravel
I am trying to create a Migration that has a foreign key referencing the id of a table from another database, both Mysql. Follows the code: //config/database.php 'mysql' => [ 'driver' =>…
-
1
votes1
answer27
viewsMigrations adds the letter S in the table name
I have a model: public class pimentel { [Key] public int id { get; set; } public string cod_item_Crm { get; set; } public string tag { get; set; } public string data_anal { get; set; } public string…
-
1
votes1
answer59
viewsLaravel 5.4 Migrations?
I’m learning Laravel 5.4, when I will create a related table one to one is not creating the foreign key, but creates tables normally. My Migrations: <?php use Illuminate\Support\Facades\Schema;…
-
1
votes1
answer169
viewsError While Running Migrations
Friends, I have two entities Deliveryfee and City, where Deliveryfee has a FK from City, when I went to withdraw the relationship between the two and ran the Migration he returned me the following…
c# asp.net-mvc entity-framework asp.net-web-api migrationsasked 7 years, 1 month ago Thiago Ubiratan 353 -
1
votes1
answer72
viewsMigrations Asp Net MVC
I did a project first feeding my application ASP.Net MVC by an SQL Server database that I have uploaded to the web.config file (connectionString). Then, following some courses I did, I started using…
-
1
votes1
answer216
viewsDDD + Entityframework + Migrations + SQL Server
Hello, I have a Solution that I am implementing the DDD architecture with Entityframework, Migrations and SQL Server! However I am not able to connect to my local database when performing the…
-
1
votes2
answers65
viewsWhen placing a class in Dbset using Migrations
I have the following classes: public DbSet<Request> Requests { get; set; } public DbSet<Answer> Answers { get; set; } where they have a one-to-Many relationship. When I want a class to…
-
1
votes1
answer121
viewsError using add-Migration command. Using json as configuration file
Good morning! When performing the add-Migration command, to make the migrations, I am receiving the error sequinte: Add-Migration : Exception calling "AddFromFile" with "1" argument(s) : "'basePath'…
-
1
votes1
answer118
viewsMap a table and enable Auto-increment of a FK field in Postgre using EF Core and Fluent Api
I am unable to activate the Auto_increment of the Contactotype field in Postgre. In the table mapping I specified the "Valuegeneratedonadd" resource, but when I update the database with Migrations,…
entity-framework asp.net-core migrations fluent-api entity-framework-coreasked 6 years, 3 months ago Master JR 1,853 -
1
votes1
answer459
viewsEntity Framework Migrations on an already installed system, how to run?
A C# Winforms application, with the Entity Framework that accesses data in SQL Server in development phase we use Migrations to make the database according to our model, but then with the system…
-
1
votes2
answers45
viewsPlan properties in a single table
Consider the following classes: public class Pessoa { public int Id { get; set; } public string Nome { get; set; } public Telefone Telefone { get; set; } } public class Telefone { public string…
-
1
votes1
answer1155
viewsProblem running Migrations on Laravel
I am trying to run the Migrations on the Windows and bumped into the following error, do not know if and connection to the database what can be Illuminate\Database\QueryException : SQLSTATE[HY000]…
-
1
votes2
answers1062
viewsAdd-Migration does not work on EF Core 3
good afternoon. When trying to generate an initial Migration to create the database structure, I get the following error: "Unable to create an Object of type 'Meudbcontext'. For the Different…
c# visual-studio asp.net-core entity-framework-core migrationsasked 4 years, 10 months ago Marcos Reis 21 -
1
votes0
answers39
viewsIs it possible for an entity to have 2 N-to-N relationships using Entity Framework?
I have 2 models: Cliente and Empresa, which need to have registered addresses. I created another template called Endereço to make the relationships N for N, in which it stayed this way: public class…
-
0
votes1
answer124
viewsInsertion 1 for many is recording two records in the database
I have the following classes: Usuario, Noticia, Bloco and Editoria. I had a relationship One to Many between the tables Noticia and Editoria, Noticia and Bloco. It works perfectly, by putting the…
-
0
votes1
answer1150
viewsMigration change only the default value of a field - Laravel
I want to launch a migration that updates only the default value of a field, I tried it as follows : $table->string('mikrotik_rate_limit')->default('1048576/1048576');…
-
0
votes1
answer352
viewsError trying to recreate a table with code first(Migration)
I’m following Eduardo Pires' tutorial on DDD + Asp.Net MVC 5 + Ioc and so on. Well, in the first attempt to create the bank and the client table, it was a gem. It turns out, Eduardo made some…
-
0
votes1
answer131
viewsMigrate: Is it possible to change a table to add a column and already pass some value to it (excluding the nullable() option)?
for example I have the student table (name, age); Then I create a Migration to add the genus (M/F) Schema::table('estudantes', function (Blueprint $table) {…
-
0
votes1
answer220
viewsEmpty generated migration after Scaffolding
I’m studying ASP.NET MVC5, so I created a model called RelatorioTagModels: public class RelatorioTagModels { [Key] public int TagID { get; set; } [Required] public decimal Tag { get; set; }…
-
0
votes1
answer290
viewsSequelize Migrate - Error: Typeerror: defineCall is not a Function
Hello I’m doing a simple championship API, I used the Sequelize as ORM for my database. I created the Arbitro table that had only the NAME field and did not have the CPF field in the table. I had to…
node.js postgresql migrations sequelize-jsasked 7 years, 6 months ago Leonardo Nascimento Cintra 175 -
0
votes1
answer26
viewsGenerating Script and saving to a specific folder?
Looking at an example of how Generate SQL scripts. So I executed the following command: PM> Script-Migration The above command works fine, however I want to save in a specific folder, I tried…
-
0
votes1
answer618
viewsHow to perform a Migration in Laravel, without excluding the other tables
I’m new to both Laravel and Stack, recently I’m building a system and in the process I forgot to put a Migration. Usually I put the remote php artisan migrate:refresh, however all the data that were…
-
0
votes1
answer36
viewsMigrations Entityframework C#
Error while performing Migrations. The ADO.NET Provider with invariant name 'Sqlclient' is either not Registered in the machine or application config file, or could not be Loaded. See the Inner…
-
0
votes1
answer75
viewsEF 6 - Migrations does not reflect changes in entities
I changed my entities and I turned the command Update-Database -Verbose -Script only to see in SQL what changes would be made. Generated the legal script with all changes. I closed the script window…
-
0
votes1
answer305
viewsQuestions about relationships in Rails "field must exists"
Good morning, I started studying Rails recently and whenever I will define the relationships between the entities in my database arise some doubts. The first time, I created and defined…
-
0
votes0
answers8
viewsHow to run Cakephp Migrations ONLY in my development environment?
I am working on a project that has three different environments: Live (project in production) Staging Development I created a Migration that creates the table teste, however, instead of creating in…
-
0
votes1
answer20
viewsMigrations from my Django app are not applied
I created the models.py file in my app, created all the models, added appConfig to INSTALLED_APPS but when I use the manage.py migrate myapp it does not make any changes to the mysql database: Can…
-
0
votes1
answer178
viewsHow to ignore Django.contrib.auth Migrations?
I have a Django application where I intend to customise the authentication part. I’ve already made my own Backend of authentication, as well as configuring my own Model that will be used in…
-
0
votes1
answer392
viewsHow to make Foreign Keys using Migrations Laravel
I’m trying to relate one field to another using Migrations this way: But when doing foreign key in Migrations this way: Migration Permission: Schema::create('permissions', function (Blueprint…
-
0
votes1
answer215
views(Localdb) Error after Update-Database command -> "Cannot attach the file ...."
I am trying to use Sql Serve Localdb in an application with Entity Framework and Migrations, but when I give the Update-Database command, the following error occurs: Cannot attach the file 'C:…
c# .net entity-framework entity-framework-6 migrationsasked 6 years, 3 months ago Márcio Sebastião 769 -
0
votes1
answer192
viewsProblems with Migration
I’m developing an application using DDD architecture. In my Infra layer, I have my data models, all based on Code First. I’m trying to use the Mysql as database. I have installed everything that was…
-
0
votes0
answers41
viewsMigration does not run on EF Core 2.0
When Perform Add-Migration Init no message is shown and Migration is not performed and the prompt is in the state again PM> I checked that you are taking Entityframeworkcore.Tools 2.0.3 instead…
-
0
votes1
answer24
viewsLambda in related classes (EF Migrations)
It’s been a while since I’ve dealt with FE so I doubt it. Have the classes Product and Producthow much and need to make an inquiry in the products with quantity equal to 10; I tried to: var retorno…
-
0
votes1
answer484
viewsHow to resolve lambda expression conversion error of type Servicelifetime net core?
I am starting a very simple project with net core 2.2 and confronted myself with the following error: Cannot convert lambda expression to "Servicelifetime" type because it is not a delegated type…
-
0
votes4
answers274
viewsI’m not able to create the relationship between the tables through the migrations of Laravel
I am using the Multi Tenancy in Laravel, so I created the Migrations, without relationship between table was working normal, when I related that started the error. I thought it was the execution…
-
0
votes1
answer174
viewsHow to properly configure db-migrate nodejs? Error in database.json
I’m trying to use db-migrate but I’m getting the answer, when running db-migrate up, the mistake: [ERROR] TypeError: Cannot read property '1' of null at Class.parseName…
-
0
votes1
answer139
viewsRun Artisan Migrate in dynamic banks
Hail, hail people! I have a problem in a project with multiple databases, each database corresponds to a user that is created when the user confirms their registration. I created a specific command…
-
0
votes1
answer591
viewsmkConfigObj Knex error
I’m creating an Migration from the Knex, but when I run the command npx knex migrate:latest --knexfile knexfile.ts migrate:latest I get the following error: No Configuration file found and no…
-
0
votes1
answer310
viewsMigrations of Manytomany relations on Typeorm using Queryrunner
It is possible to create the SQL of an Migration automatically, through the CLI command migration:generate -n MigrationName? However, it is possible to create Migrations from Migration API, more…
-
0
votes1
answer39
viewsError while running migrate
Schema::create('filiais', function (Blueprint $table) { $table->id(); $table->string('filial', 30); $table->timestamps(); }); Schema::create('produto_filiais', function (Blueprint $table) {…
-
-1
votes1
answer303
viewsProblem when migrating with Python and Django: no such column: forum_thread.Slug
I have this problem in my code: OperationalError at /admin/forum/thread/ no such column: forum_thread.slug I’ve tried to make a million changes and I couldn’t. When I turn the command python…
-
-1
votes1
answer343
viewsHow to perform an auto-update on a local web system?
Talk, you guys, blz? I have developed a web system (in Codeigniter) for a customer and the same runs on a local machine inside your office. Whenever I need to update the system, I perform the…
-
-1
votes1
answer173
viewsAssociative table in Laravel 5.8 (Migrate)
I am making a system for a school in the automotive sector that offers courses, this system the user will be able to register the courses and view them, in general, will be a panel for him to…
-
-1
votes1
answer160
viewsBuild failed. - error creating migration
Good afternoon. I am starting a web project that is generating an error using the command: "dotnet Ef database drop" I used at the end of the -v command to generate a complete message. Error…
c# visual-studio-code entity-framework-core migrations dotnet-cliasked 4 years, 10 months ago Allan Alencar 1 -
-1
votes1
answer33
viewsHow to add a new table 1:N (one for many) in an existing database via Migration Laravel?
Hello! I need to add a new table in an existing comic. I use the Laravel Framework and I would like to do this via Migration, but every time I try it makes a mistake and I don’t know what I might be…
-
-1
votes1
answer124
viewsSequelize GEOMETRY type field
Hello, I wanted to create a table using Migrations with sequelize, and create a position field of type GEOMETRY. The bank I’m using is the postgres. I tried that code: 'use strict'; module.exports =…