今天小编给大家分享一下liquibase中不同数据库之间的数据类型对应关系是什么的相关知识点,内容详细,逻辑清晰,相信大部分人都还太了解这方面的知识,所以分享这篇文章给大家参考一下,希望大家阅读完这篇文章后有所收获,下面我们一起来了解一下吧。
数据库设计时,经常会有跨数据库平台的要求。虽然不同数据库的数据类型各不一样,但都可以找到代替的数据库类型。
如mysql有tinyint类型,但oracle只有number,这时可以使用number(3)代替tinyint。
MySQL中有boolean类型,但只是TINYINT(1)的别名。为了方便和其它数据库boolean类型对应,liquibase使用BIT(1)作为MySQL的boolean类型。
另外,navicat在对不同数据库进行转换时,varchar2超过1000个字符,就会用clob代替。可以考虑将varchar的最大长度规定为1000。
这里列出数据库管理工具liquibase中不同数据库之间的的数据类型对应关系,作为参考。
booleanMySQLDatabase: BIT(1)SQLiteDatabase: BOOLEANH2Database: BOOLEANPostgresDatabase: BOOLEANUnsupportedDatabase: BOOLEANDB2Database: SMALLINTMSSQLDatabase: [bit]OracleDatabase: NUMBER(1)HsqlDatabase: BOOLEANFirebirdDatabase: SMALLINTDerbyDatabase: SMALLINTInformixDatabase: BOOLEANSybaseDatabase: BITSybaseASADatabase: BITtinyintMySQLDatabase: TINYINTSQLiteDatabase: TINYINTH2Database: TINYINTPostgresDatabase: SMALLINTUnsupportedDatabase: TINYINTDB2Database: SMALLINTMSSQLDatabase: [tinyint]OracleDatabase: NUMBER(3)HsqlDatabase: TINYINTFirebirdDatabase: SMALLINTDerbyDatabase: SMALLINTInformixDatabase: TINYINTSybaseDatabase: TINYINTSybaseASADatabase: TINYINTintMySQLDatabase: INTSQLiteDatabase: INTEGERH2Database: INTPostgresDatabase: INTUnsupportedDatabase: INTDB2Database: INTEGERMSSQLDatabase: [int]OracleDatabase: INTEGERHsqlDatabase: INTFirebirdDatabase: INTDerbyDatabase: INTEGERInformixDatabase: INTSybaseDatabase: INTSybaseASADatabase: INTmediumintMySQLDatabase: MEDIUMINTSQLiteDatabase: MEDIUMINTH2Database: MEDIUMINTPostgresDatabase: MEDIUMINTUnsupportedDatabase: MEDIUMINTDB2Database: MEDIUMINTMSSQLDatabase: [int]OracleDatabase: MEDIUMINTHsqlDatabase: MEDIUMINTFirebirdDatabase: MEDIUMINTDerbyDatabase: MEDIUMINTInformixDatabase: MEDIUMINTSybaseDatabase: MEDIUMINTSybaseASADatabase: MEDIUMINTbigintMySQLDatabase: BIGINTSQLiteDatabase: BIGINTH2Database: BIGINTPostgresDatabase: BIGINTUnsupportedDatabase: BIGINTDB2Database: BIGINTMSSQLDatabase: [bigint]OracleDatabase: NUMBER(38, 0)HsqlDatabase: BIGINTFirebirdDatabase: BIGINTDerbyDatabase: BIGINTInformixDatabase: INT8SybaseDatabase: BIGINTSybaseASADatabase: BIGINTfloatMySQLDatabase: FLOATSQLiteDatabase: FLOATH2Database: FLOATPostgresDatabase: FLOATUnsupportedDatabase: FLOATDB2Database: FLOATMSSQLDatabase: [float](53)OracleDatabase: FLOATHsqlDatabase: FLOATFirebirdDatabase: FLOATDerbyDatabase: FLOATInformixDatabase: FLOATSybaseDatabase: FLOATSybaseASADatabase: FLOATdoubleMySQLDatabase: DOUBLESQLiteDatabase: DOUBLEH2Database: DOUBLEPostgresDatabase: DOUBLE PRECISIONUnsupportedDatabase: DOUBLEDB2Database: DOUBLEMSSQLDatabase: [float](53)OracleDatabase: FLOAT(24)HsqlDatabase: DOUBLEFirebirdDatabase: DOUBLE PRECISIONDerbyDatabase: DOUBLEInformixDatabase: DOUBLE PRECISIONSybaseDatabase: DOUBLESybaseASADatabase: DOUBLEdecimalMySQLDatabase: DECIMALSQLiteDatabase: DECIMALH2Database: DECIMALPostgresDatabase: DECIMALUnsupportedDatabase: DECIMALDB2Database: DECIMALMSSQLDatabase: [decimal](18, 0)OracleDatabase: DECIMALHsqlDatabase: DECIMALFirebirdDatabase: DECIMALDerbyDatabase: DECIMALInformixDatabase: DECIMALSybaseDatabase: DECIMALSybaseASADatabase: DECIMALnumberMySQLDatabase: numericSQLiteDatabase: NUMBERH2Database: NUMBERPostgresDatabase: numericUnsupportedDatabase: NUMBERDB2Database: numericMSSQLDatabase: [numeric](18, 0)OracleDatabase: NUMBERHsqlDatabase: numericFirebirdDatabase: numericDerbyDatabase: numericInformixDatabase: numericSybaseDatabase: numericSybaseASADatabase: numericblobMySQLDatabase: LONGBLOBSQLiteDatabase: BLOBH2Database: BLOBPostgresDatabase: BYTEAUnsupportedDatabase: BLOBDB2Database: BLOBMSSQLDatabase: [varbinary](MAX)OracleDatabase: BLOBHsqlDatabase: BLOBFirebirdDatabase: BLOBDerbyDatabase: BLOBInformixDatabase: BLOBSybaseDatabase: IMAGESybaseASADatabase: LONG BINARYfunctionMySQLDatabase: FUNCTIONSQLiteDatabase: FUNCTIONH2Database: FUNCTIONPostgresDatabase: FUNCTIONUnsupportedDatabase: FUNCTIONDB2Database: FUNCTIONMSSQLDatabase: [function]OracleDatabase: FUNCTIONHsqlDatabase: FUNCTIONFirebirdDatabase: FUNCTIONDerbyDatabase: FUNCTIONInformixDatabase: FUNCTIONSybaseDatabase: FUNCTIONSybaseASADatabase: FUNCTIONUNKNOWNMySQLDatabase: UNKNOWNSQLiteDatabase: UNKNOWNH2Database: UNKNOWNPostgresDatabase: UNKNOWNUnsupportedDatabase: UNKNOWNDB2Database: UNKNOWNMSSQLDatabase: [UNKNOWN]OracleDatabase: UNKNOWNHsqlDatabase: UNKNOWNFirebirdDatabase: UNKNOWNDerbyDatabase: UNKNOWNInformixDatabase: UNKNOWNSybaseDatabase: UNKNOWNSybaseASADatabase: UNKNOWNdatetimeMySQLDatabase: datetimeSQLiteDatabase: TEXTH2Database: TIMESTAMPPostgresDatabase: TIMESTAMP WITHOUT TIME ZONEUnsupportedDatabase: datetimeDB2Database: TIMESTAMPMSSQLDatabase: [datetime]OracleDatabase: TIMESTAMPHsqlDatabase: TIMESTAMPFirebirdDatabase: TIMESTAMPDerbyDatabase: TIMESTAMPInformixDatabase: DATETIME YEAR TO FRACTION(5)SybaseDatabase: datetimeSybaseASADatabase: datetimetimeMySQLDatabase: timeSQLiteDatabase: timeH2Database: timePostgresDatabase: TIME WITHOUT TIME ZONEUnsupportedDatabase: timeDB2Database: timeMSSQLDatabase: [time](7)OracleDatabase: DATEHsqlDatabase: timeFirebirdDatabase: timeDerbyDatabase: timeInformixDatabase: INTERVAL HOUR TO FRACTION(5)SybaseDatabase: timeSybaseASADatabase: timetimestampMySQLDatabase: timestampSQLiteDatabase: TEXTH2Database: TIMESTAMPPostgresDatabase: TIMESTAMP WITHOUT TIME ZONEUnsupportedDatabase: timestampDB2Database: timestampMSSQLDatabase: [datetime]OracleDatabase: TIMESTAMPHsqlDatabase: TIMESTAMPFirebirdDatabase: TIMESTAMPDerbyDatabase: TIMESTAMPInformixDatabase: DATETIME YEAR TO FRACTION(5)SybaseDatabase: datetimeSybaseASADatabase: timestampdateMySQLDatabase: dateSQLiteDatabase: dateH2Database: datePostgresDatabase: dateUnsupportedDatabase: dateDB2Database: dateMSSQLDatabase: [date]OracleDatabase: dateHsqlDatabase: dateFirebirdDatabase: dateDerbyDatabase: dateInformixDatabase: dateSybaseDatabase: dateSybaseASADatabase: datecharMySQLDatabase: CHARSQLiteDatabase: CHARH2Database: CHARPostgresDatabase: CHARUnsupportedDatabase: CHARDB2Database: CHARMSSQLDatabase: [char](1)OracleDatabase: CHARHsqlDatabase: CHARFirebirdDatabase: CHARDerbyDatabase: CHARInformixDatabase: CHARSybaseDatabase: CHARSybaseASADatabase: CHARvarcharMySQLDatabase: VARCHARSQLiteDatabase: VARCHARH2Database: VARCHARPostgresDatabase: VARCHARUnsupportedDatabase: VARCHARDB2Database: VARCHARMSSQLDatabase: [varchar](1)OracleDatabase: VARCHAR2HsqlDatabase: VARCHARFirebirdDatabase: VARCHARDerbyDatabase: VARCHARInformixDatabase: VARCHARSybaseDatabase: VARCHARSybaseASADatabase: VARCHARncharMySQLDatabase: NCHARSQLiteDatabase: NCHARH2Database: NCHARPostgresDatabase: NCHARUnsupportedDatabase: NCHARDB2Database: NCHARMSSQLDatabase: [nchar](1)OracleDatabase: NCHARHsqlDatabase: CHARFirebirdDatabase: NCHARDerbyDatabase: NCHARInformixDatabase: NCHARSybaseDatabase: NCHARSybaseASADatabase: NCHARnvarcharMySQLDatabase: NVARCHARSQLiteDatabase: NVARCHARH2Database: NVARCHARPostgresDatabase: VARCHARUnsupportedDatabase: NVARCHARDB2Database: NVARCHARMSSQLDatabase: [nvarchar](1)OracleDatabase: NVARCHAR2HsqlDatabase: VARCHARFirebirdDatabase: NVARCHARDerbyDatabase: VARCHARInformixDatabase: NVARCHARSybaseDatabase: NVARCHARSybaseASADatabase: NVARCHARclobMySQLDatabase: LONGTEXTSQLiteDatabase: TEXTH2Database: CLOBPostgresDatabase: TEXTUnsupportedDatabase: CLOBDB2Database: CLOBMSSQLDatabase: [varchar](MAX)OracleDatabase: CLOBHsqlDatabase: CLOBFirebirdDatabase: BLOB SUB_TYPE TEXTDerbyDatabase: CLOBInformixDatabase: CLOBSybaseDatabase: TEXTSybaseASADatabase: LONG VARCHARcurrencyMySQLDatabase: DECIMALSQLiteDatabase: REALH2Database: DECIMALPostgresDatabase: DECIMALUnsupportedDatabase: DECIMALDB2Database: DECIMAL(19, 4)MSSQLDatabase: [money]OracleDatabase: NUMBER(15, 2)HsqlDatabase: DECIMALFirebirdDatabase: DECIMAL(18, 4)DerbyDatabase: DECIMALInformixDatabase: MONEYSybaseDatabase: MONEYSybaseASADatabase: MONEYuuidMySQLDatabase: char(36)SQLiteDatabase: TEXTH2Database: UUIDPostgresDatabase: UUIDUnsupportedDatabase: char(36)DB2Database: char(36)MSSQLDatabase: [uniqueidentifier]OracleDatabase: RAW(16)HsqlDatabase: char(36)FirebirdDatabase: char(36)DerbyDatabase: char(36)InformixDatabase: char(36)SybaseDatabase: UNIQUEIDENTIFIERSybaseASADatabase: UNIQUEIDENTIFIER
以上就是“liquibase中不同数据库之间的数据类型对应关系是什么”这篇文章的所有内容,感谢各位的阅读!相信大家阅读完这篇文章都有很大的收获,小编每天都会为大家更新不同的知识,如果还想学习更多的知识,请关注编程网行业资讯频道。