Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
frankiejol committed Aug 30, 2019
2 parents efc16b5 + 7926097 commit dcfa119
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
8 changes: 1 addition & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@

**Implemented enhancements:**

- Add ISO for Debian Buster [\#1108]
- non-predictable MAC addresses [\#1103]
- first login fails after inactivity logout [\#1102]

**Bugfixes**

- Specified key was too long with MariaDB 10.1 in Debian [\#1104]
- Login name with spaces [\#1100]
- Volatile domains get invalid SPICE IP [\#1099]
- Data too long for column display [\#1107]
21 changes: 16 additions & 5 deletions lib/Ravada.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1092,16 +1092,27 @@ sub _upgrade_table {
my $dbh = $CONNECTOR->dbh;

my ($new_size) = $definition =~ m{\((\d+)};
my ($new_type) = $definition =~ m{(\w+)};

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}) {
&& $row
&& (
($row->{COLUMN_SIZE}
&& defined $new_size
&& $new_size != $row->{COLUMN_SIZE}
) || (
lc($row->{TYPE_NAME}) ne lc($new_type)
)
)
){

warn "INFO: changing $field $row->{COLUMN_SIZE} to $new_size in $table\n$definition\n" if $0 !~ /\.t$/;
warn "INFO: changing $field\n"
." $row->{COLUMN_SIZE} to ".($new_size or '')."\n"
." $row->{TYPE_NAME} -> $new_type \n"
." in $table\n$definition\n" if $0 !~ /\.t$/;
$dbh->do("alter table $table change $field $field $definition");
return;
}
Expand Down Expand Up @@ -1206,7 +1217,7 @@ sub _upgrade_tables {

$self->_upgrade_table('vms','vm_type',"char(20) NOT NULL DEFAULT 'KVM'");
$self->_upgrade_table('vms','connection_args',"text DEFAULT NULL");
$self->_upgrade_table('vms','cached_active_time',"integer DEFAULT 0");
$self->_upgrade_table('vms','cached_active_time',"int DEFAULT 0");
$self->_upgrade_table('vms','public_ip',"varchar(128) DEFAULT NULL");
$self->_upgrade_table('vms','is_active',"int DEFAULT 0");
$self->_upgrade_table('vms','enabled',"int DEFAULT 1");
Expand Down

0 comments on commit dcfa119

Please sign in to comment.