Subversion Repositories SmartDukaan

Rev

Rev 36655 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 36655 Rev 36681
Line 7... Line 7...
7
 
7
 
8
INSERT INTO auth.menu (display_text, description, parent_menu_id, sequence, action_class)
8
INSERT INTO auth.menu (display_text, description, parent_menu_id, sequence, action_class)
9
VALUES ('Beat Day View', 'View all beats running for a user on a date', 175, 6, 'beat-plan-dayview');
9
VALUES ('Beat Day View', 'View all beats running for a user on a date', 175, 6, 'beat-plan-dayview');
10
 
10
 
11
INSERT INTO auth.menu (display_text, description, parent_menu_id, sequence, action_class)
11
INSERT INTO auth.menu (display_text, description, parent_menu_id, sequence, action_class)
12
VALUES ('Base Location', 'Manage auth user base/home locations', 175, 7, 'base-location');
-
 
13
12
VALUES ('Base Location', 'Manage auth user base/home locations', 175, 7, 'base-location');
-
 
13
 
-
 
14
 
-
 
15
# new update
-
 
16
 
-
 
17
ALTER TABLE user.auth_user_location
-
 
18
    ADD COLUMN is_default TINYINT(1) NOT NULL DEFAULT 0;
-
 
19
 
-
 
20
UPDATE user.auth_user_location ul
-
 
21
    INNER JOIN (SELECT auth_user_id, MAX(id) AS max_id
-
 
22
                FROM user.auth_user_location
-
 
23
                WHERE location_type = 'BASE'
-
 
24
                GROUP BY auth_user_id) latest ON ul.id = latest.max_id
-
 
25
SET ul.is_default = 1
-
 
26
WHERE ul.location_type = 'BASE';
-
 
27
 
-
 
28
-- Optional helper index
-
 
29
CREATE INDEX idx_aul_user_type_default
-
 
30
    ON user.auth_user_location (auth_user_id, location_type, is_default);
-
 
31
14
32