mirror of
				https://github.com/immich-app/immich.git
				synced 2025-10-28 09:12:39 -04:00 
			
		
		
		
	
		
			
				
	
	
		
			40 lines
		
	
	
		
			832 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			40 lines
		
	
	
		
			832 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| import { CreateDateColumn, DatabaseSchema, Table } from 'src/sql-tools';
 | |
| 
 | |
| @Table()
 | |
| export class Table1 {
 | |
|   @CreateDateColumn()
 | |
|   createdAt!: string;
 | |
| }
 | |
| 
 | |
| export const description = 'should register a table with an created at date column';
 | |
| export const schema: DatabaseSchema = {
 | |
|   name: 'postgres',
 | |
|   schemaName: 'public',
 | |
|   functions: [],
 | |
|   enums: [],
 | |
|   extensions: [],
 | |
|   parameters: [],
 | |
|   tables: [
 | |
|     {
 | |
|       name: 'table1',
 | |
|       columns: [
 | |
|         {
 | |
|           name: 'createdAt',
 | |
|           tableName: 'table1',
 | |
|           type: 'timestamp with time zone',
 | |
|           default: 'now()',
 | |
|           nullable: false,
 | |
|           isArray: false,
 | |
|           primary: false,
 | |
|           synchronize: true,
 | |
|         },
 | |
|       ],
 | |
|       indexes: [],
 | |
|       triggers: [],
 | |
|       constraints: [],
 | |
|       synchronize: true,
 | |
|     },
 | |
|   ],
 | |
|   warnings: [],
 | |
| };
 |