Skip to content

Commit

Permalink
Fix broken resolver
Browse files Browse the repository at this point in the history
* Truncate timestamps in migrations

The new version of dbmigration seems to break if the decimal parts are
present. I thought I had addressed/tested this when I made that change,
but apparently not.

* Restyle
* Fix weeder-version
* Rev some actions
  • Loading branch information
pbrisbin committed Jul 15, 2023
1 parent 5942f18 commit f81b590
Show file tree
Hide file tree
Showing 39 changed files with 52 additions and 77 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,26 +40,27 @@ jobs:
--health-retries 5
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: freckle/stack-cache-action@v2
- run: |
stack install --no-terminal \
--copy-compiler-tool dbmigrations-postgresql
- run: db/migrate test upgrade
- uses: freckle/stack-action@v3
- id: stack
uses: freckle/stack-action@v3
env:
REDIS_URL: redis://localhost:6379/15
- run: db/pending-prod-migrations --check
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
- uses: freckle/weeder-action@v1
- uses: freckle/weeder-action@v2
with:
weeder-version: 2.3.0
ghc-version: ${{ steps.stack.outputs.compiler-version }}

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- run: |
curl --location --output .hlint.yaml \
https://raw.githubusercontent.com/pbrisbin/dotfiles/master/hlint.yaml
Expand Down
2 changes: 1 addition & 1 deletion db/migrations/add-container-to-jobs.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# vim: ft=yaml
Description: Add machine and container to job data
Created: 2019-12-10 17:47:27.984139403 UTC
Created: 2019-12-10 17:47:27 UTC
Depends: create-job
Apply: |
ALTER TABLE job
Expand Down
2 changes: 1 addition & 1 deletion db/migrations/add-enabled-to-repos.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# vim: ft=yaml
Description: Add enabled to repos
Created: 2019-12-04 00:57:22.750388541 UTC
Created: 2019-12-04 00:57:22 UTC
Depends: create-repo
Apply: |
ALTER TABLE repo
Expand Down
2 changes: 1 addition & 1 deletion db/migrations/add-expires-at-to-marketplace-account.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# vim: ft=yaml
Description: Add expires_at to marketplace_account
Created: 2020-12-11 15:49:19.854420084 UTC
Created: 2020-12-11 15:49:19 UTC
Depends: add-marketplace-account
Apply: |
ALTER TABLE marketplace_account
Expand Down
2 changes: 1 addition & 1 deletion db/migrations/add-job-count-to-restyle-machine.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# vim: ft=yaml
Description: Add job_count to restyle_machine table
Created: 2019-11-26 15:33:42.055263364 UTC
Created: 2019-11-26 15:33:42 UTC
Depends: create-restyle-machine
Apply: |
ALTER TABLE "restyle_machine"
Expand Down
2 changes: 1 addition & 1 deletion db/migrations/add-job-indexes-again-again.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# vim: ft=yaml
Description: Add indexes on job
Created: 2022-09-23 19:22:13.026251439 UTC
Created: 2022-09-23 19:22:13 UTC
Depends: create-job
Apply: |
CREATE INDEX job_owner_repo_pull_request_idx ON job (owner, repo, pull_request)
Expand Down
2 changes: 1 addition & 1 deletion db/migrations/add-job-indexes-again.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# vim: ft=yaml
Description: Add indexes on job
Created: 2022-04-27 19:22:13.026251439 UTC
Created: 2022-04-27 19:22:13 UTC
Depends: create-job
Apply: |
CREATE INDEX job_repo_owner_pull_request_idx ON job (repo, owner, pull_request)
Expand Down
2 changes: 1 addition & 1 deletion db/migrations/add-job-indexes.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# vim: ft=yaml
Description: Add indexes on job
Created: 2019-12-11 19:22:13.026251439 UTC
Created: 2019-12-11 19:22:13 UTC
Depends: create-job
Apply: |
CREATE INDEX job_created_at_idx ON job (created_at)
Expand Down
2 changes: 1 addition & 1 deletion db/migrations/add-job-log-column.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# vim: ft=yaml
Description: Add job log column
Created: 2020-04-01 18:04:08.995876002 UTC
Created: 2020-04-01 18:04:08 UTC
Depends: create-job
Apply: |
ALTER TABLE job
Expand Down
2 changes: 1 addition & 1 deletion db/migrations/add-marketplace-account-fields.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# vim: ft=yaml
Description: Add new marketplace_accounts fields
Created: 2020-02-25 20:49:04.807304481 UTC
Created: 2020-02-25 20:49:04 UTC
Depends: add-marketplace-account
Apply: |
ALTER TABLE "marketplace_account"
Expand Down
2 changes: 1 addition & 1 deletion db/migrations/add-marketplace-account.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# vim: ft=yaml
Description: Create marketplace_account table
Created: 2019-03-22 12:54:15.309616868 UTC
Created: 2019-03-22 12:54:15 UTC
Depends: create-marketplace-plan
Apply: |
CREATE TABLE "marketplace_account" (
Expand Down
2 changes: 1 addition & 1 deletion db/migrations/add-marketplace-enabled-repo.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# vim: ft=yaml
Description: Create marketplace_enabled_repo table
Created: 2019-06-27 15:25:44.841020026 UTC
Created: 2019-06-27 15:25:44 UTC
Depends: add-marketplace-account create-marketplace-plan create-repo
Apply: |
CREATE TABLE "marketplace_enabled_repo" (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# vim: ft=yaml
Description: Add marketplace_plan.private_repo_allowance
Created: 2020-10-05 15:32:17.648648347 UTC
Created: 2020-10-05 15:32:17 UTC
Depends: migrate-plans create-marketplace-plan
Apply: |
ALTER TABLE marketplace_plan
Expand Down
2 changes: 1 addition & 1 deletion db/migrations/add-marketplace-plan-to-user.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# vim: ft=yaml
Description: Add marketplacePlan to user table
Created: 2019-03-21 16:43:40.165190769 UTC
Created: 2019-03-21 16:43:40 UTC
Depends: create-marketplace-plan create-user
Apply: |
ALTER TABLE "user"
Expand Down
3 changes: 1 addition & 2 deletions db/migrations/add-reconciling-to-restyle-machine.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# vim: ft=yaml
Description: Add reconciling to restyle_machine
Created: 2020-08-07 18:10:27.13831281 UTC
Created: 2020-08-07 18:10:27 UTC
Depends: create-restyle-machine
Apply: |
ALTER TABLE "restyle_machine"
ADD COLUMN reconciling bool NOT NULL DEFAULT false
Revert: |
ALTER TABLE "restyle_machine" DROP COLUMN IF EXISTS reconciling
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# vim: ft=yaml
Description: Add restriction columns to marketplace_plan
Created: 2023-06-01 12:19:52.315243089 UTC
Created: 2023-06-01 12:19:52 UTC
Depends: create-marketplace-plan
Apply: |
ALTER TABLE marketplace_plan
Expand Down
2 changes: 1 addition & 1 deletion db/migrations/add-restyler-image-to-repo.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# vim: ft=yaml
Description: Add restyler_image to repo
Created: 2020-05-09 18:35:07.196698581 UTC
Created: 2020-05-09 18:35:07 UTC
Depends: create-repo
Apply: |
ALTER TABLE repo
Expand Down
2 changes: 1 addition & 1 deletion db/migrations/add-retired-to-marketplace-plan.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# vim: ft=yaml
Description: Add retired to marketplace_plan
Created: 2021-06-08 15:03:38.515793773 UTC
Created: 2021-06-08 15:03:38 UTC
Depends: create-marketplace-plan
Apply: |
ALTER TABLE marketplace_plan
Expand Down
2 changes: 1 addition & 1 deletion db/migrations/add-revenue-to-marketplace-plan.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# vim: ft=yaml
Description: Add revenue to marketplace_plan
Created: 2020-10-14 10:57:13.392389261 UTC
Created: 2020-10-14 10:57:13 UTC
Depends: migrate-plans create-marketplace-plan
Apply: |
ALTER TABLE marketplace_plan
Expand Down
2 changes: 1 addition & 1 deletion db/migrations/add-trial-ends-at-to-marketplace-account.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# vim: ft=yaml
Description: Add trial_ends_at to marketplace_account
Created: 2021-06-18 14:52:30.122751007 UTC
Created: 2021-06-18 14:52:30 UTC
Depends: add-marketplace-account
Apply: |
ALTER TABLE marketplace_account
Expand Down
2 changes: 1 addition & 1 deletion db/migrations/create-api-tokens.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# vim: ft=yaml
Description: Add API tokens
Created: 2020-04-14 00:27:59.492208774 UTC
Created: 2020-04-14 00:27:59 UTC
Depends: create-user
Apply: |
CREATE TABLE api_token (
Expand Down
2 changes: 1 addition & 1 deletion db/migrations/create-job-log-line.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# vim: ft=yaml
Description: Create job_log_line table
Created: 2019-05-19 20:06:58.846537179 UTC
Created: 2019-05-19 20:06:58 UTC
Depends: create-job
Apply: |
CREATE TABLE job_log_line (
Expand Down
2 changes: 1 addition & 1 deletion db/migrations/create-job.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# vim: ft=yaml
Description: Create job table
Created: 2018-12-03 13:46:19.469931 UTC
Created: 2018-12-03 13:46:19 UTC
Depends:
Apply: |
CREATE TABLE job (
Expand Down
2 changes: 1 addition & 1 deletion db/migrations/create-marketplace-plan.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# vim: ft=yaml
Description: Create marketplace_plan table
Created: 2019-03-21 16:41:57.452499027 UTC
Created: 2019-03-21 16:41:57 UTC
Depends:
Apply: |
CREATE TABLE "marketplace_plan" (
Expand Down
2 changes: 1 addition & 1 deletion db/migrations/create-offer-claims.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# vim: ft=yaml
Description: Create offer claims
Created: 2020-10-07 12:33:15.45904648 UTC
Created: 2020-10-07 12:33:15 UTC
Depends: create-offers
Apply: |
CREATE TABLE offer_claim
Expand Down
2 changes: 1 addition & 1 deletion db/migrations/create-offers.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# vim: ft=yaml
Description: Create offers
Created: 2020-10-05 20:25:23.269669821 UTC
Created: 2020-10-05 20:25:23 UTC
Depends: create-marketplace-plan
Apply: |
CREATE TABLE offer
Expand Down
2 changes: 1 addition & 1 deletion db/migrations/create-pgcrypto-extension.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# vim: ft=yaml
Description: Create pgcrypto extension
Created: 2020-04-14 00:48:57.188567253 UTC
Created: 2020-04-14 00:48:57 UTC
Depends:
Apply: |
CREATE EXTENSION IF NOT EXISTS pgcrypto;
Expand Down
2 changes: 1 addition & 1 deletion db/migrations/create-plan.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# vim: ft=yaml
Description: Create plan table
Created: 2018-12-03 13:46:22.880627 UTC
Created: 2018-12-03 13:46:22 UTC
Depends:
Apply: |
CREATE TABLE plan (
Expand Down
2 changes: 1 addition & 1 deletion db/migrations/create-repo.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# vim: ft=yaml
Description: Create repo table
Created: 2018-12-03 13:46:25.602014 UTC
Created: 2018-12-03 13:46:25 UTC
Depends:
Apply: |
CREATE TABLE repo (
Expand Down
2 changes: 1 addition & 1 deletion db/migrations/create-restyle-machine.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# vim: ft=yaml
Description: Create restyle_machine table
Created: 2019-02-27 21:42:49.257899701 UTC
Created: 2019-02-27 21:42:49 UTC
Depends:
Apply: |
CREATE TABLE "restyle_machine" (
Expand Down
2 changes: 1 addition & 1 deletion db/migrations/create-user.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# vim: ft=yaml
Description: Create user table
Created: 2018-12-03 13:46:31.930897 UTC
Created: 2018-12-03 13:46:31 UTC
Depends:
Apply: |
CREATE TABLE "user" (
Expand Down
2 changes: 1 addition & 1 deletion db/migrations/fix-marketplace-account-field.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# vim: ft=yaml
Description: Fix billing email
Created: 2020-02-25 21:02:22.688481184 UTC
Created: 2020-02-25 21:02:22 UTC
Depends: add-marketplace-account-fields add-marketplace-account
Apply: |
ALTER TABLE "marketplace_account"
Expand Down
2 changes: 1 addition & 1 deletion db/migrations/migrate-plans.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# vim: ft=yaml
Description: Migration old plan records to marketplace_account
Created: 2019-03-22 19:49:21.393490067 UTC
Created: 2019-03-22 19:49:21 UTC
Depends: create-plan add-marketplace-account create-marketplace-plan
Apply: |
INSERT INTO marketplace_plan
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# vim: ft=yaml
Description: Not null marketplace_plan.private_repo_allowance
Created: 2020-10-06 14:39:50.489188251 UTC
Created: 2020-10-06 14:39:50 UTC
Depends: add-marketplace-plan-private-repo-allowance
Apply: |
ALTER TABLE marketplace_plan
Expand Down
2 changes: 1 addition & 1 deletion db/migrations/null-marketplace-account-github-id.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# vim: ft=yaml
Description: Null marketplace_account.github_id
Created: 2020-10-06 14:18:31.910892225 UTC
Created: 2020-10-06 14:18:31 UTC
Depends: migrate-plans add-marketplace-account
Apply: |
ALTER TABLE marketplace_account
Expand Down
2 changes: 1 addition & 1 deletion db/migrations/null-marketplace-plan-github-d.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# vim: ft=yaml
Description: Null marketplace_plan.githubId
Created: 2020-10-05 15:26:41.746241895 UTC
Created: 2020-10-05 15:26:41 UTC
Depends: migrate-plans create-marketplace-plan
Apply: |
ALTER TABLE marketplace_plan
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: "3"

services:
postgres:
image: postgres
image: postgres:15.3
command: >
-c fsync=off
-c synchronous_commit=off
Expand Down
19 changes: 2 additions & 17 deletions stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,7 @@ extra-deps:

- monad-validate-1.2.0.1

# - Blammo-1.1.2.0

# # For Blammo
# - envparse-0.5.0
# - monad-logger-aeson-0.3.1.0
# - context-0.2.0.1

# # For weeder
# - algebraic-graphs-0.5

# For dbmigrations-postgresql
- HDBC-postgresql-2.5.0.1
- dbmigrations-2.0.0

# For dbmigrations
- yaml-light-0.1.4

# For yaml-light
- HsSyck-0.53
- github: jtdaugherty/dbmigrations
commit: 2cfdf435cb50d9c6cc80231a5f98dfdfcdeb64b6
26 changes: 8 additions & 18 deletions stack.yaml.lock
Original file line number Diff line number Diff line change
Expand Up @@ -84,26 +84,16 @@ packages:
original:
hackage: HDBC-postgresql-2.5.0.1
- completed:
hackage: dbmigrations-2.0.0@sha256:1e3bd62ca980659d27b6bc7b00e58ae0e2bf7781e3859f440b7c005c46037075,5270
name: dbmigrations
pantry-tree:
sha256: c0ed60caea8b8aace63e40628c753ba8b007edcea17ccc270317b533d07c8e28
size: 3935
sha256: 54d4125a75503fc71388090fb1244ab39ebbe09a33c4fb157b76bbf9f95a2d75
size: 4142
sha256: dd624bd073a30ed2e72cc3129a290757b16af38fe6db30b8a2e7f7c1b6e81fdf
size: 37218
url: https://github.com/jtdaugherty/dbmigrations/archive/2cfdf435cb50d9c6cc80231a5f98dfdfcdeb64b6.tar.gz
version: 2.1.0
original:
hackage: dbmigrations-2.0.0
- completed:
hackage: yaml-light-0.1.4@sha256:838b509c3a895339eea42b6524f46ba4e59c33e9f43537123cdaedfea09ca58d,1887
pantry-tree:
sha256: ed05f839d189a312392f35d41888602b5929a8c0bcd54ee50bffe013552526ba
size: 217
original:
hackage: yaml-light-0.1.4
- completed:
hackage: HsSyck-0.53@sha256:a987ae2163811bdebfd4f2e2dcb7c75e9d2d68afd97d196f969d6a74786e43da,1818
pantry-tree:
sha256: d0465b8296fc621a76c7362eadf1364489781ca09d79441ec22b7a18b12eed46
size: 1024
original:
hackage: HsSyck-0.53
url: https://github.com/jtdaugherty/dbmigrations/archive/2cfdf435cb50d9c6cc80231a5f98dfdfcdeb64b6.tar.gz
snapshots:
- completed:
sha256: 5a59b2a405b3aba3c00188453be172b85893cab8ebc352b1ef58b0eae5d248a2
Expand Down

0 comments on commit f81b590

Please sign in to comment.