public void CreateAllObjects(IDatabaseSource conn, ISqlDumper dmp, ISqlDialect dialect) { var dbmem = new DatabaseStructureMembers { TableList = true, TableMembers = TableStructureMembers.AllNoRefs, DomainList = true, DomainDetails = true, SpecificObjectList = true, SpecificObjectDetails = true, LoadDependencies = true, IgnoreSystemObjects = true, }; var dbs = new DatabaseStructure(conn.InvokeLoadStructure(dbmem, null)); var props = new CreateDatabaseObjectsProps { CreateDomains = Domains, CreateFixedData = FixedData, CreateSchemata = Schemata, CreateSpecificObjects = SpecificObjects, CreateTables = Tables }; IMigrationProfile profile = dialect.CreateMigrationProfile(); dialect.MigrateDatabase(dbs, profile, null); dmp.CreateDatabaseObjects(dbs, props); }
private ISpecificType GetPostgreSqlTypeArray(DbTypeArray type, IMigrationProfile profile, IProgressInfo progress) { var res = (PostgreSqlTypeBase)GenericTypeToSpecific(type.ElementType, profile, progress); res.IsArray = true; return(res); }
public void GenerateDropAllTables(IDatabaseSource conn, ISqlDumper dmp, ISqlDialect dialect) { DatabaseStructureMembers dbmem = new DatabaseStructureMembers { TableList = true, TableMembers = TableStructureMembers.ForeignKeys, IgnoreSystemObjects = true, }; var dbs = new DatabaseStructure(conn.InvokeLoadStructure(dbmem, null)); IMigrationProfile profile = dialect.CreateMigrationProfile(); dialect.MigrateDatabase(dbs, profile, null); foreach (ITableStructure tbl in dbs.Tables) { if (conn.Dialect.IsSystemTable(tbl.FullName)) { continue; } foreach (IForeignKey fk in tbl.GetConstraints <IForeignKey>()) { dmp.DropConstraint(fk); } } foreach (ITableStructure tbl in dbs.Tables) { if (conn.Dialect.IsSystemTable(tbl.FullName)) { continue; } dmp.DropTable(tbl, DropFlags.None); } }
public override ISpecificType GenericTypeToSpecific(DbTypeBase type, IMigrationProfile profile, IProgressInfo progress) { switch (type.Code) { case DbTypeCode.Int: return(GetAccessTypeInt((DbTypeInt)type)); case DbTypeCode.String: return(GetAccessTypeString((DbTypeString)type)); case DbTypeCode.Logical: return(new AccessTypeBit()); case DbTypeCode.Datetime: return(new AccessTypeDatetime()); case DbTypeCode.Numeric: { AccessTypeDecimal res = new AccessTypeDecimal(); res.Precision = ((DbTypeNumeric)type).Precision; res.Scale = ((DbTypeNumeric)type).Scale; res.IsAutoIncrement = ((DbTypeNumeric)type).Autoincrement; return(res); } case DbTypeCode.Blob: return(new AccessTypeImage()); case DbTypeCode.Text: case DbTypeCode.Array: return(new AccessTypeText()); case DbTypeCode.Float: { DbTypeFloat tp = (DbTypeFloat)type; if (tp.IsMoney) { return(new AccessTypeMoney()); } if (tp.Bytes == 4) { return(new AccessTypeReal()); } else { return(new AccessTypeFloat()); } } case DbTypeCode.Xml: return(new AccessTypeText()); case DbTypeCode.Generic: return(new AccessTypeGeneric { Sql = ((DbTypeGeneric)type).Sql }); } throw new InternalError("DAE-00058 unknown type"); }
public override void GenerateSql(IDatabaseSource db, FullDatabaseRelatedName objname, ISqlDumper dmp, ISqlDialect dialect) { IMigrationProfile profile = dialect.CreateMigrationProfile(); var tbl = new TableStructure(db.GetTable(objname.ObjectName).InvokeLoadStructure(TableStructureMembers.AllNoRefs)); dialect.MigrateTable(tbl, profile, null); InsertTemplate(tbl, dmp, dialect); }
public void GenerateFillTable(ITableSource table, ISqlDumper dmp, ISqlDialect dialect) { IMigrationProfile profile = dialect.CreateMigrationProfile(); var tbl = new TableStructure(table.InvokeLoadStructure(TableStructureMembers.AllNoRefs)); dialect.MigrateTable(tbl, profile, null); GenerateFillTable(tbl, dmp); }
public virtual void MigrateDatabase(DatabaseStructure db, IMigrationProfile profile, IProgressInfo progress) { if (db.Dialect.SameDialect(this)) { return; } foreach (TableStructure table in db.Tables) { MigrateTable(table, profile, progress); } db.Dialect = this; }
protected virtual Constraint MigrateConstraintOrIndex(Constraint cnt, IMigrationProfile profile, IProgressInfo progress) { if (cnt is IPrimaryKey) { if (DialectCaps.AnonymousPrimaryKey) { PrimaryKey pk = (PrimaryKey)cnt; pk.Name = DbObjectNameTool.PkName(pk.Table.FullName); } } return(cnt); }
public void CreateReferences(IDatabaseSource conn, ISqlDumper dmp, ISqlDialect dialect) { var dbmem = new DatabaseStructureMembers { TableList = true, TableMembers = TableStructureMembers.AllNoRefs, IgnoreSystemObjects = true, }; var dbs = new DatabaseStructure(conn.InvokeLoadStructure(dbmem, null)); IMigrationProfile profile = dialect.CreateMigrationProfile(); dialect.MigrateDatabase(dbs, profile, null); CreateReferences(dmp, dbs); }
public void CreateDomains(IDatabaseSource conn, ISqlDumper dmp, ISqlDialect dialect) { var dbmem = new DatabaseStructureMembers { DomainDetails = true, DomainList = true, IgnoreSystemObjects = true, }; var dbs = new DatabaseStructure(conn.InvokeLoadStructure(dbmem, null)); IMigrationProfile profile = dialect.CreateMigrationProfile(); dialect.MigrateDatabase(dbs, profile, null); CreateDomains(dmp, dbs); }
public void FillAllTables(IDatabaseSource conn, ISqlDumper dmp, ISqlDialect dialect) { var dbmem = new DatabaseStructureMembers { TableList = true, TableMembers = TableStructureMembers.Columns, }; var dbs = new DatabaseStructure(conn.InvokeLoadStructure(dbmem, null)); IMigrationProfile profile = dialect.CreateMigrationProfile(); dialect.MigrateDatabase(dbs, profile, null); foreach (var tbl in dbs.Tables) { GenerateFillTable(tbl, dmp); } }
public override ISpecificType GenericTypeToSpecific(DbTypeBase type, IMigrationProfile profile, IProgressInfo progress) { switch (type.Code) { case DbTypeCode.Int: return(GetPostgreSqlTypeInt((DbTypeInt)type)); case DbTypeCode.String: return(GetPostgreSqlTypeString((DbTypeString)type)); case DbTypeCode.Logical: return(new PostgreSqlTypeBoolean()); case DbTypeCode.Datetime: return(GetPostgreSqlTypeDatetime((DbTypeDatetime)type)); case DbTypeCode.Numeric: { PostgreSqlTypeNumeric res = new PostgreSqlTypeNumeric(); res.Precision = ((DbTypeNumeric)type).Precision; res.Scale = ((DbTypeNumeric)type).Scale; return(res); } case DbTypeCode.Blob: return(new PostgreSqlTypeBytea()); case DbTypeCode.Xml: return(new PostgreSqlTypeText()); case DbTypeCode.Text: return(GetPostgreSqlTypeText((DbTypeText)type)); case DbTypeCode.Array: return(GetPostgreSqlTypeArray((DbTypeArray)type, profile, progress)); case DbTypeCode.Float: return(GetPostgreSqlTypeFloat((DbTypeFloat)type)); case DbTypeCode.Generic: return(new PostgreSqlTypeGeneric { Sql = ((DbTypeGeneric)type).Sql }); } throw new Exception("DAE-00346 unknown type"); }
public override void MigrateTable(TableStructure table, IMigrationProfile profile, IProgressInfo progress) { base.MigrateTable(table, profile, progress); MigrateTool.RemoveNonPk1AutoIncrements(table, progress); foreach (ColumnStructure col in table.Columns) { var spec = col.DefaultValue as SpecialConstantSqlExpression; string subtype = col.DataType.GetSpecificAttribute("mysql", "subtype"); if (spec != null) { if (subtype != "timestamp") { col.DefaultValue = null; col.IsNullable = true; progress.Warning(String.Format("Default value for column {0}.{1} was removed, it is not valid on MySQL", table.FullName, col.ColumnName)); } } } }
public override ISpecificType GenericTypeToSpecific(DbTypeBase type, IMigrationProfile profile, IProgressInfo progress) { switch (type.Code) { case DbTypeCode.Int: return(new SqliteTypeInt { IsAutoIncrement = ((DbTypeInt)type).Autoincrement }); case DbTypeCode.Logical: return(new SqliteTypeLogical()); case DbTypeCode.Float: return(new SqliteTypeReal()); case DbTypeCode.Blob: return(new SqliteTypeBlob()); case DbTypeCode.String: case DbTypeCode.Xml: case DbTypeCode.Array: return(new SqliteTypeText()); case DbTypeCode.Datetime: return(new SqliteTypeDateTime()); case DbTypeCode.Numeric: return(new SqliteTypeNumeric()); case DbTypeCode.Text: { string subtype = type.GetSpecificAttribute("sqlite", "subtype"); return(new SqliteTypeText { SpecificCode = subtype }); } break; } return(new SqliteTypeText()); }
public virtual void MigrateTable(TableStructure table, IMigrationProfile profile, IProgressInfo progress) { foreach (ColumnStructure col in table.Columns) { // character and collation is not portable col.Collation = ""; col.CharacterSet = ""; col.DataType = MigrateDataType(col, col.DataType, profile, progress); List <string> todel = new List <string>(); foreach (string attr in col.SpecificData.Keys) { if (!attr.StartsWith(DialectName + ".")) { todel.Add(attr); } } foreach (string d in todel) { col.SpecificData.Remove(d); } } var newConstraints = new List <Constraint>(); foreach (Constraint cnt in table.Constraints) { var newcnt = MigrateConstraintOrIndex(cnt, profile, progress); if (newcnt != null) { newConstraints.Add(newcnt); } } table._Constraints.Clear(); foreach (var cnt in newConstraints) { table._Constraints.Add(cnt); } }
public override ISpecificType GenericTypeToSpecific(DbTypeBase type, IMigrationProfile profile, IProgressInfo progress) { switch (type.Code) { case DbTypeCode.Int: return(GetSqlTypeInt((DbTypeInt)type)); case DbTypeCode.String: return(GetSqlTypeString((DbTypeString)type)); case DbTypeCode.Logical: return(new SqlTypeBit()); case DbTypeCode.Datetime: { string attr = type.GetSpecificAttribute("mssql", "subtype"); var dtype = type as DbTypeDatetime; if (attr == "timestamp") { return(new SqlTypeTimestamp()); } if (attr == "datetime") { return(new SqlTypeDatetime()); } if (attr == "smalldatetime") { return(new SqlTypeSmallDatetime()); } if (m_version.Is_2008()) { if (dtype.HasTimeZone) { return(new SqlTypeDatetimeOffset()); } if (dtype.SubType == DbDatetimeSubType.Date) { return(new SqlTypeDate()); } if (dtype.SubType == DbDatetimeSubType.Time) { return(new SqlTypeTime()); } if (attr == "datetime2") { return(new SqlTypeDatetime2()); } // on 2008 server prefer datetime2 type // NO: return new SqlTypeDatetime2(); } return(new SqlTypeDatetime()); } case DbTypeCode.Numeric: { SqlTypeNumericBase res; if (type.GetSpecificAttribute("mssql", "subtype") == "decimal") { res = new SqlTypeDecimal(); } else { res = new SqlTypeNumeric(); } res.Precision = ((DbTypeNumeric)type).Precision; res.Scale = ((DbTypeNumeric)type).Scale; res.IsIdentity = ((DbTypeNumeric)type).Autoincrement; int increment; if (Int32.TryParse(type.GetSpecificAttribute("mssql", "identity_increment"), out increment)) { res.IdentityIncrement = increment; res.IdentitySeed = Int32.Parse(type.GetSpecificAttribute("mssql", "identity_seed")); } return(res); } //return String.Format("decimal({0},{1})", ((DbTypeNumeric)type).Precision, ((DbTypeNumeric)type).Scale); case DbTypeCode.Blob: if (type.GetSpecificAttribute("mssql", "subtype") == "variant") { return(new SqlTypeVariant()); } return(new SqlTypeImage()); case DbTypeCode.Text: if (((DbTypeText)type).IsUnicode) { return(new SqlTypeNText()); } else { return(new SqlTypeText()); } case DbTypeCode.Array: return(new SqlTypeText()); case DbTypeCode.Float: { DbTypeFloat tp = (DbTypeFloat)type; if (tp.IsMoney) { if (tp.Bytes == 8) { return(new SqlTypeSmallMoney()); } return(new SqlTypeMoney()); } if (tp.Bytes == 4) { return(new SqlTypeReal()); } else { return(new SqlTypeFloat()); } } case DbTypeCode.Xml: if (m_version.Is_2005()) { return(new SqlTypeXml()); } return(new SqlTypeText()); case DbTypeCode.Generic: return(new SqlTypeGeneric { Sql = ((DbTypeGeneric)type).Sql }); } throw new InternalError("DAE-00332 unknown type"); }
protected override DatAdmin.Constraint MigrateConstraintOrIndex(DatAdmin.Constraint cnt, IMigrationProfile profile, IProgressInfo progress) { var index = cnt as IndexConstraint; if (index != null) { foreach (var colname in index.Columns) { var col = cnt.Table.Columns[colname.ColumnName]; if (col.DataType is DbTypeBlob || col.DataType is DbTypeText || col.DataType is DbTypeXml) { progress.Warning("Column {0}:{1} cannot be indexable, because it is BLOB type", colname, col.DataType); return(null); } } } return(base.MigrateConstraintOrIndex(cnt, profile, progress)); }
public override void MigrateTable(TableStructure table, IMigrationProfile profile, IProgressInfo progress) { base.MigrateTable(table, profile, progress); MigrateTool.RemoveNonPk1AutoIncrements(table, progress); }
//public override bool IsSystemTable(string schema, string table) //{ // return table.Contains("$") || table == "HELP"; //} public override ISpecificType GenericTypeToSpecific(DbTypeBase type, IMigrationProfile profile, IProgressInfo progress) { switch (type.Code) { case DbTypeCode.Array: return(new OracleTypeClob()); case DbTypeCode.Blob: if (type.GetSpecificAttribute("oracle", "subtype") == "longraw") { return(new OracleTypeLongRaw()); } return(new OracleTypeBlob()); case DbTypeCode.Datetime: { var dtype = (DbTypeDatetime)type; string subtype = type.GetSpecificAttribute("oracle", "subtype"); if (subtype == "timestamp") { var res = new OracleTypeTimestamp(); try { res.TimeZone = (TimeZoneType)Enum.Parse(typeof(TimeZoneType), type.GetSpecificAttribute("oracle", "timezone"), true); } catch { res.TimeZone = TimeZoneType.None; } string fprec = type.GetSpecificAttribute("oracle", "fractionalprecision"); if (fprec != null) { res.FractionalPrecision = Int32.Parse(fprec); } return(res); } if (subtype == "yeartomonth") { var res = new OracleTypeIntervalYearToMonth(); string yprec = type.GetSpecificAttribute("oracle", "yearprecision"); if (yprec != null) { res.YearPrecision = Int32.Parse(yprec); } return(res); } if (subtype == "daytosecond") { var res = new OracleTypeIntervalDayToSecond(); string dprec = type.GetSpecificAttribute("oracle", "dayprecision"); string fprec = type.GetSpecificAttribute("oracle", "fractionalprecision"); if (dprec != null) { res.DayPrecision = Int32.Parse(dprec); } if (fprec != null) { res.FractionalPrecision = Int32.Parse(fprec); } return(res); } if (dtype.SubType == DbDatetimeSubType.Interval) { return(new OracleTypeIntervalDayToSecond()); } return(new OracleTypeDate()); } case DbTypeCode.Float: if (type.GetSpecificAttribute("oracle", "subtype") == "number") { return(new OracleTypeNumber()); } if (((DbTypeFloat)type).Bytes == 4) { return(new OracleTypeBinaryFloat()); } return(new OracleTypeBinaryDouble()); case DbTypeCode.Generic: return(new OracleTypeGeneric { Sql = ((DbTypeGeneric)type).Sql }); case DbTypeCode.Int: { string ilen = type.GetSpecificAttribute("oracle", "length"); if (ilen != null) { return new OracleTypeNumber { Precision = Int32.Parse(ilen) } } ; } return(new OracleTypeInteger()); case DbTypeCode.Logical: return(new OracleTypeInteger()); case DbTypeCode.Numeric: { var ntype = (DbTypeNumeric)type; if (type.GetSpecificAttribute("oracle", "noprec") == "1") { return new OracleTypeNumber { Scale = ntype.Scale } } ; return(new OracleTypeNumber { Precision = ntype.Precision, Scale = ntype.Scale }); } case DbTypeCode.String: { string subtype = type.GetSpecificAttribute("oracle", "subtype"); if (subtype != null) { switch (subtype) { case "rowid": return(new OracleTypeRowId()); case "urowid": return(new OracleTypeURowId()); case "mlslabel": return(new OracleTypeMlsLabel()); case "bfile": return(new OracleTypeBFile()); } } var stype = (DbTypeString)type; if (stype.IsBinary) { return new OracleTypeRaw { Length = stype.Length } } ; if (stype.IsVarLength) { if (stype.IsUnicode) { return new OracleTypeNVarChar2 { Length = stype.Length } } ; else { return new OracleTypeVarChar2 { Length = stype.Length } }; } else { if (stype.IsUnicode) { return new OracleTypeNChar { Length = stype.Length } } ; else { return new OracleTypeChar { Length = stype.Length } }; } } case DbTypeCode.Text: if (type.GetSpecificAttribute("oracle", "subtype") == "long") { return(new OracleTypeLong()); } if (((DbTypeText)type).IsUnicode) { return(new OracleTypeNClob()); } else { return(new OracleTypeClob()); } case DbTypeCode.Xml: return(new OracleTypeXml()); } throw new Exception("DAE-00342 unknown type"); }
public virtual DbTypeBase MigrateDataType(IColumnStructure owningColumn, DbTypeBase type, IMigrationProfile profile, IProgressInfo progress) { ISpecificType spectype = GenericTypeToSpecific(type, profile, progress); //if (!DialectCaps.Arrays && type.ArraySpec.IsArray) //{ // return new DbTypeText(); // migrate arrays as text blob //} return(spectype.ToGenericType()); }
public virtual void MigrateDatabase(DatabaseStructure db, IMigrationProfile profile, IProgressInfo progress) { m_dialect.MigrateDatabase(db, profile, progress); }
public virtual ISpecificType GenericTypeToSpecific(DbTypeBase generic, IMigrationProfile profile, IProgressInfo progress) { return(generic); }
public virtual DbTypeBase MigrateDataType(IColumnStructure owningColumn, DbTypeBase type, IMigrationProfile profile, IProgressInfo progress) { return(m_dialect.MigrateDataType(owningColumn, type, profile, progress)); }
public virtual void MigrateTable(TableStructure table, IMigrationProfile profile, IProgressInfo progress) { m_dialect.MigrateTable(table, profile, progress); }
public override DbTypeBase MigrateDataType(IColumnStructure owningColumn, DbTypeBase type, IMigrationProfile profile, IProgressInfo progress) { if (type is DbTypeString && ((DbTypeString)type).Length <= 0) { // convert to BLOB variant, MySQL doesn't support varchar(max) notation return(((DbTypeString)type).ConvertToBlobVariant()); } return(base.MigrateDataType(owningColumn, type, profile, progress)); }
public override ISpecificType GenericTypeToSpecific(DbTypeBase type, IMigrationProfile profile, IProgressInfo progress) { var prof = profile as IMySqlMigrationProfile; switch (type.Code) { case DbTypeCode.Int: return(GetMySqlTypeInt((DbTypeInt)type)); case DbTypeCode.String: return(GetMySqlTypeString((DbTypeString)type)); case DbTypeCode.Logical: return(new MySqlTypeBit()); //if (type.GetSpecificAttribute("mysql", "subtype") == "bit") return new MySqlTypeBit(); //return new MySqlTypeTinyInt(); case DbTypeCode.Datetime: return(GetMySqlTypeDatetime((DbTypeDatetime)type, prof, progress)); case DbTypeCode.Numeric: { MySqlTypeNumericBase res = new MySqlTypeDecimal(); var src = (DbTypeNumeric)type; res.Length = src.Precision; res.Decimals = src.Scale; res.Unsigned = src.Unsigned; res.Zerofill = src.GetSpecificAttribute("mysql", "zerofill") == "1"; return(res); } case DbTypeCode.Blob: return(GetMySqlTypeBlob((DbTypeBlob)type, prof, progress)); case DbTypeCode.Text: return(GetMySqlTypeText((DbTypeText)type, prof, progress)); case DbTypeCode.Array: return(new MySqlTypeText()); case DbTypeCode.Xml: return(GetMySqlTypeText(null, prof, progress)); case DbTypeCode.Float: { MySqlTypeReal res; var src = (DbTypeFloat)type; if (src.Bytes == 4) { res = new MySqlTypeFloat(); } else { res = new MySqlTypeDouble(); } res.Unsigned = src.Unsigned; res.Zerofill = src.GetSpecificAttribute("mysql", "zerofill") == "1"; string len = src.GetSpecificAttribute("mysql", "length"); string decs = src.GetSpecificAttribute("mysql", "decimals"); if (len != null && decs != null) { res.Length = Int32.Parse(len); res.Decimals = Int32.Parse(decs); } return(res); } case DbTypeCode.Generic: return(new MySqlTypeGeneric { Sql = ((DbTypeGeneric)type).Sql }); } throw new Exception("DAE-00335 unknown type"); }
public override ISpecificType GenericTypeToSpecific(DbTypeBase type, IMigrationProfile profile, IProgressInfo progress) { switch (type.Code) { case DbTypeCode.Int: return(GetEfzTypeInt((DbTypeInt)type)); case DbTypeCode.String: return(GetEfzTypeString((DbTypeString)type)); case DbTypeCode.Logical: return(new EfzTypeBoolean()); case DbTypeCode.Datetime: { string attr = type.GetSpecificAttribute("effiproz", "subtype"); var dtype = type as DbTypeDatetime; if (attr == "timestamp") { var res = new EfzTypeTimestamp(); res.Precision = Int32.Parse(type.GetSpecificAttribute("effiproz", "precision")); return(res); } if (attr == "yeartomonth") { var res = new EfzTypeIntervalYearToMonth(); //res.Precision = Int32.Parse(type.GetSpecificAttribute("effiproz", "precision")); return(res); } if (attr == "daytosecond") { var res = new EfzTypeIntervalDayToSecond(); //res.Precision = Int32.Parse(type.GetSpecificAttribute("effiproz", "precision")); return(res); } if (attr == "date") { var res = new EfzTypeDate(); return(res); } switch (dtype.SubType) { case DbDatetimeSubType.Date: return(new EfzTypeDate()); case DbDatetimeSubType.Datetime: if (dtype.HasTimeZone) { return(new EfzTypeTimestampTz()); } else { return(new EfzTypeTimestamp()); } case DbDatetimeSubType.Interval: return(new EfzTypeIntervalDayToSecond()); case DbDatetimeSubType.Time: return(new EfzTypeTimestamp()); case DbDatetimeSubType.Year: return(new EfzTypeDate()); } return(new EfzTypeTimestamp()); } case DbTypeCode.Numeric: { var res = new EfzTypeNumber(); res.Precision = ((DbTypeNumeric)type).Precision; res.Scale = ((DbTypeNumeric)type).Scale; res.IsIdentity = ((DbTypeNumeric)type).Autoincrement; int increment; if (Int32.TryParse(type.GetSpecificAttribute("effiproz", "identity_increment"), out increment)) { res.IdentityIncrement = increment; res.IdentitySeed = Int32.Parse(type.GetSpecificAttribute("effiproz", "identity_seed")); } return(res); } case DbTypeCode.Blob: { var res = new EfzTypeBlob(); string size = type.GetSpecificAttribute("effiproz", "maxbytes"); if (size != null) { res.MaxBytes = Int32.Parse(size); } return(res); } case DbTypeCode.Text: { var res = new EfzTypeClob(); string size = type.GetSpecificAttribute("effiproz", "maxbytes"); if (size != null) { res.MaxBytes = Int32.Parse(size); } return(res); } case DbTypeCode.Array: return(new EfzTypeClob()); case DbTypeCode.Float: return(new EfzTypeDouble()); case DbTypeCode.Xml: return(new EfzTypeClob()); case DbTypeCode.Generic: return(new EfzTypeGeneric { Sql = ((DbTypeGeneric)type).Sql }); } throw new Exception("DAE-00323 unknown type"); }
public override DbTypeBase MigrateDataType(IColumnStructure owningColumn, DbTypeBase type, IMigrationProfile profile, IProgressInfo progress) { var stype = type as DbTypeString; if (stype != null) { if (stype.Length > 255) { string msg = Texts.Get("s_reduced_column_length$column$oldlen$newlen", "column", owningColumn.Table.ToString() + "." + owningColumn.ColumnName, "oldlen", stype.Length, "newlen", 255); progress.LogMessage("TABLE", LogLevel.Warning, msg); Logging.Info(msg); stype.Length = 255; return(stype); } } return(base.MigrateDataType(owningColumn, type, profile, progress)); }