generated from Real-Dev-Squad/website-template
-
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.
change migration seq to start from 000001 for go lang migrate & add `…
…shareable_id` column (#52) * change seq to start from 1 for go lang migrate * create migration to add shareable id column in form table * add comments to create, version & force commands in makerfile * drop index in shareable id down migration * remove spacing * add the wisee prefix to pathname in google redirect url * fix build error * add a todo * chore: Generate shareable ID for new forms (#53) * create an api to get form details from shareable_id (#54) * chore: Generate shareable ID for new forms * create a api to get form details from shareable id * share shareable id to GetFormDetailsResposneDto & write test cases to get form details form shareable id api
- Loading branch information
Showing
16 changed files
with
194 additions
and
10 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,6 @@ | ||
BEGIN; | ||
|
||
DROP INDEX IF EXISTS shareable_id_idx; | ||
ALTER TABLE forms.form DROP COLUMN shareable_id; | ||
|
||
COMMIT; |
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,6 @@ | ||
BEGIN; | ||
|
||
ALTER TABLE forms.form ADD COLUMN shareable_id VARCHAR(255) UNIQUE NOT NULL; | ||
CREATE UNIQUE INDEX shareable_id_idx ON forms.form (shareable_id); | ||
|
||
COMMIT; |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package utils | ||
|
||
import ( | ||
"crypto/md5" | ||
"encoding/hex" | ||
) | ||
|
||
func GenerateHash(content string, length int8) (string, error) { | ||
hash := md5.New() | ||
_, err := hash.Write([]byte(content)) | ||
|
||
if err != nil { | ||
return "", err | ||
} | ||
|
||
return hex.EncodeToString(hash.Sum(nil))[:length], nil | ||
} |
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