Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
27bb0580
Commit
27bb0580
authored
Aug 30, 2013
by
Simon Green
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 903895 - Allow more than 32k components
r=gerv, a=sgreen
parent
7450b476
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
7 deletions
+27
-7
Schema.pm
Bugzilla/DB/Schema.pm
+5
-5
DB.pm
Bugzilla/Install/DB.pm
+22
-2
No files found.
Bugzilla/DB/Schema.pm
View file @
27bb0580
...
...
@@ -254,7 +254,7 @@ use constant ABSTRACT_SCHEMA => {
REFERENCES
=>
{
TABLE
=>
'profiles'
,
COLUMN
=>
'userid'
}},
version
=>
{
TYPE
=>
'varchar(64)'
,
NOTNULL
=>
1
},
component_id
=>
{
TYPE
=>
'INT
2
'
,
NOTNULL
=>
1
,
component_id
=>
{
TYPE
=>
'INT
3
'
,
NOTNULL
=>
1
,
REFERENCES
=>
{
TABLE
=>
'components'
,
COLUMN
=>
'id'
}},
resolution
=>
{
TYPE
=>
'varchar(64)'
,
...
...
@@ -634,7 +634,7 @@ use constant ABSTRACT_SCHEMA => {
REFERENCES
=>
{
TABLE
=>
'products'
,
COLUMN
=>
'id'
,
DELETE
=>
'CASCADE'
}},
component_id
=>
{
TYPE
=>
'INT
2
'
,
component_id
=>
{
TYPE
=>
'INT
3
'
,
REFERENCES
=>
{
TABLE
=>
'components'
,
COLUMN
=>
'id'
,
DELETE
=>
'CASCADE'
}},
...
...
@@ -655,7 +655,7 @@ use constant ABSTRACT_SCHEMA => {
REFERENCES
=>
{
TABLE
=>
'products'
,
COLUMN
=>
'id'
,
DELETE
=>
'CASCADE'
}},
component_id
=>
{
TYPE
=>
'INT
2
'
,
component_id
=>
{
TYPE
=>
'INT
3
'
,
REFERENCES
=>
{
TABLE
=>
'components'
,
COLUMN
=>
'id'
,
DELETE
=>
'CASCADE'
}},
...
...
@@ -1069,7 +1069,7 @@ use constant ABSTRACT_SCHEMA => {
REFERENCES
=>
{
TABLE
=>
'profiles'
,
COLUMN
=>
'userid'
,
DELETE
=>
'CASCADE'
}},
component_id
=>
{
TYPE
=>
'INT
2
'
,
NOTNULL
=>
1
,
component_id
=>
{
TYPE
=>
'INT
3
'
,
NOTNULL
=>
1
,
REFERENCES
=>
{
TABLE
=>
'components'
,
COLUMN
=>
'id'
,
DELETE
=>
'CASCADE'
}},
...
...
@@ -1347,7 +1347,7 @@ use constant ABSTRACT_SCHEMA => {
components
=>
{
FIELDS
=>
[
id
=>
{
TYPE
=>
'
SMALL
SERIAL'
,
NOTNULL
=>
1
,
id
=>
{
TYPE
=>
'
MEDIUM
SERIAL'
,
NOTNULL
=>
1
,
PRIMARYKEY
=>
1
},
name
=>
{
TYPE
=>
'varchar(64)'
,
NOTNULL
=>
1
},
product_id
=>
{
TYPE
=>
'INT2'
,
NOTNULL
=>
1
,
...
...
Bugzilla/Install/DB.pm
View file @
27bb0580
...
...
@@ -711,6 +711,9 @@ sub update_table_definitions {
# 2013-02-04 dkl@mozilla.com - Bug 824346
_fix_flagclusions_indexes
();
# 2013-08-26 sgreen@redhat.com - Bug 903895
_fix_components_primary_key
();
################################################################
# New --TABLE-- changes should go *** A B O V E *** this point #
################################################################
...
...
@@ -1429,9 +1432,9 @@ sub _use_ids_for_products_and_components {
print
"Updating the database to use component IDs.\n"
;
$dbh
->
bz_add_column
(
"components"
,
"id"
,
{
TYPE
=>
'
SMALL
SERIAL'
,
NOTNULL
=>
1
,
PRIMARYKEY
=>
1
});
{
TYPE
=>
'
MEDIUM
SERIAL'
,
NOTNULL
=>
1
,
PRIMARYKEY
=>
1
});
$dbh
->
bz_add_column
(
"bugs"
,
"component_id"
,
{
TYPE
=>
'INT
2
'
,
NOTNULL
=>
1
},
0
);
{
TYPE
=>
'INT
3
'
,
NOTNULL
=>
1
},
0
);
my
%
components
;
$sth
=
$dbh
->
prepare
(
"SELECT id, value, product_id FROM components"
);
...
...
@@ -3852,6 +3855,23 @@ sub _fix_flagclusions_indexes {
}
}
sub
_fix_components_primary_key
{
my
$dbh
=
Bugzilla
->
dbh
;
if
(
$dbh
->
bz_column_info
(
'components'
,
'id'
)
->
{
TYPE
}
ne
'MEDIUMSERIAL'
)
{
$dbh
->
bz_drop_related_fks
(
'components'
,
'id'
);
$dbh
->
bz_alter_column
(
"components"
,
"id"
,
{
TYPE
=>
'MEDIUMSERIAL'
,
NOTNULL
=>
1
,
PRIMARYKEY
=>
1
});
$dbh
->
bz_alter_column
(
"flaginclusions"
,
"component_id"
,
{
TYPE
=>
'INT3'
});
$dbh
->
bz_alter_column
(
"flagexclusions"
,
"component_id"
,
{
TYPE
=>
'INT3'
});
$dbh
->
bz_alter_column
(
"bugs"
,
"component_id"
,
{
TYPE
=>
'INT3'
,
NOTNULL
=>
1
});
$dbh
->
bz_alter_column
(
"component_cc"
,
"component_id"
,
{
TYPE
=>
'INT3'
,
NOTNULL
=>
1
});
}
}
1
;
__END__
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment