Compartir a través de


MigrationBuilder.AddUniqueConstraint Método

Definición

Sobrecargas

AddUniqueConstraint(String, String, String, String)

Crea un AddUniqueConstraintOperation objeto para agregar una nueva restricción única a una tabla.

AddUniqueConstraint(String, String, String[], String)

Crea un AddUniqueConstraintOperation objeto para agregar una nueva restricción única compuesta (varias columnas) a una tabla.

AddUniqueConstraint(String, String, String, String)

Source:
MigrationBuilder.cs
Source:
MigrationBuilder.cs
Source:
MigrationBuilder.cs
Source:
MigrationBuilder.cs
Source:
MigrationBuilder.cs
Source:
MigrationBuilder.cs
Source:
MigrationBuilder.cs
Source:
MigrationBuilder.cs
Source:
MigrationBuilder.cs

Crea un AddUniqueConstraintOperation objeto para agregar una nueva restricción única a una tabla.

public virtual Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AddUniqueConstraintOperation> AddUniqueConstraint (string name, string table, string column, string schema = default);
public virtual Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AddUniqueConstraintOperation> AddUniqueConstraint (string name, string table, string column, string? schema = default);
abstract member AddUniqueConstraint : string * string * string * string -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AddUniqueConstraintOperation>
override this.AddUniqueConstraint : string * string * string * string -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AddUniqueConstraintOperation>
Public Overridable Function AddUniqueConstraint (name As String, table As String, column As String, Optional schema As String = Nothing) As OperationBuilder(Of AddUniqueConstraintOperation)

Parámetros

name
String

Nombre de la restricción.

table
String

Tabla que contendrá la restricción .

column
String

Columna restringida.

schema
String

Esquema que contiene la tabla o null para usar el esquema predeterminado.

Devoluciones

Generador para permitir que las anotaciones se agreguen a la operación.

Comentarios

Consulte Migraciones de bases de datos para obtener más información y ejemplos.

Se aplica a

AddUniqueConstraint(String, String, String[], String)

Source:
MigrationBuilder.cs
Source:
MigrationBuilder.cs
Source:
MigrationBuilder.cs
Source:
MigrationBuilder.cs
Source:
MigrationBuilder.cs
Source:
MigrationBuilder.cs
Source:
MigrationBuilder.cs
Source:
MigrationBuilder.cs
Source:
MigrationBuilder.cs

Crea un AddUniqueConstraintOperation objeto para agregar una nueva restricción única compuesta (varias columnas) a una tabla.

public virtual Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AddUniqueConstraintOperation> AddUniqueConstraint (string name, string table, string[] columns, string schema = default);
public virtual Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AddUniqueConstraintOperation> AddUniqueConstraint (string name, string table, string[] columns, string? schema = default);
abstract member AddUniqueConstraint : string * string * string[] * string -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AddUniqueConstraintOperation>
override this.AddUniqueConstraint : string * string * string[] * string -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AddUniqueConstraintOperation>
Public Overridable Function AddUniqueConstraint (name As String, table As String, columns As String(), Optional schema As String = Nothing) As OperationBuilder(Of AddUniqueConstraintOperation)

Parámetros

name
String

Nombre de la restricción.

table
String

Tabla que contendrá la restricción .

columns
String[]

Lista ordenada de columnas restringidas.

schema
String

Esquema que contiene la tabla o null para usar el esquema predeterminado.

Devoluciones

Generador para permitir que las anotaciones se agreguen a la operación.

Comentarios

Consulte Migraciones de bases de datos para obtener más información y ejemplos.

Se aplica a