Request a demo
← All articles How it works

Column mapping profiles: one set of type rules for every table

How InsightAutoHub's column mapping profiles capture the type conversions for a migration path, how DDL migration applies them to tables, views and procedures, and where a person decides.

A database migration converts the same handful of types thousands of times. Decide once how DATETIME becomes TIMESTAMP or NUMBER becomes DECIMAL, write it down, and apply it everywhere: that is what a column mapping profile is for. It turns a hundred individual decisions into one reviewed rule set.

In short

A column mapping profile is a named set of rules for one source-to-target pair: each rule maps a source type to a target type, with an optional condition, a transformation note and a description. DDL migration applies a profile to the tables, views and procedures you select and produces target DDL to review, flagging rules that need a person's judgement.

What a profile holds

The Column Mapping Profiles screen lists each profile with its source and target engines, how many rules it has, whether it is the default, and when it was created, and the screen has search, a database filter, and create, edit and delete. InsightAutoHub ships three built-in profiles: MySQL to PostgreSQL (the default), Oracle to MySQL, and SQL Server to PostgreSQL.

The Column Mapping Profiles list showing three profiles: MySQL to PostgreSQL Standard (default, 6 rules), Oracle to MySQL Migration (5 rules) and SQL Server to PostgreSQL (5 rules), each with source and target badges.
Column mapping profiles: one per migration path, each a small set of reviewed rules.
Rule fieldWhat it is forExample from the Oracle to MySQL profile
Source typeThe type as declared in the sourceVARCHAR2
Target typeWhat it becomesVARCHAR
ConditionWhen the rule applies, such as a length limitlength <= 65535
TransformationA note for cases the simple mapping does not coverLONGTEXT if length > 65535
DescriptionWhy the rule existsVARCHAR2 to VARCHAR with length check

Applying a profile: DDL migration

DDL Migration runs in three tabs. In Configuration, choose the source and target locations, the object type (tables, views or procedures) and the column mapping profile. In Object Selection, load the objects and pick the ones to convert. DDL Results shows, per object, the original DDL, the converted DDL, and issues and warnings. Options can add a DROP TABLE IF EXISTS or a CREATE SCHEMA IF NOT EXISTS in front of each statement, and the results screen has export and execute actions, with an execution history and status for each run.

The DDL Migration configuration tab with source and target data location selectors, object type, and the column mapping profile set to MySQL to PostgreSQL Standard, with a Load Objects button.
DDL Migration: choose locations, the object type and the profile, then load the objects to convert.
Where people stay in charge. Conversion replaces type names using the profile's rules and raises a warning where a rule's condition mentions a length or the rule carries a transformation note. A DBA reviews the generated DDL, including keys, indexes, defaults, partitioning and engine-specific options, and decides when it runs against the target.

Writing good rules

  • Be explicit about precision. NUMBER without precision and NUMBER(10,2) deserve different rules; write both.
  • Say what happens to long text. Every engine has a different limit for its variable-length string type; make the overflow case a rule with a transformation note.
  • Decide booleans once. TINYINT(1), NUMBER(1) and CHAR(1) all show up as flags; pick the target type and the values that mean true.
  • Mark the default. One default profile per migration means nobody converts a table with the wrong rules by accident.

A profile you might write for Redshift to Oracle ADW

An illustration of the method, not a shipped profile: the rules a team might agree after reading its datatype mapping report. Verify each against your database versions.

Source typeTarget typeConditionTransformation note
VARCHAR(n)VARCHAR2(n CHAR)n <= 4000Character semantics, so multi-byte text fits
VARCHAR(n)CLOBn > 4000Check sorts, groups and joins on the column
NUMERIC(p,s)NUMBER(p,s)Precision and scale kept exactly
BOOLEANNUMBER(1)1 for true, 0 for false; say so in the description
TIMESTAMPTZTIMESTAMP WITH TIME ZONEDo not convert to local time on load

Each rule's description should say who agreed it and why. The fourth rule is a good example of a decision that affects more than the DDL: validation queries will need to present the Redshift boolean as 1 or 0 to compare it with the target.

How to test a profile before trusting it

  1. Pick five tables that between them use every rule: one wide table, one with long text, one with money, one with flags, one with timestamps.
  2. Convert their DDL with the profile and have a DBA read the result line by line.
  3. Create the target tables and run the datatype mapping report on them; every pair in it should be one the profile intended.
  4. Load a sample and run row-level validation; a rule that changes values will show up here, not in the DDL.
  5. Only then apply the profile to the rest of the schema.

Profiles as shared agreements

A profile is also a record of decisions. When a reviewer asks why every DATE became a DATETIME, the answer is a rule with a description, not a recollection. Keep one profile per migration path, change it through review, and note in each rule's description who agreed it. When the same team runs a second migration on the same path, the profile is the head start.

Profiles also make conversions consistent across people. Two engineers converting tables in parallel will make the same choices because the profile makes them, rather than their habits.

Questions people ask about profiles

Do profiles handle keys, indexes and partitioning?

No. A profile is about column types. Constraints, indexes, defaults, partitioning and storage options need their own review.

One profile or several?

One per source-and-target pair, marked as the default for that pair. A second profile for the same pair usually means two conventions are competing; settle it instead.

Can a profile be reused on the next migration?

That is much of its value. The rules for a given pair rarely change between projects; what changes is the handful of exceptions a new schema brings, which become new rules with their own descriptions.

Before converting anything, look at what the types actually are: datatype mapping reports.

See it on your own migration

Bring one schema you need to move

We'll map its types, plan the tables and validate a sample end to end with your team, as a hosted trial or inside your own cloud.

Request a demo