feat(infisical-pg): added a seed setup with test user creation and org creation

This commit is contained in:
Akhil Mohan
2024-01-27 12:38:22 +05:30
parent a19e8ad016
commit d0695a8998
5 changed files with 123 additions and 9 deletions
+17
View File
@@ -0,0 +1,17 @@
/* eslint-disable */
import { execSync } from "child_process";
import { readdirSync } from "fs";
import path from "path";
import promptSync from "prompt-sync";
const prompt = promptSync();
const migrationName = prompt("Enter name for seedfile: ");
const fileCounter = readdirSync(path.join(__dirname, "../src/db/seed")).length || 1;
execSync(
`npx knex seed:make --knexfile ${path.join(
__dirname,
"../src/db/knexfile.ts"
)} -x ts ${fileCounter}-${migrationName}`,
{ stdio: "inherit" }
);