Files
mattermost-mobile/app/database/migration/server/index.ts
Shaz MJ de2c240bc7 [Gekidou] [Migration] Adds member_count to groups table (#6468)
* Adds member_count to groups table

* Newline
2022-07-15 11:01:54 +04:00

47 lines
1.2 KiB
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
// NOTE : To implement migration, please follow this document
// https://nozbe.github.io/WatermelonDB/Advanced/Migrations.html
import {schemaMigrations, addColumns} from '@nozbe/watermelondb/Schema/migrations';
import {MM_TABLES} from '@constants/database';
const {SERVER: {
GROUP,
MY_CHANNEL,
THREAD,
}} = MM_TABLES;
export default schemaMigrations({migrations: [
{
toVersion: 3,
steps: [
addColumns({
table: GROUP,
columns: [
{name: 'member_count', type: 'number'},
],
}),
],
},
{
toVersion: 2,
steps: [
addColumns({
table: MY_CHANNEL,
columns: [
{name: 'last_fetched_at', type: 'number', isIndexed: true},
],
}),
addColumns({
table: THREAD,
columns: [
{name: 'last_fetched_at', type: 'number', isIndexed: true},
],
}),
],
},
]});