Skip to content

Commit

Permalink
Fixed comments
Browse files Browse the repository at this point in the history
  • Loading branch information
colodenn committed Feb 20, 2025
1 parent 44288ec commit 5ab96b6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/utils/migration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,9 @@ export const triggersToRecreate = (
existingModel || ({} as Model),
);

// find triggers with the same slug and if they have different properties we need to drop and create
// For each trigger in the defined model, check if a trigger with the same slug exists
// in the database. If it does and its properties differ, drop the existing trigger and
// create a new one with the updated properties.
const needRecreation = Object.entries(definedModel.triggers || {}).reduce<
Array<string>
>((acc, [slug, trigger]) => {
Expand Down Expand Up @@ -380,7 +382,9 @@ export const indexesToRecreate = (
existingModel || ({} as Model),
);

// find indexes with the same slug and if they have different properties we need to drop and create
// For each index in the defined model, check if an index with the same slug exists
// in the database. If it does and its properties differ, drop the existing index and
// create a new one with the updated properties.
const needRecreation = Object.entries(definedModel.indexes || {}).reduce<
Array<string>
>((acc, [slug, index]) => {
Expand Down
1 change: 0 additions & 1 deletion tests/fixtures/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ export const runMigration = async (
statements: Array<Statement>;
modelDiff: Array<string>;
}> => {
// We need to convert the models.fields: Object -> Array
const db = await queryEphemeralDatabase(existingModels, insertStatements);

const packages = await getLocalPackages();
Expand Down

0 comments on commit 5ab96b6

Please sign in to comment.