-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Utkarsh Saxena <[email protected]>
- Loading branch information
1 parent
158b221
commit 8db9176
Showing
7 changed files
with
132 additions
and
32 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
internal/gatewayserver/database/migrations/20240525205304_add_set_source.go
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,31 @@ | ||
package migration | ||
|
||
import ( | ||
"database/sql" | ||
|
||
"github.com/pressly/goose/v3" | ||
) | ||
|
||
func init() { | ||
goose.AddMigration(Up20240525205304, Down20240525205304) | ||
} | ||
|
||
func Up20240525205304(tx *sql.Tx) error { | ||
var err error | ||
|
||
_, err = tx.Exec("ALTER TABLE `policies` ADD COLUMN `set_request_source` VARCHAR(255) DEFAULT '';") | ||
if err != nil { | ||
return err | ||
} | ||
return err | ||
} | ||
|
||
func Down20240525205304(tx *sql.Tx) error { | ||
var err error | ||
|
||
_, err = tx.Exec("ALTER TABLE `policies` DROP COLUMN `set_request_source`;") | ||
if err != nil { | ||
return err | ||
} | ||
return err | ||
} |
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