Convert a SQLite schema to MariaDB
Paste the CREATE TABLE statements from SQLite and ERD Designer draws them as a diagram. Change the diagram's target database to MariaDB and every column's datatype is converted. You review each change before it is applied, then generate the MariaDB script.
What changes in the sample
Converted to MariaDB 11.8, these columns of the sample above change type. Everything else keeps its type; names, keys, nullability and lists of allowed values are left as they are.
| Column | SQLite | MariaDB | Note |
|---|---|---|---|
customers.customer_id | INTEGER | BIGINT | numbered by the database |
customers.email | TEXT | VARCHAR(255) | |
customers.notes | TEXT | LONGTEXT | |
customers.is_active | BOOLEAN | BOOLEAN | default: 1 → TRUE |
customers.created_at | DATETIME | DATETIME(6) | |
orders.order_id | INTEGER | BIGINT | numbered by the database |
orders.customer_id | INTEGER | BIGINT | |
orders.status | TEXT | VARCHAR(7) | |
orders.total | NUMERIC(12,2) | DECIMAL(12,2) | |
orders.placed_at | DATETIME | DATETIME(6) | |
orders.receipt_pdf | BLOB | LONGBLOB |
What it tells you
Where a conversion loses something, ERD Designer says so rather than picking for you. These are the messages for the sample:
- customers.email: MariaDB cannot use LONGTEXT as a key or index it — converted to VARCHAR(255); widen it if your values are longer.
The MariaDB script
This is what ERD Designer generates for the sample, for MariaDB 11.8. Our test suite applies this conversion to a real MariaDB server and then reads the database back to confirm it matches the diagram exactly.
-- Create table customers
CREATE TABLE `customers` (
`customer_id` BIGINT NOT NULL AUTO_INCREMENT,
`email` VARCHAR(255) NOT NULL,
`full_name` VARCHAR(120) NOT NULL,
`notes` LONGTEXT NULL,
`is_active` TINYINT(1) NOT NULL DEFAULT 1,
`created_at` DATETIME(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
PRIMARY KEY (`customer_id`)
) ENGINE=InnoDB;
-- Create table orders
CREATE TABLE `orders` (
`order_id` BIGINT NOT NULL AUTO_INCREMENT,
`customer_id` BIGINT NOT NULL,
`status` VARCHAR(7) NOT NULL DEFAULT 'new' CHECK (`status` IN ('new', 'paid', 'shipped')),
`total` DECIMAL(12,2) NOT NULL,
`placed_at` DATETIME(6) NOT NULL,
`receipt_pdf` LONGBLOB NULL,
PRIMARY KEY (`order_id`)
) ENGINE=InnoDB;
-- Add unique constraint on customers (email)
ALTER TABLE `customers` ADD CONSTRAINT `customers_UQ1` UNIQUE (`email`);
-- Create index on orders (placed_at)
CREATE INDEX `orders_placed_ix` ON `orders` (`placed_at`);
-- Add foreign key orders (customer_id) → customers (customer_id)
ALTER TABLE `orders` ADD CONSTRAINT `orders_FK1` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`customer_id`);
How to convert your own schema
- Paste your SQLite script above and press Open in ERD Designer. The diagram opens laid out and ready to edit.
- Click the diagram's name in the toolbar to open its properties, choose MariaDB under Target Database / Version, and press Apply Changes.
- If MariaDB offers more than one way to store a kind of column, choose one and press Continue.
- Read the list of retyped columns and any warnings, then press Apply Conversion. Save the diagram to keep it.
- Press Generate DDL (the database icon) to copy or download the MariaDB script — or apply it to a database on your own network with the ERD Designer Agent.
What it reads, and what it does not
- It reads
CREATE TABLE,ALTER TABLE … ADD CONSTRAINTandCREATE INDEX: tables, columns, keys, foreign keys, unique constraints, check lists and indexes. Anything else in the script is skipped and listed. - It converts the schema, never the data: no rows are read, moved or changed.
- It does not convert views, stored procedures, functions, triggers or packages.
Which plan you need
Pasting a script and working with it as a diagram is free on the Basic plan, with no card. Converting a diagram to another database is part of the Pro and Advanced plans, which also generate its script and can apply it through the Agent.
Other conversions
- SQLite to PostgreSQL
- SQLite to Oracle
- SQLite to SQL Server
- SQLite to MySQL
- SQLite to Amazon Redshift
- SQLite to Google BigQuery
- SQLite to Snowflake
- PostgreSQL to MariaDB
- Oracle to MariaDB
- SQL Server to MariaDB
- MySQL to MariaDB
- Amazon Redshift to MariaDB
- Google BigQuery to MariaDB
- Snowflake to MariaDB
Questions? Write to support@erddesigner.com. · ERD Designer · Terms · Privacy