Lines 11-20
return {
Link Here
|
11 |
primary_key_exists( 'user_permissions', 'module_bit' ) && |
11 |
primary_key_exists( 'user_permissions', 'module_bit' ) && |
12 |
primary_key_exists( 'user_permissions', 'code') |
12 |
primary_key_exists( 'user_permissions', 'code') |
13 |
){ |
13 |
){ |
14 |
$dbh->do(q{ |
14 |
if ( primary_key_exists('user_permissions') ) { |
15 |
ALTER TABLE user_permissions DROP INDEX IF EXISTS `PRIMARY` |
15 |
$dbh->do(q{ |
16 |
}); |
16 |
ALTER TABLE user_permissions DROP INDEX IF EXISTS `PRIMARY` |
17 |
say $out "Dropped any previously created primary key"; |
17 |
}); |
|
|
18 |
say $out "Dropped any previously created primary key"; |
19 |
} |
18 |
|
20 |
|
19 |
$dbh->do(q{ALTER TABLE user_permissions ADD COLUMN temp SERIAL PRIMARY KEY}); |
21 |
$dbh->do(q{ALTER TABLE user_permissions ADD COLUMN temp SERIAL PRIMARY KEY}); |
20 |
$dbh->do(q{DELETE t1 FROM user_permissions t1 INNER JOIN user_permissions t2 WHERE t1.temp < t2.temp AND t1.borrowernumber = t2.borrowernumber AND t1.module_bit = t2.module_bit AND t1.code = t2.code}); |
22 |
$dbh->do(q{DELETE t1 FROM user_permissions t1 INNER JOIN user_permissions t2 WHERE t1.temp < t2.temp AND t1.borrowernumber = t2.borrowernumber AND t1.module_bit = t2.module_bit AND t1.code = t2.code}); |
21 |
- |
|
|