Basic User Table Structure of mysql

Table Name : op_user 
Uses : For any Project to Manage User 
#NameTypeCollationAttributesNullDefaultCommentsExtra
1int(11)NoNoneAUTO_INCREMENT
2varchar(255)latin1_swedish_ciNoADMIN
3varchar(255)latin1_swedish_ciYesNULL
4varchar(10)latin1_swedish_ciYesNULL
5varchar(30)latin1_swedish_ciNoNone
6varchar(255)latin1_swedish_ciNoNone
7varchar(255)latin1_swedish_ciYesNULL
8dateYesNULL
9varchar(255)latin1_swedish_ciNoACTIVE
10varchar(255)latin1_swedish_ciYesNULL
11timestampYescurrent_timestamp()
12int(11)YesNULL
13datetimeYesNULL
14int(11)YesNULL
15timestampYescurrent_timestamp()

 

CREATE TABLE `op_user` (
  `id` int(11) NOT NULL,
  `user_type` varchar(255) CHARACTER SET latin1 NOT NULL DEFAULT 'ADMIN',
  `full_name` varchar(255) CHARACTER SET latin1 DEFAULT NULL,
  `user_mobile` varchar(10) CHARACTER SET latin1 DEFAULT NULL,
  `user_name` varchar(30) CHARACTER SET latin1 NOT NULL,
  `user_pass` varchar(255) CHARACTER SET latin1 NOT NULL,
  `user_email` varchar(255) CHARACTER SET latin1 DEFAULT NULL,
  `doc` date DEFAULT NULL,
  `status` varchar(255) CHARACTER SET latin1 NOT NULL DEFAULT 'ACTIVE',
  `token` varchar(255) CHARACTER SET latin1 DEFAULT NULL,
  `last_login` timestamp NULL DEFAULT current_timestamp(),
  `created_by` int(11) DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_by` int(11) DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;


--
-- Indexes for table `op_user`
--
ALTER TABLE `op_user`
  ADD PRIMARY KEY (`id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `op_user`
--
ALTER TABLE `op_user`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
COMMIT;

Comments