diff --git a/others/db_changes/readme.adoc b/others/db_changes/readme.adoc index 0a3669f7cef26fe0366c348d411d4d874a1732ce..0eb0f310d1afc59d57d5cff6b0ce5e84543ce4ed 100644 --- a/others/db_changes/readme.adoc +++ b/others/db_changes/readme.adoc @@ -73,8 +73,7 @@ Therefore it's easy to use and you can start immediately. == FAQ [qanda] What about unicode-columns like `NVARCHAR` or `NCLOB`?:: - Simply define them in your changesets; This is something which is not completely verified: - Maybe columns like `NCLOB` cause problems in some DBMS like _MS SQL Server_ + Simply define them in your changesets. They are prefered over non-unicode-datatypes What if i switch between branches and want to switch between different database-states?:: This is something that needs to be defined. Possible ways: rollback or recreate your database entirely Is it possible to write an update-changeset where I can use a preparedStatement in the where-clause?:: diff --git a/others/db_changes/struct/contractChanges.xml b/others/db_changes/struct/contractChanges.xml deleted file mode 100644 index f7f2e2c301f1d2493348bd0943e6bf98687ffcd3..0000000000000000000000000000000000000000 --- a/others/db_changes/struct/contractChanges.xml +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.1" encoding="UTF-8" standalone="no"?> -<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd"> - <changeSet author="m.schroeger" id="eae40a20-2a4a-4a96-99f6-b66fb9f5e6c9"> - <addUniqueConstraint tableName="CONTRACT" columnNames="CONTRACTCODE" constraintName="unique_CONTRACT_CONTRACTCODE"/> - - </changeSet> -</databaseChangeLog> \ No newline at end of file diff --git a/others/db_changes/struct/create_address.xml b/others/db_changes/struct/create_address.xml index 3444b2f8c99947b144e827e6ccf6664db13039b1..9ec6e0e9ad1890ecb53b483932538a2a2f291951 100644 --- a/others/db_changes/struct/create_address.xml +++ b/others/db_changes/struct/create_address.xml @@ -10,23 +10,23 @@ <constraints nullable="false"/> </column> <column name="ADDR_TYPE" type="SMALLINT"/> - <column name="USER_EDIT" type="VARCHAR(50)"/> - <column name="USER_NEW" type="VARCHAR(50)"> + <column name="USER_EDIT" type="NVARCHAR(50)"/> + <column name="USER_NEW" type="NVARCHAR(50)"> <constraints nullable="false"/> </column> - <column name="ADDRESS" type="VARCHAR(50)"/> - <column name="ADDRESSADDITION" type="VARCHAR(60)"/> - <column name="ADDRIDENTIFIER" type="VARCHAR(60)"/> - <column name="BUILDINGNO" type="VARCHAR(50)"/> - <column name="CITY" type="VARCHAR(50)"/> + <column name="ADDRESS" type="NVARCHAR(50)"/> + <column name="ADDRESSADDITION" type="NVARCHAR(60)"/> + <column name="ADDRIDENTIFIER" type="NVARCHAR(60)"/> + <column name="BUILDINGNO" type="NVARCHAR(50)"/> + <column name="CITY" type="NVARCHAR(50)"/> <column name="COUNTRY" type="CHAR(2)"/> - <column name="DISTRICT" type="VARCHAR(50)"/> - <column name="REGION" type="VARCHAR(50)"/> + <column name="DISTRICT" type="NVARCHAR(50)"/> + <column name="REGION" type="NVARCHAR(50)"/> <column name="RELATION_ID" type="CHAR(36)"> <constraints nullable="false"/> </column> - <column name="STATE" type="VARCHAR(50)"/> - <column name="ZIP" type="VARCHAR(50)"/> + <column name="STATE" type="NVARCHAR(50)"/> + <column name="ZIP" type="NVARCHAR(50)"/> </createTable> <addColumn tableName="RELATION"> diff --git a/others/db_changes/struct/create_comm.xml b/others/db_changes/struct/create_comm.xml index ce1a745f3f4078c73406a22dccebdb8ef01166fd..0e98076aeee24d74dc62d0fec27cbc735dbbf173 100644 --- a/others/db_changes/struct/create_comm.xml +++ b/others/db_changes/struct/create_comm.xml @@ -5,7 +5,7 @@ <column name="COMMID" type="CHAR(36)"> <constraints primaryKey="true" primaryKeyName="PK_COMM_COMMID"/> </column> - <column name="ADDR" type="VARCHAR(255)"/> + <column name="ADDR" type="NVARCHAR(255)"/> <column name="MEDIUM_ID" type="INTEGER"/> <column name="RELATION_ID" type="CHAR(36)"/> <column name="STANDARD" type="TINYINT"> @@ -15,8 +15,8 @@ <column name="DATE_NEW" type="TIMESTAMP"> <constraints nullable="false"/> </column> - <column name="USER_EDIT" type="VARCHAR(50)"/> - <column name="USER_NEW" type="VARCHAR(50)"> + <column name="USER_EDIT" type="NVARCHAR(50)"/> + <column name="USER_NEW" type="NVARCHAR(50)"> <constraints nullable="false"/> </column> </createTable> diff --git a/others/db_changes/struct/create_contract.xml b/others/db_changes/struct/create_contract.xml index 6844b7e21fe3ed1a9ffe25478f42cdd4af8e86d5..b6eaabc5acade5bd548f94faddfaf5a36d223daa 100644 --- a/others/db_changes/struct/create_contract.xml +++ b/others/db_changes/struct/create_contract.xml @@ -2,7 +2,7 @@ <databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd"> <changeSet author="m.schroeger" id="fdf350de-cff9-4be1-bcbe-61ec9a46c9f0"> <createTable tableName="CONTRACT"> - <column name="CONTRACTCODE" type="VARCHAR(30)"> + <column name="CONTRACTCODE" type="NVARCHAR(30)"> <constraints nullable="false" unique="true" uniqueConstraintName="UNIQUE_CONTRACT_CONTRACTCODE"/> </column> <column name="CONTRACTDUE" type="TIMESTAMP"/> @@ -13,8 +13,8 @@ </column> <column name="CONTRACTSTATUS" type="INTEGER"/> <column name="CONTRACTTYPE" type="INTEGER"/> - <column name="USER_EDIT" type="VARCHAR(50)"/> - <column name="USER_NEW" type="VARCHAR(50)"> + <column name="USER_EDIT" type="NVARCHAR(50)"/> + <column name="USER_NEW" type="NVARCHAR(50)"> <constraints nullable="false"/> </column> <column name="DATE_NEW" type="TIMESTAMP"> diff --git a/others/db_changes/struct/create_countryinfo.xml b/others/db_changes/struct/create_countryinfo.xml index 83b6922f41f60811f721af550d543b8784eb474a..eb467867be4e052a198bb01373f4b45e16dd21ed 100644 --- a/others/db_changes/struct/create_countryinfo.xml +++ b/others/db_changes/struct/create_countryinfo.xml @@ -8,11 +8,11 @@ <column name="ISO3" type="CHAR(3)"> <constraints nullable="false"/> </column> - <column name="NAME_LATIN" type="VARCHAR(100)"/> + <column name="NAME_LATIN" type="NVARCHAR(100)"/> <column name="NAME_NATIVE" type="NVARCHAR(100)"/> - <column name="ADDR_FORMAT" type="VARCHAR(50)"/> - <column name="REQUIRED_FIELDS" type="VARCHAR(50)"/> - <column name="ZIP_REGEX" type="VARCHAR(2000)"/> + <column name="ADDR_FORMAT" type="NVARCHAR(50)"/> + <column name="REQUIRED_FIELDS" type="NVARCHAR(50)"/> + <column name="ZIP_REGEX" type="NVARCHAR(2000)"/> <column name="DATE_NEW" type="TIMESTAMP"> <constraints nullable="false"/> </column> diff --git a/others/db_changes/struct/create_history.xml b/others/db_changes/struct/create_history.xml index 5a648df0cb14c5168aca2a69f6c6f80d4141c827..1bb222b3e2b7f2e30b16cdb190b7f7e4608ec408 100644 --- a/others/db_changes/struct/create_history.xml +++ b/others/db_changes/struct/create_history.xml @@ -2,7 +2,7 @@ <databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd"> <changeSet author="d.lechner" id="1528461798137-1"> <createTable tableName="HISTORY"> - <column name="SUBJECT" type="VARCHAR(254)"/> + <column name="SUBJECT" type="NVARCHAR(254)"/> <column name="INFO" type="NCLOB"/> <column name="MEDIUM" type="INTEGER"/> <column name="DIRECTION" type="CHAR(1)"/> @@ -10,10 +10,10 @@ <column name="HISTORYID" type="CHAR(36)"> <constraints primaryKey="true" primaryKeyName="PK_HISTORY_HISTORYID"/> </column> - <column name="USER_NEW" type="VARCHAR(50)"> + <column name="USER_NEW" type="NVARCHAR(50)"> <constraints nullable="false"/> </column> - <column name="USER_EDIT" type="VARCHAR(50)"/> + <column name="USER_EDIT" type="NVARCHAR(50)"/> <column name="DATE_NEW" type="TIMESTAMP"> <constraints nullable="false"/> </column> diff --git a/others/db_changes/struct/create_offer.xml b/others/db_changes/struct/create_offer.xml index a0a379cefc074d0117b645d9e267fae0e0d3b80f..de77d4e25e68f469e61a5a283dc01119798ceda1 100644 --- a/others/db_changes/struct/create_offer.xml +++ b/others/db_changes/struct/create_offer.xml @@ -25,8 +25,8 @@ <column name="DATE_NEW" type="TIMESTAMP"> <constraints nullable="false"/> </column> - <column name="USER_EDIT" type="VARCHAR(50)"/> - <column name="USER_NEW" type="VARCHAR(50)"> + <column name="USER_EDIT" type="NVARCHAR(50)"/> + <column name="USER_NEW" type="NVARCHAR(50)"> <constraints nullable="false"/> </column> </createTable> diff --git a/others/db_changes/struct/create_offeritem.xml b/others/db_changes/struct/create_offeritem.xml index ee141f069a210d9066e4b96b2ad6d789de06fd7f..4e2a246e0377c0341d213eb64603be73e315c1b2 100644 --- a/others/db_changes/struct/create_offeritem.xml +++ b/others/db_changes/struct/create_offeritem.xml @@ -19,18 +19,18 @@ <constraints nullable="false" foreignKeyName="FK_OFFERITEM_PRODUCT_ID" references="PRODUCT(PRODUCTID)"/> </column> <column name="VAT" type="NUMERIC(14,2)"/> - <column name="ITEMNAME" type="VARCHAR(250)"/> + <column name="ITEMNAME" type="NVARCHAR(250)"/> <column name="OPTIONAL" type="TINYINT"> <constraints nullable="false"/> </column> <column name="DISCOUNT" type="NUMERIC(14,2)"/> - <column name="ITEMPOSITION" type="VARCHAR(10)"/> + <column name="ITEMPOSITION" type="NVARCHAR(10)"/> <column name="DATE_EDIT" type="TIMESTAMP"/> <column name="DATE_NEW" type="TIMESTAMP"> <constraints nullable="false"/> </column> - <column name="USER_EDIT" type="VARCHAR(50)"/> - <column name="USER_NEW" type="VARCHAR(50)"> + <column name="USER_EDIT" type="NVARCHAR(50)"/> + <column name="USER_NEW" type="NVARCHAR(50)"> <constraints nullable="false"/> </column> </createTable> diff --git a/others/db_changes/struct/create_org.xml b/others/db_changes/struct/create_org.xml index 8622d415d06ab3e9caa39aa4e3b856f5e2bdaa8c..1cb5a208219be48e0e54c81d6d270d8df2632da0 100644 --- a/others/db_changes/struct/create_org.xml +++ b/others/db_changes/struct/create_org.xml @@ -16,10 +16,10 @@ <column name="STRENGTH" type="INTEGER"/> <column name="WEAKNESS" type="INTEGER"/> - <column name="USER_NEW" type="VARCHAR(50)"> + <column name="USER_NEW" type="NVARCHAR(50)"> <constraints nullable="false"/> </column> - <column name="USER_EDIT" type="VARCHAR(50)"/> + <column name="USER_EDIT" type="NVARCHAR(50)"/> <column name="DATE_NEW" type="TIMESTAMP"> <constraints nullable="false"/> </column> diff --git a/others/db_changes/struct/create_pers.xml b/others/db_changes/struct/create_pers.xml index 4ee0fc967d4497985a9b4816a8268a986961dde0..6943d73ad9557d0e573406329e3d4d5f0fddfae8 100644 --- a/others/db_changes/struct/create_pers.xml +++ b/others/db_changes/struct/create_pers.xml @@ -8,17 +8,17 @@ <column name="DATE_EDIT" type="TIMESTAMP"/> <column name="DATE_NEW" type="TIMESTAMP"/> <column name="DATEOFBIRTH" type="DATE"/> - <column name="USER_EDIT" type="VARCHAR(50)"/> - <column name="USER_NEW" type="VARCHAR(50)"/> - <column name="FIRSTNAME" type="VARCHAR(50)"/> - <column name="MIDDLENAME" type="VARCHAR(50)"/> - <column name="LASTNAME" type="VARCHAR(50)"> + <column name="USER_EDIT" type="NVARCHAR(50)"/> + <column name="USER_NEW" type="NVARCHAR(50)"/> + <column name="FIRSTNAME" type="NVARCHAR(50)"/> + <column name="MIDDLENAME" type="NVARCHAR(50)"/> + <column name="LASTNAME" type="NVARCHAR(50)"> <constraints nullable="false"/> </column> <column name="GENDER" type="CHAR(1)"/> - <column name="SALUTATION" type="VARCHAR(16)"/> - <column name="TITLE" type="VARCHAR(50)"/> - <column name="TITLESUFFIX" type="VARCHAR(50)"/> + <column name="SALUTATION" type="NVARCHAR(16)"/> + <column name="TITLE" type="NVARCHAR(50)"/> + <column name="TITLESUFFIX" type="NVARCHAR(50)"/> </createTable> <createIndex indexName="IDX_PERS" tableName="PERS"> <column name="FIRSTNAME"/> diff --git a/others/db_changes/struct/create_prod2prod.xml b/others/db_changes/struct/create_prod2prod.xml index a52b1bda725e90110861624675e462f9067f8ea3..8dd66b17a3764fb4237779112ff196e35835005d 100644 --- a/others/db_changes/struct/create_prod2prod.xml +++ b/others/db_changes/struct/create_prod2prod.xml @@ -22,8 +22,8 @@ <column name="DATE_NEW" type="TIMESTAMP"> <constraints nullable="false"/> </column> - <column name="USER_EDIT" type="VARCHAR(50)"/> - <column name="USER_NEW" type="VARCHAR(50)"> + <column name="USER_EDIT" type="NVARCHAR(50)"/> + <column name="USER_NEW" type="NVARCHAR(50)"> <constraints nullable="false"/> </column> </createTable> diff --git a/others/db_changes/struct/create_product.xml b/others/db_changes/struct/create_product.xml index 73153b0db2592d421b9f9e4c7e8f8a3fe3091c21..7066b391703f2e0bd4c05e3dc4c27be177371023 100644 --- a/others/db_changes/struct/create_product.xml +++ b/others/db_changes/struct/create_product.xml @@ -9,10 +9,10 @@ <column name="GROUPCODEID" type="INTEGER"/> <column name="MINSTOCK" type="INTEGER"/> <column name="RELATION_ID" type="CHAR(36)"/> - <column name="PRODUCTCODE" type="VARCHAR(50)"> + <column name="PRODUCTCODE" type="NVARCHAR(50)"> <constraints nullable="false" unique="true" uniqueConstraintName="UNIQUE_PRODUCT_PRODUCTCODE"/> </column> - <column name="PRODUCTNAME" type="VARCHAR(50)"/> + <column name="PRODUCTNAME" type="NVARCHAR(50)"/> <column name="STATUS" type="INTEGER"/> <column name="UNIT" type="INTEGER"/> <column name="STANDARD" type="INTEGER"/> @@ -20,8 +20,8 @@ <column name="DATE_NEW" type="TIMESTAMP"> <constraints nullable="false"/> </column> - <column name="USER_EDIT" type="VARCHAR(50)"/> - <column name="USER_NEW" type="VARCHAR(50)"> + <column name="USER_EDIT" type="NVARCHAR(50)"/> + <column name="USER_NEW" type="NVARCHAR(50)"> <constraints nullable="false"/> </column> </createTable> diff --git a/others/db_changes/struct/create_productprice.xml b/others/db_changes/struct/create_productprice.xml index 662969bf891b9df18f6af2eca82b3a9ad23f7c73..626c98b68d552431829c701f00198ccf8131e141 100644 --- a/others/db_changes/struct/create_productprice.xml +++ b/others/db_changes/struct/create_productprice.xml @@ -19,13 +19,13 @@ <constraints nullable="false"/> </column> <column name="PRICELIST" type="INTEGER"/> - <column name="BUYSELL" type="VARCHAR(5)"/> + <column name="BUYSELL" type="NVARCHAR(5)"/> <column name="DATE_EDIT" type="TIMESTAMP"/> <column name="DATE_NEW" type="TIMESTAMP"> <constraints nullable="false"/> </column> - <column name="USER_EDIT" type="VARCHAR(50)"/> - <column name="USER_NEW" type="VARCHAR(50)"> + <column name="USER_EDIT" type="NVARCHAR(50)"/> + <column name="USER_NEW" type="NVARCHAR(50)"> <constraints nullable="false"/> </column> </createTable> diff --git a/others/db_changes/struct/create_relation.xml b/others/db_changes/struct/create_relation.xml index cc007b21963e818135141aa808c7fdcac2bdee0c..33a4bc63da9ce1ef2b91aa27de9069a681746005 100644 --- a/others/db_changes/struct/create_relation.xml +++ b/others/db_changes/struct/create_relation.xml @@ -10,10 +10,10 @@ <column name="RELATIONID" type="CHAR(36)"> <constraints primaryKey="true" primaryKeyName="PK_RELATION_RELATIONID"/> </column> - <column name="USER_NEW" type="VARCHAR(50)"> + <column name="USER_NEW" type="NVARCHAR(50)"> <constraints nullable="false"/> </column> - <column name="USER_EDIT" type="VARCHAR(50)"/> + <column name="USER_EDIT" type="NVARCHAR(50)"/> <column name="DATE_NEW" type="TIMESTAMP"> <constraints nullable="false"/> </column> diff --git a/others/db_changes/struct/create_salesproject.xml b/others/db_changes/struct/create_salesproject.xml index fa50bd40ff54c395051a1d749addfa016f6f5aa1..614658b91eb93bc72a478b3d1cb7200fa57c6afb 100644 --- a/others/db_changes/struct/create_salesproject.xml +++ b/others/db_changes/struct/create_salesproject.xml @@ -6,7 +6,7 @@ <column name="PROJECTCODE" type="INTEGER"> <constraints nullable="false" unique="true" uniqueConstraintName="UNIQUE_SALESPROJECT_PROJECTCODE" /> </column> - <column name="PROJECTTITLE" type="VARCHAR(30)"/> + <column name="PROJECTTITLE" type="NVARCHAR(30)"/> <column name="RELATION_ID" type="CHAR(36)"> <constraints nullable="false"/> </column> @@ -16,7 +16,7 @@ <column name="VOLUME" type="NUMERIC(14,2)"/> <column name="STARTDATE" type="TIMESTAMP"/> <column name="ENDDATE" type="TIMESTAMP"/> - <column name="ESTIMATION" type="VARCHAR(50)"/> + <column name="ESTIMATION" type="NVARCHAR(50)"/> <column name="ESTIMATIONVALUE" type="INTEGER"/> <column name="PROBABILITY" type="INTEGER"/> @@ -24,8 +24,8 @@ <constraints primaryKey="true" primaryKeyName="PK_SALESPROJECT_SALESPROJECTID"/> </column> - <column name="USER_EDIT" type="VARCHAR(50)"/> - <column name="USER_NEW" type="VARCHAR(50)"> + <column name="USER_EDIT" type="NVARCHAR(50)"/> + <column name="USER_NEW" type="NVARCHAR(50)"> <constraints nullable="false"/> </column> <column name="DATE_NEW" type="TIMESTAMP"> diff --git a/others/db_changes/struct/create_salesproject_classification.xml b/others/db_changes/struct/create_salesproject_classification.xml index 76c83bb8f880355a505b89ea128bbde26c7f6be9..0c5062330cadd78a9c8460500a557eb2f853932d 100644 --- a/others/db_changes/struct/create_salesproject_classification.xml +++ b/others/db_changes/struct/create_salesproject_classification.xml @@ -10,12 +10,12 @@ </column> <column name="CLASS" type="INTEGER"/> - <column name="TYPE" type="VARCHAR(50)"/> + <column name="TYPE" type="NVARCHAR(50)"/> <column name="VALUE" type="INTEGER"/> - <column name="USER_EDIT" type="VARCHAR(50)"/> - <column name="USER_NEW" type="VARCHAR(50)"> + <column name="USER_EDIT" type="NVARCHAR(50)"/> + <column name="USER_NEW" type="NVARCHAR(50)"> <constraints nullable="false"/> </column> <column name="DATE_NEW" type="TIMESTAMP"> diff --git a/others/db_changes/struct/create_salesproject_competition.xml b/others/db_changes/struct/create_salesproject_competition.xml index 7f362d063cc152500af7c8db0a39a5a4ca1b40d3..86a854e7764aaf56ee802a76d4fe225b099c5231 100644 --- a/others/db_changes/struct/create_salesproject_competition.xml +++ b/others/db_changes/struct/create_salesproject_competition.xml @@ -16,8 +16,8 @@ <column name="REASON" type="INTEGER"/> <column name="STATUS" type="INTEGER"/> - <column name="USER_EDIT" type="VARCHAR(50)"/> - <column name="USER_NEW" type="VARCHAR(50)"> + <column name="USER_EDIT" type="NVARCHAR(50)"/> + <column name="USER_NEW" type="NVARCHAR(50)"> <constraints nullable="false"/> </column> <column name="DATE_NEW" type="TIMESTAMP"> diff --git a/others/db_changes/struct/create_salesproject_cycle.xml b/others/db_changes/struct/create_salesproject_cycle.xml index 73db00ee2500b9baaf9adeb34284235b303610d6..cb64ce08576d761856502b495a302cb654ba1d89 100644 --- a/others/db_changes/struct/create_salesproject_cycle.xml +++ b/others/db_changes/struct/create_salesproject_cycle.xml @@ -15,8 +15,8 @@ <column name="DATE_START" type="TIMESTAMP"/> <column name="DATE_END" type="TIMESTAMP"/> - <column name="USER_EDIT" type="VARCHAR(50)"/> - <column name="USER_NEW" type="VARCHAR(50)"> + <column name="USER_EDIT" type="NVARCHAR(50)"/> + <column name="USER_NEW" type="NVARCHAR(50)"> <constraints nullable="false"/> </column> <column name="DATE_NEW" type="TIMESTAMP"> diff --git a/others/db_changes/struct/create_salesproject_forecast.xml b/others/db_changes/struct/create_salesproject_forecast.xml index 8f86a3b2d9d6ea50e5c7d2c2e3828d6206e97b21..299a4e16ae05c621baf1c717839d68002c9bd586 100644 --- a/others/db_changes/struct/create_salesproject_forecast.xml +++ b/others/db_changes/struct/create_salesproject_forecast.xml @@ -15,12 +15,12 @@ <column name="GROUPCODE" type="INTEGER"/> <column name="INFO" type="NCLOB"/> <column name="DATE_START" type="TIMESTAMP"/> - <column name="TYPE" type="VARCHAR(10)"/> + <column name="TYPE" type="NVARCHAR(10)"/> <column name="VOLUME" type="INTEGER"/> - <column name="USER_EDIT" type="VARCHAR(50)"/> - <column name="USER_NEW" type="VARCHAR(50)"> + <column name="USER_EDIT" type="NVARCHAR(50)"/> + <column name="USER_NEW" type="NVARCHAR(50)"> <constraints nullable="false"/> </column> <column name="DATE_NEW" type="TIMESTAMP"> diff --git a/others/db_changes/struct/create_salesproject_member.xml b/others/db_changes/struct/create_salesproject_member.xml index 29973e31174f997cf2c488c3158efeb69a9ab393..12d1cc07a69b9642442b45b9a6adda87516c8d0a 100644 --- a/others/db_changes/struct/create_salesproject_member.xml +++ b/others/db_changes/struct/create_salesproject_member.xml @@ -14,8 +14,8 @@ <column name="RELATIONSHIP" type="INTEGER"/> <column name="SALESPROJECT_ROLE" type="INTEGER"/> - <column name="USER_EDIT" type="VARCHAR(50)"/> - <column name="USER_NEW" type="VARCHAR(50)"> + <column name="USER_EDIT" type="NVARCHAR(50)"/> + <column name="USER_NEW" type="NVARCHAR(50)"> <constraints nullable="false"/> </column> <column name="DATE_NEW" type="TIMESTAMP"> diff --git a/others/db_changes/struct/create_salesproject_source.xml b/others/db_changes/struct/create_salesproject_source.xml index 60403186efb7ab78ed2de38928b2971f61a5be9e..7ac4385615ad2a51db5bd47abc33383aeae21278 100644 --- a/others/db_changes/struct/create_salesproject_source.xml +++ b/others/db_changes/struct/create_salesproject_source.xml @@ -13,8 +13,8 @@ </column> <column name="SOURCE" type="INTEGER"/> - <column name="USER_EDIT" type="VARCHAR(50)"/> - <column name="USER_NEW" type="VARCHAR(50)"> + <column name="USER_EDIT" type="NVARCHAR(50)"/> + <column name="USER_NEW" type="NVARCHAR(50)"> <constraints nullable="false"/> </column> <column name="DATE_NEW" type="TIMESTAMP"> diff --git a/others/db_changes/struct/create_stock.xml b/others/db_changes/struct/create_stock.xml index b5f0f600442a2e2db37a319640b5b6f0a744a32b..fdcbac4766938bb87e6f6c80e5cc8eccf289fb64 100644 --- a/others/db_changes/struct/create_stock.xml +++ b/others/db_changes/struct/create_stock.xml @@ -9,7 +9,7 @@ <constraints nullable="false"/> </column> <column name="QUANTITY" type="NUMERIC(14,2)"/> - <column name="REFNUMBER" type="VARCHAR(50)"/> + <column name="REFNUMBER" type="NVARCHAR(50)"/> <column name="PRODUCT_ID" type="CHAR(36)"> <constraints nullable="false" foreignKeyName="FK_STOCK_PRODUCT_ID" references="PRODUCT(PRODUCTID)"/> </column> @@ -19,8 +19,8 @@ <column name="DATE_NEW" type="TIMESTAMP"> <constraints nullable="false"/> </column> - <column name="USER_EDIT" type="VARCHAR(50)"/> - <column name="USER_NEW" type="VARCHAR(50)"> + <column name="USER_EDIT" type="NVARCHAR(50)"/> + <column name="USER_NEW" type="NVARCHAR(50)"> <constraints nullable="false"/> </column> </createTable> diff --git a/others/db_changes/struct/create_timetracking.xml b/others/db_changes/struct/create_timetracking.xml index 6947e705fd046f86d60840e8e99566cd15ad02c1..6a8cc243d86b63c3fc3b58773a925e10d715d577 100644 --- a/others/db_changes/struct/create_timetracking.xml +++ b/others/db_changes/struct/create_timetracking.xml @@ -23,10 +23,10 @@ <constraints nullable="false"/> </column> - <column name="USER_NEW" type="VARCHAR(50)"> + <column name="USER_NEW" type="NVARCHAR(50)"> <constraints nullable="false"/> </column> - <column name="USER_EDIT" type="VARCHAR(50)"/> + <column name="USER_EDIT" type="NVARCHAR(50)"/> <column name="DATE_NEW" type="TIMESTAMP"> <constraints nullable="false"/> </column> diff --git a/others/db_changes/whichDatatype.adoc b/others/db_changes/whichDatatype.adoc index 7ba7cd96c3618b46c09abf6cb84c37efb31fefec..f71cdce5fc16d9fee510a0ed1094ae66b5577650 100644 --- a/others/db_changes/whichDatatype.adoc +++ b/others/db_changes/whichDatatype.adoc @@ -4,11 +4,100 @@ Overview over datatypes This is a simple overview about when to to use which datatype. == Boolean == -Datatype: -tinyint - -Usage: +=== Datatype === +---- +TINYINT +---- +=== Usage === 0 => false 1 => true Add nullable="false" constraint, because for boolean null makes no sense and complicates searches and validations. + +== Text == +Text should be saved as Unicode. For this prefix the datatype with a 'N' (there are some exceptions lik the UUID) + +=== Big text === +For informations, descriptions, ... +---- +NCLOB +---- + +=== Small / Normal text === +For Names, ... + +You have to define the maximum length. +---- +NVARCHAR(50) +---- + +=== Fixed size text === +If you are sure that the length is always fixed and will not change. + +You have to define the length. +---- +NCHAR(5) +---- + +=== UUID's, standardized codes === +For them unicode is mostly not needed. Only use unicode here if you are sure, it is needed. + +For UUID's, standardized codes (language codes), ... + +You have to define the length. +---- +CHAR(5) +---- + +UUID needs length 36: +---- +CHAR(36) +---- + +=== Decimal numbers === +If precision and fixed decimals (Nachkommastellen) are needed, use DECIMAL. +For prices, ... +---- +DECIMAL(10, 2) +---- + +Else you can use double. +---- +DOUBLE +---- + +=== Integer numbers === +In normal cases just use INTEGER + +If you know that very big integers or only very small Integers are needed, you can also use + +Byte count may not be the same on all databases. + +8 Byte + +---- +BIGINT +---- + +4 Byte + +---- +INTEGER +---- + +2 Byte + +---- +SMALLINT +---- + +1 Byte + +---- +TINYINT +---- + +=== Binary data === +---- +BLOB +---- \ No newline at end of file