Questions tagged as 'migrations'

0
answers

Composite key in laravel migrate

I would like to create a double primary key with an auto increment field "id" and "id_lement_time", but it gives error and I do not know the correct way to do it, if someone can help me, I would appreciate it! > Migrate Schema::create('disci...
asked by 18.05.2018 / 00:44
1
answer

Configuration many to many code fast migration

Good afternoon! I have this many-to-many configuration in my project. public class Usuario { public Usuario() { this.LocalTrabalho = new HashSet<LocalAtendimento>(); } public virtual ICollection<LocalAtendim...
asked by 30.09.2017 / 17:37
2
answers

Default registry if you have no other - mysql

Is it possible to program the database so that there is a default record if there is no other one in the table? making the table impossible to be empty. So if you have other records, it ignores the default, if you do not have any, use the def...
asked by 26.02.2016 / 15:00
1
answer

error Migrations C # MVC

I created a Financial Controller, but when I click on the menu to list it returns the error:    Invalid object name 'dbo.Movimentacaos'. Why did you get this name? It was meant to be Movimentacoes . PS: I already added in my cont...
asked by 15.06.2016 / 05:00
2
answers

Problem to execute "Update-Database"

I'm following the tutorial for this video to set up an ASP.NET MVC project using EntityFramework6. The database used in the tutorial is SQLServer and what I'm trying to use is MySQL. I already have the MySQL Connector installed. I was ab...
asked by 09.07.2015 / 04:09
1
answer

Error in FK when running Migrations in C #

I have the following scenario public class branch() { public Branch() { Branchs = new HashSet<Branch>(); } [StringLength(80)] public string Description { get; set; } [Required] [ForeignKey("TypeDeliv...
asked by 19.06.2017 / 18:58
1
answer

Migrations adds the letter S to 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 modelo { get; set; }...
asked by 24.07.2017 / 19:12
1
answer

Entity Framework 6 - Migrations - Add column with default value and name constraint

I want to add a column of type BIT to an existing table with a default value of 1 via migrations. The challenge is ... we have in the company a default for the name of constraints and it is not legal the name automatically c...
asked by 26.05.2017 / 21:02
1
answer

Error in running update-database migration

I'm trying to run the creation of my database, but I'm getting this error below and I'm not understanding why:    The type 'Client' can not be mapped as defined because it maps inherited properties from types that use entity splitting or anot...
asked by 24.02.2017 / 21:42
1
answer

Migration on multiple tables with the same prefix

Is it possible with laravel to generate a migration that changes multiple tables with the same prefix? for example: in tables pesquisas_187 and pesquisas_146 (tables that have the same fields) Schema::table('pesquisas_', function...
asked by 02.03.2017 / 20:31