Bug #26976
openRudder webapp migration create table ScoreDetails with message constraint
Description
the webapp creates the table with the following code
val sql2 = sql"""CREATE TABLE IF NOT EXISTS ScoreDetails ( nodeId text , scoreId text , score score NOT NULL , message text NOT NULL CHECK (message <> '') , details jsonb NOT NULL , PRIMARY KEY (nodeId, scoreId) );"""
the constraint on message breaks the creation of benchmark, and it should not include it. The sql for creation is
Create table scoreDetails ( nodeId text NOT NULL , scoreId text NOT NULL , score score NOT NULL , message text NOT NULL , details jsonb NOT NULL , PRIMARY KEY (nodeId, scoreId) );
Updated by Vincent MEMBRÉ 17 days ago
- Target version changed from 8.2.7 to 8.2.8
Updated by François ARMAND 17 days ago
- Assignee set to François ARMAND
- Priority changed from To review to 1 (highest)
We need to understand why there is constraint in half of the cases, and if the constraint is valid, why benchmarks don't follow it.
Updated by François ARMAND 9 days ago
I think that the constraint is correct and that the problem lays in security benchmark
Updated by François ARMAND 9 days ago
- Subject changed from Rudder webapp create table ScoreDetails with an invalid constraint to Rudder webapp create table ScoreDetails without message constraint
So, the constraint should be there, and it's an inconsistency. Just add it (without migration, because we are going to remove it in 9.0, and the one coming from a previous version will have the constraint)
Updated by François ARMAND 9 days ago
- Subject changed from Rudder webapp create table ScoreDetails without message constraint to Rudder webapp migration create table ScoreDetails with message constraint
OK, so with more thinking, and know that we want to remove message
column in 9.0, we are going to :
- remove the constraint in the existing migration
- add a migration to remove the constraint in an existing DB.
Updated by François ARMAND 9 days ago
- Status changed from In progress to Pending technical review
- Assignee changed from François ARMAND to Vincent MEMBRÉ
- Pull Request set to https://github.com/Normation/rudder/pull/6451
Updated by Anonymous 9 days ago
- Status changed from Pending technical review to Pending release
Applied in changeset rudder|852d6d08773fa747f66ba4ddc0762165780c97dd.