Database Column Type Converter
Moving a schema to another database starts with its column types. Paste CREATE TABLE statements from MySQL, PostgreSQL, SQLite or SQL Server and get them rewritten for another database, or view a mapping table of every column’s old and new type. Booleans, enums, JSON, UUIDs, unsigned integers, money, timestamps and auto-increment keys are translated, and every loss of information is explained.
- Runs in your browser
- No sign-up
- Free to use
How to use Database Column Type Converter
- Paste the CREATE TABLE statements.
- Choose the source and target databases.
- Switch between converted SQL and the mapping table.
- Read the notes and copy the result.
Database Column Type Converter features
Four databases
MySQL/MariaDB, PostgreSQL, SQLite and SQL Server in any direction.
Type mapping
TINYINT(1) ⇄ BOOLEAN ⇄ BIT, JSON ⇄ JSONB, CHAR(36) ⇄ UUID.
Keys
AUTO_INCREMENT, identity, INTEGER PRIMARY KEY and IDENTITY(1,1).
Defaults
CURRENT_TIMESTAMP, NOW(), GETDATE() and UUID functions translated.
Constraints
Enums as CHECK constraints, unsigned ranges kept with CHECK.
Mapping table
Every column’s type before and after.
When to use Database Column Type Converter
- Migrating an application from MySQL to PostgreSQL.
- Creating a SQLite copy of a server schema for tests.
- Moving a SQL Server database to an open-source database.
- Checking type compatibility before a migration.
Database Column Type Converter FAQ
Does it convert the data too?
No, only the table definitions. Export and import the data separately, for example as CSV, once the tables exist.
What happens to MySQL ENUM?
PostgreSQL, SQLite and SQL Server get a text column with a CHECK constraint listing the allowed values.
How are unsigned integers handled?
Only MySQL has them. In other databases the column keeps a CHECK (column >= 0), and INT UNSIGNED becomes BIGINT so the full range still fits.
What about TIMESTAMP?
MySQL TIMESTAMP stores UTC and becomes TIMESTAMPTZ or DATETIMEOFFSET; DATETIME and PostgreSQL TIMESTAMP have no zone and stay that way.
What does SQLite get?
SQLite’s storage classes: INTEGER, REAL, TEXT and BLOB, with notes on how dates, booleans and decimals are stored.
Is anything uploaded?
No. The conversion runs in your browser.
Translating column types
Every database implements the SQL types a little differently, and some types exist in only one of them. MySQL has unsigned integers and ENUM, PostgreSQL has JSONB, UUID and arrays, SQL Server has BIT, NVARCHAR and DATETIMEOFFSET, and SQLite has only five storage classes. Converting a schema means finding the closest equivalent for each column and being clear about what changes.
The converter parses the source SQL with knowledge of its dialect, so MySQL’s TINYINT(1) is recognised as a boolean, TIMESTAMP as a UTC point in time and a SERIAL as an auto-increment key. Each column is mapped to a neutral type and written in the target dialect.
Some mappings are exact, such as INTEGER or DATE. Others need a decision that the notes explain: MySQL has no UUID type, so UUIDs become CHAR(36); SQLite stores decimals as floating point, so money should be kept as integer cents; MySQL has no time-zone-aware type, so TIMESTAMPTZ becomes DATETIME holding UTC.
Keys and defaults are translated together with the types. Auto-increment becomes the target’s identity mechanism; CURRENT_TIMESTAMP, NOW() and GETDATE() become the target’s current-time function; and UUID generators such as gen_random_uuid(), UUID() and NEWID() are swapped accordingly. ENUM values and unsigned ranges are preserved as CHECK constraints.
The mapping table view lists every column with its old and new type, which is useful for migration plans and reviews, while the SQL view gives you statements ready to run, ordered so that referenced tables are created first.