Cinder SQL scripts assume too much about the environment and the way in
which they are executed by sqlalchemy-migrate. Particularly, they manage
transactions on their own even though sqlalchemy-migrate do it itself,
plus it assumes that scripts are executed in one go (even though
standard Python DB-API 2.0 does not mention multi-statement SQL commands
to be executed on DB cursors.
blueprint enable-mysql-connector
Change-Id: I10c58b3af75d3ab9153a8bbd2a539bf1577de328
Closes-Bug:
1368391
-BEGIN TRANSACTION;
-
CREATE TEMPORARY TABLE volumes_backup (
created_at DATETIME,
updated_at DATETIME,
FROM volumes_backup;
DROP TABLE volumes_backup;
-COMMIT;
-- As sqlite does not support the DROP FOREIGN KEY, we need to create
-- the table, and move all the data to it.
-BEGIN TRANSACTION;
-
CREATE TABLE snapshots_v6 (
created_at DATETIME,
updated_at DATETIME,
DROP TABLE snapshots;
ALTER TABLE snapshots_v6 RENAME TO snapshots;
-
-COMMIT;
-BEGIN TRANSACTION;
-
CREATE TABLE volumes_v10 (
created_at DATETIME,
updated_at DATETIME,
DROP TABLE volumes;
ALTER TABLE volumes_v10 RENAME TO volumes;
-COMMIT;
-BEGIN TRANSACTION;
-
CREATE TABLE volumes_v11 (
created_at DATETIME,
updated_at DATETIME,
DROP TABLE volumes;
ALTER TABLE volumes_v11 RENAME TO volumes;
-COMMIT;
-BEGIN TRANSACTION;
-
CREATE TABLE volumes_v12 (
created_at DATETIME,
updated_at DATETIME,
DROP TABLE volumes;
ALTER TABLE volumes_v12 RENAME TO volumes;
-COMMIT;
-BEGIN TRANSACTION;
-
CREATE TABLE volumes_v13 (
created_at DATETIME,
updated_at DATETIME,
DROP TABLE volumes;
ALTER TABLE volumes_v13 RENAME TO volumes;
-COMMIT;