import { DataSource } from 'typeorm';
import { User } from './user/user.entity';
// import { UserSetting } from './user-setting/user-setting.entity';
import { ModelConfig } from './model-config/model-config.entity';
import { KnowledgeBase } from './knowledge-base/knowledge-base.entity';
import { KnowledgeGroup } from './knowledge-group/knowledge-group.entity';
import { SearchHistory } from './search-history/search-history.entity';
import { ChatMessage } from './search-history/chat-message.entity';
import { Note } from './note/note.entity';
import { PodcastEpisode } from './podcasts/entities/podcast-episode.entity';
import { ImportTask } from './import-task/import-task.entity';
import { Tenant } from './tenant/tenant.entity';
import { TenantSetting } from './tenant/tenant-setting.entity';

export const AppDataSource = new DataSource({
    type: 'better-sqlite3',
    database: './data/knowledge-base.db',
    synchronize: false,
    logging: true,
    entities: [
        User,
        // UserSetting,
        ModelConfig,
        KnowledgeBase,
        KnowledgeGroup,
        SearchHistory,
        ChatMessage,
        Note,
        PodcastEpisode,
        ImportTask,
        Tenant,
        TenantSetting,
    ],
    migrations: ['src/migrations/**/*.ts'],
});
