doc-exports/docs/dws/tool/dws_16_0137.html
Lu, Huayi 27019c2991 DWS TOOL 830.201 version
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Co-authored-by: Lu, Huayi <luhuayi@huawei.com>
Co-committed-by: Lu, Huayi <luhuayi@huawei.com>
2024-05-16 07:35:25 +00:00

2.2 KiB

IF NOT EXISTS

DSC supports the conversion of IF NOT EXISTS, which is reserved during the migration.

Input

drop table if exists `categories`;
CREATE TABLE IF NOT EXISTS `categories`
(
    `CategoryID` tinyint(5) unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT,
    `CategoryName` varchar(15) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' ,
    `Description` mediumtext CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL ,
    `Picture` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
    UNIQUE   (`CategoryID`)
)ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=latin1;
drop table if exists `categories`;

Output

DROP TABLE IF EXISTS "public"."categories";
CREATE TABLE IF NOT EXISTS "public"."categories" (
  "categoryid" SMALLSERIAL NOT NULL PRIMARY KEY,
  "categoryname" VARCHAR(60) NOT NULL DEFAULT '',
  "description" TEXT NOT NULL,
  "picture" VARCHAR(200) NOT NULL DEFAULT ''
) WITH (ORIENTATION = ROW, COMPRESSION = NO) NOCOMPRESS DISTRIBUTE BY HASH ("categoryid");
DROP TABLE IF EXISTS "public"."categories";