This commit is contained in:
2025-03-10 18:19:32 +08:00
parent 16722f1d1d
commit 90333c791b
2 changed files with 48 additions and 1 deletions

View File

@@ -0,0 +1,46 @@
import '../modules/init.ts';
import { User, UserInit } from '../models/user.ts';
import { Org, OrgInit } from '../models/org.ts';
import { useContextKey } from '@kevisual/use-config/context';
const sequelize = useContextKey('sequelize');
export const main = async () => {
// await UserInit(null ,null, {
// alter: true,
// });
await UserInit();
await OrgInit();
const user = await User.findOne({
where: {
username: 'root',
},
});
if (!user) {
process.exit(0);
return;
}
await user.createPassword('silkyai2025');
await user.save();
process.exit(0);
};
// main();
export const changeDemo = async () => {
await UserInit();
await OrgInit();
const user = await User.findOne({
where: {
username: 'demo',
},
});
if (!user) {
process.exit(0);
}
await user.createPassword('123456');
await user.save();
process.exit(0);
};
// changeDemo();