Esempio n. 1
0
        public virtual IEnumerable<string> Run(CreateForeignKeyCommand command)
        {
            var builder = new StringBuilder();

            builder.Append("alter table ")
                .Append(_dialect.QuoteForTableName(command.SrcTable));

            builder.Append(_dialect.GetAddForeignKeyConstraintString(command.Name,
                command.SrcColumns,
                _dialect.QuoteForTableName(command.DestTable),
                command.DestColumns,
                false));

            yield return builder.ToString();
        }
Esempio n. 2
0
 public override IEnumerable<string> Run(CreateForeignKeyCommand command)
 {
     yield break;
 }
Esempio n. 3
0
 public SchemaBuilder CreateForeignKey(string name, string srcModule, string srcTable, string[] srcColumns, string destModule, string destTable, string[] destColumns)
 {
     var command = new CreateForeignKeyCommand(FormatTable(name), FormatTable(srcTable), srcColumns, FormatTable(destTable), destColumns);
     Execute(_builder.CreateSql(command));
     return this;
 }