import { Entity, Column } from 'typeorm';
import { BaseEntity } from '@cool-midway/core';

@Entity('config_data_source')
export class DataSourceEntity extends BaseEntity {
  @Column({ comment: '数据源名' })
  name: string;

  @Column({ comment: 'IP地址', length: 20, nullable: true })
  host: string;

  @Column({ comment: '端口', length: 5, nullable: true })
  port: string;

  @Column({ comment: '用户名', nullable: true })
  user: string;

  @Column({ comment: '密码', nullable: true })
  password: string;

  @Column({ comment: '数据库(实例)名(地址)' })
  database: string;

  @Column({
    comment: '数据库类型 0：oracle 1：pgsql 2：mysql 3：sqlite',
    default: 0,
  })
  type: number;

  @Column({ comment: '备注', nullable: true })
  remark: string;
}
