-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor/aws integration #100
Merged
Merged
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
3424d9f
feat:added upload middleware; added route to test file upload to s3;
Manjish 3ae61c8
feat: added cognito auth middleware
Manjish e4458d5
feat: added admin seed; changes in user model; added auto migration u…
Manjish c01e188
refactor:made auto-migrate optional
Manjish b07b345
feat:sending simple email using Amazon SES
Manjish 2de07ae
:wrench: chore: remove gcp and firebase related services
paudelgaurav 514d870
:sparkles: feat: added atlas as migation tool
paudelgaurav 02d6fd0
:wrench: chore: merge branch develop into refactor/enhancement-aws-in…
paudelgaurav b21b15e
:wrench: chore: update go version to 1.22 in workflow file
paudelgaurav 1d4db2c
:wrench: chore: running migration in github runner
paudelgaurav bfc8f90
:wrench: chore: downloading atlas in github runner
paudelgaurav da39f7b
:wrench: chore: remove env flag while applying migration
paudelgaurav c95f131
:wrench: chore: remove apply migration in runner
paudelgaurav aea044b
:wrench: chore: fix command to serve and check health
paudelgaurav ace0efd
:wrench: chore: fix command to migrate
paudelgaurav f6ec64e
:hammer: updated make file for migrating to previous version
Denes-cilwal a849067
:hammer: added port forward in env
Denes-cilwal 16da18e
Merge pull request #114 from wesionaryTEAM/refactor/enhancement-in-aw…
Denes-cilwal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ func NewRepository(db infrastructure.Database, logger framework.Logger) Reposito | |
return Repository{db, logger} | ||
} | ||
|
||
// For AutoMigrating (used in fx.Invoke) | ||
func Migrate(r Repository) error { | ||
r.logger.Info("[Migrating...User]") | ||
if err := r.DB.AutoMigrate(&models.User{}); err != nil { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let revert these changes ! @Manjish There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. will be fixed by #114 |
||
|
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 |
---|---|---|
@@ -1,18 +1,27 @@ | ||
|
||
-- +migrate Up | ||
CREATE TABLE IF NOT EXISTS `users` ( | ||
`id` BINARY(16) NOT NULL, | ||
`email` VARCHAR(100) NOT NULL, | ||
`name` VARCHAR(20) NOT NULL, | ||
`age` int(10) UNSIGNED, | ||
`birthday` DATETIME, | ||
`profile_pic` VARCHAR(100), | ||
`member_number` VARCHAR(100), | ||
`id` bigint unsigned AUTO_INCREMENT PRIMARY KEY, | ||
`created_at` DATETIME NOT NULL, | ||
`updated_at` DATETIME NOT NULL, | ||
PRIMARY KEY (`id`), | ||
CONSTRAINT email_unique UNIQUE(email) | ||
)ENGINE = InnoDB DEFAULT CHARSET=utf8mb4; | ||
`deleted_at` DATETIME NULL, | ||
`uuid` BINARY(16) NOT NULL, | ||
`cognito_uid` VARCHAR(50) NULL, | ||
`first_name` VARCHAR(255) NOT NULL, | ||
`last_name` VARCHAR(255) NOT NULL, | ||
`first_name_ja` VARCHAR(255) NOT NULL, | ||
`last_name_ja` VARCHAR(255) NOT NULL, | ||
`email` VARCHAR(255) NOT NULL UNIQUE, | ||
`role` VARCHAR(25) NOT NULL, | ||
`is_active` BOOLEAN NOT NULL DEFAULT false, | ||
`is_email_verified` BOOLEAN NOT NULL DEFAULT false, | ||
`is_admin` BOOLEAN NOT NULL DEFAULT false, | ||
`profile_pic` text NOT NULL, | ||
INDEX `idx_users_uuid` (`uuid`), | ||
INDEX `idx_users_cognito_uid` (`cognito_uid`), | ||
INDEX `idx_users_email` (`email`) | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; | ||
|
||
|
||
-- +migrate Down | ||
DROP TABLE IF EXISTS `users`; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Manjish Let's remove this as auto migrate invocation and stick to writing migration for schema.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will be fixed by #114