mirror of
https://github.com/immich-app/immich.git
synced 2025-05-24 01:12:58 -04:00
42 lines
868 B
TypeScript
42 lines
868 B
TypeScript
import { Column, DatabaseSchema, Index, Table } from 'src/sql-tools';
|
|
|
|
@Table()
|
|
@Index({ name: 'IDX_test', columns: ['id'] })
|
|
export class Table1 {
|
|
@Column({ type: 'uuid' })
|
|
id!: string;
|
|
}
|
|
|
|
export const description = 'should create an index with a specific name';
|
|
export const schema: DatabaseSchema = {
|
|
name: 'public',
|
|
tables: [
|
|
{
|
|
name: 'table1',
|
|
columns: [
|
|
{
|
|
name: 'id',
|
|
tableName: 'table1',
|
|
type: 'uuid',
|
|
nullable: false,
|
|
isArray: false,
|
|
primary: false,
|
|
synchronize: true,
|
|
},
|
|
],
|
|
indexes: [
|
|
{
|
|
name: 'IDX_test',
|
|
tableName: 'table1',
|
|
unique: false,
|
|
columnNames: ['id'],
|
|
synchronize: true,
|
|
},
|
|
],
|
|
constraints: [],
|
|
synchronize: true,
|
|
},
|
|
],
|
|
warnings: [],
|
|
};
|