public static IAddedForeignKey AddDefaultForeignKeyTo(this IExistingTable table, string foreignTable) { return(table.AddForeignKeyTo(foreignTable).Through(ForeginKeyColumnTo(foreignTable), "Id")); }
/// <summary> /// Gets an foreign key constraint by the name of its referenced table. /// </summary> public static IForeignKey ForeignKeyTo(this IExistingTable table, string referencedTableName) { return(table.ForeignKeys[DefaultObjectNameProvider.GetForeignKeyConstraintName(table.TableName, referencedTableName, null)]); }
/// <summary> /// Gets the primary key constraint of the table with the default name. /// </summary> public static IExistingPrimaryKey PrimaryKey(this IExistingTable table) { return(table.PrimaryKey(DefaultObjectNameProvider.GetPrimaryKeyConstraintName(table.TableName, null))); }
/// <summary> /// Gets an unique constraint by the name of its first column. /// </summary> public static IUniqueConstraint UniqueConstraintOf(this IExistingTable table, string firstColumnName) { return(table.UniqueConstraints[DefaultObjectNameProvider.GetUniqueConstraintName(table.TableName, firstColumnName, null)]); }
/// <summary> /// Adds an unique constraint to the table with the default name. /// </summary> public static IAddedUniqueConstraint AddUniqueConstraint(this IExistingTable table) { return(table.AddUniqueConstraint(null)); }
/// <summary> /// Adds a foreign key constraint to another table within the same schema with a default foreign key name. /// </summary> public static IAddedForeignKey AddForeignKeyTo(this IExistingTable table, string referencedTableName) { return(table.AddForeignKeyTo(referencedTableName, null)); }
/// <summary> /// Adds an index to the table. /// </summary> public static IAddedIndex AddIndex(this IExistingTable table) { return(table.AddIndex(null)); }
/// <summary> /// Adds a primary key constraint to the table with the default name. /// </summary> public static IAddedPrimaryKey AddPrimaryKey(this IExistingTable table) { return(table.AddPrimaryKey(null)); }