Skip to content

Commit

Permalink
migration name fix
Browse files Browse the repository at this point in the history
  • Loading branch information
maxwn04 committed Oct 11, 2023
1 parent 7eac2db commit e86e942
Showing 1 changed file with 41 additions and 41 deletions.
82 changes: 41 additions & 41 deletions migrations/0037-add-collection-image-table.ts
Original file line number Diff line number Diff line change
@@ -1,50 +1,50 @@
import { MigrationInterface, QueryRunner, Table, TableColumn, TableIndex } from 'typeorm';
import { MigrationInterface, QueryRunner, Table, TableIndex } from 'typeorm';

const TABLE_NAME = 'MerchCollectionPhotos';

export class addCollectionImageTable implements MigrationInterface {
export class addCollectionImageTable1696990832868 implements MigrationInterface {

public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.createTable(new Table({
name: TABLE_NAME,
columns: [
{
name: 'uuid',
type: 'uuid',
isGenerated: true,
isPrimary: true,
generationStrategy: 'uuid',
},
{
name: 'merchCollection',
type: 'uuid',
},
{
name: 'uploadedPhoto',
type: 'varchar(255)',
},
{
name: 'uploadedAt',
type: 'timestamptz',
default: 'CURRENT_TIMESTAMP(6)',
},
{
name: 'position',
type: 'integer',
},
],
}));
await queryRunner.createTable(new Table({
name: TABLE_NAME,
columns: [
{
name: 'uuid',
type: 'uuid',
isGenerated: true,
isPrimary: true,
generationStrategy: 'uuid',
},
{
name: 'merchCollection',
type: 'uuid',
},
{
name: 'uploadedPhoto',
type: 'varchar(255)',
},
{
name: 'uploadedAt',
type: 'timestamptz',
default: 'CURRENT_TIMESTAMP(6)',
},
{
name: 'position',
type: 'integer',
},
],
}));

await queryRunner.createIndices(TABLE_NAME, [
new TableIndex({
name: 'images_by_collection_index',
columnNames: ['merchCollection'],
}),
]);
}
await queryRunner.createIndices(TABLE_NAME, [
new TableIndex({
name: 'images_by_collection_index',
columnNames: ['merchCollection'],
}),
]);
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.dropTable(TABLE_NAME);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.dropTable(TABLE_NAME);
}

}

0 comments on commit e86e942

Please sign in to comment.