-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start working on having status codes settable by resolvers (#334)
- Loading branch information
Showing
56 changed files
with
1,489 additions
and
546 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
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,44 @@ | ||
//go:build !test || migrationtest | ||
|
||
package migration | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/jackc/pgx/v4" | ||
) | ||
|
||
func init() { | ||
// The version of this migration | ||
const migrationVersion = 2 | ||
|
||
Register( | ||
migrationVersion, | ||
func(ctx context.Context, tx pgx.Tx) error { | ||
// The Up action of this migration | ||
// Delete all cached entries | ||
_, err := tx.Exec(ctx, `TRUNCATE cache;`) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
_, err = tx.Exec(ctx, ` | ||
ALTER TABLE cache | ||
ADD http_status_code SMALLINT NOT NULL, | ||
ADD http_content_type TEXT NOT NULL | ||
;`) | ||
|
||
return err | ||
}, | ||
func(ctx context.Context, tx pgx.Tx) error { | ||
// The Down action of this migration | ||
_, err := tx.Exec(ctx, ` | ||
ALTER TABLE cache | ||
DROP http_status_code, | ||
DROP http_content_type | ||
;`) | ||
|
||
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
Oops, something went wrong.