H2创建表带注释的语法
H2用这种语法不行:
- CREATE TABLE log2(
- id BIGINT PRIMARY KEY COMMENT '主键',
- userid VARCHAR(50) COMMENT '用户id',
- username VARCHAR(100) COMMENT '用户名',
- role VARCHAR(50) COMMENT '用户角色类别',
- orgid VARCHAR(50) COMMENT '机构ID'
- );
不能使用类似mysql的语法,
要用这种可以:
- CREATE TABLE log2(
- id BIGINT PRIMARY KEY ,
- userid VARCHAR(50) ,
- username VARCHAR(100) ,
- role VARCHAR(50) ,
- orgid VARCHAR(50)
- );
- COMMENT ON COLUMN log2.id IS '主键';
- COMMENT ON COLUMN log2.userid IS '用户id';
- COMMENT ON COLUMN log2.username IS '用户名';
- COMMENT ON COLUMN log2.role IS '用户角色类别';
- COMMENT ON COLUMN log2.orgid IS '机构ID';