4e993316a6
* feat: wip conditional schema based on column map instead of column field * feat: conditionalSchema columnMap and singular plural * fix: remove uuid fix * feat: add name and label (singular/plural) drop old tableColumnName
41 lines
829 B
TypeScript
41 lines
829 B
TypeScript
import {
|
|
Column,
|
|
CreateDateColumn,
|
|
Entity,
|
|
PrimaryGeneratedColumn,
|
|
UpdateDateColumn,
|
|
DataSourceOptions,
|
|
} from 'typeorm';
|
|
|
|
type DataSourceType = DataSourceOptions['type'];
|
|
|
|
@Entity('data_source_metadata')
|
|
export class DataSourceMetadata {
|
|
@PrimaryGeneratedColumn('uuid')
|
|
id: string;
|
|
|
|
@Column({ nullable: true })
|
|
url: string;
|
|
|
|
@Column({ nullable: true })
|
|
schema: string;
|
|
|
|
@Column({ type: 'enum', enum: ['postgres'], default: 'postgres' })
|
|
type: DataSourceType;
|
|
|
|
@Column({ nullable: true, name: 'label' })
|
|
label: string;
|
|
|
|
@Column({ default: false, name: 'is_remote' })
|
|
isRemote: boolean;
|
|
|
|
@Column({ nullable: false, name: 'workspace_id' })
|
|
workspaceId: string;
|
|
|
|
@CreateDateColumn({ name: 'created_at' })
|
|
createdAt: Date;
|
|
|
|
@UpdateDateColumn({ name: 'updated_at' })
|
|
updatedAt: Date;
|
|
}
|