Skip to content

Commit

Permalink
Merge pull request #28 from dcramer/feat/overhaul-vintages
Browse files Browse the repository at this point in the history
feat: Overhaul vintages
  • Loading branch information
dcramer committed May 22, 2023
2 parents b665837 + e536f55 commit 4f4097d
Show file tree
Hide file tree
Showing 43 changed files with 1,792 additions and 636 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml → .github/workflows/test.yml
@@ -1,11 +1,11 @@
name: CI
name: Test
on:
push:
branches:
- main
pull_request:
jobs:
main:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down
16 changes: 16 additions & 0 deletions apps/api/migrations/0019_lucky_wild_child.sql
@@ -0,0 +1,16 @@
ALTER TABLE "collection_bottle" ADD COLUMN "vintage_fingerprint" varchar(128);
ALTER TABLE "collection_bottle" ADD COLUMN "series" varchar(255);
ALTER TABLE "collection_bottle" ADD COLUMN "vintage_year" smallint;
ALTER TABLE "collection_bottle" ADD COLUMN "barrel" smallint;
ALTER TABLE "collection" ADD COLUMN "total_bottles" bigint DEFAULT 0 NOT NULL;
ALTER TABLE "tasting" ADD COLUMN "series" varchar(255);
ALTER TABLE "tasting" ADD COLUMN "vintage_year" smallint;
ALTER TABLE "tasting" ADD COLUMN "barrel" smallint;
ALTER TABLE "collection_bottle" DROP CONSTRAINT "collection_bottle_edition_id_edition_id_fk";

ALTER TABLE "tasting" DROP CONSTRAINT "tasting_edition_id_edition_id_fk";

ALTER TABLE "collection_bottle" DROP COLUMN IF EXISTS "edition_id";
ALTER TABLE "tasting" DROP COLUMN IF EXISTS "edition_id";
DROP TABLE edition;
UPDATE "collection" SET "total_bottles" = (SELECT COUNT(*) FROM "collection_bottle" WHERE "collection_bottle"."collection_id" = "collection"."id");

0 comments on commit 4f4097d

Please sign in to comment.