correct publicKey length and table name of entity

This commit is contained in:
Claus-Peter Hübner 2022-11-29 00:15:36 +01:00
parent c3971222f0
commit 3a17a3491b
2 changed files with 3 additions and 3 deletions

View File

@ -1,11 +1,11 @@
import { BaseEntity, Entity, PrimaryGeneratedColumn, Column } from 'typeorm'
@Entity('community')
@Entity('communities')
export class Community extends BaseEntity {
@PrimaryGeneratedColumn('increment', { unsigned: true })
id: number
@Column({ name: 'public_key', type: 'binary', length: 32, default: null, nullable: true })
@Column({ name: 'public_key', type: 'binary', length: 64, default: null, nullable: true })
publicKey: Buffer
@Column({ name: 'api_version', length: 10, nullable: false })

View File

@ -10,7 +10,7 @@ export async function upgrade(queryFn: (query: string, values?: any[]) => Promis
await queryFn(`
CREATE TABLE IF NOT EXISTS communities (
id int unsigned NOT NULL AUTO_INCREMENT,
public_key binary(32),
public_key binary(64),
api_version varchar(10) NOT NULL,
endpoint varchar(255) NOT NULL,
last_announced_at datetime(3) NOT NULL,