mirror of
https://github.com/immich-app/immich.git
synced 2026-06-06 06:05:21 -04:00
e7a5b96ed0
feat: sql-tools extension, triggers, functions, comments, parameters
21 lines
453 B
TypeScript
21 lines
453 B
TypeScript
import { register } from 'src/sql-tools/from-code/register';
|
|
import { DatabaseEnum } from 'src/sql-tools/types';
|
|
|
|
export type EnumOptions = {
|
|
name: string;
|
|
values: string[];
|
|
synchronize?: boolean;
|
|
};
|
|
|
|
export const registerEnum = (options: EnumOptions) => {
|
|
const item: DatabaseEnum = {
|
|
name: options.name,
|
|
values: options.values,
|
|
synchronize: options.synchronize ?? true,
|
|
};
|
|
|
|
register({ type: 'enum', item });
|
|
|
|
return item;
|
|
};
|