ITeye博客

MySQL SQL Create demo

fairy_xzc · 2018-10-22 15:10 · RDBMS · 数据库 · Markdown

ddl demo

CREATE TABLE IF NOT EXISTS user (
    `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `username` varchar(32) NOT NULL,
    `password` varchar(32) NOT NULL,
    `status` tinyint(4) unsigned NOT NULL DEFAULT '1',
    `is_deleted` tinyint(1) unsigned NOT NULL DEFAULT '0',
    `create_time` timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
    `update_time` timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3),
    PRIMARY KEY (`id`),
    UNIQUE KEY `unique_username` (`username_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。