init-data.sql 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. -- 初始帐套
  2. INSERT INTO "Company" ("objectId", "title", "createdAt", "updatedAt")
  3. VALUES
  4. ('RbIKpmuaMC', '国家级本科教材遴选','2024-06-16 12:00:00','2024-06-16 12:00:00')
  5. ON conflict("objectId") DO UPDATE
  6. SET "title" = excluded."title","createdAt"=excluded."createdAt","updatedAt"=excluded."updatedAt";
  7. -- 初始超级管理员 bookadmin bk2024
  8. INSERT INTO "_User" ("objectId", "username", "_hashed_password", "company", "createdAt", "updatedAt")
  9. VALUES
  10. ('BOOKADMINI', 'bookadmin','$2y$10$diWXn9Sksms/neufGnphU.4wKUXF0CivkRltz4.NMEF9f4MJu2aX6','RbIKpmuaMC','2024-06-16 12:00:00','2024-06-16 12:00:00')
  11. ON conflict("objectId") DO UPDATE
  12. SET
  13. "username" = excluded."username",
  14. "company" = excluded."company",
  15. "createdAt"=excluded."createdAt",
  16. "updatedAt"=excluded."updatedAt";
  17. -- 初始化超级管理员角色
  18. INSERT INTO "_Role" ("objectId","title", "name", "_rperm", "_wperm", "company", "createdAt", "updatedAt")
  19. VALUES
  20. ('ZQOwyoDteL','超级管理员', 'superadmin','{*,BOOKADMINI}','{BOOKADMINI}','RbIKpmuaMC','2024-06-16 12:00:00','2024-06-16 12:00:00')
  21. ON conflict("objectId") DO UPDATE
  22. SET
  23. "title" = excluded."title",
  24. "name" = excluded."name",
  25. "company" = excluded."company",
  26. "createdAt"=excluded."createdAt";
  27. -- 超级管理员帐号,添加至超管用户组
  28. INSERT INTO "_Join:users:_Role" ("relatedId", "owningId")
  29. VALUES
  30. ('BOOKADMINI', 'ZQOwyoDteL')
  31. ON conflict("relatedId","owningId") DO UPDATE
  32. SET
  33. "relatedId" = excluded."relatedId",
  34. "owningId" = excluded."owningId";