ALTER TABLE partinstance
DROP COLUMN `serialNo`;

CREATE TABLE `partinstancealias`(
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `partInstanceAliasTypeId` int(10) unsigned NOT NULL DEFAULT 0,
  `partInstanceId` int(10) unsigned NOT NULL DEFAULT 0,
  `value` varchar(100) NOT NULL DEFAULT '',
  `active` tinyint(1) NOT NULL DEFAULT '1',
  `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
  `createdById` int(10) unsigned NOT NULL DEFAULT '0',
  `updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `updatedById` int(10) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `partInstanceId` (`partInstanceId`),
  KEY `partInstanceAliasTypeId` (`partInstanceAliasTypeId`),
  KEY `value` (`value`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;


CREATE TABLE `partinstancealiastype`(
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(100) NOT NULL DEFAULT '',
  `active` tinyint(1) NOT NULL DEFAULT '1',
  `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
  `createdById` int(10) unsigned NOT NULL DEFAULT '0',
  `updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `updatedById` int(10) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `name` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;


insert into `partinstancealiastype` (name, created, createdById, updated, updatedById) VALUES ('SerialNo', '2019-10-11 00:00:00', 10, '2019-10-11 00:00:00', 10);



-- insert into `productstockinfo` (storeId, productId, statusId, daysOfInventoryTarget, active, created, createdById, updated, updatedById )
--     VALUES (1, 212, 1, 30, 1, '2019-10-11 00:00:00', 10, '2019-10-11 00:00:00', 10);
