Example #1
0
 public override string DropForeignKey(ForeignKey foreignKey) {
     var sql = new StringBuilder("alter table ");
     this.AppendQuotedTableName(sql, foreignKey.ChildColumn.Map);
     sql.Append(" drop foreign key ");
     this.AppendQuotedName(sql, foreignKey.Name);
     return sql.ToString();
 }
Example #2
0
 private string CreateForeignKey(ForeignKey foreignKey) {
     var sql = new StringBuilder();
     sql.Append("alter table ");
     this.dialect.AppendQuotedTableName(sql, foreignKey.ChildColumn.Map);
     sql.Append(" add constraint ").Append(foreignKey.Name).Append(" foreign key (");
     this.dialect.AppendQuotedName(sql, foreignKey.ChildColumn.DbName);
     sql.Append(") references ");
     this.dialect.AppendQuotedTableName(sql, foreignKey.ParentMap);
     sql.Append("(");
     this.dialect.AppendQuotedName(sql, foreignKey.ParentMap.PrimaryKey.DbName);
     sql.Append(")");
     return sql.ToString();
 }
Example #3
0
 public override string DropForeignKey(ForeignKey foreignKey) {
     throw new InvalidOperationException("There is no Ansi-SQL way of dropping a foreign key.");
 }
Example #4
0
 public abstract string DropForeignKey(ForeignKey foreignKey);
Example #5
0
 public string DropForeignKey(ForeignKey foreignKey) {
     return this.dialect.DropForeignKey(foreignKey);
 }
Example #6
0
 public override string DropForeignKey(ForeignKey foreignKey) {
     throw new System.NotImplementedException();
 }
Example #7
0
 public override string CreateForeignKey(ForeignKey foreignKey) {
     return string.Empty; // Not supported yet - needs to drop and recreate tables etc
 }