Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Upgrade/Downgrade scripts for first migration #95

Open
KES777 opened this issue May 12, 2018 · 2 comments
Open

Implement Upgrade/Downgrade scripts for first migration #95

KES777 opened this issue May 12, 2018 · 2 comments

Comments

@KES777
Copy link

KES777 commented May 12, 2018

When database is not versioned yet, but already exists it looks reasonable to generate upgrade/downgrade scripts which add/drop table for versioning:

MySQL/upgrade/0-1/001-auto.sql

CREATE TABLE `dbix_class_deploymenthandler_versions` (
  `id` integer NOT NULL auto_increment,
  `version` varchar(50) NOT NULL,
  `ddl` text NULL,
  `upgrade_sql` text NULL,
  PRIMARY KEY (`id`),
  UNIQUE `dbix_class_deploymenthandler_versions_version` (`version`)
);
SET foreign_key_checks=1;

MySQL/downgrade/1-0/001-auto.sql

DROP TABLE dbix_class_deploymenthandler_versions;

This will allow us to start versioning without deploying database from scratch

@kivilahtio
Copy link

It would be good to be able to deploy fixtures for the version1 as well.

@mohawk2
Copy link
Collaborator

mohawk2 commented Mar 5, 2019

I would be open to a new Script command install_version_storage, which would leverage a provided (required) to_version argument by installing the version storage (not with a migration, unnecessary) with a call to DBICDH. Tests would be required, of course. I will not be implementing such myself at the present time.

Volunteers? :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants