forked from Ivasoft/mattermost-mobile
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:
@@ -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},
|
||||
],
|
||||
}),
|
||||
],
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -17,3 +17,4 @@ export default tableSchema({
|
||||
{name: 'identifier', type: 'string', isIndexed: true},
|
||||
],
|
||||
});
|
||||
|
||||
|
||||
@@ -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},
|
||||
],
|
||||
},
|
||||
},
|
||||
|
||||
BIN
docs/database/app_database/app-database-v1.pdf
Normal file
BIN
docs/database/app_database/app-database-v1.pdf
Normal file
Binary file not shown.
BIN
docs/database/app_database/app-database-v1.png
Normal file
BIN
docs/database/app_database/app-database-v1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 26 KiB |
1
docs/database/app_database/app-database-v1.rtf
Normal file
1
docs/database/app_database/app-database-v1.rtf
Normal file
File diff suppressed because one or more lines are too long
58
docs/database/app_database/app-database-v1.sql
Normal file
58
docs/database/app_database/app-database-v1.sql
Normal 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
|
||||
30
docs/database/app_database/app-database.md
Normal file
30
docs/database/app_database/app-database.md
Normal 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
|
||||
Reference in New Issue
Block a user