public void ExtendDatabaseStructure(IConceptInfo conceptInfo, ICodeBuilder codeBuilder, out IEnumerable <Tuple <IConceptInfo, IConceptInfo> > createdDependencies) { var info = (ReferencePropertyDbConstraintInfo)conceptInfo; var reference = info.Reference; createdDependencies = ForeignKeyUtility.GetAdditionalForeignKeyDependencies(reference.Referenced) .Select(dep => Tuple.Create <IConceptInfo, IConceptInfo>(dep, reference)); }
public string CreateDatabaseStructure(IConceptInfo conceptInfo) { var info = (ReferencePropertyDbConstraintInfo)conceptInfo; var reference = info.Reference; return(Sql.Format("ReferencePropertyConstraintDatabaseDefinition_Create", SqlUtility.Identifier(reference.DataStructure.Module.Name) + "." + SqlUtility.Identifier(reference.DataStructure.Name), GetConstraintName(reference), reference.GetColumnName(), ForeignKeyUtility.GetSchemaTableForForeignKey(reference.Referenced), ForeignKeyConstraintOptions.Evaluate(info))); }
public void ExtendDatabaseStructure(IConceptInfo conceptInfo, ICodeBuilder codeBuilder, out IEnumerable <Tuple <IConceptInfo, IConceptInfo> > createdDependencies) { var info = (ReferencePropertyInfo)conceptInfo; var dependencies = new List <Tuple <IConceptInfo, IConceptInfo> >(); if (IsSupported(info)) { dependencies.AddRange(ForeignKeyUtility.GetAdditionalForeignKeyDependencies(info.Referenced) .Select(dep => Tuple.Create <IConceptInfo, IConceptInfo>(dep, info))); } createdDependencies = dependencies; }
public string CreateDatabaseStructure(IConceptInfo conceptInfo) { var info = (DataStructureExtendsInfo)conceptInfo; if (ShouldCreateConstraint(info)) { return(Sql.Format("DataStructureExtendsDatabaseDefinition_Create", SqlUtility.Identifier(info.Extension.Module.Name) + "." + SqlUtility.Identifier(info.Extension.Name), GetConstraintName(info), ForeignKeyUtility.GetSchemaTableForForeignKey(info.Base), ForeignKeyConstraintOptions.Evaluate(info))); } // TODO: else - Generate a Filter+InvalidData validation in the server application that checks for invalid items. return(""); }
public string CreateDatabaseStructure(IConceptInfo conceptInfo) { var info = (ReferencePropertyInfo)conceptInfo; if (IsSupported(info)) { return(Sql.Format("ReferencePropertyConstraintDatabaseDefinition_Create", SqlUtility.Identifier(info.DataStructure.Module.Name) + "." + SqlUtility.Identifier(info.DataStructure.Name), GetConstraintName(info), info.GetColumnName(), ForeignKeyUtility.GetSchemaTableForForeignKey(info.Referenced), ForeignKeyConstraintOptions.Evaluate(info))); } return(""); }
public void ExtendDatabaseStructure(IConceptInfo conceptInfo, ICodeBuilder codeBuilder, out IEnumerable <Tuple <IConceptInfo, IConceptInfo> > createdDependencies) { var info = (DataStructureExtendsInfo)conceptInfo; var dependencies = new List <Tuple <IConceptInfo, IConceptInfo> >(); dependencies.Add(Tuple.Create <IConceptInfo, IConceptInfo>(info.Base, info.Extension)); if (ShouldCreateConstraint(info)) { dependencies.AddRange(ForeignKeyUtility.GetAdditionalForeignKeyDependencies(info.Base) .Select(dep => Tuple.Create <IConceptInfo, IConceptInfo>(dep, info)) .ToList()); } createdDependencies = dependencies; }
private static bool ShouldCreateConstraint(DataStructureExtendsInfo info) { return(info.Extension is EntityInfo && ForeignKeyUtility.GetSchemaTableForForeignKey(info.Base) != null); }
public static bool IsSupported(UniqueReferenceInfo info) { return(info.Extension is EntityInfo && ForeignKeyUtility.GetSchemaTableForForeignKey(info.Base) != null); }
public static bool ShouldCreateConstraint(UniqueReferenceInfo info) { return(info.Extension is EntityInfo && ForeignKeyUtility.GetSchemaTableForForeignKey(info.Base) != null); }
public static bool IsSupported(ReferencePropertyInfo info) { return(ReferencePropertyDatabaseDefinition.IsSupported(info) && ForeignKeyUtility.GetSchemaTableForForeignKey(info.Referenced) != null); }