Tag

Schemas

SQL differences

MySQL Refuses a Plain DEFAULT Value on TEXT Columns

A notes column declared as TEXT DEFAULT '' works on SQLite, PostgreSQL and MariaDB. MySQL refuses the CREATE TABLE. MySQL 8.0.13 and later accept a default written as an …

SQL differences

MySQL Refuses CREATE INDEX IF NOT EXISTS

Migrations that may run twice often say CREATE INDEX IF NOT EXISTS, and SQLite, PostgreSQL and MariaDB accept it. MySQL stops the migration with a syntax error. MySQL …

SQL differences

SQLite Has No CREATE OR REPLACE VIEW

CREATE OR REPLACE VIEW lets a migration change a view in one step on PostgreSQL, MySQL and MariaDB. On SQLite the statement is a syntax error. SQLite can only drop a view …

SQL differences

VARCHAR Without a Length Fails on MySQL and MariaDB

Schemas written for PostgreSQL often declare names and notes as plain VARCHAR, with no length. MySQL and MariaDB refuse that CREATE TABLE, since they want a length on …