-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Setup Prisma migrations (#146)
* chore: Bump prisma * feat: Setup initial migration * feat: GHA workflow
- Loading branch information
1 parent
cb32f66
commit e91c717
Showing
5 changed files
with
153 additions
and
29 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Deploy migrations | ||
on: | ||
push: | ||
paths: | ||
# Only run this workflow when migrations are updated | ||
- prisma/migrations/** | ||
branches: | ||
- main | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
- name: Install dependencies | ||
run: npm install | ||
- name: Apply all pending migrations to the database | ||
run: npx prisma migrate deploy | ||
env: | ||
DATABASE_URL: ${{ secrets.PRODUCTION_DATABASE_URL }} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,98 @@ | ||
-- CreateTable | ||
CREATE TABLE "buildprices" ( | ||
"id" SERIAL NOT NULL, | ||
"housetypedescription" VARCHAR(250), | ||
"housetype" VARCHAR(1), | ||
"pricerange" VARCHAR(50), | ||
"pricemid" DOUBLE PRECISION, | ||
|
||
CONSTRAINT "buildprices_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "gdhi" ( | ||
"id" SERIAL NOT NULL, | ||
"itllevel" VARCHAR(250), | ||
"itl3" VARCHAR(250), | ||
"region" VARCHAR(250), | ||
"gdhi_2020" DOUBLE PRECISION, | ||
|
||
CONSTRAINT "gdhi_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "hpi" ( | ||
"id" SERIAL NOT NULL, | ||
"region" VARCHAR(250), | ||
"itl3" VARCHAR(250), | ||
"ladcode" VARCHAR(250), | ||
"hpi_2000" DOUBLE PRECISION, | ||
|
||
CONSTRAINT "hpi_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "itl_lookup" ( | ||
"postcode" TEXT, | ||
"district" TEXT, | ||
"areacode" TEXT, | ||
"itl3" TEXT, | ||
"id" SERIAL NOT NULL, | ||
|
||
CONSTRAINT "itl_lookup_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "pricespaid" ( | ||
"id" SERIAL NOT NULL, | ||
"transactionidentifier" VARCHAR(250), | ||
"price" DOUBLE PRECISION, | ||
"postcode" VARCHAR(250), | ||
"propertytype" VARCHAR(250), | ||
"newbuild" VARCHAR(250), | ||
|
||
CONSTRAINT "pricespaid_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "rent" ( | ||
"id" SERIAL NOT NULL, | ||
"itl3" VARCHAR(250), | ||
"ladcode" VARCHAR(250), | ||
"region" VARCHAR(250), | ||
"monthlymeanrent" DOUBLE PRECISION, | ||
|
||
CONSTRAINT "rent_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "soc_rent_adjustments" ( | ||
"year" VARCHAR(10), | ||
"inflation" DOUBLE PRECISION, | ||
"additional" DOUBLE PRECISION, | ||
"total" DOUBLE PRECISION, | ||
"id" SERIAL NOT NULL, | ||
|
||
CONSTRAINT "soc_rent_adjustments_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "socialrent" ( | ||
"id" SERIAL NOT NULL, | ||
"county" VARCHAR(250), | ||
"itl3" VARCHAR(250), | ||
"earningsperweek" DOUBLE PRECISION, | ||
|
||
CONSTRAINT "socialrent_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "gas_bills" ( | ||
"id" INTEGER NOT NULL, | ||
"Region" VARCHAR NOT NULL, | ||
"itl" VARCHAR NOT NULL, | ||
"bill" DOUBLE PRECISION NOT NULL, | ||
|
||
CONSTRAINT "gas_bills_pkey" PRIMARY KEY ("id") | ||
); | ||
|
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,3 @@ | ||
# Please do not edit this file manually | ||
# It should be added in your version-control system (i.e. Git) | ||
provider = "postgresql" |