В mariadb-10.3.7
на движке InnoDB я пытаюсь создать следующую структуру:
drop sequence if exists user_account_id_seq;
create sequence user_account_id_seq start with 1 increment by 10;
drop table if exists user_account;
create table user_account (
-- id bigint(20) unsigned not null auto_increment,
id bigint(20) unsigned not null default (next value for user_account_id_seq),
version int(10) unsigned not null,
created_on datetime,
updated_on datetime,
firstname varchar(255) not null,
lastname varchar(255) not null,
password varchar(100),
password_salt varchar(50),
readable_password varchar(50),
email varchar(50) not null,
confirmed_email bit(1) not null check (confirmed_email in (0, 1)),
work_phone varchar(20),
unique key email (email),
primary key (id)
);
Но не хочет удалять последовательность:
--------------
drop sequence if exists user_account_id_seq
--------------
--------------
commit
--------------
--------------
create sequence user_account_id_seq start with 1 increment by 10
--------------
ERROR 1050 (42S01) at line 4: Table '`useraccount`.`user_account_id_seq`' already exists
+ /usr/bin/mariadb/install/bin/mysql useraccount --protocol=tcp -h mysql -P 3306 -u root -v
--------------
Затем я вручную попробовал эти команды, чтобы показать, как озадачивает это сообщение:
MariaDB [useraccount]> create sequence user_account_id_seq start with 1 increment by 10;
ERROR 1813 (HY000): Tablespace for table '`useraccount`.`user_account_id_seq`' exists. Please DISCARD the tablespace before IMPORT
MariaDB [useraccount]> alter table `useraccount`.`user_account_id_seq` discard tablespace;
ERROR 1146 (42S02): Table 'useraccount.user_account_id_seq' doesn't exist