Subversion Repositories SmartDukaan

Rev

Rev 36655 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

UPDATE auth.menu
SET display_text = 'Lead Visits'
WHERE action_class = 'visit-approvals';

ALTER TABLE user.beat
    ADD UNIQUE KEY uk_beat_user_name (auth_user_id, name);

INSERT INTO auth.menu (display_text, description, parent_menu_id, sequence, action_class)
VALUES ('Beat Day View', 'View all beats running for a user on a date', 175, 6, 'beat-plan-dayview');

INSERT INTO auth.menu (display_text, description, parent_menu_id, sequence, action_class)
VALUES ('Base Location', 'Manage auth user base/home locations', 175, 7, 'base-location');


# new update

ALTER TABLE user.auth_user_location
    ADD COLUMN is_default TINYINT(1) NOT NULL DEFAULT 0;

UPDATE user.auth_user_location ul
    INNER JOIN (SELECT auth_user_id, MAX(id) AS max_id
                FROM user.auth_user_location
                WHERE location_type = 'BASE'
                GROUP BY auth_user_id) latest ON ul.id = latest.max_id
SET ul.is_default = 1
WHERE ul.location_type = 'BASE';

-- Optional helper index
CREATE INDEX idx_aul_user_type_default
    ON user.auth_user_location (auth_user_id, location_type, is_default);