mattermost-mobile/app/database/schema/app/index.ts
Avinash Lingaloo b5c53d769f
Gekidou - Updated App Database Diagrams/Schema/Models (#6133)
* app database - schema md file

* exported docs

* proper refactor of file name
2022-04-07 09:56:40 -04:00

38 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 {INFO, GLOBAL, SERVERS} = MM_TABLES.APP;
export const schema: AppSchema = appSchema({
version: 1,
tables: [
tableSchema({
name: INFO,
columns: [
{name: 'build_number', type: 'string'},
{name: 'created_at', type: 'number'},
{name: 'version_number', type: 'string'},
],
}),
tableSchema({
name: GLOBAL,
columns: [
{name: 'value', type: 'string'},
],
}),
tableSchema({
name: SERVERS,
columns: [
{name: 'db_path', type: 'string'},
{name: 'display_name', type: 'string'},
{name: 'identifier', type: 'string', isIndexed: true},
{name: 'last_active_at', type: 'number', isIndexed: true},
{name: 'url', type: 'string', isIndexed: true},
],
}),
],
});