Beispiel #1
0
        protected override void Generate(CreateTableOperation createTableOperation)
        {
            _tableCollation = createTableOperation.Annotations.ContainsKey(CollationAttribute.AnnotationName)
                ? (CollationAttribute)createTableOperation.Annotations[CollationAttribute.AnnotationName]
                : null;

            base.Generate(createTableOperation);

            _tableCollation = null;
        }
Beispiel #2
0
        protected override void Generate(AlterTableOperation alterTableOperation)
        {
            _tableCollation = alterTableOperation.Annotations.ContainsKey(CollationAttribute.AnnotationName)
                ? (CollationAttribute)alterTableOperation.Annotations[CollationAttribute.AnnotationName].NewValue
                : null;

            if (_tableCollation != null)
            {
                // Need to alter any column that doesn't have explicitly set collation
                foreach (var column in alterTableOperation.Columns.Where(
                             c => c.ClrType == typeof(string) &&
                             !c.Annotations.ContainsKey(CollationAttribute.AnnotationName)))
                {
                    Generate(new AlterColumnOperation(alterTableOperation.Name, column, false));
                }
            }

            _tableCollation = null;
        }
        protected override void Generate(AlterTableOperation alterTableOperation)
        {
            _tableCollation = alterTableOperation.Annotations.ContainsKey(CollationAttribute.AnnotationName)
                ? (CollationAttribute)alterTableOperation.Annotations[CollationAttribute.AnnotationName].NewValue
                : null;

            if (_tableCollation != null)
            {
                // Need to alter any column that doesn't have explictly set collation
                foreach (var column in alterTableOperation.Columns.Where(
                    c => c.ClrType == typeof(string)
                         && !c.Annotations.ContainsKey(CollationAttribute.AnnotationName)))
                {
                    Generate(new AlterColumnOperation(alterTableOperation.Name, column, false));
                }
            }

            _tableCollation = null;
        }
        protected override void Generate(CreateTableOperation createTableOperation)
        {
            _tableCollation = createTableOperation.Annotations.ContainsKey(CollationAttribute.AnnotationName)
                ? (CollationAttribute)createTableOperation.Annotations[CollationAttribute.AnnotationName]
                : null;

            base.Generate(createTableOperation);

            _tableCollation = null;
        }