Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • cubicweb cubicweb
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 197
    • Issues 197
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 15
    • Merge requests 15
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • cubicweb
  • cubicwebcubicweb
  • Issues
  • #14

Closed
Open
Created May 12, 2020 by Fabien Amarger@famargerOwner

Better handling of upgrades scripts

upgrade scripts from cubicweb_/migration/X.Y.Z_Any.py are executed only if package version is set to a higher or equal version than X.Y.Z

This have some drawbacks:

  • When adding a new migration without increment the version (e.g. default development mode), the migration isn't executed
  • Working with an instance which is continuously deployed require to increment the version number
  • cubicweb_/migration/ files are subject to conflict when having multiple modification from several mercurial draft heads.

I propose to implement a new algorithm for migration, inspired from django (formely south).

To create a migration, add a new command "makemigration " that create a new unique filename in the migration directory, something like _.py

Add a new sql table containing the name, eventually cube name of the migration that where already executed. When cubicweb starts, it check all available migrations files have been executed, otherwise it fail and suggest to run "cubicweb-ctl upgrade"

cubicweb-ctl upgrade execute migrations files in the correct order.

Original ticket : https://www.cubicweb.org/ticket/17254006

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking