This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import { storeJson } from '../fileModels/storeJson'
|
||||
import { sdk } from '../sdk'
|
||||
import { POSTGRES_DB, POSTGRES_USER, randomPassword } from '../utils'
|
||||
|
||||
export const taskSeedDb = sdk.setupOnInit(async (effects) => {
|
||||
const existing = await storeJson.read((s) => s.dbAuth).once()
|
||||
if (existing) return
|
||||
|
||||
await storeJson.merge(
|
||||
effects,
|
||||
{
|
||||
dbAuth: {
|
||||
username: POSTGRES_USER,
|
||||
password: randomPassword(),
|
||||
database: POSTGRES_DB,
|
||||
},
|
||||
},
|
||||
{ allowWriteAfterConst: true },
|
||||
)
|
||||
})
|
||||
Reference in New Issue
Block a user