Skip to content

Commit

Permalink
[feat:3885]Datasource env add unique index (#3886)
Browse files Browse the repository at this point in the history
* add unique index for datasource env

* upgrade sql

* add engine default sql script

* add unique index for linkis_pserror_code

Co-authored-by: casionone <[email protected]>
  • Loading branch information
aiceflower and casionone authored Nov 25, 2022
1 parent ef40b1c commit ee40ca1
Show file tree
Hide file tree
Showing 3 changed files with 120 additions and 15 deletions.
9 changes: 6 additions & 3 deletions linkis-dist/package/db/linkis_ddl.sql
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,8 @@ CREATE TABLE `linkis_ps_dm_datasource`
`version_id` int(11) DEFAULT NULL COMMENT 'current version id',
`expire` tinyint(1) DEFAULT 0,
`published_version_id` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
PRIMARY KEY (`id`),
UNIQUE INDEX `datasource_name_un` (`datasource_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

-- ----------------------------
Expand All @@ -875,7 +876,8 @@ CREATE TABLE `linkis_ps_dm_datasource_env`
`modify_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`modify_user` varchar(255) COLLATE utf8_bin NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `env_name` (`env_name`)
UNIQUE KEY `env_name` (`env_name`),
UNIQUE INDEX `env_name_datasource_type_id` (`env_name`, `datasource_type_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;


Expand All @@ -892,7 +894,8 @@ CREATE TABLE `linkis_ps_dm_datasource_type`
`classifier` varchar(32) COLLATE utf8_bin NOT NULL,
`icon` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`layers` int(3) NOT NULL,
PRIMARY KEY (`id`)
PRIMARY KEY (`id`),
UNIQUE INDEX `name_un` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

-- ----------------------------
Expand Down
Loading

0 comments on commit ee40ca1

Please sign in to comment.