-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add migration and build script; enhance seeker functionality
- Implemented shell scripts for creating migrations and managing build lifecycle. - Added seeker-specific modifications for streamlined functionality. - Included dynamic migration naming with random suffix generation.
- Loading branch information
Showing
14 changed files
with
142 additions
and
20 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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/bin/bash | ||
|
||
random_number() { | ||
echo $((RANDOM % 10000 + 1)) | ||
} | ||
|
||
echo "Select the context for the migration:" | ||
echo "1. ApplicationDbContext (AppDB)" | ||
echo "2. BaseDbContext (BaseDB)" | ||
read -p "Enter your choice (1 or 2): " choice | ||
|
||
suffix=$(random_number) | ||
|
||
# Handle user choice | ||
case $choice in | ||
1) | ||
context="ApplicationDbContext" | ||
migration_name="AppDBCreate$suffix" | ||
;; | ||
2) | ||
context="BaseDBContext" | ||
migration_name="BaseDBCreate$suffix" | ||
;; | ||
*) | ||
echo "Invalid choice. Exiting." | ||
exit 1 | ||
;; | ||
esac | ||
|
||
# Run the EF Core migration and update database | ||
command="dotnet ef migrations add $migration_name --context $context" | ||
echo "Running: $command" | ||
$command | ||
|
||
if [ $? -eq 0 ]; then | ||
echo "Migration created successfully." | ||
update_command="dotnet ef database update --context $context" | ||
echo "Running: $update_command" | ||
$update_command | ||
|
||
if [ $? -eq 0 ]; then | ||
echo "Database updated successfully." | ||
else | ||
echo "Failed to update the database." | ||
fi | ||
else | ||
echo "Failed to create the migration." | ||
fi |
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
1 change: 0 additions & 1 deletion
1
Server/JobLeet.WebApi/JobLeet.Core/Entities/Jobs/V1/Application.cs
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
6 changes: 3 additions & 3 deletions
6
...20250123165553_Authentication.Designer.cs → ...0250124134905_AppDBCreate1571.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
17 changes: 14 additions & 3 deletions
17
.../20250123164735_InitialCreate.Designer.cs → ...250124134945_BaseDBCreate9892.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
|
||
|
||
execute_command() { | ||
command="$1" | ||
echo "Running: $command" | ||
$command | ||
|
||
if [ $? -ne 0 ]; then | ||
echo "Command failed: $command" | ||
exit 1 | ||
fi | ||
} | ||
|
||
|
||
execute_command "dotnet clean" | ||
|
||
|
||
execute_command "dotnet restore" | ||
|
||
|
||
execute_command "dotnet build" | ||
|
||
execute_command "dotnet run" |