CREATE TABLE hosts_profiles_tmp ( hostid bigint unsigned DEFAULT '0' NOT NULL, devicetype varchar(64) DEFAULT '' NOT NULL, name varchar(64) DEFAULT '' NOT NULL, os varchar(64) DEFAULT '' NOT NULL, serialno varchar(64) DEFAULT '' NOT NULL, tag varchar(64) DEFAULT '' NOT NULL, macaddress varchar(64) DEFAULT '' NOT NULL, hardware blob DEFAULT '' NOT NULL, software blob DEFAULT '' NOT NULL, contact blob DEFAULT '' NOT NULL, location blob DEFAULT '' NOT NULL, notes blob DEFAULT '' NOT NULL, PRIMARY KEY (hostid) ); insert into hosts_profiles_tmp select * from hosts_profiles; drop table hosts_profiles; alter table hosts_profiles_tmp rename hosts_profiles;