mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
removed after master merge
This commit is contained in:
parent
25701218e9
commit
5d2fa57c99
@ -1,42 +0,0 @@
|
|||||||
import {
|
|
||||||
BaseEntity,
|
|
||||||
Entity,
|
|
||||||
PrimaryGeneratedColumn,
|
|
||||||
Column,
|
|
||||||
CreateDateColumn,
|
|
||||||
UpdateDateColumn,
|
|
||||||
} from 'typeorm'
|
|
||||||
|
|
||||||
@Entity('communities')
|
|
||||||
export class Community extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ name: 'public_key', type: 'binary', length: 64, default: null, nullable: true })
|
|
||||||
publicKey: Buffer
|
|
||||||
|
|
||||||
@Column({ name: 'api_version', length: 10, nullable: false })
|
|
||||||
apiVersion: string
|
|
||||||
|
|
||||||
@Column({ name: 'end_point', length: 255, nullable: false })
|
|
||||||
endPoint: string
|
|
||||||
|
|
||||||
@Column({ name: 'last_announced_at', type: 'datetime', nullable: false })
|
|
||||||
lastAnnouncedAt: Date
|
|
||||||
|
|
||||||
@CreateDateColumn({
|
|
||||||
name: 'created_at',
|
|
||||||
type: 'datetime',
|
|
||||||
default: () => 'CURRENT_TIMESTAMP(3)',
|
|
||||||
nullable: false,
|
|
||||||
})
|
|
||||||
createdAt: Date
|
|
||||||
|
|
||||||
@UpdateDateColumn({
|
|
||||||
name: 'updated_at',
|
|
||||||
type: 'datetime',
|
|
||||||
onUpdate: 'CURRENT_TIMESTAMP(3)',
|
|
||||||
nullable: true,
|
|
||||||
})
|
|
||||||
updatedAt: Date | null
|
|
||||||
}
|
|
||||||
@ -1,28 +0,0 @@
|
|||||||
/* MIGRATION TO CREATE THE FEDERATION COMMUNITY TABLES
|
|
||||||
*
|
|
||||||
* This migration creates the `community` and 'communityfederation' tables in the `apollo` database (`gradido_community`).
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
|
||||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
||||||
|
|
||||||
export async function upgrade(queryFn: (query: string, values?: any[]) => Promise<Array<any>>) {
|
|
||||||
await queryFn(`
|
|
||||||
CREATE TABLE communities (
|
|
||||||
id int unsigned NOT NULL AUTO_INCREMENT,
|
|
||||||
public_key binary(64),
|
|
||||||
api_version varchar(10) NOT NULL,
|
|
||||||
end_point varchar(255) NOT NULL,
|
|
||||||
last_announced_at datetime(3) NOT NULL,
|
|
||||||
created_at datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
|
|
||||||
updated_at datetime(3),
|
|
||||||
PRIMARY KEY (id),
|
|
||||||
UNIQUE KEY public_api_key (public_key, api_version)
|
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
|
||||||
`)
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function downgrade(queryFn: (query: string, values?: any[]) => Promise<Array<any>>) {
|
|
||||||
// write downgrade logic as parameter of queryFn
|
|
||||||
await queryFn(`DROP TABLE communities;`)
|
|
||||||
}
|
|
||||||
Loading…
x
Reference in New Issue
Block a user