-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Refactored model indexes & triggers from arrays to objects * Updated model unit tests
- Loading branch information
Showing
3 changed files
with
26 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,22 +14,22 @@ export const Account = model({ | |
birthday: date(), | ||
}, | ||
|
||
indexes: [ | ||
{ | ||
indexes: { | ||
name: { | ||
fields: [{ slug: 'name', order: 'ASC', collation: 'BINARY' }], | ||
unique: true, | ||
}, | ||
], | ||
}, | ||
|
||
triggers: [ | ||
{ | ||
triggers: { | ||
afterInsert: { | ||
when: 'AFTER', | ||
action: 'INSERT', | ||
fields: [{ slug: 'name' }], | ||
// @ts-expect-error: The queries need to be adjusted in the TS client. | ||
effects: () => [add.member.with({ name: 'admin', email: '[email protected]' })], | ||
}, | ||
], | ||
}, | ||
}); | ||
|
||
export const Profile = model({ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters