public string CreateConstraintName(string constraint, string objectName)
        {
            objectName = SQLiteProviderManifestHelper.RemoveDbo(objectName);

            var name = string.Format("{0}_{1}", constraint, objectName);

            if (name.Length + 9 > SQLiteProviderManifestHelper.MaxObjectNameLength)
            {
                name = name.Substring(0, SQLiteProviderManifestHelper.MaxObjectNameLength - 9);
            }

            name += "_" + this.GetRandomString();

            return(name);
        }
Exemple #2
0
        public void AppendIdentifier(string identifier)
        {
            string correctIdentifier;

            correctIdentifier = SQLiteProviderManifestHelper.RemoveDbo(identifier);

            if (correctIdentifier.Length > SQLiteProviderManifestHelper.MaxObjectNameLength)
            {
                string guid = Guid.NewGuid().ToString().Replace("-", "");
                correctIdentifier = correctIdentifier.Substring(0, SQLiteProviderManifestHelper.MaxObjectNameLength - guid.Length) + guid;
            }


            AppendSql(SQLiteProviderManifestHelper.QuoteIdentifier(correctIdentifier));
        }