import {usersDBMigration} from './migration';
import {chatDBMigration} from './migration';
import {databaseConf} from './types';

const users: databaseConf = {
  filePath: 'users',
  version: 1,
  migration: () => {
    return usersDBMigration(users);
  },
  details: {
    name: 'users',
    properties: {
      UserId: 'string',
      AccountName: 'string',
      Username: 'string',
    },
    primaryKey: 'UserId',
  },
};

const chat: databaseConf = {
  filePath: 'chat',
  version: 1,
  migration: () => {
    return chatDBMigration(chat);
  },
  details: {
    name: 'chat',
    properties: {
      UserId: 'string',
      msg: 'string',
    },
    primaryKey: 'UserId',
  },
};

const DBSchemas = {users, chat};
export default DBSchemas;
