mirror of
https://github.com/immich-app/immich.git
synced 2025-05-24 01:12:58 -04:00
41 lines
911 B
TypeScript
41 lines
911 B
TypeScript
import { Column, DatabaseConstraintType, DatabaseSchema, Table } from 'src/sql-tools';
|
|
|
|
@Table()
|
|
export class Table1 {
|
|
@Column({ type: 'uuid', unique: true })
|
|
id!: string;
|
|
}
|
|
|
|
export const description = 'should create a unique key constraint with a default 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: [],
|
|
constraints: [
|
|
{
|
|
type: DatabaseConstraintType.UNIQUE,
|
|
name: 'UQ_b249cc64cf63b8a22557cdc8537',
|
|
tableName: 'table1',
|
|
columnNames: ['id'],
|
|
synchronize: true,
|
|
},
|
|
],
|
|
synchronize: true,
|
|
},
|
|
],
|
|
warnings: [],
|
|
};
|