/// <summary>
        ///
        /// </summary>
        /// <param name="table"></param>
        /// <param name="foreignKeyMetadata"></param>
        /// <returns></returns>
        private ForeignKeyInfo GetForeignKey(MetadataTableInfo table, ForeignKeyMetadata foreignKeyMetadata)
        {
            var foreignKey = new ForeignKeyInfo();

            foreignKey.Name   = foreignKeyMetadata.Name;
            foreignKey.Column = table.GetColumn(foreignKeyMetadata.Column.Name);
            foreignKey.Table  = table;

            foreignKey.ReferenceTable  = GetReferenceTable(foreignKeyMetadata);
            foreignKey.ReferenceColumn = GetReferenceColumn(foreignKey, foreignKeyMetadata);

            MigrateManager.CorrectName(foreignKey);
            return(foreignKey);
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="tableInfo"></param>
        /// <param name="tableMetadata"></param>
        /// <returns></returns>
        private PrimaryKeyInfo GetPrimaryKey(MetadataTableInfo tableInfo, TableMetadata tableMetadata)
        {
            var primaryKeyMetadata = tableMetadata.PrimaryKey;

            if (primaryKeyMetadata == null)
            {
                return(null);
            }

            var primaryKey = new PrimaryKeyInfo();

            primaryKey.Table         = tableInfo;
            primaryKey.Name          = primaryKeyMetadata.Name;
            primaryKey.PrimaryColumn = tableInfo.GetColumn(primaryKeyMetadata.PrimaryColumn?.Name);

            MigrateManager.CorrectName(primaryKey);
            return(primaryKey);
        }