Project

General

Profile

Actions

User story #2253

closed

Automatically update the SQL schema on upgrade from to 2.4 (extra column in policyInstances and groups tables)

Added by Jonathan CLARKE almost 13 years ago. Updated almost 10 years ago.

Status:
Released
Priority:
2
Assignee:
Matthieu CERDA
Category:
Packaging
Target version:
UX impact:
Suggestion strength:
User visibility:
Effort required:
Name check:
Fix check:
Regression:

Description

After #2012 and #2143 we will need to add two new columns to SQL tables that historize group and PT names.

This will need to be implemented in the migration script, in particular:

  • Check if column for group type exists, and add if not
  • Check if column for PT name exists and if not:
    • Add the column
    • Run a script to fetch all existing lines in the table and add in the PT name, after searching for it in the /var/rudder/configuration-rules/policy-templates repository

Files

dbMigration.sql (2.04 KB) dbMigration.sql Nicolas CHARLES, 2012-02-09 10:33
rudder-upgrade-database-2.3-2.4-PT-names.pl (1.39 KB) rudder-upgrade-database-2.3-2.4-PT-names.pl Jonathan CLARKE, 2012-02-15 10:41

Related issues 2 (0 open2 closed)

Follows Rudder - Architecture #2012: The historization of the group doesn't store if the group is static or dynamicReleasedNicolas CHARLES2011-11-08Actions
Follows Rudder - Architecture #2143: Historize human readable name of PTReleasedNicolas CHARLES2011-12-23Actions
Actions #1

Updated by Nicolas CHARLES almost 13 years ago

  • File dbMigration.sql added

Here is the DB migration script (it will also be on github)
It creates two columns :
- PolicyTemplateHumanName in the table PolicyInstances
- GroupStatus in the table Groups

Thank you !

Actions #2

Updated by Nicolas CHARLES almost 13 years ago

  • File deleted (dbMigration.sql)
Actions #4

Updated by Nicolas CHARLES almost 13 years ago

Nicolas CHARLES wrote:

Here is the DB migration script (it will also be on github)
It creates two columns :
- PolicyTemplateHumanName in the table PolicyInstances
- GroupStatus in the table Groups

Thank you !

And you should make a script that would set the value of the PolicyTemplateHumanName based on the value of the policyPackageName and policyPackageVersion (note that all these names might change)

Actions #5

Updated by Jonathan CLARKE almost 13 years ago

Nicolas CHARLES wrote:

Here is the DB migration script (it will also be on github)
It creates two columns :
- PolicyTemplateHumanName in the table PolicyInstances
- GroupStatus in the table Groups

Thank you !

Thanks, but we really need it in a git repo to be able to use it. The packaging always copies files from their original git location, instead of duplicating them.

Actions #6

Updated by Jonathan CLARKE almost 13 years ago

Matthieu, I'm handing this over to you. Attached is the embryon of a script that I started - it may or may not be useful to you.

Actions #7

Updated by Matthieu CERDA almost 13 years ago

  • Status changed from 2 to In progress

Leeeet's rock ! I'm on it.

Actions #8

Updated by Matthieu CERDA almost 13 years ago

  • Status changed from In progress to Pending technical review
  • % Done changed from 0 to 100
Actions #9

Updated by Matthieu CERDA almost 13 years ago

As discussed between NCH, JCL and MCE, a perl script iterating through the PTs to get their real name to store them in the table would have a too serious impact on the machine (DBI and XPath dependencies especially), so the idea has been forfeited. A plain SQL script initializing the PolicyTemplateHumanName to the PT name already present on the SQL table has been preferred.

Actions #10

Updated by Jonathan CLARKE almost 13 years ago

  • Subject changed from Migration script to add columns to SQL tables policyInstances and groups and fill them to Automatically update the SQL schema on upgrade from to 2.4 (igration script to add columns to SQL tables policyInstances and groups and fill them
  • Status changed from Pending technical review to 10
Actions #11

Updated by Jonathan CLARKE almost 13 years ago

  • Subject changed from Automatically update the SQL schema on upgrade from to 2.4 (igration script to add columns to SQL tables policyInstances and groups and fill them to Automatically update the SQL schema on upgrade from to 2.4 (extra column in policyInstances and groups tables)
  • Status changed from 10 to Released

Latest modifications look good.

Actions #12

Updated by Nicolas PERRON almost 12 years ago

  • Project changed from Rudder to 34
  • Category deleted (11)
Actions #13

Updated by Benoît PECCATTE almost 10 years ago

  • Project changed from 34 to Rudder
  • Category set to Packaging
Actions

Also available in: Atom PDF