Environmental changes since 3.1.5
-
Database relation user-userpreferences changed to make the user-entity the
master of the relation and the preferences referencing to the user (1:1).
This is done by having the same primary key for user and preferences.
To apply to the database without loosing existing user preferences,
you will have to stop itracker and apply the following query (MySQL):
ALTER TABLE userpreferencesbean ADD COLUMN newid INT(11) NOT NULL AFTER id;
UPDATE userpreferencesbean, userbean
SET userpreferencesbean.newid = userbean.id
WHERE userpreferencesbean.id = userbean.preferences_id;
ALTER TABLE userbean DROP FOREIGN KEY `>foreign key name<` ;
ALTER TABLE userpreferencesbean
CHANGE COLUMN id id INT(11) NOT NULL;
ALTER TABLE userpreferencesbean DROP PRIMARY KEY;
ALTER TABLE userpreferencesbean ADD PRIMARY KEY (newid),
CHANGE COLUMN newid newid INT(11) NOT NULL AUTO_INCREMENT;
ALTER TABLE userbean DROP COLUMN preferences_id;
UPDATE userpreferencesbean
SET id = newid;
ALTER TABLE userpreferencesbean
CHANGE COLUMN id id INT(11) NOT NULL AUTO_INCREMENT ,
CHANGE COLUMN newid newid INT(11) NOT NULL ,
DROP PRIMARY KEY,
ADD PRIMARY KEY (id);
ALTER TABLE userpreferencesbean
ADD CONSTRAINT user_fk
FOREIGN KEY (id)
REFERENCES userbean (id)
ON DELETE RESTRICT
ON UPDATE RESTRICT;
ALTER TABLE userpreferencesbean DROP COLUMN newid;
Alternatively, shutdown itracker, drop the table userpreferences, upgrade itracker and start.
-> Be aware: By doing this, all user-preferences will be reset!
itracker 3.2.0 release-notes - Changes from 3.1.5
This is a dev-release, goals is:
- preparing for a stable 3.3 release
- fix relation between user and user-preferences in the database schema