PRIMARY KEY (`id`)
) ENGINE=InnoDBDEFAULT CHARSET=utf8mb4 COMMENT='Contacts data' ;
-CREATE TABLE `customer` (
+CREATE TABLE IF NOT EXISTS `customer` (
`id` bigint(20) unsigned NOT NULL COMMENT 'Primay key',
`customer_contact_id` bigint(20) unsigned NOT NULL COMMENT 'Table reference on "contact"',
+ `customer_number` varchar(20) COLLATE 'utf8mb4_general_ci' NOT NULL COMMENT 'Customer number',
`customer_password_hash` varchar(255) COLLATE 'utf8mb4_general_ci' NOT NULL COMMENT 'Password hash',
`customer_confirm_key` varchar(50) COLLATE 'utf8mb4_general_ci' NULL DEFAULT NULL COMMENT 'Email confirmation key',
`customer_status` enum('UNCONFIRMED','CONFIRMED','LOCKED') COLLATE 'utf8mb4_general_ci' NOT NULL DEFAULT 'UNCONFIRMED' COMMENT 'Account status',
`customer_locked` datetime NULL COMMENT 'Last locked timestamp',
PRIMARY KEY (`id`),
UNIQUE (`customer_confirm_key`),
+ UNIQUE (`customer_number`),
INDEX (`customer_contact_id`)
) COMMENT='Customer data' ENGINE='InnoDB' COLLATE 'utf8mb4_general_ci';