Check for duplicate migration keys (#8597)

* Check for duplicate migration keys

* Run prettier
This commit is contained in:
heyarne
2021-10-08 00:00:31 +02:00
committed by GitHub
parent 37b90a9f10
commit 0d7d63f9fe
2 changed files with 7 additions and 2 deletions

View File

@@ -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]);

View File

@@ -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.