oracle.sql 776 B

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