Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Projets publics
Ravada-Mirror
Commits
27ab8ff2
Commit
27ab8ff2
authored
Apr 26, 2019
by
Francesc Guasch
Browse files
fix(upgrade): change field size on upgrade
issue #1073
parent
5a9f4bf7
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/Ravada.pm
View file @
27ab8ff2
...
...
@@ -1053,9 +1053,21 @@ sub _upgrade_table {
my
(
$table
,
$field
,
$definition
)
=
@_
;
my
$dbh
=
$CONNECTOR
->
dbh
;
my
(
$new_size
)
=
$definition
=~
m{\((\d+)}
;
my
$sth
=
$dbh
->
column_info
(
undef
,
undef
,
$table
,
$field
);
my
$row
=
$sth
->
fetchrow_hashref
;
$sth
->
finish
;
if
(
$dbh
->
{
Driver
}{
Name
}
=~
/mysql/
&&
$row
&&
$row
->
{
COLUMN_SIZE
}
&&
$new_size
&&
$new_size
!=
$row
->
{
COLUMN_SIZE
})
{
$dbh
->
do
("
alter table
$table
change
$field
$field
$definition
");
warn
"
INFO: changing
$field
$row
->{COLUMN_SIZE} to
$new_size
in
$table
\n
"
if
$
0
!~
/\.t$/
;
return
;
}
return
if
$row
;
warn
"
INFO: adding
$field
$definition
to
$table
\n
"
if
$
0
!~
/\.t$/
;
...
...
Write
Preview
Supports
Markdown
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