Commit 79260972 authored by Francesc Guasch's avatar Francesc Guasch
Browse files

Merge branch 'hotfix/0.4.8'

parents 7bca9a83 40a1faf4
......@@ -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]
......@@ -3,7 +3,7 @@ package Ravada;
use warnings;
use strict;
our $VERSION = '0.4.7';
our $VERSION = '0.4.8';
use Carp qw(carp croak);
use Data::Dumper;
......@@ -1115,16 +1115,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;
}
......@@ -1229,7 +1240,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");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment