最佳答案
我试图找到一些方法,以 相关列类型跨越最常用的数据库: MySQL,PostgreSQL,和 SQLite。
以下是我目前为止所做的工作,但恐怕还没有完成,我需要一些更有经验的人来帮助我完成任何类型的缺失。
MySQL PostgreSQL SQLite
TINYINT SMALLINT INTEGER
SMALLINT SMALLINT
MEDIUMINT INTEGER
BIGINT BIGINT
BIT BIT INTEGER
_______________________________________________________
TINYINT UNSIGNED SMALLINT INTEGER
SMALLINT UNSIGNED INTEGER
MEDIUMINT UNSIGNED INTEGER
INT UNSIGNED BIGINT
BIGINT UNSIGNED NUMERIC(20)
_______________________________________________________
DOUBLE DOUBLE PRECISION REAL
FLOAT REAL REAL
DECIMAL DECIMAL REAL
NUMERIC NUMERIC REAL
_______________________________________________________
BOOLEAN BOOLEAN INTEGER
_______________________________________________________
DATE DATE TEXT
TIME TIME
DATETIME TIMESTAMP
_______________________________________________________
TIMESTAMP DEFAULT TIMESTAMP DEFAULT TEXT
NOW() NOW()
_______________________________________________________
LONGTEXT TEXT TEXT
MEDIUMTEXT TEXT TEXT
BLOB BYTEA BLOB
VARCHAR VARCHAR TEXT
CHAR CHAR TEXT
_______________________________________________________
columnname INT columnname SERIAL INTEGER PRIMARY
AUTO_INCREMENT KEY AUTOINCREMENT