mirror of
https://github.com/immich-app/immich.git
synced 2025-12-19 09:13:14 +03:00
feat: schema diff sql tools (#17116)
This commit is contained in:
39
server/test/sql-tools/column-enum-name.stub.ts
Normal file
39
server/test/sql-tools/column-enum-name.stub.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
import { Column, DatabaseSchema, Table } from 'src/sql-tools';
|
||||
|
||||
enum Test {
|
||||
Foo = 'foo',
|
||||
Bar = 'bar',
|
||||
}
|
||||
|
||||
@Table()
|
||||
export class Table1 {
|
||||
@Column({ enum: Test })
|
||||
column1!: string;
|
||||
}
|
||||
|
||||
export const description = 'should use a default enum naming convention';
|
||||
export const schema: DatabaseSchema = {
|
||||
name: 'public',
|
||||
tables: [
|
||||
{
|
||||
name: 'table1',
|
||||
columns: [
|
||||
{
|
||||
name: 'column1',
|
||||
tableName: 'table1',
|
||||
type: 'enum',
|
||||
enumName: 'table1_column1_enum',
|
||||
enumValues: ['foo', 'bar'],
|
||||
nullable: false,
|
||||
isArray: false,
|
||||
primary: false,
|
||||
synchronize: true,
|
||||
},
|
||||
],
|
||||
indexes: [],
|
||||
constraints: [],
|
||||
synchronize: true,
|
||||
},
|
||||
],
|
||||
warnings: [],
|
||||
};
|
||||
Reference in New Issue
Block a user