forked from PluralFlux/PluralFlux
Compare commits
17 Commits
webhook-re
...
add-system
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ee4dca2ae3 | ||
|
|
ff4dba3dfd | ||
|
|
96c2abc06a | ||
| b602e654ec | |||
| 732ad36bba | |||
| 8446559bfb | |||
| 14ef1581c1 | |||
| 10eab6de74 | |||
| d8682c2a1b | |||
| 20e8564c15 | |||
| 78cda7d3c4 | |||
| 21587dcb7a | |||
| aeb7d88ee9 | |||
| 8fe53563d0 | |||
| d14e89e8b2 | |||
| 39a7115803 | |||
|
|
72b70f5175 |
@@ -8,7 +8,7 @@ on:
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
jobs:
|
||||
|
||||
build:
|
||||
|
||||
|
||||
47
database/entity/System.ts
Normal file
47
database/entity/System.ts
Normal file
@@ -0,0 +1,47 @@
|
||||
import {Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, Unique} from "typeorm"
|
||||
|
||||
@Entity({name: "System", synchronize: true})
|
||||
@Unique("UQ_System_userid", ['userid'])
|
||||
@Unique("UQ_System_shortid", ['shortid'])
|
||||
export class System {
|
||||
|
||||
@PrimaryGeneratedColumn()
|
||||
id: number
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
})
|
||||
shortid: string
|
||||
|
||||
@Column()
|
||||
userid: string
|
||||
|
||||
@Column({
|
||||
length: 100,
|
||||
nullable: true
|
||||
})
|
||||
name: string
|
||||
|
||||
@Column({
|
||||
type: "varchar",
|
||||
nullable: true,
|
||||
length: 100
|
||||
})
|
||||
fronter: string
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
})
|
||||
grouptag: string
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
})
|
||||
autoproxy: string
|
||||
|
||||
@CreateDateColumn({ type: 'timestamptz' })
|
||||
createdAt: Date
|
||||
|
||||
@UpdateDateColumn({ type: 'timestamptz' })
|
||||
updatedAt: Date
|
||||
}
|
||||
14
database/migrations/1773670748825-update.ts
Normal file
14
database/migrations/1773670748825-update.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||
|
||||
export class Update1773670748825 implements MigrationInterface {
|
||||
name = 'Update1773670748825'
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`CREATE TABLE "System" ("id" SERIAL NOT NULL, "shortid" character varying, "userid" character varying NOT NULL, "name" character varying(100), "fronter" character varying(100), "grouptag" character varying, "autoproxy" character varying, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), CONSTRAINT "UQ_System_shortid" UNIQUE ("shortid"), CONSTRAINT "UQ_System_userid" UNIQUE ("userid"), CONSTRAINT "PK_b8e3f6855de5a4758fcb59e5567" PRIMARY KEY ("id"))`);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`DROP TABLE "System"`);
|
||||
}
|
||||
|
||||
}
|
||||
13
database/migrations/1773749921832-update.ts
Normal file
13
database/migrations/1773749921832-update.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||
|
||||
export class Update1773749921832 implements MigrationInterface {
|
||||
name = 'Update1773749921832'
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`INSERT INTO "System" ("userid") SELECT DISTINCT "userid" FROM "Member";`);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`DELETE from "System" USING "Member" WHERE "System".userid = "Member".userid;`);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user