Changeset 4c749d0f0c2e…
Parent ac7862d335c5…
by
Changes to 5 files · Browse files at 4c749d0f0c2e Showing diff from parent ac7862d335c5 Diff from another changeset...
@@ -292,5 +292,15 @@
#endregion
+
+ public override void RemoveConstraint(string constraint, string table)
+ {
+ throw new NotImplementedException();
+ }
+
+ public override void AddUniqueConstraint(string constraint, string table, params string[] columns)
+ {
+ throw new NotImplementedException();
+ }
}
}
|
@@ -282,5 +282,15 @@
#endregion
+
+ public override void RemoveConstraint(string constraint, string table)
+ {
+ throw new NotImplementedException();
+ }
+
+ public override void AddUniqueConstraint(string constraint, string table, params string[] columns)
+ {
+ throw new NotImplementedException();
+ }
}
}
|
@@ -566,5 +566,19 @@ }
}
#endregion
+
+ public override void AddUniqueConstraint(string constraint, string table, params string[] columns)
+ {
+ if (ConstraintExists(constraint, table))
+ throw new ArgumentException("Constraint [" + constraint + "] already exists.", "constraint");
+
+ ExecuteNonQuery("Alter Table {0} Add Constraint {1} Unique ({2})", table, constraint, string.Join(",", columns));
+ }
+
+ public override void RemoveConstraint(string constraint, string table)
+ {
+ if (ConstraintExists(constraint, table))
+ ExecuteNonQuery("Alter Table {0} Drop Constraint {1}", table, constraint);
+ }
}
}
|
@@ -201,18 +201,15 @@ /// <param name="constraint">Name of the Constraint</param>
/// <param name="table">Name of the table to add the constraint to</param>
/// <param name="columns">Columns to constrain to uniqueness</param>
- public void AddUniqueConstraint(string constraint, string table, params string[] columns)
- {
- if (ConstraintExists(constraint, table))
- {
- _logger.Warn("Constraint {0} exists and will be dropped first.", constraint);
- throw new ArgumentException("Constraint [" + constraint + "] already exists.", "constraint");
+ public abstract void AddUniqueConstraint(string constraint, string table, params string[] columns);
-
- } // if (ConstraintExists)
- ExecuteNonQuery("Alter Table {0} ADD CONSTRAINT {1} UNIQUE ({2})", table, constraint, string.Join(",", columns));
-
- } // AddUniqueConstraint(constraint, table, columns)
+ /// <summary>
+ /// Removes an existing constraint from a table
+ /// </summary>
+ /// <param name="table">Name of the table</param>
+ /// <param name="constraint">Name of the Constraint</param>
+ public abstract void RemoveConstraint(string constraint, string table);
+
#endregion
/// <summary>
|
@@ -157,27 +157,37 @@
public override bool ConvertColumn<T, U>(string table, string column, string tempColumn, TransformationProvider.ConvertColumnDelegate<T, U> convertFunc)
{
- throw new Exception("The method or operation is not implemented.");
+ throw new NotImplementedException();
}
public override bool ConvertColumn<T, U>(string table, string column, string tempColumn, TransformationProvider.ConvertColumnDelegate<T, U> convertFunc, int size)
{
- throw new Exception("The method or operation is not implemented.");
+ throw new NotImplementedException();
}
public override bool ConvertColumn<T, U>(string table, string column, string tempColumn, TransformationProvider.ConvertColumnDelegate<T, U> convertFunc, int size, ColumnProperties property)
{
- throw new Exception("The method or operation is not implemented.");
+ throw new NotImplementedException();
}
public override bool ConvertColumn<T, U>(string table, string column, string tempColumn, TransformationProvider.ConvertColumnDelegate<T, U> convertFunc, ColumnProperties property)
{
- throw new Exception("The method or operation is not implemented.");
+ throw new NotImplementedException();
}
public override bool ConvertColumn<T, U>(string table, string column, string tempColumn, TransformationProvider.ConvertColumnDelegate<T, U> convertFunc, int size, object defaultValue, ColumnProperties property)
{
- throw new Exception("The method or operation is not implemented.");
+ throw new NotImplementedException();
+ }
+
+ public override void AddUniqueConstraint(string table, string constraint, params string[] columns)
+ {
+ throw new NotImplementedException();
+ }
+
+ public override void RemoveConstraint(string table, string constraint)
+ {
+ throw new NotImplementedException();
}
}
}
|
Loading...