1
0
mirror of https://github.com/immich-app/immich.git synced 2025-07-04 05:50:38 +02:00
Files
immich/server/test/sql-tools/column-default-date.stub.ts

42 lines
913 B
TypeScript
Raw Normal View History

2025-03-28 10:40:09 -04:00
import { Column, DatabaseSchema, Table } from 'src/sql-tools';
const date = new Date(2023, 0, 1);
@Table()
export class Table1 {
@Column({ type: 'character varying', default: date })
column1!: string;
}
export const description = 'should register a table with a column with a default value (date)';
export const schema: DatabaseSchema = {
name: 'postgres',
schemaName: 'public',
functions: [],
enums: [],
extensions: [],
parameters: [],
2025-03-28 10:40:09 -04:00
tables: [
{
name: 'table1',
columns: [
{
name: 'column1',
tableName: 'table1',
type: 'character varying',
nullable: false,
isArray: false,
primary: false,
synchronize: true,
default: "'2023-01-01T00:00:00.000Z'",
},
],
indexes: [],
triggers: [],
2025-03-28 10:40:09 -04:00
constraints: [],
synchronize: true,
},
],
warnings: [],
};