Merge branch '2.0' of github.com:payloadcms/payload into 2.0
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@payloadcms/bundler-vite",
|
||||
"version": "0.1.0-beta.7",
|
||||
"version": "0.1.0-beta.8",
|
||||
"description": "The officially supported Vite bundler adapter for Payload",
|
||||
"repository": "https://github.com/payloadcms/payload",
|
||||
"license": "MIT",
|
||||
|
||||
@@ -71,8 +71,8 @@ export const createMigration: CreateMigration = async function createMigration(
|
||||
const timestamp = `${formattedDate}_${formattedTime}`
|
||||
|
||||
const fileName = migrationName
|
||||
? `${timestamp}_${migrationName.replace(/\W/g, '_')}.ts`
|
||||
: `${timestamp}.ts`
|
||||
? `${timestamp}_${migrationName.replace(/\W/g, '_')}`
|
||||
: `${timestamp}`
|
||||
|
||||
const filePath = `${dir}/${fileName}`
|
||||
|
||||
@@ -96,12 +96,16 @@ export const createMigration: CreateMigration = async function createMigration(
|
||||
const sqlStatementsUp = await generateMigration(drizzleJsonBefore, drizzleJsonAfter)
|
||||
const sqlStatementsDown = await generateMigration(drizzleJsonAfter, drizzleJsonBefore)
|
||||
|
||||
// write schema
|
||||
fs.writeFileSync(`${filePath}.json`, JSON.stringify(drizzleJsonAfter))
|
||||
|
||||
// write migration
|
||||
fs.writeFileSync(
|
||||
filePath,
|
||||
`${filePath}.ts`,
|
||||
migrationTemplate(
|
||||
sqlStatementsUp.length ? sqlStatementsUp?.join('\n') : undefined,
|
||||
sqlStatementsDown.length ? sqlStatementsDown?.join('\n') : undefined,
|
||||
),
|
||||
)
|
||||
payload.logger.info({ msg: `Migration created at ${filePath}` })
|
||||
payload.logger.info({ msg: `Migration created at ${filePath}.ts` })
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "payload",
|
||||
"version": "2.0.0-beta.12",
|
||||
"version": "2.0.0-beta.13",
|
||||
"description": "Node, React and MongoDB Headless CMS and Application Framework",
|
||||
"license": "MIT",
|
||||
"main": "./src/index.ts",
|
||||
|
||||
Reference in New Issue
Block a user