Migration Gotcha: Prefer GENERATED BY DEFAULT AS IDENTITY over legacy Oracle trigger+sequence pairs and PostgreSQL SERIAL for clean ownership and dump/restore permissions.

Oracle Database

CREATE TABLE invoices (
  id NUMBER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
  total NUMBER(12,2) NOT NULL
);

PostgreSQL

CREATE TABLE invoices (
  id BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
  total NUMERIC(12,2) NOT NULL
);

MySQL 8+

CREATE TABLE invoices (
  id BIGINT AUTO_INCREMENT PRIMARY KEY,
  total DECIMAL(12,2) NOT NULL
);

SQLite 3

CREATE TABLE invoices (
  id INTEGER PRIMARY KEY,
  total NUMERIC NOT NULL
);