Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from dcramer/feat/overhaul-vintages
feat: Overhaul vintages
- Loading branch information
Showing
43 changed files
with
1,792 additions
and
636 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"); |
Oops, something went wrong.