-
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.
- Loading branch information
Showing
11 changed files
with
59 additions
and
74 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,22 @@ | ||
import { MigrationInterface, QueryRunner } from "typeorm"; | ||
|
||
export class InitialMigration1706470114726 implements MigrationInterface { | ||
name = 'InitialMigration1706470114726' | ||
|
||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(`CREATE TABLE "auth_sessions" ("id" character varying NOT NULL, "session" json NOT NULL, CONSTRAINT "PK_641507381f32580e8479efc36cd" PRIMARY KEY ("id"))`); | ||
await queryRunner.query(`CREATE TABLE "countries" ("id" character varying NOT NULL, "name" character varying NOT NULL, "iso" character varying NOT NULL, "languages" json NOT NULL DEFAULT '{"languages":[]}', CONSTRAINT "PK_b2d7006793e8697ab3ae2deff18" PRIMARY KEY ("id"))`); | ||
await queryRunner.query(`CREATE TABLE "term" ("id" character varying, "type" character varying, "languageId" character varying, "countryId" character varying, "userId" character varying, "created_at" TIMESTAMP DEFAULT now(), "updated_at" TIMESTAMP DEFAULT now(), "terms" json DEFAULT '{"terms":[]}', CONSTRAINT "PK_55b0479f0743f2e5d5ec414821e" PRIMARY KEY ("id"))`); | ||
await queryRunner.query(`CREATE INDEX "IDX_19a144ebe2c3c451ea16ff1685" ON "term" ("type") `); | ||
await queryRunner.query(`CREATE TABLE "users" ("id" character varying NOT NULL, "name" character varying NOT NULL, "provider" character varying NOT NULL, "email" character varying NOT NULL, "photo" character varying NOT NULL, "interests" text NOT NULL, CONSTRAINT "PK_a3ffb1c0c8416b9fc6f907b7433" PRIMARY KEY ("id"))`); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(`DROP TABLE "users"`); | ||
await queryRunner.query(`DROP INDEX "public"."IDX_19a144ebe2c3c451ea16ff1685"`); | ||
await queryRunner.query(`DROP TABLE "term"`); | ||
await queryRunner.query(`DROP TABLE "countries"`); | ||
await queryRunner.query(`DROP TABLE "auth_sessions"`); | ||
} | ||
|
||
} |
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 |
---|---|---|
@@ -1,27 +0,0 @@ | ||
import { MigrationInterface, QueryRunner } from 'typeorm'; | ||
|
||
export class CreateInitialTables1685896868634 implements MigrationInterface { | ||
name = 'CreateInitialTables1685896868634'; | ||
|
||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query( | ||
`CREATE TABLE "countries" ("id" character varying NOT NULL, "name" character varying NOT NULL, "iso" character varying NOT NULL, "languages" json NOT NULL DEFAULT '{"languages":[]}', CONSTRAINT "PK_b2d7006793e8697ab3ae2deff18" PRIMARY KEY ("id"))` | ||
); | ||
await queryRunner.query( | ||
`CREATE TABLE "expressions" ("id" character varying NOT NULL, "languageId" character varying NOT NULL, "countryId" character varying NOT NULL, "terms" json NOT NULL DEFAULT '{"terms":[]}', "userId" character varying NOT NULL, CONSTRAINT "PK_e75aa87c24b37cd86f6c8a668c9" PRIMARY KEY ("id"))` | ||
); | ||
await queryRunner.query( | ||
`CREATE TABLE "users" ("id" character varying NOT NULL, "name" character varying NOT NULL, "provider" character varying NOT NULL, "email" character varying NOT NULL, "photo" character varying NOT NULL, CONSTRAINT "PK_a3ffb1c0c8416b9fc6f907b7433" PRIMARY KEY ("id"))` | ||
); | ||
await queryRunner.query( | ||
`CREATE TABLE "words" ("id" character varying NOT NULL, "languageId" character varying NOT NULL, "countryId" character varying NOT NULL, "terms" json NOT NULL DEFAULT '{"terms":[]}', "userId" character varying NOT NULL, CONSTRAINT "PK_feaf97accb69a7f355fa6f58a3d" PRIMARY KEY ("id"))` | ||
); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(`DROP TABLE "words"`); | ||
await queryRunner.query(`DROP TABLE "users"`); | ||
await queryRunner.query(`DROP TABLE "expressions"`); | ||
await queryRunner.query(`DROP TABLE "countries"`); | ||
} | ||
} | ||
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 |
---|---|---|
@@ -1,15 +0,0 @@ | ||
import { MigrationInterface, QueryRunner } from 'typeorm'; | ||
|
||
export class AddAuthSessionTable1689433983736 implements MigrationInterface { | ||
name = 'AddAuthSessionTable1689433983736'; | ||
|
||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query( | ||
`CREATE TABLE "auth_sessions" ("id" character varying NOT NULL, "session" json NOT NULL, CONSTRAINT "PK_641507381f32580e8479efc36cd" PRIMARY KEY ("id"))` | ||
); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(`DROP TABLE "auth_sessions"`); | ||
} | ||
} | ||
15 changes: 0 additions & 15 deletions
15
migrations/1703275398290-addInterestsFieldToUser.ts
100755 → 100644
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 |
---|---|---|
@@ -1,15 +0,0 @@ | ||
import { MigrationInterface, QueryRunner } from 'typeorm'; | ||
|
||
export class AddInterestsFieldToUser1703275398290 implements MigrationInterface { | ||
name = 'AddInterestsFieldToUser1703275398290'; | ||
|
||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(`ALTER TABLE "users" ADD "interests" text NULL`); | ||
await queryRunner.query(`UPDATE "users" SET "interests" = ARRAY[]::varchar[]`); | ||
await queryRunner.query(`ALTER TABLE "users" ALTER COLUMN "interests" SET NOT NULL`); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(`ALTER TABLE "users" DROP COLUMN "interests"`); | ||
} | ||
} | ||
Empty file modified
0
migrations/1705170635561-addDatesColumnsToExpressionAndWord.ts
100755 → 100644
Empty file.
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
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
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