新建数据库必备字段


发布于 2025-02-24 / 23 阅读 / 0 评论 /
create table configuration ( id int unsigned auto_increment comment '主键' primary key, site_id int default 0
create table configuration
(
    id          int unsigned auto_increment comment '主键'
        primary key,
    site_id     int              default 0   not null comment '站点id',
    create_time int              default 0   not null comment '添加时间',
    update_time int              default 0   not null comment '更新时间',
    delete_time int              default 0   not null comment '删除时间',
    is_del      tinyint unsigned default '0' not null
)
    comment '联盟配置表' row_format = DYNAMIC;


create table nc_
(
    id                          int auto_increment comment '主键id'
        primary key,
    site_id                     int            default 0      not null comment '站点id',
    admin_uid                   int            default 0      not null comment '操作人id',
    admin_username              varchar(255)   default ''     not null comment '操作人名称',
    create_time                 int            default 0      not null comment '创建时间',
    update_time                 int            default 0      not null comment '更新时间',
    delete_time                 int            default 0      not null comment '删除时间'
)
    comment '表' collate = utf8mb4_general_ci
                           row_format = DYNAMIC;

create index idx_admin_uid
    on nc_ (admin_uid);

create index idx_create_time
    on nc_ (create_time);

create index idx_site_id
    on nc_ (site_id);




是否对你有帮助?

评论