当前位置: 首页>>代码示例>>C#>>正文


C# Framework.ForeignKeyConstraint类代码示例

本文整理汇总了C#中Migrator.Framework.ForeignKeyConstraint的典型用法代码示例。如果您正苦于以下问题:C# ForeignKeyConstraint类的具体用法?C# ForeignKeyConstraint怎么用?C# ForeignKeyConstraint使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ForeignKeyConstraint类属于Migrator.Framework命名空间,在下文中一共展示了ForeignKeyConstraint类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AddForeignKey

		public override void AddForeignKey(string name, string primaryTable, string[] primaryColumns, string refTable,
		                                   string[] refColumns, ForeignKeyConstraint constraint)
		{
			GuardAgainstMaximumIdentifierLengthForOracle(name);

			if (ConstraintExists(primaryTable, name))
			{
				Logger.Warn("Constraint {0} already exists", name);
				return;
			}

			primaryTable = QuoteTableNameIfRequired(primaryTable);
			refTable = QuoteTableNameIfRequired(refTable);
			string primaryColumnsSql = String.Join(",", primaryColumns.Select(col => QuoteColumnNameIfRequired(col)).ToArray());
			string refColumnsSql = String.Join(",", refColumns.Select(col => QuoteColumnNameIfRequired(col)).ToArray());

			ExecuteNonQuery(String.Format("ALTER TABLE {0} ADD CONSTRAINT {1} FOREIGN KEY ({2}) REFERENCES {3} ({4})", primaryTable, name, primaryColumnsSql, refTable, refColumnsSql));
		}
开发者ID:rvaccari,项目名称:Migrator.NET,代码行数:18,代码来源:OracleTransformationProvider.cs

示例2: GenerateForeignKey

			GenerateForeignKey(primaryTable, refTable, ForeignKeyConstraint.NoAction);
		}

		public void GenerateForeignKey(string primaryTable, string refTable, ForeignKeyConstraint constraint)
开发者ID:asynchrony,项目名称:Migrator.NET,代码行数:4,代码来源:TransformationProvider.cs

示例3: AddForeignKey

		public virtual void AddForeignKey(string name, string primaryTable, string[] primaryColumns, string refTable,
                                          string[] refColumns, ForeignKeyConstraint constraint)
		{
			if (ConstraintExists(primaryTable, name))
			{
				Logger.Warn("Constraint {0} already exists", name);
				return;
			}

			string constraintResolved = constraintMapper.SqlForConstraint(constraint);
			ExecuteNonQuery(
				String.Format(
					"ALTER TABLE {0} ADD CONSTRAINT {1} FOREIGN KEY ({2}) REFERENCES {3} ({4}) ON UPDATE {5} ON DELETE {6}",
					primaryTable, name, String.Join(",", primaryColumns),
					refTable, String.Join(",", refColumns), constraintResolved, constraintResolved));
		}
开发者ID:asynchrony,项目名称:Migrator.NET,代码行数:16,代码来源:TransformationProvider.cs

示例4: GenerateForeignKey

		public void GenerateForeignKey(string primaryTable, string refTable, ForeignKeyConstraint constraint)
		{
			// No Op
		}
开发者ID:modulexcite,项目名称:Migrator.NET,代码行数:4,代码来源:NoOpTransformationProvider.cs

示例5: AddForeignKey

		public void AddForeignKey(string name, string primaryTable, string[] primaryColumns, string refTable,
		                          string[] refColumns, ForeignKeyConstraint constraint)
		{
			// No Op
		}
开发者ID:modulexcite,项目名称:Migrator.NET,代码行数:5,代码来源:NoOpTransformationProvider.cs

示例6: AddForeignKey

		public override void AddForeignKey(string name, string primaryTable, string[] primaryColumns, string refTable,
		                                   string[] refColumns, ForeignKeyConstraint constraint)
		{
			// NOOP Because SQLite doesn't support foreign keys
		}
开发者ID:rvaccari,项目名称:Migrator.NET,代码行数:5,代码来源:SQLiteTransformationProvider.cs

示例7: GenerateForeignKey

 public void GenerateForeignKey(string foreignTable, string primaryTable, ForeignKeyConstraint constraint)
 {
     _sqlServerTransformationProvider.GenerateForeignKey(foreignTable, primaryTable, constraint);
 }
开发者ID:scottccoates,项目名称:MigratorNeo4j,代码行数:4,代码来源:CliqFlipTransformationProvider.cs

示例8: AddForeignKey

 public void AddForeignKey(string name, string foreignTable, string foreignColumn, string primaryTable, string primaryColumn, ForeignKeyConstraint constraint)
 {
     _sqlServerTransformationProvider.AddForeignKey(name, foreignTable, foreignColumn, primaryTable, primaryColumn, constraint);
 }
开发者ID:scottccoates,项目名称:MigratorNeo4j,代码行数:4,代码来源:CliqFlipTransformationProvider.cs


注:本文中的Migrator.Framework.ForeignKeyConstraint类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。