MM-30475 [v2] watermelondb default schema (#4977)

* MM_30475 : ADDED default schema

* MM_30475 : Updated typings and references to MM_TABLES

* MM_30475 : Removed the app_id (The id field will be overwritten at the time of creation.)

* MM_30475 : Updated PR as per comments
This commit is contained in:
Avinash Lingaloo
2020-11-24 13:58:20 +04:00
committed by GitHub
parent 22e82dfc2a
commit 2dfb3433c9
12 changed files with 175 additions and 7 deletions

9
types/database/app.d.ts vendored Normal file
View File

@@ -0,0 +1,9 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {Model} from '@nozbe/watermelondb';
export default class App extends Model {
static table: string;
buildNumber: string;
createdAt: number;
versionNumber: string;
}

10
types/database/global.d.ts vendored Normal file
View File

@@ -0,0 +1,10 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {Model} from '@nozbe/watermelondb';
export default class Global extends Model {
static table: string;
name: string;
// TODO : atm, the return type for 'value' is string[]. However, this return type can change to string/number/etc. A broader definition will need to be applied and this return type updated accordingly.
value: string[];
}

11
types/database/server.d.ts vendored Normal file
View File

@@ -0,0 +1,11 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {Model} from '@nozbe/watermelondb';
export default class Server extends Model {
static table: string;
dbPath: string;
displayName: string;
mentionCount: number;
unreadCount: number;
url: string;
}