public virtual Statement[] Render(AddForeignKeyChange change)
        {
            ForeignKeyInfo fk = change.ForeignKey;

            string[] cols    = fk.Columns.ToArray();
            string[] refcols = fk.ReferencedColumns.ToArray();

            string sql = string.Format("alter table {0} {1}",
                                       GetQualifiedName(change.Table),
                                       _dialect.GetAddForeignKeyConstraintString(fk.Name, cols, GetQualifiedName(change.Table.Schema, fk.ReferencedTable), refcols, true));

            return(new Statement[] { new Statement(sql) });
        }
Exemple #2
0
		public virtual Statement[] Render(AddForeignKeyChange change)
		{
			ForeignKeyInfo fk = change.ForeignKey;
			string[] cols = fk.Columns.ToArray();
			string[] refcols = fk.ReferencedColumns.ToArray();

			string sql = string.Format("alter table {0} {1}",
				GetQualifiedName(change.Table),
				_dialect.GetAddForeignKeyConstraintString(fk.Name, cols, GetQualifiedName(change.Table.Schema, fk.ReferencedTable), refcols, true));

			return new Statement[] { new Statement(sql) };
		}