mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
feat: add foreign key indexes (#17672)
This commit is contained in:
parent
81ed54aa61
commit
e275f2d8b3
49 changed files with 382 additions and 285 deletions
46
server/test/sql-tools/column-index-name.ts
Normal file
46
server/test/sql-tools/column-index-name.ts
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
import { Column, DatabaseSchema, Table } from 'src/sql-tools';
|
||||
|
||||
@Table()
|
||||
export class Table1 {
|
||||
@Column({ indexName: 'IDX_test' })
|
||||
column1!: string;
|
||||
}
|
||||
|
||||
export const description = 'should create a column with an index if a name is provided';
|
||||
export const schema: DatabaseSchema = {
|
||||
name: 'postgres',
|
||||
schemaName: 'public',
|
||||
functions: [],
|
||||
enums: [],
|
||||
extensions: [],
|
||||
parameters: [],
|
||||
tables: [
|
||||
{
|
||||
name: 'table1',
|
||||
columns: [
|
||||
{
|
||||
name: 'column1',
|
||||
tableName: 'table1',
|
||||
type: 'character varying',
|
||||
nullable: false,
|
||||
isArray: false,
|
||||
primary: false,
|
||||
synchronize: true,
|
||||
},
|
||||
],
|
||||
indexes: [
|
||||
{
|
||||
name: 'IDX_test',
|
||||
columnNames: ['column1'],
|
||||
tableName: 'table1',
|
||||
unique: false,
|
||||
synchronize: true,
|
||||
},
|
||||
],
|
||||
triggers: [],
|
||||
constraints: [],
|
||||
synchronize: true,
|
||||
},
|
||||
],
|
||||
warnings: [],
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue