mirror of
				https://github.com/immich-app/immich.git
				synced 2025-11-04 03:27:09 -05:00 
			
		
		
		
	
		
			
				
	
	
		
			40 lines
		
	
	
		
			861 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			40 lines
		
	
	
		
			861 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
import { Column, DatabaseSchema, Table } from 'src/sql-tools';
 | 
						|
 | 
						|
@Table()
 | 
						|
export class Table1 {
 | 
						|
  @Column({ type: 'character varying', default: () => 'now()' })
 | 
						|
  column1!: string;
 | 
						|
}
 | 
						|
 | 
						|
export const description = 'should register a table with a column with a default function';
 | 
						|
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,
 | 
						|
          default: 'now()',
 | 
						|
        },
 | 
						|
      ],
 | 
						|
      indexes: [],
 | 
						|
      triggers: [],
 | 
						|
      constraints: [],
 | 
						|
      synchronize: true,
 | 
						|
    },
 | 
						|
  ],
 | 
						|
  warnings: [],
 | 
						|
};
 |