export const initDataSQL = `
-- 初始帐套
INSERT INTO "Company" ("objectId", "title", "createdAt", "updatedAt")
VALUES
('RbIKpmuaMC', '国家级本科教材遴选','2024-06-16 12:00:00','2024-06-16 12:00:00')
ON conflict("objectId") DO UPDATE
SET "title" = excluded."title","createdAt"=excluded."createdAt","updatedAt"=excluded."updatedAt";


-- 初始超级管理员 bookadmin bk2024
-- Authing同步用户ID 6684b5464b9206e48dbcf67c
INSERT INTO "_User" ("objectId", "username", "_hashed_password", "company", "createdAt", "updatedAt")
VALUES
('6684b5464b9206e48dbcf67c', 'bookadmin','$2y$10$diWXn9Sksms/neufGnphU.4wKUXF0CivkRltz4.NMEF9f4MJu2aX6','RbIKpmuaMC','2024-06-16 12:00:00','2024-06-16 12:00:00')
ON conflict("objectId") DO UPDATE
SET 
"username" = excluded."username",
"company" = excluded."company",
"createdAt"=excluded."createdAt",
"updatedAt"=excluded."updatedAt";

-- 初始化超级管理员角色
INSERT INTO "_Role" ("objectId","title", "name", "_rperm", "_wperm", "company", "createdAt", "updatedAt")
VALUES
('ZQOwyoDteL','超级管理员', 'superadmin','{*,6684b5464b9206e48dbcf67c}','{6684b5464b9206e48dbcf67c}','RbIKpmuaMC','2024-06-16 12:00:00','2024-06-16 12:00:00')
ON conflict("objectId") DO UPDATE
SET 
"title" = excluded."title",
"name" = excluded."name",
"company" = excluded."company",
"createdAt"=excluded."createdAt";

-- 初始化管理员角色
INSERT INTO "_Role" ("objectId","title", "name", "_rperm", "_wperm", "company", "createdAt", "updatedAt")
VALUES
('ADMININITI','管理员', 'admin','{*,6684b5464b9206e48dbcf67c}','{6684b5464b9206e48dbcf67c}','RbIKpmuaMC','2024-06-16 12:00:00','2024-06-16 12:00:00')
ON conflict("objectId") DO UPDATE
SET 
"title" = excluded."title",
"name" = excluded."name",
"company" = excluded."company",
"createdAt"=excluded."createdAt";

-- 初始化操作员角色
INSERT INTO "_Role" ("objectId","title", "name", "_rperm", "_wperm", "company", "createdAt", "updatedAt")
VALUES
('MANAGERINT','操作员', 'manager','{*,6684b5464b9206e48dbcf67c}','{6684b5464b9206e48dbcf67c}','RbIKpmuaMC','2024-06-16 12:00:00','2024-06-16 12:00:00')
ON conflict("objectId") DO UPDATE
SET 
"title" = excluded."title",
"name" = excluded."name",
"company" = excluded."company",
"createdAt"=excluded."createdAt";

-- 超级管理员帐号,添加至超管用户组
INSERT INTO "_Join:users:_Role" ("relatedId", "owningId")
VALUES
('6684b5464b9206e48dbcf67c', 'ZQOwyoDteL')
ON conflict("relatedId","owningId") DO UPDATE
SET 
"relatedId" = excluded."relatedId",
"owningId" = excluded."owningId";
`