SQL: fix all support_names-related migrations

This solves some problems in Docker instance
This commit is contained in:
Alexander Minkin 2023-09-23 01:10:03 +03:00
parent edf10c4248
commit 8483a2d343
Signed by untrusted user: WerySkok
GPG key ID: 88E9A2F3AFE44C30
3 changed files with 9 additions and 11 deletions

View file

@ -1 +1,7 @@
CREATE TABLE `support_names` ( `agent` BIGINT UNSIGNED NOT NULL , `name` VARCHAR(512) NOT NULL , `icon` VARCHAR(1024) NULL DEFAULT NULL , `numerate` BOOLEAN NOT NULL DEFAULT FALSE , PRIMARY KEY (`agent`)) ENGINE = InnoDB;
CREATE TABLE `support_names` (
`agent` BIGINT UNSIGNED NOT NULL,
`name` VARCHAR(512) NOT NULL,
`icon` VARCHAR(1024) NULL DEFAULT NULL,
`numerate` BOOLEAN NOT NULL DEFAULT FALSE,
PRIMARY KEY (`agent`)
) ENGINE = InnoDB;

View file

@ -1,14 +1,8 @@
CREATE TABLE `support_names` (
`id` bigint(20) UNSIGNED NOT NULL,
`agent` bigint(20) UNSIGNED NOT NULL,
`name` varchar(512) COLLATE utf8mb4_unicode_ci NOT NULL,
`icon` varchar(1024) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`numerate` tinyint(1) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
ALTER TABLE `support_names` ADD `id` bigint(20) UNSIGNED NOT NULL FIRST;
ALTER TABLE `support_names`
ADD PRIMARY KEY (`id`);
ADD UNIQUE KEY `id` (`id`);
ALTER TABLE `support_names`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

View file

@ -1,2 +0,0 @@
ALTER TABLE `support_names`
ADD COLUMN `id` bigint(20) NOT NULL AUTO_INCREMENT UNIQUE FIRST;