postgresql.sql 646 B

12345678910111213141516171819202122232425
  1. CREATE TABLE tb_user (
  2. id int8 NOT NULL,
  3. username varchar(50) NOT NULL,
  4. mobile varchar(20) NOT NULL,
  5. password varchar(64),
  6. create_date timestamp,
  7. PRIMARY KEY (id),
  8. UNIQUE (username)
  9. );
  10. CREATE TABLE tb_token (
  11. id int8 NOT NULL,
  12. user_id int8 NOT NULL,
  13. token varchar(100) NOT NULL,
  14. expire_date timestamp,
  15. update_date timestamp,
  16. PRIMARY KEY (id),
  17. UNIQUE (user_id),
  18. UNIQUE (token)
  19. );
  20. -- 账号:13612345678 密码:admin
  21. INSERT INTO tb_user (id, username, mobile, password, create_date) VALUES (1067246875900000001, 'mark', '13612345678', '8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918', now());