mirror of
https://github.com/spacebarchat/server.git
synced 2026-07-10 14:21:47 +00:00
Fix some missed column types
This commit is contained in:
@@ -35,10 +35,10 @@ export class ApplicationCommand extends BaseClass {
|
||||
@Column({ default: ApplicationCommandType.CHAT_INPUT })
|
||||
type?: ApplicationCommandType;
|
||||
|
||||
@Column()
|
||||
@Column({ type: "int8" })
|
||||
application_id: Snowflake;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@Column({ type: "int8", nullable: true })
|
||||
guild_id?: Snowflake;
|
||||
|
||||
@Column()
|
||||
@@ -80,8 +80,8 @@ export class ApplicationCommand extends BaseClass {
|
||||
@Column({ nullable: true, type: "jsonb" })
|
||||
contexts?: InteractionContextType[];
|
||||
|
||||
@Column({ default: 0 })
|
||||
version: Snowflake;
|
||||
@Column({ type: "int8", default: "0::bigint" })
|
||||
version: Snowflake; // Is this really a snowflake though? "An autoincrementing version identifier updated during substantial record changes"
|
||||
|
||||
@Column({ default: 0 })
|
||||
handler?: ApplicationCommandHandlerType;
|
||||
|
||||
@@ -39,7 +39,7 @@ import { BaseClassWithoutId } from "./BaseClass";
|
||||
export class Categories extends BaseClassWithoutId {
|
||||
// Not using snowflake
|
||||
|
||||
@PrimaryColumn()
|
||||
@PrimaryColumn({ type: "int4" })
|
||||
id: number;
|
||||
|
||||
@Column({ nullable: true })
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||
|
||||
export class MoreInt8Fixes17829253071887 implements MigrationInterface {
|
||||
name = "MoreInt8Fixes1782925307187";
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`ALTER TABLE application_commands ALTER COLUMN guild_id TYPE int8 USING guild_id::int8`);
|
||||
await queryRunner.query(`ALTER TABLE application_commands ALTER COLUMN name_localizations TYPE jsonb USING name_localizations::jsonb`);
|
||||
// oops, this one wasnt supposed to be an int8
|
||||
await queryRunner.query(`ALTER TABLE badges ALTER COLUMN id TYPE character varying USING id::character varying`);
|
||||
await queryRunner.query(`ALTER TABLE categories ALTER COLUMN id TYPE int4 USING id::int4`);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`ALTER TABLE application_commands ALTER COLUMN guild_id TYPE character varying USING guild_id::character varying`);
|
||||
await queryRunner.query(`ALTER TABLE application_commands ALTER COLUMN name_localizations TYPE character varying USING name_localizations::character varying`);
|
||||
await queryRunner.query(`ALTER TABLE badges ALTER COLUMN id TYPE int8 USING id::int8`);
|
||||
await queryRunner.query(`ALTER TABLE categories ALTER COLUMN id TYPE int8 USING id::int8`);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user