Files
mattermost-mobile/app/database/schema/default/index.ts
Avinash Lingaloo 78b76352c8 MM-30482 [Gekidou] Data Operator (#5346)
* MM_30482: Imported database and types /database folder

* MM_30482: Imported database and types /database folder

* MM_30482 : All tests are passing

* MM_30482 : Updating patch package for watermelon db

* MM_30482 : Fixing CI issue

* MM_30482 : Updating TS  complaint

* Update index.ts

* MM_30482 : Code clean up

Co-authored-by: Avinash Lingaloo <>
2021-04-22 19:16:00 +04:00

39 lines
1.2 KiB
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {AppSchema, appSchema, tableSchema} from '@nozbe/watermelondb';
import {MM_TABLES} from '@constants/database';
const {APP, GLOBAL, SERVERS} = MM_TABLES.DEFAULT;
export const defaultSchema: AppSchema = appSchema({
version: 1,
tables: [
tableSchema({
name: APP,
columns: [
{name: 'build_number', type: 'string'},
{name: 'created_at', type: 'number'},
{name: 'version_number', type: 'string'},
],
}),
tableSchema({
name: GLOBAL,
columns: [
{name: 'name', type: 'string', isIndexed: true},
{name: 'value', type: 'string'},
],
}),
tableSchema({
name: SERVERS,
columns: [
{name: 'db_path', type: 'string'},
{name: 'display_name', type: 'string'},
{name: 'mention_count', type: 'number'},
{name: 'unread_count', type: 'number'},
{name: 'url', type: 'string', isIndexed: true},
],
}),
],
});