-- (PART A) USERS TABLE
CREATE TABLE `users` (
  `user_id` bigint(20) NOT NULL,
  `user_email` varchar(255) NOT NULL,
  `user_password` varchar(255) NOT NULL,
  `nfc_hash` varchar(255) NULL,
  `nfc_create` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

ALTER TABLE `users`
  ADD PRIMARY KEY (`user_id`),
  ADD UNIQUE KEY `user_email` (`user_email`),
  ADD KEY `nfc_create` (`nfc_create`);

ALTER TABLE `users`
  MODIFY `user_id` bigint(20) NOT NULL AUTO_INCREMENT;

-- (PART B) DUMMY USER
INSERT INTO `users` (`user_id`, `user_email`, `user_password`, `nfc_hash`, `nfc_create`)
VALUES (NULL, 'jon@doe.com', 'DOES-NOT-MATTER', null, null);