forked from Giveth/impact-graph
-
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.
Replaced manual migrations with automatic one
- Loading branch information
1 parent
4aa771c
commit 38fc395
Showing
5 changed files
with
102 additions
and
115 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,55 @@ | ||
version: '3.3' | ||
|
||
services: | ||
impact-graph-postgres: | ||
# Use this postgres image https://github.com/Giveth/postgres-givethio | ||
image: ghcr.io/giveth/postgres-givethio:latest | ||
restart: always | ||
environment: | ||
- POSTGRES_DB=givethio | ||
- POSTGRES_USER=postgres | ||
- POSTGRES_PASSWORD=postgres | ||
- PGDATA=/var/lib/postgresql/data/pgdata | ||
ports: | ||
- "5442:5432" | ||
volumes: | ||
- db-data:/var/lib/postgresql/data | ||
|
||
impact-graph-postgres-test: | ||
# CAUTION: Running tests will delete all records of this db, so just use this container for test | ||
# For running application use above container port: 5442 | ||
|
||
# Use this postgres image https://github.com/Giveth/postgres-givethio | ||
image: ghcr.io/giveth/postgres-givethio:latest | ||
restart: always | ||
environment: | ||
- POSTGRES_DB=givethio | ||
- POSTGRES_USER=postgres | ||
- POSTGRES_PASSWORD=postgres | ||
- PGDATA=/var/lib/postgresql/data/pgdata | ||
ports: | ||
- "5443:5432" | ||
volumes: | ||
- db-data-test:/var/lib/postgresql/data | ||
|
||
redis-giveth: | ||
# it's better to not using the latest tag, maybe latest tag have some breaking changes | ||
image: redis:7.2.0-alpine3.18 | ||
container_name: redis-giveth | ||
environment: | ||
- REDIS_ALLOW_EMPTY_PASSWORD=yes | ||
restart: always | ||
ports: | ||
- "6379:6379" | ||
volumes: | ||
- redis-data:/data | ||
|
||
volumes: | ||
db-data: | ||
db-data-test: | ||
redis-data: | ||
|
||
networks: | ||
giveth: | ||
external: true | ||
|
52 changes: 0 additions & 52 deletions
52
migration/1724112704036-AddEmailConfirmationFieldsToUserTable.ts
This file was deleted.
Oops, something went wrong.
63 changes: 0 additions & 63 deletions
63
migration/1724112826669-CreateUserEmailVerificationTable.ts
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { MigrationInterface, QueryRunner } from 'typeorm'; | ||
|
||
export class EmailVerification1724143752405 implements MigrationInterface { | ||
name = 'EmailVerification1724143752405'; | ||
|
||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query( | ||
`CREATE TABLE "user_email_verification" ("id" SERIAL NOT NULL, "userId" integer NOT NULL, "emailVerificationCode" text, "emailVerificationCodeExpiredAt" TIMESTAMP WITH TIME ZONE, CONSTRAINT "PK_8ad3e54beb79f46d33950e9d487" PRIMARY KEY ("id"))`, | ||
); | ||
await queryRunner.query( | ||
`ALTER TABLE "user" ADD "emailConfirmed" boolean NOT NULL DEFAULT false`, | ||
); | ||
await queryRunner.query( | ||
`ALTER TABLE "user" ADD "emailConfirmationSent" boolean NOT NULL DEFAULT false`, | ||
); | ||
await queryRunner.query( | ||
`ALTER TABLE "user" ADD "emailConfirmationSentAt" TIMESTAMP WITH TIME ZONE`, | ||
); | ||
await queryRunner.query( | ||
`ALTER TABLE "user" ADD "emailConfirmedAt" TIMESTAMP WITH TIME ZONE`, | ||
); | ||
await queryRunner.query( | ||
`ALTER TABLE "project" ADD "teaser" character varying`, | ||
); | ||
await queryRunner.query(`ALTER TABLE "project" ADD "teamMembers" jsonb`); | ||
await queryRunner.query(`ALTER TABLE "project" ADD "abc" jsonb`); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(`ALTER TABLE "project" DROP COLUMN "abc"`); | ||
await queryRunner.query(`ALTER TABLE "project" DROP COLUMN "teamMembers"`); | ||
await queryRunner.query(`ALTER TABLE "project" DROP COLUMN "teaser"`); | ||
await queryRunner.query( | ||
`ALTER TABLE "user" DROP COLUMN "emailConfirmedAt"`, | ||
); | ||
await queryRunner.query( | ||
`ALTER TABLE "user" DROP COLUMN "emailConfirmationSentAt"`, | ||
); | ||
await queryRunner.query( | ||
`ALTER TABLE "user" DROP COLUMN "emailConfirmationSent"`, | ||
); | ||
await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "emailConfirmed"`); | ||
await queryRunner.query(`DROP TABLE "user_email_verification"`); | ||
} | ||
} |
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