Skip to content

Commit

Permalink
feat: rename toggle to flag migration
Browse files Browse the repository at this point in the history
  • Loading branch information
sjaanus committed May 23, 2024
1 parent 2d51946 commit 5354ab5
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
2 changes: 1 addition & 1 deletion frontend/cypress/integration/projects/access.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ describe('project-access', () => {

cy.get(`[data-testid='CancelIcon']`).last().click();
cy.get(`[data-testid='${PA_ROLE_ID}']`).click();
cy.contains('update feature toggles within a project').click({
cy.contains('update feature flags within a project').click({
force: true,
});

Expand Down
41 changes: 41 additions & 0 deletions src/migrations/20240523093355-toggle-to-flag-rename.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
exports.up = function (db, cb) {
db.runSql(`
UPDATE permissions SET display_name = 'Create feature flags' WHERE permission = 'CREATE_FEATURE' AND type = 'project';
UPDATE permissions SET display_name = 'Update feature flags' WHERE permission = 'UPDATE_FEATURE' AND type = 'project';
UPDATE permissions SET display_name = 'Delete feature flags' WHERE permission = 'DELETE_FEATURE' AND type = 'project';
UPDATE permissions SET display_name = 'Change feature flag project' WHERE permission = 'MOVE_FEATURE_TOGGLE' AND type = 'project';
UPDATE permissions SET display_name = 'Enable/disable flags' WHERE permission = 'UPDATE_FEATURE_ENVIRONMENT' AND type = 'environment';
`, cb);
};

exports.down = function (db, cb) {
db.runSql(
`
UPDATE permissions
SET display_name = 'Create feature toggles'
WHERE permission = 'CREATE_FEATURE'
AND type = 'project';
UPDATE permissions
SET display_name = 'Update feature toggles'
WHERE permission = 'UPDATE_FEATURE'
AND type = 'project';
UPDATE permissions
SET display_name = 'Delete feature toggles'
WHERE permission = 'DELETE_FEATURE'
AND type = 'project';
UPDATE permissions
SET display_name = 'Change feature toggle project'
WHERE permission = 'MOVE_FEATURE_TOGGLE'
AND type = 'project';
UPDATE permissions
SET display_name = 'Enable/disable toggles'
WHERE permission = 'UPDATE_FEATURE_ENVIRONMENT'
AND type = 'environment';
`,
cb,
);
};

0 comments on commit 5354ab5

Please sign in to comment.