forked from PluralFlux/PluralFlux
Compare commits
5 Commits
b602e654ec
...
add-system
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ee4dca2ae3 | ||
|
|
ff4dba3dfd | ||
|
|
96c2abc06a | ||
| c2a88804ad | |||
| 2b31cc2ae9 |
@@ -6,7 +6,9 @@ on:
|
||||
pull_request:
|
||||
branches: ["main"]
|
||||
|
||||
jobs:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
|
||||
build:
|
||||
|
||||
|
||||
@@ -7,8 +7,6 @@ PluralFlux is a proxybot akin to PluralKit and Tupperbox, but for [Fluxer](https
|
||||
|
||||
[Sponsor the project](https://github.com/sponsors/pieartsy)
|
||||
|
||||
If it's not running at the moment, it's because my computer crashed or something. I'm looking to move running it to a somewhat more permanent solution.
|
||||
|
||||
## Commands
|
||||
All commands are prefixed by `pf;`. Currently only a few are implemented.
|
||||
|
||||
|
||||
@@ -22,4 +22,5 @@ services:
|
||||
volumes:
|
||||
- pgadmindata:/var/lib/pgadmin
|
||||
volumes:
|
||||
pgdata:
|
||||
pgdata:
|
||||
pgadmindata:
|
||||
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