Schemint

paste PostgreSQL or JSON, get your schema reviewed like a senior would

PostgreSQL CREATE TABLE to Flyway migration

Paste a CREATE TABLE, get a Flyway migration. Nothing you paste is stored.

Paste one or more PostgreSQL CREATE TABLE statements and get a versioned Flyway migration (V1__...sql): the DDL normalized and the tables ordered topologically by foreign key, so it applies cleanly.

Generated from your real schema, on the server, discarded after the response.

Try it on your own schema

Example

PostgreSQL in:

CREATE TABLE product (
    id BIGSERIAL PRIMARY KEY,
    sku VARCHAR(40) UNIQUE NOT NULL,
    name VARCHAR(200) NOT NULL,
    price NUMERIC(12, 2) NOT NULL,
    in_stock BOOLEAN NOT NULL DEFAULT true,
    created_at TIMESTAMP NOT NULL DEFAULT now()
);

Generated:

V1__create_product.sql

CREATE TABLE product (
    id BIGSERIAL PRIMARY KEY,
    sku VARCHAR(40) NOT NULL UNIQUE,
    name VARCHAR(200) NOT NULL,
    price NUMERIC(12, 2) NOT NULL,
    in_stock BOOLEAN NOT NULL DEFAULT TRUE,
    created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);

Related