@lucidcms/core
Version:
The core of the Lucid CMS. It's responsible for spinning up the API and serving the CMS.
1 lines • 1.11 kB
Source Map (JSON)
{"version":3,"file":"define-migration.mjs","names":[],"sources":["../../../src/libs/db/define-migration.ts"],"sourcesContent":["import type { ExternalMigrationFn } from \"./types.js\";\n\n/**\n * A typed helper for authoring external migration files. Migration files\n * registered via `config.migrations.sources` or the project `migrations/`\n * directory must default export the result of this helper.\n *\n * External migrations run after core migrations. `lucid_*` tables are internal\n * and modifying them is unsupported.\n *\n * @example\n * export default defineMigration(({ adapter }) => ({\n * \tasync up(db) {\n * \t\tawait db.schema\n * \t\t\t.createTable(\"my_table\")\n * \t\t\t.addColumn(\"id\", adapter.getDataType(\"primary\"), (col) =>\n * \t\t\t\tadapter.primaryKeyColumnBuilder(col),\n * \t\t\t)\n * \t\t\t.execute();\n * \t},\n * \tasync down(db) {\n * \t\tawait db.schema.dropTable(\"my_table\").execute();\n * \t},\n * }));\n */\nconst defineMigration = (fn: ExternalMigrationFn): ExternalMigrationFn => fn;\n\nexport default defineMigration;\n"],"mappings":"AAyBA,MAAM,EAAmB,GAAiD"}