Gekidou - Updated App Database Diagrams/Schema/Models (#6133)

* app database - schema md file

* exported docs

* proper refactor of file name
This commit is contained in:
Avinash Lingaloo
2022-04-07 17:56:40 +04:00
committed by GitHub
parent 0950dbd21b
commit b5c53d769f
10 changed files with 97 additions and 7 deletions

View File

@@ -29,9 +29,9 @@ export const schema: AppSchema = appSchema({
columns: [
{name: 'db_path', type: 'string'},
{name: 'display_name', type: 'string'},
{name: 'url', type: 'string', isIndexed: true},
{name: 'last_active_at', type: 'number', isIndexed: true},
{name: 'identifier', type: 'string', isIndexed: true},
{name: 'last_active_at', type: 'number', isIndexed: true},
{name: 'url', type: 'string', isIndexed: true},
],
}),
],

View File

@@ -1,6 +1,6 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
export {default as app} from './app';
export {default as info} from './info';
export {default as global} from './global';
export {default as servers} from './servers';

View File

@@ -17,3 +17,4 @@ export default tableSchema({
{name: 'identifier', type: 'string', isIndexed: true},
],
});

View File

@@ -39,16 +39,16 @@ describe('*** Test schema for APP database ***', () => {
columns: {
db_path: {name: 'db_path', type: 'string'},
display_name: {name: 'display_name', type: 'string'},
url: {name: 'url', type: 'string', isIndexed: true},
last_active_at: {name: 'last_active_at', type: 'number', isIndexed: true},
identifier: {name: 'identifier', type: 'string', isIndexed: true},
last_active_at: {name: 'last_active_at', type: 'number', isIndexed: true},
url: {name: 'url', type: 'string', isIndexed: true},
},
columnArray: [
{name: 'db_path', type: 'string'},
{name: 'display_name', type: 'string'},
{name: 'url', type: 'string', isIndexed: true},
{name: 'last_active_at', type: 'number', isIndexed: true},
{name: 'identifier', type: 'string', isIndexed: true},
{name: 'last_active_at', type: 'number', isIndexed: true},
{name: 'url', type: 'string', isIndexed: true},
],
},
},

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,58 @@
-- Exported from QuickDBD: https://www.quickdatabasediagrams.com/
-- Link to schema: https://app.quickdatabasediagrams.com/#/d/JbG8iC
-- NOTE! If you have used non-SQL datatypes in your design, you will have to change these here.
-- App Database - Schema Version 1
-- Please bump the version by 1, any time the schema changes.
-- Also, include the migration plan under app/database/migration/server,
-- update all models, relationships and types.
-- Lastly, export all PNGs, SVGs, etc under the source project (./docs/database)
-- If you have any question/queries that you would like to clarify, please reach out to the Mobile Platform Team.
SET XACT_ABORT ON
BEGIN TRANSACTION QUICKDBD
CREATE TABLE [Info] (
-- auto-generated
[id] string NOT NULL ,
[build_number] string NOT NULL ,
[created_at] number NOT NULL ,
[version_number] string NOT NULL ,
CONSTRAINT [PK_Info] PRIMARY KEY CLUSTERED (
[id] ASC
)
)
CREATE TABLE [Global] (
-- GLOBAL_IDENTIFIERS
[id] string NOT NULL ,
[value] string NOT NULL ,
CONSTRAINT [PK_Global] PRIMARY KEY CLUSTERED (
[id] ASC
)
)
CREATE TABLE [Servers] (
-- auto-generated
[id] string NOT NULL ,
[db_path] string NOT NULL ,
[display_name] string NOT NULL ,
[url] string NOT NULL ,
[last_active_at] number NOT NULL ,
[identifier] string NOT NULL ,
CONSTRAINT [PK_Servers] PRIMARY KEY CLUSTERED (
[id] ASC
)
)
CREATE INDEX [idx_Servers_url]
ON [Servers] ([url])
CREATE INDEX [idx_Servers_last_active_at]
ON [Servers] ([last_active_at])
CREATE INDEX [idx_Servers_identifier]
ON [Servers] ([identifier])
COMMIT TRANSACTION QUICKDBD

View File

@@ -0,0 +1,30 @@
# App Database - Schema Version 1
# Please bump the version by 1, any time the schema changes.
# Also, include the migration plan under app/database/migration/server,
# update all models, relationships and types.
# Lastly, export all PNGs, SVGs, etc under the source project (./docs/database)
# If you have any question/queries that you would like to clarify, please reach out to the Mobile Platform Team.
Info
-
id PK string # auto-generated
build_number string
created_at number
version_number string
Global
-
id PK string # GLOBAL_IDENTIFIERS
value string
Servers
-
id PK string # auto-generated
db_path string
display_name string
url string INDEX
last_active_at number INDEX
identifier string INDEX