ログインできた
This commit is contained in:
parent
326384957c
commit
dfbc06f858
18 changed files with 853 additions and 167 deletions
16
migration/1596513280623-Init.ts
Normal file
16
migration/1596513280623-Init.ts
Normal file
|
@ -0,0 +1,16 @@
|
|||
import {MigrationInterface, QueryRunner} from 'typeorm';
|
||||
|
||||
export class Init1596513280623 implements MigrationInterface {
|
||||
name = 'Init1596513280623'
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query('CREATE TABLE "user" ("id" SERIAL NOT NULL, "username" character varying NOT NULL, "host" character varying NOT NULL, "token" character varying NOT NULL, "prevNotesCount" integer NOT NULL, "prevFollowingCount" integer NOT NULL, "prevFollowersCount" integer NOT NULL, CONSTRAINT "PK_cace4a159ff9f2512dd42373760" PRIMARY KEY ("id"))');
|
||||
await queryRunner.query('CREATE UNIQUE INDEX "IDX_6269eebacdb25de8569298a52a" ON "user" ("username", "host") ');
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query('DROP INDEX "IDX_6269eebacdb25de8569298a52a"');
|
||||
await queryRunner.query('DROP TABLE "user"');
|
||||
}
|
||||
|
||||
}
|
18
migration/1596514165166-Init2.ts
Normal file
18
migration/1596514165166-Init2.ts
Normal file
|
@ -0,0 +1,18 @@
|
|||
import {MigrationInterface, QueryRunner} from 'typeorm';
|
||||
|
||||
export class Init21596514165166 implements MigrationInterface {
|
||||
name = 'Init21596514165166'
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query('ALTER TABLE "user" ALTER COLUMN "prevNotesCount" SET DEFAULT 0');
|
||||
await queryRunner.query('ALTER TABLE "user" ALTER COLUMN "prevFollowingCount" SET DEFAULT 0');
|
||||
await queryRunner.query('ALTER TABLE "user" ALTER COLUMN "prevFollowersCount" SET DEFAULT 0');
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query('ALTER TABLE "user" ALTER COLUMN "prevFollowersCount" DROP DEFAULT');
|
||||
await queryRunner.query('ALTER TABLE "user" ALTER COLUMN "prevFollowingCount" DROP DEFAULT');
|
||||
await queryRunner.query('ALTER TABLE "user" ALTER COLUMN "prevNotesCount" DROP DEFAULT');
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue