Comment 25 for bug 1524477

Revision history for this message
Sonal (sonal-ojha) wrote :

Renat,

So I did the offline db migration(mistral-db-manage --config-file /path/to/mistral.conf upgrade 009:011 --sql) and it gives sql only to create and update the schema, I don't see anything to migrate the data as per the latest schema.

============================

mistral-db-manage --config-file /path/to/mistral.conf upgrade 009:011 --sql
INFO [alembic.runtime.migration] Context impl MySQLImpl.
INFO [alembic.runtime.migration] Generating static SQL
INFO [alembic.runtime.migration] Will assume non-transactional DDL.
INFO [alembic.runtime.migration] Running upgrade 009 -> 010, add_resource_members_v2_table
-- Running upgrade 009 -> 010

CREATE TABLE resource_members_v2 (
    id VARCHAR(36) NOT NULL,
    created_at DATETIME,
    updated_at DATETIME,
    project_id VARCHAR(80) NOT NULL,
    member_id VARCHAR(80) NOT NULL,
    resource_id VARCHAR(80) NOT NULL,
    resource_type VARCHAR(50) NOT NULL,
    status VARCHAR(20) NOT NULL,
    PRIMARY KEY (id),
    UNIQUE (resource_id, resource_type, member_id)
);

UPDATE alembic_version SET version_num='010' WHERE alembic_version.version_num = '009';

INFO [alembic.runtime.migration] Running upgrade 010 -> 011, add workflow id for execution
-- Running upgrade 010 -> 011

ALTER TABLE executions_v2 ADD COLUMN workflow_id VARCHAR(80);

UPDATE alembic_version SET version_num='011' WHERE alembic_version.version_num = '010';