-
Notifications
You must be signed in to change notification settings - Fork 191
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make foreign key mapping null safe (#451)
* Change ForeignKeyAction to enum in the generator (#359) * Added support for WITH statements for DatabaseViews (#443) * Documentation update on DateTimeConverter sample (#442) * Make foreign key mapping null safe Co-authored-by: mqus <8398165+mqus@users.noreply.github.com> Co-authored-by: themadmrj <themadmrj@users.noreply.github.com> Co-authored-by: Cássio Seffrin <cassioseffrin@gmail.com>
- Loading branch information
1 parent
0af0b1b
commit 7b2ef20
Showing
21 changed files
with
346 additions
and
110 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
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
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
18 changes: 18 additions & 0 deletions
18
floor_generator/lib/misc/extension/foreign_key_action_extension.dart
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import 'package:floor_annotation/floor_annotation.dart'; | ||
|
||
extension ForeignKeyActionExtension on ForeignKeyAction { | ||
String toSql() { | ||
switch (this) { | ||
case ForeignKeyAction.noAction: | ||
return 'NO ACTION'; | ||
case ForeignKeyAction.restrict: | ||
return 'RESTRICT'; | ||
case ForeignKeyAction.setNull: | ||
return 'SET NULL'; | ||
case ForeignKeyAction.setDefault: | ||
return 'SET DEFAULT'; | ||
case ForeignKeyAction.cascade: | ||
return 'CASCADE'; | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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
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
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
Oops, something went wrong.