Hello, I have following changeset:
- <changeSet author="author" id="id">
- <createTable tableName="TABLE1">
- <column autoIncrement="true" name="ID" type="java.lang.Long">
- <constraints primaryKey="true"primaryKeyName="PK__ID"/>
- </column>
- <column name="NAMESPACE_ID" type="java.lang.Long">
- <constraints nullable="false"/>
- </column>
- <column name="UUID" type="java.lang.String(256)">
- <constraints nullable="false"/>
- </column>
- <column name="DESCRIPTION" type="java.lang.String(2000)"/>
- <column name="NAME" type="java.lang.String(255)"/>
- <column name="VALUE" type="java.lang.String(2000)"/>
- </createTable>
- </changeSet>
Which ends up with following scripts for DBMS I'm interested in:
Oracle
- CREATE TABLE TABLE1 (ID NUMBER(38, 0) NOT NULL, NAMESPACE_ID NUMBER(19, 0) NOT NULL, UUID VARCHAR2(256) NOT NULL, DESCRIPTION VARCHAR2(2000), NAME VARCHAR2(255), VALUE VARCHAR2(2000), CONSTRAINT PK__ID PRIMARY KEY (ID));
MsSql
- CREATE TABLE TABLE1 ([ID] BIGINT IDENTITY (1, 1) NOT NULL, [NAMESPACE_ID] BIGINT NOT NULL, [UUID] VARCHAR(256) NOT NULL, [DESCRIPTION] VARCHAR(2000), [NAME] VARCHAR(255), [VALUE] VARCHAR(2000), CONSTRAINT [PK__ID] PRIMARY KEY ([ID]))
How can I change changeset above to generate slightly different SQLs? See below:
Oracle
- CREATE TABLE TABLE1 (ID NUMBER(19, 0) NOT NULL, NAMESPACE_ID NUMBER(19, 0) NOT NULL, UUID VARCHAR2(256 CHAR) NOT NULL, DESCRIPTION VARCHAR2(2000 CHAR), NAME VARCHAR2(255 CHAR), VALUE VARCHAR2(2000 CHAR), CONSTRAINT PK__ID PRIMARY KEY (ID));
MsSql
- CREATE TABLE TABLE1 ([ID] BIGINT IDENTITY (1, 1) NOT NULL, [NAMESPACE_ID] BIGINT NOT NULL, [UUID] NVARCHAR(256) NOT NULL, [DESCRIPTION] NVARCHAR(2000), [NAME] NVARCHAR(255), [VALUE] NVARCHAR(2000), CONSTRAINT [PK__ID] PRIMARY KEY ([ID]))
It would be good to be able to define such conversion for all changeset in one place, so I believe modifySql wouldn't help me here.