10000 Database migrations hook · Issue #401 · nuxt-hub/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Database migrations hook #401
Closed
Closed
@farnabaz

Description

@farnabaz

Database migrations are great for initializing and seeding production database. I was thinking of expanding migration usage and allow other modules to communicate with migration engine.
Currently, migrations are stored and retrieved from the server/database/migrations directory. What if NuxtHub provides some hooks that allow other modules to inject migration/seeding queries without the need to create a file in server/database/migrations directory?

The hook:
nuxthub:database:migrations: The hook will call with the list of existing migrations and consumers can modify or append to it

Using this hook

  • Modules like Nuxt Content can inject migration queries without the need to create the file
  • Also this hook is a good place to know the exact timing of when NuxtHub retrieves migrations and creates a custom one (In this case we use this hook to create a migration file in the server directory)

Additionally, it would be awesome NuxtHub could provide a hook to provide a database connection and allow running javascript logic (like strapi migrations) or Nuxt tasks. This is tricky thing to achieve since it should work in different types of deployment.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0