搭建postgresql-11.3,和客户端工具
1,准备对应的包,右键直接下一步安装完即可, 将postgresql设置为本地服务,方便启动,
2,用对应客户端软件连接,新建一个数据库controlDB 新建用户lzkj 密码lzkj123 设为controlDB的所有者 再新建目前总控上面用到的两张表
```sql
1、Controller_Users: //用户表
CREATE UNLOGGED TABLE public."Controller_Users"
("UserID" bigint NOT NULL,"UserName" character varying(128) NOT NULL,"PassWord" character varying(128) NOT NULL,"Nullity" character varying(1) NOT NULL,"MobilePhone" character varying(11) NOT NULL,"CreateTime" timestamp(6) with time zone,CONSTRAINT "Controller_Users_pkey" PRIMARY KEY ("UserID")
)
WITH (OIDS=FALSE
);
ALTER TABLE public."Controller_Users"OWNER TO test;
COMMENT ON TABLE public."Controller_Users"IS '总表';
第二张表
2、Owner//1表
CREATE UNLOGGED TABLE public."Owner"
("ID" bigint NOT NULL,"OwnerID" character varying(64) NOT NULL,"OwnerName" character varying(64) NOT NULL,"ServerIP" character varying(32) NOT NULL,"ServerPost" character varying(4) NOT NULL DEFAULT 80,"Telephone" character varying(11) NOT NULL,"CreationTime" character varying(64),CONSTRAINT "Owner_pkey" PRIMARY KEY ("ID")
)
WITH (OIDS=FALSE
);
ALTER TABLE public."Owner"OWNER TO test;
COMMENT ON TABLE public."Owner"IS '1表';
######
新建两个序列:
CREATE SEQUENCE public.controller_userid_seqINCREMENT 1MINVALUE 1MAXVALUE 999999START 4CACHE 1;
ALTER TABLE public.controller_userid_seqOWNER TO test;
第二个
CREATE SEQUENCE public.owner_id_seqINCREMENT 1MINVALUE 1MAXVALUE 999999START 1CACHE 1;
ALTER TABLE public.owner_id_seqOWNER TO test
告诉web端对应的ip端口用户密码