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
3d061531
Commit
3d061531
authored
Feb 04, 2019
by
Dylan William Hardison
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 1526703 - Increase the size of the flagtype id column
parent
f91e240a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
7 deletions
+30
-7
Schema.pm
Bugzilla/DB/Schema.pm
+4
-4
DB.pm
Bugzilla/Install/DB.pm
+26
-3
No files found.
Bugzilla/DB/Schema.pm
View file @
3d061531
...
@@ -626,7 +626,7 @@ use constant ABSTRACT_SCHEMA => {
...
@@ -626,7 +626,7 @@ use constant ABSTRACT_SCHEMA => {
FIELDS
=>
[
FIELDS
=>
[
id
=>
{
TYPE
=>
'MEDIUMSERIAL'
,
NOTNULL
=>
1
,
PRIMARYKEY
=>
1
},
id
=>
{
TYPE
=>
'MEDIUMSERIAL'
,
NOTNULL
=>
1
,
PRIMARYKEY
=>
1
},
type_id
=>
{
type_id
=>
{
TYPE
=>
'INT
2
'
,
TYPE
=>
'INT
3
'
,
NOTNULL
=>
1
,
NOTNULL
=>
1
,
REFERENCES
=>
{
TABLE
=>
'flagtypes'
,
COLUMN
=>
'id'
,
DELETE
=>
'CASCADE'
}
REFERENCES
=>
{
TABLE
=>
'flagtypes'
,
COLUMN
=>
'id'
,
DELETE
=>
'CASCADE'
}
},
},
...
@@ -662,7 +662,7 @@ use constant ABSTRACT_SCHEMA => {
...
@@ -662,7 +662,7 @@ use constant ABSTRACT_SCHEMA => {
# "flagtypes" defines the types of flags that can be set.
# "flagtypes" defines the types of flags that can be set.
flagtypes
=>
{
flagtypes
=>
{
FIELDS
=>
[
FIELDS
=>
[
id
=>
{
TYPE
=>
'
SMALL
SERIAL'
,
NOTNULL
=>
1
,
PRIMARYKEY
=>
1
},
id
=>
{
TYPE
=>
'
MEDIUM
SERIAL'
,
NOTNULL
=>
1
,
PRIMARYKEY
=>
1
},
name
=>
{
TYPE
=>
'varchar(50)'
,
NOTNULL
=>
1
},
name
=>
{
TYPE
=>
'varchar(50)'
,
NOTNULL
=>
1
},
description
=>
{
TYPE
=>
'MEDIUMTEXT'
,
NOTNULL
=>
1
},
description
=>
{
TYPE
=>
'MEDIUMTEXT'
,
NOTNULL
=>
1
},
cc_list
=>
{
TYPE
=>
'varchar(200)'
},
cc_list
=>
{
TYPE
=>
'varchar(200)'
},
...
@@ -689,7 +689,7 @@ use constant ABSTRACT_SCHEMA => {
...
@@ -689,7 +689,7 @@ use constant ABSTRACT_SCHEMA => {
flaginclusions
=>
{
flaginclusions
=>
{
FIELDS
=>
[
FIELDS
=>
[
type_id
=>
{
type_id
=>
{
TYPE
=>
'INT
2
'
,
TYPE
=>
'INT
3
'
,
NOTNULL
=>
1
,
NOTNULL
=>
1
,
REFERENCES
=>
{
TABLE
=>
'flagtypes'
,
COLUMN
=>
'id'
,
DELETE
=>
'CASCADE'
}
REFERENCES
=>
{
TABLE
=>
'flagtypes'
,
COLUMN
=>
'id'
,
DELETE
=>
'CASCADE'
}
},
},
...
@@ -711,7 +711,7 @@ use constant ABSTRACT_SCHEMA => {
...
@@ -711,7 +711,7 @@ use constant ABSTRACT_SCHEMA => {
flagexclusions
=>
{
flagexclusions
=>
{
FIELDS
=>
[
FIELDS
=>
[
type_id
=>
{
type_id
=>
{
TYPE
=>
'INT
2
'
,
TYPE
=>
'INT
3
'
,
NOTNULL
=>
1
,
NOTNULL
=>
1
,
REFERENCES
=>
{
TABLE
=>
'flagtypes'
,
COLUMN
=>
'id'
,
DELETE
=>
'CASCADE'
}
REFERENCES
=>
{
TABLE
=>
'flagtypes'
,
COLUMN
=>
'id'
,
DELETE
=>
'CASCADE'
}
},
},
...
...
Bugzilla/Install/DB.pm
View file @
3d061531
...
@@ -475,9 +475,8 @@ sub update_table_definitions {
...
@@ -475,9 +475,8 @@ sub update_table_definitions {
$dbh
->
bz_drop_column
(
'profiles'
,
'refreshed_when'
);
$dbh
->
bz_drop_column
(
'profiles'
,
'refreshed_when'
);
$dbh
->
bz_drop_column
(
'groups'
,
'last_changed'
);
$dbh
->
bz_drop_column
(
'groups'
,
'last_changed'
);
# 2006-08-06 LpSolit@gmail.com - Bug 347521
# 2019-01-31 dylan@hardison.net - Bug TODO
$dbh
->
bz_alter_column
(
'flagtypes'
,
'id'
,
_update_flagtypes_id
();
{
TYPE
=>
'SMALLSERIAL'
,
NOTNULL
=>
1
,
PRIMARYKEY
=>
1
});
$dbh
->
bz_alter_column
(
'keyworddefs'
,
'id'
,
$dbh
->
bz_alter_column
(
'keyworddefs'
,
'id'
,
{
TYPE
=>
'SMALLSERIAL'
,
NOTNULL
=>
1
,
PRIMARYKEY
=>
1
});
{
TYPE
=>
'SMALLSERIAL'
,
NOTNULL
=>
1
,
PRIMARYKEY
=>
1
});
...
@@ -820,6 +819,30 @@ sub _update_product_name_definition {
...
@@ -820,6 +819,30 @@ sub _update_product_name_definition {
}
}
}
}
sub
_update_flagtypes_id
{
my
$dbh
=
Bugzilla
->
dbh
;
my
@fixes
=
(
{
table
=>
'flaginclusions'
,
column
=>
'type_id'
},
{
table
=>
'flagexclusions'
,
column
=>
'type_id'
},
{
table
=>
'flags'
,
column
=>
'type_id'
},
);
my
$flagtypes_def
=
$dbh
->
bz_column_info
(
'flagtypes'
,
'id'
);
foreach
my
$fix
(
@fixes
)
{
my
$def
=
$dbh
->
bz_column_info
(
$fix
->
{
table
},
$fix
->
{
column
});
if
(
$def
->
{
TYPE
}
eq
'INT2'
)
{
warn
"Dropping $fix->{table}\n"
;
$dbh
->
bz_drop_related_fks
(
$fix
->
{
table
},
$fix
->
{
column
});
$def
->
{
TYPE
}
=
'INT3'
;
$dbh
->
bz_alter_column
(
$fix
->
{
table
},
$fix
->
{
column
},
$def
);
}
}
if
(
$flagtypes_def
->
{
TYPE
}
eq
'SMALLSERIAL'
)
{
$flagtypes_def
->
{
TYPE
}
=
'MEDIUMSERIAL'
;
$dbh
->
bz_alter_column
(
'flagtypes'
,
'id'
,
$flagtypes_def
);
}
}
# A helper for the function below.
# A helper for the function below.
sub
_write_one_longdesc
{
sub
_write_one_longdesc
{
my
(
$id
,
$who
,
$when
,
$buffer
)
=
(
@_
);
my
(
$id
,
$who
,
$when
,
$buffer
)
=
(
@_
);
...
...
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