mirror of
https://github.com/directus/directus.git
synced 2026-01-23 08:08:04 -05:00
Check for duplicate migration keys (#8597)
* Check for duplicate migration keys * Run prettier
This commit is contained in:
@@ -26,6 +26,11 @@ export default async function run(database: Knex, direction: 'up' | 'down' | 'la
|
||||
...customMigrationFiles.map((path) => parseFilePath(path, true)),
|
||||
].sort((a, b) => (a.version > b.version ? 1 : -1));
|
||||
|
||||
const migrationKeys = new Set(migrations.map((m) => m.version));
|
||||
if (migrations.length > migrationKeys.size) {
|
||||
throw new Error('Migration keys collide! Please ensure that every migration uses a unique key.');
|
||||
}
|
||||
|
||||
function parseFilePath(filePath: string, custom = false) {
|
||||
const version = filePath.split('-')[0];
|
||||
const name = formatTitle(filePath.split('-').slice(1).join('_').split('.')[0]);
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
|
||||
1. Navigate to the **User Library**
|
||||
2. Click the **Invite Users** button in the header
|
||||
4. Enter **one or more email addresses**, separated by new lines, in the modal
|
||||
5. Click **Invite**
|
||||
3. Enter **one or more email addresses**, separated by new lines, in the modal
|
||||
4. Click **Invite**
|
||||
|
||||
At this point the invited user(s) will receive an email with a link to the App where they set a password and enable
|
||||
their account.
|
||||
|
||||
Reference in New Issue
Block a user