chore: requires drizzle-kit within func

This commit is contained in:
James
2024-03-10 21:54:31 -04:00
parent 1a8564bc35
commit 2db385c6a5
2 changed files with 107 additions and 3 deletions

View File

@@ -7,8 +7,6 @@ import type { PostgresAdapter } from '../types.js'
const require = createRequire(import.meta.url)
const { pushSchema } = require('drizzle-kit/payload')
/**
* Pushes the development schema to the database using Drizzle.
*
@@ -16,6 +14,8 @@ const { pushSchema } = require('drizzle-kit/payload')
* @returns {Promise<void>} - A promise that resolves once the schema push is complete.
*/
export const pushDevSchema = async (db: PostgresAdapter) => {
const { pushSchema } = require('drizzle-kit/payload')
// This will prompt if clarifications are needed for Drizzle to push new schema
const { apply, hasDataLoss, statementsToExecute, warnings } = await pushSchema(
db.schema,