import {usersDBMigration} from './migration';

type databaseNames = 'users' | 'chat';

interface databaseConf {
  filePath: string;
  version: number;
  migration?: any;
  details: {
    name: databaseNames;
    properties: any;
    primaryKey: string;
  };
}

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

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

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